Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge branch 'net-hns3-add-two-fixes-for-net'

Guangbin Huang says:

====================
net: hns3: add two fixes for -net

This series adds two fixes for the HNS3 ethernet driver.
====================

Link: https://lore.kernel.org/r/20220330134506.36635-1-huangguangbin2@huawei.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>

+15 -8
+1
drivers/net/ethernet/hisilicon/hns3/hnae3.h
··· 845 845 struct dentry *hnae3_dbgfs; 846 846 /* protects concurrent contention between debugfs commands */ 847 847 struct mutex dbgfs_lock; 848 + char **dbgfs_buf; 848 849 849 850 /* Network interface message level enabled bits */ 850 851 u32 msg_enable;
+11 -4
drivers/net/ethernet/hisilicon/hns3/hns3_debugfs.c
··· 1227 1227 return ret; 1228 1228 1229 1229 mutex_lock(&handle->dbgfs_lock); 1230 - save_buf = &hns3_dbg_cmd[index].buf; 1230 + save_buf = &handle->dbgfs_buf[index]; 1231 1231 1232 1232 if (!test_bit(HNS3_NIC_STATE_INITED, &priv->state) || 1233 1233 test_bit(HNS3_NIC_STATE_RESETTING, &priv->state)) { ··· 1332 1332 int ret; 1333 1333 u32 i; 1334 1334 1335 + handle->dbgfs_buf = devm_kcalloc(&handle->pdev->dev, 1336 + ARRAY_SIZE(hns3_dbg_cmd), 1337 + sizeof(*handle->dbgfs_buf), 1338 + GFP_KERNEL); 1339 + if (!handle->dbgfs_buf) 1340 + return -ENOMEM; 1341 + 1335 1342 hns3_dbg_dentry[HNS3_DBG_DENTRY_COMMON].dentry = 1336 1343 debugfs_create_dir(name, hns3_dbgfs_root); 1337 1344 handle->hnae3_dbgfs = hns3_dbg_dentry[HNS3_DBG_DENTRY_COMMON].dentry; ··· 1387 1380 u32 i; 1388 1381 1389 1382 for (i = 0; i < ARRAY_SIZE(hns3_dbg_cmd); i++) 1390 - if (hns3_dbg_cmd[i].buf) { 1391 - kvfree(hns3_dbg_cmd[i].buf); 1392 - hns3_dbg_cmd[i].buf = NULL; 1383 + if (handle->dbgfs_buf[i]) { 1384 + kvfree(handle->dbgfs_buf[i]); 1385 + handle->dbgfs_buf[i] = NULL; 1393 1386 } 1394 1387 1395 1388 mutex_destroy(&handle->dbgfs_lock);
-1
drivers/net/ethernet/hisilicon/hns3/hns3_debugfs.h
··· 49 49 enum hnae3_dbg_cmd cmd; 50 50 enum hns3_dbg_dentry_type dentry; 51 51 u32 buf_len; 52 - char *buf; 53 52 int (*init)(struct hnae3_handle *handle, unsigned int cmd); 54 53 }; 55 54
+3 -3
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
··· 10323 10323 } 10324 10324 10325 10325 if (!ret) { 10326 - if (is_kill) 10327 - hclge_rm_vport_vlan_table(vport, vlan_id, false); 10328 - else 10326 + if (!is_kill) 10329 10327 hclge_add_vport_vlan_table(vport, vlan_id, 10330 10328 writen_to_tbl); 10329 + else if (is_kill && vlan_id != 0) 10330 + hclge_rm_vport_vlan_table(vport, vlan_id, false); 10331 10331 } else if (is_kill) { 10332 10332 /* when remove hw vlan filter failed, record the vlan id, 10333 10333 * and try to remove it from hw later, to be consistence