瀏覽代碼

macvlan: don't broadcast PAUSE frames to macvlan devices

PAUSE frames are only relevant for the real device, broadcasting them
to all macvlan devices can cause a significant load increase.

Reported-by: Ben Greear <greearb@candelatech.com>
Tested-by: Ben Greear <greearb@candelatech.com>
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Patrick McHardy 16 年之前
父節點
當前提交
efbbced361
共有 1 個文件被更改,包括 3 次插入0 次删除
  1. 3 0
      drivers/net/macvlan.c

+ 3 - 0
drivers/net/macvlan.c

@@ -70,6 +70,9 @@ static void macvlan_broadcast(struct sk_buff *skb,
 	struct sk_buff *nskb;
 	struct sk_buff *nskb;
 	unsigned int i;
 	unsigned int i;
 
 
+	if (skb->protocol == htons(ETH_P_PAUSE))
+		return;
+
 	for (i = 0; i < MACVLAN_HASH_SIZE; i++) {
 	for (i = 0; i < MACVLAN_HASH_SIZE; i++) {
 		hlist_for_each_entry_rcu(vlan, n, &port->vlan_hash[i], hlist) {
 		hlist_for_each_entry_rcu(vlan, n, &port->vlan_hash[i], hlist) {
 			dev = vlan->dev;
 			dev = vlan->dev;