From: Julian Wiedmann <jwi@linux.ibm.com>
Date: Mon, 18 Mar 2019 16:40:56 +0100
Subject: s390/qeth: be drop monitor friendly
Git-commit: 104b48592b5441c722dcd95c38ab9300f2d94856
Patch-mainline: v5.1-rc3
References: bsc#1142220 LTC#179335
As part of the TX completion path, qeth_release_skbs() frees the completed
skbs with __skb_queue_purge(). This ends in kfree_skb(), reporting every
completed skb as dropped.
On the other hand when dropping an skb in .ndo_start_xmit, we end up
calling consume_skb()... where we should be using kfree_skb() so that
drop monitors get notified.
Switch the drop/consume logic around, and also don't accumulate dropped
packets in the tx_errors statistics.
[ ptesarik: Since commit dc149e3764d8b724b110f8841b198e0f867e413a is not
contained in SLE15, the corresponding hunk could be dropped. The other
part of the patch (fix for the tx_drop path) had been broken even before
that commit, so that's preserved. ]
Fixes: dc149e3764d8 ("s390/qeth: replace open-coded skb_queue_walk()")
Signed-off-by: Julian Wiedmann <jwi@linux.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Acked-by: Petr Tesarik <ptesarik@suse.com>
---
drivers/s390/net/qeth_l2_main.c | 3 +--
drivers/s390/net/qeth_l3_main.c | 3 +--
2 files changed, 2 insertions(+), 4 deletions(-)
--- a/drivers/s390/net/qeth_l2_main.c
+++ b/drivers/s390/net/qeth_l2_main.c
@@ -882,8 +882,7 @@ static netdev_tx_t qeth_l2_hard_start_xm
tx_drop:
card->stats.tx_dropped++;
- card->stats.tx_errors++;
- dev_kfree_skb_any(skb);
+ kfree_skb(skb);
netif_wake_queue(dev);
return NETDEV_TX_OK;
}
--- a/drivers/s390/net/qeth_l3_main.c
+++ b/drivers/s390/net/qeth_l3_main.c
@@ -2802,10 +2802,9 @@ static netdev_tx_t qeth_l3_hard_start_xm
tx_drop:
card->stats.tx_dropped++;
- card->stats.tx_errors++;
if ((new_skb != skb) && new_skb)
dev_kfree_skb_any(new_skb);
- dev_kfree_skb_any(skb);
+ kfree_skb(skb);
netif_wake_queue(dev);
return NETDEV_TX_OK;
}