Commit 07d92d5c authored by Nicolas Dichtel's avatar Nicolas Dichtel Committed by David S. Miller

macvlan: allow to enqueue broadcast pkt on virtual device

Since commit 412ca155 ("macvlan: Move broadcasts into a work queue"), the
driver uses tx_queue_len of the master device as the limit of packets enqueuing.
Problem is that virtual drivers have this value set to 0, thus all broadcast
packets were rejected.
Because tx_queue_len was arbitrarily chosen, I replace it with a static limit
of 1000 (also arbitrarily chosen).

CC: Herbert Xu <herbert@gondor.apana.org.au>
Reported-by: default avatarThibaut Collet <thibaut.collet@6wind.com>
Suggested-by: default avatarThibaut Collet <thibaut.collet@6wind.com>
Tested-by: default avatarThibaut Collet <thibaut.collet@6wind.com>
Signed-off-by: default avatarNicolas Dichtel <nicolas.dichtel@6wind.com>
Acked-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 4e5f9ef3
...@@ -36,6 +36,7 @@ ...@@ -36,6 +36,7 @@
#include <linux/netpoll.h> #include <linux/netpoll.h>
#define MACVLAN_HASH_SIZE (1 << BITS_PER_BYTE) #define MACVLAN_HASH_SIZE (1 << BITS_PER_BYTE)
#define MACVLAN_BC_QUEUE_LEN 1000
struct macvlan_port { struct macvlan_port {
struct net_device *dev; struct net_device *dev;
...@@ -248,7 +249,7 @@ static void macvlan_broadcast_enqueue(struct macvlan_port *port, ...@@ -248,7 +249,7 @@ static void macvlan_broadcast_enqueue(struct macvlan_port *port,
goto err; goto err;
spin_lock(&port->bc_queue.lock); spin_lock(&port->bc_queue.lock);
if (skb_queue_len(&port->bc_queue) < skb->dev->tx_queue_len) { if (skb_queue_len(&port->bc_queue) < MACVLAN_BC_QUEUE_LEN) {
__skb_queue_tail(&port->bc_queue, nskb); __skb_queue_tail(&port->bc_queue, nskb);
err = 0; err = 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment