dpif: Wildcard bond output port with recirculation
authorAndy Zhou <azhou@nicira.com>
Tue, 8 Apr 2014 04:49:07 +0000 (21:49 -0700)
committerAndy Zhou <azhou@nicira.com>
Wed, 9 Apr 2014 03:08:42 +0000 (20:08 -0700)
This patch took advantage of the recirculation infrastructure
introduced in commit adcf00ba35a0, allowing megaflows to be generated
when the flow output to bond ports.

Without recirculation, it is necessary flows output to Bond ports
in balance_tcp mode to unmask all hash fields. With recirculation,
masking of hash fields is no longer required as kernel
now hashes each packet and redirects packets based on the hash value
using recirculation.

This patch removes the masking requirements when recirculation is
in use. Datapaths do not support recirculation are still supported,
but without the benefits of megaflow.

Signed-off-by: Andy Zhou <azhou@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
ofproto/ofproto-dpif-xlate.c
tests/ofproto-dpif.at

index c3040d7..7b6e9f7 100644 (file)
@@ -1144,6 +1144,7 @@ output_normal(struct xlate_ctx *ctx, const struct xbundle *out_xbundle,
     } else {
         struct ofport_dpif *ofport;
         struct xlate_recirc *xr = &ctx->xout->recirc;
+        struct flow_wildcards *wc = &ctx->xout->wc;
 
         if (ctx->xbridge->enable_recirc) {
             ctx->xout->use_recirc = bond_may_recirc(
@@ -1153,11 +1154,14 @@ output_normal(struct xlate_ctx *ctx, const struct xbundle *out_xbundle,
                 /* Only TCP mode uses recirculation. */
                 xr->hash_alg = OVS_RECIRC_HASH_ALG_L4;
                 bond_update_post_recirc_rules(out_xbundle->bond, false);
+
+                /* Recirculation does not require unmasking hash fields. */
+                wc = NULL;
             }
         }
 
-        ofport = bond_choose_output_slave(out_xbundle->bond, &ctx->xin->flow,
-                                          &ctx->xout->wc, vid);
+        ofport = bond_choose_output_slave(out_xbundle->bond,
+                                          &ctx->xin->flow, wc, vid);
         xport = xport_lookup(ofport);
 
         if (!xport) {
index e590c04..064407a 100644 (file)
@@ -4069,8 +4069,8 @@ AT_CHECK([ovs-appctl netdev-dummy/receive p7 'in_port(1),eth(src=50:54:00:00:00:
 AT_CHECK([ovs-appctl netdev-dummy/receive p7 'in_port(1),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(src=10.0.0.4,dst=10.0.0.3,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'])
 
 AT_CHECK([ovs-appctl dpif/dump-flows br0 | STRIP_XOUT], [0], [dnl
-skb_priority(0),in_port(7),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2/255.255.255.255,dst=10.0.0.1/255.255.255.255,proto=1/0xff,tos=0/0,ttl=64/0,frag=no/0xff),icmp(type=8,code=0), packets:0, bytes:0, used:never, actions: <del>
-skb_priority(0),in_port(7),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(src=10.0.0.4/255.255.255.255,dst=10.0.0.3/255.255.255.255,proto=1/0xff,tos=0/0,ttl=64/0,frag=no/0xff),icmp(type=8,code=0), packets:0, bytes:0, used:never, actions: <del>
+skb_priority(0),in_port(7),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2/0.0.0.0,dst=10.0.0.1/0.0.0.0,proto=1/0,tos=0/0,ttl=64/0,frag=no/0xff), packets:0, bytes:0, used:never, actions: <del>
+skb_priority(0),in_port(7),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(src=10.0.0.4/0.0.0.0,dst=10.0.0.3/0.0.0.0,proto=1/0,tos=0/0,ttl=64/0,frag=no/0xff), packets:0, bytes:0, used:never, actions: <del>
 ])
 OVS_VSWITCHD_STOP
 AT_CLEANUP