netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net] macvlan: allow to enqueue broadcast pkt on virtual device
@ 2014-09-17  8:08 Nicolas Dichtel
  2014-09-19 20:03 ` David Miller
                   ` (2 more replies)
  0 siblings, 3 replies; 14+ messages in thread
From: Nicolas Dichtel @ 2014-09-17  8:08 UTC (permalink / raw)
  To: davem; +Cc: netdev, Nicolas Dichtel, Herbert Xu

Since commit 412ca1550cbe ("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: Thibaut Collet <thibaut.collet@6wind.com>
Suggested-by: Thibaut Collet <thibaut.collet@6wind.com>
Tested-by: Thibaut Collet <thibaut.collet@6wind.com>
Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
---
 drivers/net/macvlan.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/macvlan.c b/drivers/net/macvlan.c
index a96955597755..8e776935ca52 100644
--- a/drivers/net/macvlan.c
+++ b/drivers/net/macvlan.c
@@ -36,6 +36,7 @@
 #include <linux/netpoll.h>
 
 #define MACVLAN_HASH_SIZE	(1 << BITS_PER_BYTE)
+#define MACVLAN_BC_QUEUE_LEN	1000
 
 struct macvlan_port {
 	struct net_device	*dev;
@@ -248,7 +249,7 @@ static void macvlan_broadcast_enqueue(struct macvlan_port *port,
 		goto err;
 
 	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);
 		err = 0;
 	}
-- 
2.1.0

^ permalink raw reply related	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2014-09-22 18:10 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-09-17  8:08 [PATCH net] macvlan: allow to enqueue broadcast pkt on virtual device Nicolas Dichtel
2014-09-19 20:03 ` David Miller
2014-09-19 23:31   ` Herbert Xu
2014-09-19 23:44     ` Eric Dumazet
2014-09-19 21:24 ` Cong Wang
2014-09-19 21:35   ` Eric Dumazet
2014-09-19 21:59     ` Cong Wang
2014-09-19 22:05       ` Eric Dumazet
2014-09-19 22:14         ` Cong Wang
2014-09-19 22:44           ` Eric Dumazet
2014-09-19 22:57             ` Cong Wang
2014-09-19 23:09               ` Eric Dumazet
2014-09-20  2:00                 ` David Miller
2014-09-22 18:10 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).