lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 09 Sep 2014 16:38:32 -0700
From:	Rick Jones <rick.jones2@...com>
To:	Eric Dumazet <eric.dumazet@...il.com>,
	Rick Jones <raj@...dy.usa.hp.com>
CC:	netdev@...r.kernel.org, davem@...emloft.net, sshah@...arflare.com,
	linux-net-drivers@...arflare.com
Subject: Re: [PATCH net-next] sfc: Convert the normal transmit complete path
 to dev_consume_skb_any()

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@...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
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ