lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 25 Aug 2010 12:00:51 -0700
From:	Ben Greear <greearb@...delatech.com>
To:	netdev@...r.kernel.org
Cc:	Ben Greear <greearb@...delatech.com>
Subject: [net-next 2/2] macvlan:  Enable qdisc backoff logic.

This allows macvlans to apply backpressure to calling code
in the transmit path when the underlying qdisc cannot accept
additional packets.

Signed-off-by: Ben Greear <greearb@...delatech.com>
---
:100644 100644 0ef0eb0... 43c7096... M	drivers/net/macvlan.c
 drivers/net/macvlan.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/drivers/net/macvlan.c b/drivers/net/macvlan.c
index 0ef0eb0..43c7096 100644
--- a/drivers/net/macvlan.c
+++ b/drivers/net/macvlan.c
@@ -237,7 +237,7 @@ static int macvlan_queue_xmit(struct sk_buff *skb, struct net_device *dev)
 
 xmit_world:
 	skb_set_dev(skb, vlan->lowerdev);
-	return dev_queue_xmit(skb);
+	return try_dev_queue_xmit(skb, 1);
 }
 
 netdev_tx_t macvlan_start_xmit(struct sk_buff *skb,
@@ -252,6 +252,10 @@ netdev_tx_t macvlan_start_xmit(struct sk_buff *skb,
 	if (likely(ret == NET_XMIT_SUCCESS || ret == NET_XMIT_CN)) {
 		txq->tx_packets++;
 		txq->tx_bytes += len;
+	} else if (ret == NET_XMIT_BUSY) {
+		/* Calling code should retry, skb was NOT freed. */
+		dev->stats.collisions++; /* sort of a collision, at least */
+		return NETDEV_TX_BUSY;
 	} else
 		txq->tx_dropped++;
 
-- 
1.6.2.5

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ