aboutsummaryrefslogtreecommitdiff
path: root/ofproto
diff options
context:
space:
mode:
authorJustin Pettit <jpettit@nicira.com>2013-02-13 14:08:15 -0800
committerJustin Pettit <jpettit@nicira.com>2013-03-06 13:55:29 -0800
commit2fe37b93bea9c87be387aeede4f38e7a0b360cf2 (patch)
treedcf887cd99aec20367488e5a8bb5dafa97d2b55e /ofproto
parent65fc33cc3c78a546d1dd571ae63e19dfd210442c (diff)
tunnel: Generate datapath flows for tunneled packets dropped due to ECN.
Move the check for whether tunneled packets should be dropped due to congestion encountered (CE) when the encapsulated packet is not ECN capable (non-ECT). This also adds some additional tests for ECN handling on tunnel decapsulation. Signed-off-by: Justin Pettit <jpettit@nicira.com>
Diffstat (limited to 'ofproto')
-rw-r--r--ofproto/ofproto-dpif.c16
-rw-r--r--ofproto/tunnel.c8
2 files changed, 15 insertions, 9 deletions
diff --git a/ofproto/ofproto-dpif.c b/ofproto/ofproto-dpif.c
index 5522b9ed..81118915 100644
--- a/ofproto/ofproto-dpif.c
+++ b/ofproto/ofproto-dpif.c
@@ -6272,6 +6272,20 @@ may_receive(const struct ofport_dpif *port, struct action_xlate_ctx *ctx)
return true;
}
+static bool
+tunnel_ecn_ok(struct action_xlate_ctx *ctx)
+{
+ if (is_ip_any(&ctx->base_flow)
+ && (ctx->base_flow.tunnel.ip_tos & IP_ECN_MASK) == IP_ECN_CE
+ && (ctx->base_flow.nw_tos & IP_ECN_MASK) == IP_ECN_NOT_ECT) {
+ VLOG_WARN_RL(&rl, "dropping tunnel packet marked ECN CE but is not ECN"
+ " capable");
+ return false;
+ }
+
+ return true;
+}
+
static void
do_xlate_actions(const struct ofpact *ofpacts, size_t ofpacts_len,
struct action_xlate_ctx *ctx)
@@ -6590,7 +6604,7 @@ xlate_actions(struct action_xlate_ctx *ctx,
add_sflow_action(ctx);
- if (!in_port || may_receive(in_port, ctx)) {
+ if (tunnel_ecn_ok(ctx) && (!in_port || may_receive(in_port, ctx))) {
do_xlate_actions(ofpacts, ofpacts_len, ctx);
/* We've let OFPP_NORMAL and the learning action look at the
diff --git a/ofproto/tunnel.c b/ofproto/tunnel.c
index afe7221d..82879376 100644
--- a/ofproto/tunnel.c
+++ b/ofproto/tunnel.c
@@ -197,14 +197,6 @@ tnl_port_receive(struct flow *flow)
return NULL;
}
- if (is_ip_any(flow)
- && ((flow->tunnel.ip_tos & IP_ECN_MASK) == IP_ECN_CE)
- && (flow->nw_tos & IP_ECN_MASK) == IP_ECN_NOT_ECT) {
- VLOG_WARN_RL(&rl, "dropping tunnel packet marked ECN CE but is not ECN"
- " capable");
- return NULL;
- }
-
if (!VLOG_DROP_DBG(&dbg_rl)) {
pre_flow_str = flow_to_string(flow);
}