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

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'there-are-some-bugfix-for-the-hns3-ethernet-driver'

Jijie Shao says:

====================
There are some bugfix for the HNS3 ethernet driver
====================

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

+22 -3
+1 -1
drivers/net/ethernet/hisilicon/hns3/hns3_common/hclge_comm_tqp_stats.c
··· 85 85 hclge_comm_cmd_setup_basic_desc(&desc, HCLGE_OPC_QUERY_TX_STATS, 86 86 true); 87 87 88 - desc.data[0] = cpu_to_le32(tqp->index & 0x1ff); 88 + desc.data[0] = cpu_to_le32(tqp->index); 89 89 ret = hclge_comm_cmd_send(hw, &desc, 1); 90 90 if (ret) { 91 91 dev_err(&hw->cmq.csq.pdev->dev,
+17 -2
drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c
··· 78 78 #define HNS3_NIC_LB_TEST_NO_MEM_ERR 1 79 79 #define HNS3_NIC_LB_TEST_TX_CNT_ERR 2 80 80 #define HNS3_NIC_LB_TEST_RX_CNT_ERR 3 81 + #define HNS3_NIC_LB_TEST_UNEXECUTED 4 82 + 83 + static int hns3_get_sset_count(struct net_device *netdev, int stringset); 81 84 82 85 static int hns3_lp_setup(struct net_device *ndev, enum hnae3_loop loop, bool en) 83 86 { ··· 421 418 static void hns3_self_test(struct net_device *ndev, 422 419 struct ethtool_test *eth_test, u64 *data) 423 420 { 421 + int cnt = hns3_get_sset_count(ndev, ETH_SS_TEST); 424 422 struct hns3_nic_priv *priv = netdev_priv(ndev); 425 423 struct hnae3_handle *h = priv->ae_handle; 426 424 int st_param[HNAE3_LOOP_NONE][2]; 427 425 bool if_running = netif_running(ndev); 426 + int i; 427 + 428 + /* initialize the loopback test result, avoid marking an unexcuted 429 + * loopback test as PASS. 430 + */ 431 + for (i = 0; i < cnt; i++) 432 + data[i] = HNS3_NIC_LB_TEST_UNEXECUTED; 428 433 429 434 if (hns3_nic_resetting(ndev)) { 430 435 netdev_err(ndev, "dev resetting!"); 431 - return; 436 + goto failure; 432 437 } 433 438 434 439 if (!(eth_test->flags & ETH_TEST_FL_OFFLINE)) 435 - return; 440 + goto failure; 436 441 437 442 if (netif_msg_ifdown(h)) 438 443 netdev_info(ndev, "self test start\n"); ··· 462 451 463 452 if (netif_msg_ifdown(h)) 464 453 netdev_info(ndev, "self test end\n"); 454 + return; 455 + 456 + failure: 457 + eth_test->flags |= ETH_TEST_FL_FAILED; 465 458 } 466 459 467 460 static void hns3_update_limit_promisc_mode(struct net_device *netdev,
+4
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
··· 11626 11626 if (ret) 11627 11627 goto err_pci_uninit; 11628 11628 11629 + devl_lock(hdev->devlink); 11630 + 11629 11631 /* Firmware command queue initialize */ 11630 11632 ret = hclge_comm_cmd_queue_init(hdev->pdev, &hdev->hw.hw); 11631 11633 if (ret) ··· 11807 11805 11808 11806 hclge_task_schedule(hdev, round_jiffies_relative(HZ)); 11809 11807 11808 + devl_unlock(hdev->devlink); 11810 11809 return 0; 11811 11810 11812 11811 err_mdiobus_unreg: ··· 11820 11817 err_cmd_uninit: 11821 11818 hclge_comm_cmd_uninit(hdev->ae_dev, &hdev->hw.hw); 11822 11819 err_devlink_uninit: 11820 + devl_unlock(hdev->devlink); 11823 11821 hclge_devlink_uninit(hdev); 11824 11822 err_pci_uninit: 11825 11823 pcim_iounmap(pdev, hdev->hw.hw.io_base);