Skip to content

Commit

Permalink
ofproto-dpif-upcall: Add VLOG_WARN_RL logs for upcall_cb() error.
Browse files Browse the repository at this point in the history
Signed-off-by: Alex Wang <[email protected]>
Acked-by: Jarno Rajahalme <[email protected]>
  • Loading branch information
yew011 committed Aug 11, 2015
1 parent 0c1e8a7 commit 9cec827
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions ofproto/ofproto-dpif-upcall.c
Original file line number Diff line number Diff line change
Expand Up @@ -1058,6 +1058,7 @@ upcall_cb(const struct dp_packet *packet, const struct flow *flow, ovs_u128 *ufi
const struct nlattr *userdata, struct ofpbuf *actions,
struct flow_wildcards *wc, struct ofpbuf *put_actions, void *aux)
{
static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(1, 1);
struct udpif *udpif = aux;
unsigned int flow_limit;
struct upcall upcall;
Expand Down Expand Up @@ -1088,18 +1089,21 @@ upcall_cb(const struct dp_packet *packet, const struct flow *flow, ovs_u128 *ufi
}

if (udpif_get_n_flows(udpif) >= flow_limit) {
VLOG_WARN_RL(&rl, "upcall_cb failure: datapath flow limit reached");
error = ENOSPC;
goto out;
}

/* Prevent miss flow installation if the key has recirculation ID but we
* were not able to get a reference on it. */
if (type == DPIF_UC_MISS && upcall.recirc && !upcall.have_recirc_ref) {
VLOG_WARN_RL(&rl, "upcall_cb failure: no reference for recirc flow");
error = ENOSPC;
goto out;
}

if (upcall.ukey && !ukey_install(udpif, upcall.ukey)) {
VLOG_WARN_RL(&rl, "upcall_cb failure: ukey installation fails");
error = ENOSPC;
}
out:
Expand Down

0 comments on commit 9cec827

Please sign in to comment.