netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] sfc: Convert the normal transmit complete path to dev_consume_skb_any()
@ 2014-09-09 21:43 Rick Jones
  2014-09-09 23:18 ` Eric Dumazet
  0 siblings, 1 reply; 6+ messages in thread
From: Rick Jones @ 2014-09-09 21:43 UTC (permalink / raw)
  To: netdev; +Cc: davem, sshah, linux-net-drivers


From: Rick Jones <rick.jones2@hp.com>

Convert the normal transmit completion path from dev_kfree_skb_any()
to dev_consume_skb_any() to help keep dropped packet profiling
meaningful.

Signed-off-by: Rick Jones <rick.jones2@hp.com>

---

Compile tested only.  Also a fixup to make scripts/checkpatch.pl
happy.

diff --git a/drivers/net/ethernet/sfc/tx.c b/drivers/net/ethernet/sfc/tx.c
index 65c220f..3206098 100644
--- a/drivers/net/ethernet/sfc/tx.c
+++ b/drivers/net/ethernet/sfc/tx.c
@@ -78,7 +78,7 @@ static void efx_dequeue_buffer(struct efx_tx_queue *tx_queue,
 	if (buffer->flags & EFX_TX_BUF_SKB) {
 		(*pkts_compl)++;
 		(*bytes_compl) += buffer->skb->len;
-		dev_kfree_skb_any((struct sk_buff *) buffer->skb);
+		dev_consume_skb_any((struct sk_buff *)buffer->skb);
 		netif_vdbg(tx_queue->efx, tx_done, tx_queue->efx->net_dev,
 			   "TX queue %d transmission id %x complete\n",
 			   tx_queue->queue, tx_queue->read_count);

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

* Re: [PATCH net-next] sfc: Convert the normal transmit complete path to dev_consume_skb_any()
  2014-09-09 21:43 [PATCH net-next] sfc: Convert the normal transmit complete path to dev_consume_skb_any() Rick Jones
@ 2014-09-09 23:18 ` Eric Dumazet
  2014-09-09 23:38   ` Rick Jones
  0 siblings, 1 reply; 6+ messages in thread
From: Eric Dumazet @ 2014-09-09 23:18 UTC (permalink / raw)
  To: Rick Jones; +Cc: netdev, davem, sshah, linux-net-drivers

On Tue, 2014-09-09 at 14:43 -0700, Rick Jones wrote:
> From: Rick Jones <rick.jones2@hp.com>
> 
> Convert the normal transmit completion path from dev_kfree_skb_any()
> to dev_consume_skb_any() to help keep dropped packet profiling
> meaningful.
> 
> Signed-off-by: Rick Jones <rick.jones2@hp.com>
> 
> ---
> 
> Compile tested only.  Also a fixup to make scripts/checkpatch.pl
> happy.
> 
> diff --git a/drivers/net/ethernet/sfc/tx.c b/drivers/net/ethernet/sfc/tx.c
> index 65c220f..3206098 100644
> --- a/drivers/net/ethernet/sfc/tx.c
> +++ b/drivers/net/ethernet/sfc/tx.c
> @@ -78,7 +78,7 @@ static void efx_dequeue_buffer(struct efx_tx_queue *tx_queue,
>  	if (buffer->flags & EFX_TX_BUF_SKB) {
>  		(*pkts_compl)++;
>  		(*bytes_compl) += buffer->skb->len;
> -		dev_kfree_skb_any((struct sk_buff *) buffer->skb);
> +		dev_consume_skb_any((struct sk_buff *)buffer->skb);
>  		netif_vdbg(tx_queue->efx, tx_done, tx_queue->efx->net_dev,
>  			   "TX queue %d transmission id %x complete\n",
>  			   tx_queue->queue, tx_queue->read_count);

Right, but please remove this ugly cast while you are at it ;)

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

* Re: [PATCH net-next] sfc: Convert the normal transmit complete path to dev_consume_skb_any()
  2014-09-09 23:18 ` Eric Dumazet
@ 2014-09-09 23:38   ` Rick Jones
  2014-09-09 23:46     ` David Miller
  2014-09-10  0:25     ` Eric Dumazet
  0 siblings, 2 replies; 6+ messages in thread
From: Rick Jones @ 2014-09-09 23:38 UTC (permalink / raw)
  To: Eric Dumazet, Rick Jones; +Cc: netdev, davem, sshah, linux-net-drivers

On 09/09/2014 04:18 PM, Eric Dumazet wrote:
> On Tue, 2014-09-09 at 14:43 -0700, Rick Jones wrote:
>> From: Rick Jones <rick.jones2@hp.com>
 >> ...
>> Compile tested only.  Also a fixup to make scripts/checkpatch.pl
>> happy.
>>
>> diff --git a/drivers/net/ethernet/sfc/tx.c b/drivers/net/ethernet/sfc/tx.c
>> index 65c220f..3206098 100644
>> --- a/drivers/net/ethernet/sfc/tx.c
>> +++ b/drivers/net/ethernet/sfc/tx.c
>> @@ -78,7 +78,7 @@ static void efx_dequeue_buffer(struct efx_tx_queue *tx_queue,
>>   	if (buffer->flags & EFX_TX_BUF_SKB) {
>>   		(*pkts_compl)++;
>>   		(*bytes_compl) += buffer->skb->len;
>> -		dev_kfree_skb_any((struct sk_buff *) buffer->skb);
>> +		dev_consume_skb_any((struct sk_buff *)buffer->skb);
>>   		netif_vdbg(tx_queue->efx, tx_done, tx_queue->efx->net_dev,
>>   			   "TX queue %d transmission id %x complete\n",
>>   			   tx_queue->queue, tx_queue->read_count);
>
> Right, but please remove this ugly cast while you are at it ;)
>

I can remove that const, and then smooth the ripples stemming from it to 
arrive at something like:

diff --git a/drivers/net/ethernet/sfc/net_driver.h 
b/drivers/net/ethernet/sfc/ne
index 9ede320..a75aa08 100644
--- a/drivers/net/ethernet/sfc/net_driver.h
+++ b/drivers/net/ethernet/sfc/net_driver.h
@@ -148,7 +148,7 @@ struct efx_special_buffer {
   */
  struct efx_tx_buffer {
         union {
-               const struct sk_buff *skb;
+               struct sk_buff *skb;
                 void *heap_buf;
         };
         union {
diff --git a/drivers/net/ethernet/sfc/tx.c b/drivers/net/ethernet/sfc/tx.c
index 65c220f..a43c0c5 100644
--- a/drivers/net/ethernet/sfc/tx.c
+++ b/drivers/net/ethernet/sfc/tx.c
@@ -78,7 +78,7 @@ static void efx_dequeue_buffer(struct efx_tx_queue 
*tx_queue,
         if (buffer->flags & EFX_TX_BUF_SKB) {
                 (*pkts_compl)++;
                 (*bytes_compl) += buffer->skb->len;
-               dev_kfree_skb_any((struct sk_buff *) buffer->skb);
+               dev_consume_skb_any(buffer->skb);
                 netif_vdbg(tx_queue->efx, tx_done, tx_queue->efx->net_dev,
                            "TX queue %d transmission id %x complete\n",
                            tx_queue->queue, tx_queue->read_count);
@@ -1086,7 +1086,7 @@ static int tso_get_fragment(struct tso_state *st, 
struct e
   * of fragment or end-of-packet.
   */
  static void tso_fill_packet_with_fragment(struct efx_tx_queue *tx_queue,
-                                         const struct sk_buff *skb,
+                                         struct sk_buff *skb,
                                           struct tso_state *st)
  {
         struct efx_tx_buffer *buffer;


(might be mangled by this email client)


But perhaps someone from SolarFlare can say why that was a const to 
begin with.

rick

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

* Re: [PATCH net-next] sfc: Convert the normal transmit complete path to dev_consume_skb_any()
  2014-09-09 23:38   ` Rick Jones
@ 2014-09-09 23:46     ` David Miller
  2014-09-10  0:25     ` Eric Dumazet
  1 sibling, 0 replies; 6+ messages in thread
From: David Miller @ 2014-09-09 23:46 UTC (permalink / raw)
  To: rick.jones2; +Cc: eric.dumazet, raj, netdev, sshah, linux-net-drivers

From: Rick Jones <rick.jones2@hp.com>
Date: Tue, 09 Sep 2014 16:38:32 -0700

> But perhaps someone from SolarFlare can say why that was a const to
> begin with.

Probably to trap skb->x modifications after the SKB has been placed
in these entries, except for these explicit spots where the casts
are applied.

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

* Re: [PATCH net-next] sfc: Convert the normal transmit complete path to dev_consume_skb_any()
  2014-09-09 23:38   ` Rick Jones
  2014-09-09 23:46     ` David Miller
@ 2014-09-10  0:25     ` Eric Dumazet
  2014-09-10  0:34       ` David Miller
  1 sibling, 1 reply; 6+ messages in thread
From: Eric Dumazet @ 2014-09-10  0:25 UTC (permalink / raw)
  To: Rick Jones; +Cc: Rick Jones, netdev, davem, sshah, linux-net-drivers

On Tue, 2014-09-09 at 16:38 -0700, Rick Jones wrote:

> I can remove that const, and then smooth the ripples stemming from it to 
> arrive at something like:

Oh I missed this const, so this will be a different patch, sorry for
this.

Acked-by: Eric Dumazet <edumazet@google.com>

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

* Re: [PATCH net-next] sfc: Convert the normal transmit complete path to dev_consume_skb_any()
  2014-09-10  0:25     ` Eric Dumazet
@ 2014-09-10  0:34       ` David Miller
  0 siblings, 0 replies; 6+ messages in thread
From: David Miller @ 2014-09-10  0:34 UTC (permalink / raw)
  To: eric.dumazet; +Cc: rick.jones2, raj, netdev, sshah, linux-net-drivers

From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Tue, 09 Sep 2014 17:25:30 -0700

> On Tue, 2014-09-09 at 16:38 -0700, Rick Jones wrote:
> 
>> I can remove that const, and then smooth the ripples stemming from it to 
>> arrive at something like:
> 
> Oh I missed this const, so this will be a different patch, sorry for
> this.
> 
> Acked-by: Eric Dumazet <edumazet@google.com>

Applied, thanks everyone.

 

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

end of thread, other threads:[~2014-09-10  0:34 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-09-09 21:43 [PATCH net-next] sfc: Convert the normal transmit complete path to dev_consume_skb_any() Rick Jones
2014-09-09 23:18 ` Eric Dumazet
2014-09-09 23:38   ` Rick Jones
2014-09-09 23:46     ` David Miller
2014-09-10  0:25     ` Eric Dumazet
2014-09-10  0:34       ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).