summaryrefslogtreecommitdiff
path: root/ofproto
diff options
context:
space:
mode:
authorBen Pfaff <blp@ovn.org>2016-10-31 14:33:13 -0700
committerBen Pfaff <blp@ovn.org>2016-11-01 08:15:59 -0700
commitcaa5c156d7b25b5b67502b1cb8a32989f6627dca (patch)
tree26e720711cee92c4410a5627738563aa89d0993d /ofproto
parentdc76953f753943af6a9591c9898e3c651d8617b3 (diff)
downloadopenvswitch-caa5c156d7b25b5b67502b1cb8a32989f6627dca.tar.gz
ofproto-dpif: Log warning when ct action or its variants are not supported.
Some datapaths do not support the ct action, and others support only a subset of its features. Until now, it has been difficult to tell why a particular action is being rejected. This commit should make it clearer. Reported-by: Kevin Lin <kevinlin@berkeley.edu> Reported-at: http://openvswitch.org/pipermail/discuss/2016-October/023060.html Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Joe Stringer <joe@ovn.org>
Diffstat (limited to 'ofproto')
-rw-r--r--ofproto/ofproto-dpif.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/ofproto/ofproto-dpif.c b/ofproto/ofproto-dpif.c
index 7374ccca3..330bd488f 100644
--- a/ofproto/ofproto-dpif.c
+++ b/ofproto/ofproto-dpif.c
@@ -4134,6 +4134,16 @@ check_mask(struct ofproto_dpif *ofproto, const struct miniflow *flow)
return 0;
}
+static void
+report_unsupported_ct(const char *detail)
+{
+ static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(1, 5);
+ VLOG_WARN_RL(&rl, "Rejecting ct action because datapath does not support "
+ "ct action%s%s (your kernel module may be out of date)",
+ detail ? " " : "",
+ detail ? detail : "");
+}
+
static enum ofperr
check_actions(const struct ofproto_dpif *ofproto,
const struct rule_actions *const actions)
@@ -4153,9 +4163,11 @@ check_actions(const struct ofproto_dpif *ofproto,
support = &ofproto_dpif_get_support(ofproto)->odp;
if (!support->ct_state) {
+ report_unsupported_ct(NULL);
return OFPERR_OFPBAC_BAD_TYPE;
}
if ((ct->zone_imm || ct->zone_src.field) && !support->ct_zone) {
+ report_unsupported_ct("zone");
return OFPERR_OFPBAC_BAD_ARGUMENT;
}
@@ -4166,10 +4178,12 @@ check_actions(const struct ofproto_dpif *ofproto,
/* The backer doesn't seem to support the NAT bits in
* 'ct_state': assume that it doesn't support the NAT
* action. */
+ report_unsupported_ct("nat");
return OFPERR_OFPBAC_BAD_TYPE;
}
if (dst && ((dst->id == MFF_CT_MARK && !support->ct_mark)
|| (dst->id == MFF_CT_LABEL && !support->ct_label))) {
+ report_unsupported_ct("setting mark and/or label");
return OFPERR_OFPBAC_BAD_SET_ARGUMENT;
}
}