From: Andy Zhou Date: Tue, 8 Apr 2014 04:49:07 +0000 (-0700) Subject: dpif: Wildcard bond output port with recirculation X-Git-Tag: sliver-openvswitch-2.2.90-1~5^2~13 X-Git-Url: http://git.onelab.eu/?p=sliver-openvswitch.git;a=commitdiff_plain;h=54ecb5a2331ca95264879252e413becaba130573 dpif: Wildcard bond output port with recirculation 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 Acked-by: Ben Pfaff --- diff --git a/ofproto/ofproto-dpif-xlate.c b/ofproto/ofproto-dpif-xlate.c index c3040d729..7b6e9f793 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 e590c042c..064407ad0 100644 --- a/tests/ofproto-dpif.at +++ b/tests/ofproto-dpif.at @@ -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: -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: +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: +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: ]) OVS_VSWITCHD_STOP AT_CLEANUP