2019-09-04 14:12:57

by Huazhong Tan

[permalink] [raw]
Subject: [PATCH net-next 0/7] net: hns3: add some bugfixes and cleanups

This patch-set includes bugfixes and cleanups for the HNS3
ethernet controller driver.

[patch 01/07] fixes an error when setting VLAN offload.

[patch 02/07] fixes an double free issue when setting ringparam.

[patch 03/07] fixes a mis-assignment of hdev->reset_level.

[patch 04/07] adds a checking for client's validity.

[patch 05/07] simplifies bool variable's assignment.

[patch 06/07] disables loopback when initializing.

[patch 07/07] makes internal function to static.

Guojia Liao (2):
net: hns3: remove explicit conversion to bool
net: hns3: make hclge_dbg_get_m7_stats_info static

Huazhong Tan (2):
net: hns3: fix double free bug when setting ringparam
net: hns3: fix mis-assignment to hdev->reset_level in hclge_reset

Jian Shen (1):
net: hns3: fix error VF index when setting VLAN offload

Peng Li (1):
net: hns3: add client node validity judgment

Yufeng Mo (1):
net: hns3: disable loopback setting in hclge_mac_init

drivers/net/ethernet/hisilicon/hns3/hnae3.c | 16 ++++++
drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c | 4 +-
.../ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c | 2 +-
.../ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 59 ++++++++++++++++++----
4 files changed, 69 insertions(+), 12 deletions(-)

--
2.7.4


2019-09-04 14:13:04

by Huazhong Tan

[permalink] [raw]
Subject: [PATCH net-next 4/7] net: hns3: add client node validity judgment

From: Peng Li <[email protected]>

HNS3 driver can only unregister client which included in hnae3_client_list.
This patch adds the client node validity judgment.

Signed-off-by: Peng Li <[email protected]>
Signed-off-by: Huazhong Tan <[email protected]>
---
drivers/net/ethernet/hisilicon/hns3/hnae3.c | 16 ++++++++++++++++
1 file changed, 16 insertions(+)

diff --git a/drivers/net/ethernet/hisilicon/hns3/hnae3.c b/drivers/net/ethernet/hisilicon/hns3/hnae3.c
index 528f624..6aa5257 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hnae3.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hnae3.c
@@ -138,12 +138,28 @@ EXPORT_SYMBOL(hnae3_register_client);

void hnae3_unregister_client(struct hnae3_client *client)
{
+ struct hnae3_client *client_tmp;
struct hnae3_ae_dev *ae_dev;
+ bool existed = false;

if (!client)
return;

mutex_lock(&hnae3_common_lock);
+
+ list_for_each_entry(client_tmp, &hnae3_client_list, node) {
+ if (client_tmp->type == client->type) {
+ existed = true;
+ break;
+ }
+ }
+
+ if (!existed) {
+ mutex_unlock(&hnae3_common_lock);
+ pr_err("client %s not existed!\n", client->name);
+ return;
+ }
+
/* un-initialize the client on every matched port */
list_for_each_entry(ae_dev, &hnae3_ae_dev_list, node) {
hnae3_uninit_client_instance(client, ae_dev);
--
2.7.4

2019-09-05 11:04:25

by Huazhong Tan

[permalink] [raw]
Subject: Re: [PATCH net-next 4/7] net: hns3: add client node validity judgment



On 2019/9/5 18:12, Sergei Shtylyov wrote:
> On 04.09.2019 17:06, Huazhong Tan wrote:
>
>> From: Peng Li <[email protected]>
>>
>> HNS3 driver can only unregister client which included in
>> hnae3_client_list.
>> This patch adds the client node validity judgment.
>>
>> Signed-off-by: Peng Li <[email protected]>
>> Signed-off-by: Huazhong Tan <[email protected]>
>> ---
>>   drivers/net/ethernet/hisilicon/hns3/hnae3.c | 16 ++++++++++++++++
>>   1 file changed, 16 insertions(+)
>>
>> diff --git a/drivers/net/ethernet/hisilicon/hns3/hnae3.c
>> b/drivers/net/ethernet/hisilicon/hns3/hnae3.c
>> index 528f624..6aa5257 100644
>> --- a/drivers/net/ethernet/hisilicon/hns3/hnae3.c
>> +++ b/drivers/net/ethernet/hisilicon/hns3/hnae3.c
>> @@ -138,12 +138,28 @@ EXPORT_SYMBOL(hnae3_register_client);
>>   void hnae3_unregister_client(struct hnae3_client *client)
>>   {
>> +    struct hnae3_client *client_tmp;
>>       struct hnae3_ae_dev *ae_dev;
>> +    bool existed = false;
>>       if (!client)
>>           return;
>>       mutex_lock(&hnae3_common_lock);
>> +
>> +    list_for_each_entry(client_tmp, &hnae3_client_list, node) {
>> +        if (client_tmp->type == client->type) {
>> +            existed = true;
>> +            break;
>> +        }
>> +    }
>> +
>> +    if (!existed) {
>> +        mutex_unlock(&hnae3_common_lock);
>> +        pr_err("client %s not existed!\n", client->name);
>
>    Did not exist, you mean?
>

yes

> [...]
>
> MBR, Sergei
>
> .
>

2019-09-05 12:13:41

by Sergei Shtylyov

[permalink] [raw]
Subject: Re: [PATCH net-next 4/7] net: hns3: add client node validity judgment

On 04.09.2019 17:06, Huazhong Tan wrote:

> From: Peng Li <[email protected]>
>
> HNS3 driver can only unregister client which included in hnae3_client_list.
> This patch adds the client node validity judgment.
>
> Signed-off-by: Peng Li <[email protected]>
> Signed-off-by: Huazhong Tan <[email protected]>
> ---
> drivers/net/ethernet/hisilicon/hns3/hnae3.c | 16 ++++++++++++++++
> 1 file changed, 16 insertions(+)
>
> diff --git a/drivers/net/ethernet/hisilicon/hns3/hnae3.c b/drivers/net/ethernet/hisilicon/hns3/hnae3.c
> index 528f624..6aa5257 100644
> --- a/drivers/net/ethernet/hisilicon/hns3/hnae3.c
> +++ b/drivers/net/ethernet/hisilicon/hns3/hnae3.c
> @@ -138,12 +138,28 @@ EXPORT_SYMBOL(hnae3_register_client);
>
> void hnae3_unregister_client(struct hnae3_client *client)
> {
> + struct hnae3_client *client_tmp;
> struct hnae3_ae_dev *ae_dev;
> + bool existed = false;
>
> if (!client)
> return;
>
> mutex_lock(&hnae3_common_lock);
> +
> + list_for_each_entry(client_tmp, &hnae3_client_list, node) {
> + if (client_tmp->type == client->type) {
> + existed = true;
> + break;
> + }
> + }
> +
> + if (!existed) {
> + mutex_unlock(&hnae3_common_lock);
> + pr_err("client %s not existed!\n", client->name);

Did not exist, you mean?

[...]

MBR, Sergei