net: mv643xx_eth: Be drop monitor friendly
Subsystems (3)
PATCH v2 1/1 net: mv643xx_eth: Be drop monitor friendly
txq_reclaim() does the normal transmit queue reclamation and rxq_deinit() does the RX ring cleanup, none of these are packet drops, so use dev_consume_skb() for both locations.
--- drivers/net/ethernet/marvell/mv643xx_eth.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/ethernet/marvell/mv643xx_eth.c +2 -2
@@ -1121,7 +1121,7 @@ static int txq_reclaim(struct tx_queue *txq, int budget, int force)struct sk_buff *skb =__skb_dequeue (&txq->tx_skb);if (!WARN_ON (!skb)) -dev_kfree_skb (skb); +dev_consume_skb_any (skb); }if (cmd_sts &ERROR_SUMMARY ) {
@@ -2024,7 +2024,7 @@ static void rxq_deinit(struct rx_queue *rxq)for (i =0 ; i < rxq->rx_ring_size; i++) {if (rxq->rx_skb[i]) { -dev_kfree_skb (rxq->rx_skb[i]); +dev_consume_skb_any (rxq->rx_skb[i]); rxq->rx_desc_count--; } }
Signature · 1 line
2.11.0
From: Florian Fainelli <[email protected]>
Date: Thu, 24 Aug 2017 20:55:40 -0700
Quoted 5 lines
txq_reclaim()does the normal transmit queue reclamation andrxq_deinit()does the RX ring cleanup, none of these are packet drops, so usedev_consume_skb()for both locations.Signed-off-by Florian Fainelli <[email protected]>
Applied.
Quoted 23 lines · Florian Fainelli
txq_reclaim()does the normal transmit queue reclamation andrxq_deinit()does the RX ring cleanup, none of these are packet drops, so usedev_consume_skb()for both locations.Signed-off-by Florian Fainelli <[email protected]>--- drivers/net/ethernet/marvell/mv643xx_eth.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/net/ethernet/marvell/mv643xx_eth.c +1
-1@@ -1121,7 +1121,7 @@ static int txq_reclaim(struct tx_queue *txq, int budget, int force)struct sk_buff *skb =__skb_dequeue (&txq->tx_skb);if (!WARN_ON (!skb)) -dev_kfree_skb (skb); +dev_consume_skb_any (skb); }if (cmd_sts &ERROR_SUMMARY ) {
drivers/net/ethernet/marvell/mv643xx_eth.c static void rxq_deinit(struct rx_queue *rxq) · line 2030
Quoted 8 lines
drivers/net/ethernet/marvell/mv643xx_eth.c +1
-1@@ -2024,7 +2024,7 @@ static void rxq_deinit(struct rx_queue *rxq)for (i =0 ; i < rxq->rx_ring_size; i++) {if (rxq->rx_skb[i]) { -dev_kfree_skb (rxq->rx_skb[i]); +dev_consume_skb_any (rxq->rx_skb[i]); rxq->rx_desc_count--; } }
I do not believe this patch is needed.
dev_kfree_skb() is an alias of consume_skb(), which is already drop monitor ready ;)
Quoted 36 lines · Eric Dumazet
Quoted 23 lines · Florian Fainelli
txq_reclaim()does the normal transmit queue reclamation andrxq_deinit()does the RX ring cleanup, none of these are packet drops, so usedev_consume_skb()for both locations.Signed-off-by Florian Fainelli <[email protected]>--- drivers/net/ethernet/marvell/mv643xx_eth.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/net/ethernet/marvell/mv643xx_eth.c +1
-1@@ -1121,7 +1121,7 @@ static int txq_reclaim(struct tx_queue *txq, int budget, int force)struct sk_buff *skb =__skb_dequeue (&txq->tx_skb);if (!WARN_ON (!skb)) -dev_kfree_skb (skb); +dev_consume_skb_any (skb); }if (cmd_sts &ERROR_SUMMARY ) {drivers/net/ethernet/marvell/mv643xx_eth.c static void rxq_deinit(struct rx_queue *rxq) · line 2030
Quoted 8 lines
drivers/net/ethernet/marvell/mv643xx_eth.c +1
-1@@ -2024,7 +2024,7 @@ static void rxq_deinit(struct rx_queue *rxq)for (i =0 ; i < rxq->rx_ring_size; i++) {if (rxq->rx_skb[i]) { -dev_kfree_skb (rxq->rx_skb[i]); +dev_consume_skb_any (rxq->rx_skb[i]); rxq->rx_desc_count--; } }I do not believe this patch is needed.
Quoted 2 lines
dev_kfree_skb()is an alias ofconsume_skb(), which is already drop monitor ready ;)
You are right, this patch is/was not needed, I have been too trigger happy with the dev_kfree_skb*() replacement, but only dev_kfree_skb_{any,irq} are valid candidates for replacement by dev_consume_skb_{any,irq}. I will re-audit my other two submissions to e1000e and r8169. Thanks Eric.
Signature · 1 line
Florian