public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next v2] net: mv643xx_eth: Be drop monitor friendly
@ 2017-08-25  3:55 Florian Fainelli
  2017-08-25  4:29 ` David Miller
  2017-08-25  4:34 ` Eric Dumazet
  0 siblings, 2 replies; 4+ messages in thread
From: Florian Fainelli @ 2017-08-25  3:55 UTC (permalink / raw)
  To: netdev; +Cc: davem, andrew, Florian Fainelli, Sebastian Hesselbarth, open list

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.

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
 drivers/net/ethernet/marvell/mv643xx_eth.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/marvell/mv643xx_eth.c b/drivers/net/ethernet/marvell/mv643xx_eth.c
index fb2d533ae4ef..81c1fac00d33 100644
--- a/drivers/net/ethernet/marvell/mv643xx_eth.c
+++ b/drivers/net/ethernet/marvell/mv643xx_eth.c
@@ -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--;
 		}
 	}
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH net-next v2] net: mv643xx_eth: Be drop monitor friendly
  2017-08-25  3:55 [PATCH net-next v2] net: mv643xx_eth: Be drop monitor friendly Florian Fainelli
@ 2017-08-25  4:29 ` David Miller
  2017-08-25  4:34 ` Eric Dumazet
  1 sibling, 0 replies; 4+ messages in thread
From: David Miller @ 2017-08-25  4:29 UTC (permalink / raw)
  To: f.fainelli; +Cc: netdev, andrew, sebastian.hesselbarth, linux-kernel

From: Florian Fainelli <f.fainelli@gmail.com>
Date: Thu, 24 Aug 2017 20:55:40 -0700

> 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.
> 
> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>

Applied.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH net-next v2] net: mv643xx_eth: Be drop monitor friendly
  2017-08-25  3:55 [PATCH net-next v2] net: mv643xx_eth: Be drop monitor friendly Florian Fainelli
  2017-08-25  4:29 ` David Miller
@ 2017-08-25  4:34 ` Eric Dumazet
  2017-08-25 16:44   ` Florian Fainelli
  1 sibling, 1 reply; 4+ messages in thread
From: Eric Dumazet @ 2017-08-25  4:34 UTC (permalink / raw)
  To: Florian Fainelli; +Cc: netdev, davem, andrew, Sebastian Hesselbarth, open list

On Thu, 2017-08-24 at 20:55 -0700, Florian Fainelli wrote:
> 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.
> 
> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
> ---
>  drivers/net/ethernet/marvell/mv643xx_eth.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/ethernet/marvell/mv643xx_eth.c b/drivers/net/ethernet/marvell/mv643xx_eth.c
> index fb2d533ae4ef..81c1fac00d33 100644
> --- a/drivers/net/ethernet/marvell/mv643xx_eth.c
> +++ b/drivers/net/ethernet/marvell/mv643xx_eth.c
> @@ -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--;
>  		}
>  	}


I do not believe this patch is needed.

dev_kfree_skb() is an alias of consume_skb(), which is already drop
monitor ready ;)

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH net-next v2] net: mv643xx_eth: Be drop monitor friendly
  2017-08-25  4:34 ` Eric Dumazet
@ 2017-08-25 16:44   ` Florian Fainelli
  0 siblings, 0 replies; 4+ messages in thread
From: Florian Fainelli @ 2017-08-25 16:44 UTC (permalink / raw)
  To: Eric Dumazet; +Cc: netdev, davem, andrew, Sebastian Hesselbarth, open list

On 08/24/2017 09:34 PM, Eric Dumazet wrote:
> On Thu, 2017-08-24 at 20:55 -0700, Florian Fainelli wrote:
>> 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.
>>
>> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
>> ---
>>  drivers/net/ethernet/marvell/mv643xx_eth.c | 4 ++--
>>  1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/net/ethernet/marvell/mv643xx_eth.c b/drivers/net/ethernet/marvell/mv643xx_eth.c
>> index fb2d533ae4ef..81c1fac00d33 100644
>> --- a/drivers/net/ethernet/marvell/mv643xx_eth.c
>> +++ b/drivers/net/ethernet/marvell/mv643xx_eth.c
>> @@ -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--;
>>  		}
>>  	}
> 
> 
> I do not believe this patch is needed.
> 
> dev_kfree_skb() is an alias of consume_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.
-- 
Florian

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-08-25 16:44 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-08-25  3:55 [PATCH net-next v2] net: mv643xx_eth: Be drop monitor friendly Florian Fainelli
2017-08-25  4:29 ` David Miller
2017-08-25  4:34 ` Eric Dumazet
2017-08-25 16:44   ` Florian Fainelli

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox