net: congestion notifications are not dropped packets
authorEric Dumazet <eric.dumazet@gmail.com>
Mon, 10 May 2010 04:51:02 +0000 (04:51 +0000)
committerDavid S. Miller <davem@davemloft.net>
Sun, 16 May 2010 07:42:15 +0000 (00:42 -0700)
vlan/macvlan start_xmit() can inform caller of congestion with
NET_XMIT_CN return value. This doesnt mean packet was dropped.
Increment normal stat counters instead of tx_dropped.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Acked-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/macvlan.c
net/8021q/vlan_dev.c

index 1b78c0057a8d03707a1bdb699d4df32d49ce8b25..4e238afab4a3b999d2e4af9ee178b6d593c4a9ed 100644 (file)
@@ -239,7 +239,7 @@ netdev_tx_t macvlan_start_xmit(struct sk_buff *skb,
        int ret;
 
        ret = macvlan_queue_xmit(skb, dev);
-       if (likely(ret == NET_XMIT_SUCCESS)) {
+       if (likely(ret == NET_XMIT_SUCCESS || ret == NET_XMIT_CN)) {
                txq->tx_packets++;
                txq->tx_bytes += len;
        } else
index b5249c5fd4d37c0ab807acbce15e9af3812999f6..55be90826f5fd1317f961b9fbabb3f3b989f380e 100644 (file)
@@ -327,7 +327,7 @@ static netdev_tx_t vlan_dev_hard_start_xmit(struct sk_buff *skb,
        len = skb->len;
        ret = dev_queue_xmit(skb);
 
-       if (likely(ret == NET_XMIT_SUCCESS)) {
+       if (likely(ret == NET_XMIT_SUCCESS || ret == NET_XMIT_CN)) {
                txq->tx_packets++;
                txq->tx_bytes += len;
        } else
@@ -353,7 +353,7 @@ static netdev_tx_t vlan_dev_hwaccel_hard_start_xmit(struct sk_buff *skb,
        len = skb->len;
        ret = dev_queue_xmit(skb);
 
-       if (likely(ret == NET_XMIT_SUCCESS)) {
+       if (likely(ret == NET_XMIT_SUCCESS || ret == NET_XMIT_CN)) {
                txq->tx_packets++;
                txq->tx_bytes += len;
        } else