aboutsummaryrefslogtreecommitdiffstats
path: root/net/core/dev.c
diff options
context:
space:
mode:
authorJohn Fastabend <john.r.fastabend@intel.com>2011-10-10 05:16:41 -0400
committerDavid S. Miller <davem@davemloft.net>2011-10-18 23:46:46 -0400
commit2425717b27eb92b175335ca4ff0bb218cbe0cb64 (patch)
treecfde444fc262214d9374411ac55741bf689aa596 /net/core/dev.c
parentb340a207c5d81a0a33899e8ab3236a04dd8b48c3 (diff)
net: allow vlan traffic to be received under bond
The following configuration used to work as I expected. At least we could use the fcoe interfaces to do MPIO and the bond0 iface to do load balancing or failover. ---eth2.228-fcoe | eth2 -----| | |---- bond0 | eth3 -----| | ---eth3.228-fcoe This worked because of a change we added to allow inactive slaves to rx 'exact' matches. This functionality was kept intact with the rx_handler mechanism. However now the vlan interface attached to the active slave never receives traffic because the bonding rx_handler updates the skb->dev and goto's another_round. Previously, the vlan_do_receive() logic was called before the bonding rx_handler. Now by the time vlan_do_receive calls vlan_find_dev() the skb->dev is set to bond0 and it is clear no vlan is attached to this iface. The vlan lookup fails. This patch moves the VLAN check above the rx_handler. A VLAN tagged frame is now routed to the eth2.228-fcoe iface in the above schematic. Untagged frames continue to the bond0 as normal. This case also remains intact, eth2 --> bond0 --> vlan.228 Here the skb is VLAN tagged but the vlan lookup fails on eth2 causing the bonding rx_handler to be called. On the second pass the vlan lookup is on the bond0 iface and completes as expected. Putting a VLAN.228 on both the bond0 and eth2 device will result in eth2.228 receiving the skb. I don't think this is completely unexpected and was the result prior to the rx_handler result. Note, the same setup is also used for other storage traffic that MPIO is used with eg. iSCSI and similar setups can be contrived without storage protocols. Signed-off-by: John Fastabend <john.r.fastabend@intel.com> Acked-by: Jesse Gross <jesse@nicira.com> Reviewed-by: Jiri Pirko <jpirko@redhat.com> Tested-by: Hans Schillstrom <hams.schillstrom@ericsson.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core/dev.c')
-rw-r--r--net/core/dev.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/net/core/dev.c b/net/core/dev.c
index 70ecb86439ca..8b6118a16b87 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -3231,6 +3231,17 @@ another_round:
3231ncls: 3231ncls:
3232#endif 3232#endif
3233 3233
3234 if (vlan_tx_tag_present(skb)) {
3235 if (pt_prev) {
3236 ret = deliver_skb(skb, pt_prev, orig_dev);
3237 pt_prev = NULL;
3238 }
3239 if (vlan_do_receive(&skb))
3240 goto another_round;
3241 else if (unlikely(!skb))
3242 goto out;
3243 }
3244
3234 rx_handler = rcu_dereference(skb->dev->rx_handler); 3245 rx_handler = rcu_dereference(skb->dev->rx_handler);
3235 if (rx_handler) { 3246 if (rx_handler) {
3236 if (pt_prev) { 3247 if (pt_prev) {
@@ -3251,17 +3262,6 @@ ncls:
3251 } 3262 }
3252 } 3263 }
3253 3264
3254 if (vlan_tx_tag_present(skb)) {
3255 if (pt_prev) {
3256 ret = deliver_skb(skb, pt_prev, orig_dev);
3257 pt_prev = NULL;
3258 }
3259 if (vlan_do_receive(&skb))
3260 goto another_round;
3261 else if (unlikely(!skb))
3262 goto out;
3263 }
3264
3265 /* deliver only exact match when indicated */ 3265 /* deliver only exact match when indicated */
3266 null_or_dev = deliver_exact ? skb->dev : NULL; 3266 null_or_dev = deliver_exact ? skb->dev : NULL;
3267 3267