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 <az...@nicira.com>
---
 ofproto/ofproto-dpif-xlate.c |    8 ++++++--
 tests/ofproto-dpif.at        |    4 ++--
 2 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/ofproto/ofproto-dpif-xlate.c b/ofproto/ofproto-dpif-xlate.c
index c3040d7..7b6e9f7 100644
--- a/ofproto/ofproto-dpif-xlate.c
+++ b/ofproto/ofproto-dpif-xlate.c
@@ -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) {
diff --git a/tests/ofproto-dpif.at b/tests/ofproto-dpif.at
index 7ec3d8e..8295dfb 100644
--- a/tests/ofproto-dpif.at
+++ b/tests/ofproto-dpif.at
@@ -4053,8 +4053,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
-- 
1.7.9.5

_______________________________________________
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev

Reply via email to