diff options
Diffstat (limited to 'net/core/dev.c')
-rw-r--r-- | net/core/dev.c | 33 |
1 files changed, 21 insertions, 12 deletions
diff --git a/net/core/dev.c b/net/core/dev.c index 1845b08c624e..2b3bf53bc687 100644 --- a/net/core/dev.c +++ b/net/core/dev.c | |||
@@ -2253,11 +2253,9 @@ static int get_rps_cpu(struct net_device *dev, struct sk_buff *skb, | |||
2253 | if (skb_rx_queue_recorded(skb)) { | 2253 | if (skb_rx_queue_recorded(skb)) { |
2254 | u16 index = skb_get_rx_queue(skb); | 2254 | u16 index = skb_get_rx_queue(skb); |
2255 | if (unlikely(index >= dev->num_rx_queues)) { | 2255 | if (unlikely(index >= dev->num_rx_queues)) { |
2256 | if (net_ratelimit()) { | 2256 | WARN_ONCE(dev->num_rx_queues > 1, "%s received packet " |
2257 | pr_warning("%s received packet on queue " | 2257 | "on queue %u, but number of RX queues is %u\n", |
2258 | "%u, but number of RX queues is %u\n", | 2258 | dev->name, index, dev->num_rx_queues); |
2259 | dev->name, index, dev->num_rx_queues); | ||
2260 | } | ||
2261 | goto done; | 2259 | goto done; |
2262 | } | 2260 | } |
2263 | rxqueue = dev->_rx + index; | 2261 | rxqueue = dev->_rx + index; |
@@ -2795,7 +2793,7 @@ static int __netif_receive_skb(struct sk_buff *skb) | |||
2795 | struct net_device *orig_dev; | 2793 | struct net_device *orig_dev; |
2796 | struct net_device *master; | 2794 | struct net_device *master; |
2797 | struct net_device *null_or_orig; | 2795 | struct net_device *null_or_orig; |
2798 | struct net_device *null_or_bond; | 2796 | struct net_device *orig_or_bond; |
2799 | int ret = NET_RX_DROP; | 2797 | int ret = NET_RX_DROP; |
2800 | __be16 type; | 2798 | __be16 type; |
2801 | 2799 | ||
@@ -2812,13 +2810,24 @@ static int __netif_receive_skb(struct sk_buff *skb) | |||
2812 | if (!skb->skb_iif) | 2810 | if (!skb->skb_iif) |
2813 | skb->skb_iif = skb->dev->ifindex; | 2811 | skb->skb_iif = skb->dev->ifindex; |
2814 | 2812 | ||
2813 | /* | ||
2814 | * bonding note: skbs received on inactive slaves should only | ||
2815 | * be delivered to pkt handlers that are exact matches. Also | ||
2816 | * the deliver_no_wcard flag will be set. If packet handlers | ||
2817 | * are sensitive to duplicate packets these skbs will need to | ||
2818 | * be dropped at the handler. The vlan accel path may have | ||
2819 | * already set the deliver_no_wcard flag. | ||
2820 | */ | ||
2815 | null_or_orig = NULL; | 2821 | null_or_orig = NULL; |
2816 | orig_dev = skb->dev; | 2822 | orig_dev = skb->dev; |
2817 | master = ACCESS_ONCE(orig_dev->master); | 2823 | master = ACCESS_ONCE(orig_dev->master); |
2818 | if (master) { | 2824 | if (skb->deliver_no_wcard) |
2819 | if (skb_bond_should_drop(skb, master)) | 2825 | null_or_orig = orig_dev; |
2826 | else if (master) { | ||
2827 | if (skb_bond_should_drop(skb, master)) { | ||
2828 | skb->deliver_no_wcard = 1; | ||
2820 | null_or_orig = orig_dev; /* deliver only exact match */ | 2829 | null_or_orig = orig_dev; /* deliver only exact match */ |
2821 | else | 2830 | } else |
2822 | skb->dev = master; | 2831 | skb->dev = master; |
2823 | } | 2832 | } |
2824 | 2833 | ||
@@ -2868,10 +2877,10 @@ ncls: | |||
2868 | * device that may have registered for a specific ptype. The | 2877 | * device that may have registered for a specific ptype. The |
2869 | * handler may have to adjust skb->dev and orig_dev. | 2878 | * handler may have to adjust skb->dev and orig_dev. |
2870 | */ | 2879 | */ |
2871 | null_or_bond = NULL; | 2880 | orig_or_bond = orig_dev; |
2872 | if ((skb->dev->priv_flags & IFF_802_1Q_VLAN) && | 2881 | if ((skb->dev->priv_flags & IFF_802_1Q_VLAN) && |
2873 | (vlan_dev_real_dev(skb->dev)->priv_flags & IFF_BONDING)) { | 2882 | (vlan_dev_real_dev(skb->dev)->priv_flags & IFF_BONDING)) { |
2874 | null_or_bond = vlan_dev_real_dev(skb->dev); | 2883 | orig_or_bond = vlan_dev_real_dev(skb->dev); |
2875 | } | 2884 | } |
2876 | 2885 | ||
2877 | type = skb->protocol; | 2886 | type = skb->protocol; |
@@ -2879,7 +2888,7 @@ ncls: | |||
2879 | &ptype_base[ntohs(type) & PTYPE_HASH_MASK], list) { | 2888 | &ptype_base[ntohs(type) & PTYPE_HASH_MASK], list) { |
2880 | if (ptype->type == type && (ptype->dev == null_or_orig || | 2889 | if (ptype->type == type && (ptype->dev == null_or_orig || |
2881 | ptype->dev == skb->dev || ptype->dev == orig_dev || | 2890 | ptype->dev == skb->dev || ptype->dev == orig_dev || |
2882 | ptype->dev == null_or_bond)) { | 2891 | ptype->dev == orig_or_bond)) { |
2883 | if (pt_prev) | 2892 | if (pt_prev) |
2884 | ret = deliver_skb(skb, pt_prev, orig_dev); | 2893 | ret = deliver_skb(skb, pt_prev, orig_dev); |
2885 | pt_prev = ptype; | 2894 | pt_prev = ptype; |