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]
Message-ID: <2f017ae3-ddec-928c-16b7-5ed59e6fc8d6@huawei.com>
Date:   Tue, 3 Dec 2019 12:28:22 +0800
From:   Yunsheng Lin <linyunsheng@...wei.com>
To:     David Miller <davem@...emloft.net>, <tanhuazhong@...wei.com>
CC:     <netdev@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
        <salil.mehta@...wei.com>, <yisen.zhuang@...wei.com>,
        <linuxarm@...wei.com>, <jakub.kicinski@...ronome.com>
Subject: Re: [PATCH net 1/3] net: hns3: fix for TX queue not restarted problem

On 2019/12/3 11:25, David Miller wrote:
> From: Huazhong Tan <tanhuazhong@...wei.com>
> Date: Tue, 3 Dec 2019 11:08:53 +0800
> 
>> diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c
>> index ba05368..b2bb8e2 100644
>> --- a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c
>> +++ b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c
>> @@ -1286,13 +1286,16 @@ static bool hns3_skb_need_linearized(struct sk_buff *skb, unsigned int *bd_size,
>>  	return false;
>>  }
>>  
>> -static int hns3_nic_maybe_stop_tx(struct hns3_enet_ring *ring,
>> +static int hns3_nic_maybe_stop_tx(struct net_device *netdev,
>>  				  struct sk_buff **out_skb)
>>  {
>> +	struct hns3_nic_priv *priv = netdev_priv(netdev);
>>  	unsigned int bd_size[HNS3_MAX_TSO_BD_NUM + 1U];
>>  	struct sk_buff *skb = *out_skb;
>> +	struct hns3_enet_ring *ring;
>>  	unsigned int bd_num;
>>  
>> +	ring = &priv->ring[skb->queue_mapping];
> 
> Please just pass the ring pointer into hns3_nic_maybe_stop_tx() instead of
> needlessly recalculating it.

The reason that I am passing the netdev instead of ring pointer is
that the netif_start_subqueue() need a netdev parameter, and the
netdev can not be derived from the ring pointer.

Do you think it is better to keep it as this patch, or add a new
netdevice parameter? like below:

static int hns3_nic_maybe_stop_tx(struct net_device *netdev,
				  struct hns3_enet_ring *ring,
				  struct sk_buff **out_skb)



> 
> Thank you.
> 
> .
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ