Skip to content

Commit 2425717

Browse files
John Fastabenddavem330
authored andcommitted
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 <[email protected]> Acked-by: Jesse Gross <[email protected]> Reviewed-by: Jiri Pirko <[email protected]> Tested-by: Hans Schillstrom <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent b340a20 commit 2425717

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

net/core/dev.c

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3231,6 +3231,17 @@ static int __netif_receive_skb(struct sk_buff *skb)
32313231
ncls:
32323232
#endif
32333233

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+
32343245
rx_handler = rcu_dereference(skb->dev->rx_handler);
32353246
if (rx_handler) {
32363247
if (pt_prev) {
@@ -3251,17 +3262,6 @@ static int __netif_receive_skb(struct sk_buff *skb)
32513262
}
32523263
}
32533264

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-
32653265
/* deliver only exact match when indicated */
32663266
null_or_dev = deliver_exact ? skb->dev : NULL;
32673267

0 commit comments

Comments
 (0)