From: Ben Greear <greearb@candelatech.com>
To: netdev@vger.kernel.org
Cc: Ben Greear <greearb@candelatech.com>
Subject: [net-next 2/2] macvlan: Enable qdisc backoff logic.
Date: Wed, 25 Aug 2010 12:00:51 -0700 [thread overview]
Message-ID: <1282762851-3612-2-git-send-email-greearb@candelatech.com> (raw)
In-Reply-To: <1282762851-3612-1-git-send-email-greearb@candelatech.com>
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@candelatech.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
next prev parent reply other threads:[~2010-08-25 19:01 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-08-25 19:00 [net-next 1/2] qdisc: Allow qdiscs to provide backpressure up the stack Ben Greear
2010-08-25 19:00 ` Ben Greear [this message]
2010-08-25 19:24 ` [net-next 2/2] macvlan: Enable qdisc backoff logic Arnd Bergmann
2010-08-25 19:27 ` Ben Greear
2010-08-25 19:38 ` Hagen Paul Pfeifer
2010-08-25 19:49 ` Ben Greear
2010-08-25 19:59 ` Arnd Bergmann
2010-08-25 20:49 ` Ben Greear
2010-08-26 13:55 ` Arnd Bergmann
2010-08-26 15:33 ` Ben Greear
2010-08-26 17:45 ` Ben Greear
2010-08-27 13:16 ` Arnd Bergmann
2010-08-25 20:44 ` [net-next 1/2] qdisc: Allow qdiscs to provide backpressure up the stack Stephen Hemminger
2010-08-25 20:56 ` Ben Greear
2010-08-26 22:59 ` David Miller
2010-08-27 4:14 ` Ben Greear
2010-08-27 4:34 ` David Miller
2010-08-27 5:22 ` Ben Greear
2010-08-27 5:36 ` David Miller
2010-08-27 5:58 ` Ben Greear
2010-08-27 6:11 ` David Miller
2010-08-27 15:26 ` Ben Greear
2010-08-27 15:59 ` Eric Dumazet
2010-08-27 17:00 ` Ben Greear
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1282762851-3612-2-git-send-email-greearb@candelatech.com \
--to=greearb@candelatech.com \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).