Re: [net-next 2/2] macvlan: Enable qdisc backoff logic.

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Ben Greear
Date: Thursday, August 26, 2010 - 10:45 am

On 08/26/2010 06:55 AM, Arnd Bergmann wrote:

I think this will keep today's functionality.  Someone that knows and uses this
code might can figure out how to properly do backpressure to calling code
and re-queue the skb instead of just deleting it when the underlying device
complains of being busy.

diff --git a/drivers/net/macvtap.c b/drivers/net/macvtap.c
index 4256727..5abf0c0 100644
--- a/drivers/net/macvtap.c
+++ b/drivers/net/macvtap.c
@@ -571,9 +571,15 @@ static ssize_t macvtap_get_user(struct macvtap_queue *q,

         rcu_read_lock_bh();
         vlan = rcu_dereference(q->vlan);
-       if (vlan)
-               macvlan_start_xmit(skb, vlan->dev);
-       else
+       if (vlan) {
+               /* TODO:  Deal with BUSY properly by somehow re-queuing
+                * skb for later transmit and let calling logic know it
+                * needs to back off for a short time.
+                */
+               if (macvlan_start_xmit(skb, vlan->dev) == NETDEV_TX_BUSY)
+                       goto free_skb;
+       } else
+free_skb:
                 kfree_skb(skb);
         rcu_read_unlock_bh();


If this looks good, I'll do up an official patch set containing this and the other
two patches I sent previously.

Thanks,
Ben



-- 
Ben Greear <greearb@candelatech.com>
Candela Technologies Inc  http://www.candelatech.com

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[net-next 2/2] macvlan: Enable qdisc backoff logic., Ben Greear, (Wed Aug 25, 12:00 pm)
Re: [net-next 2/2] macvlan: Enable qdisc backoff logic., Arnd Bergmann, (Wed Aug 25, 12:24 pm)
Re: [net-next 2/2] macvlan: Enable qdisc backoff logic., Hagen Paul Pfeifer, (Wed Aug 25, 12:38 pm)
Re: [net-next 2/2] macvlan: Enable qdisc backoff logic., Arnd Bergmann, (Wed Aug 25, 12:59 pm)
Re: [net-next 2/2] macvlan: Enable qdisc backoff logic., Arnd Bergmann, (Thu Aug 26, 6:55 am)
Re: [net-next 2/2] macvlan: Enable qdisc backoff logic., Ben Greear, (Thu Aug 26, 10:45 am)
Re: [net-next 2/2] macvlan: Enable qdisc backoff logic., Arnd Bergmann, (Fri Aug 27, 6:16 am)