Skip to content

Commit

Permalink
net/hns3: fix some return values
Browse files Browse the repository at this point in the history
[ upstream commit 08159599978f7f7eb6c4aaed7c290e33b8bc3d64 ]

1. Fix the return value of hns3_get_imissed_stats_num as 'uint16_t'.
2. Add some error check for return value.

Fixes: fcba820 ("net/hns3: support flow director")

Signed-off-by: Jie Hai <haijie1@huawei.com>
  • Loading branch information
Jie Hai authored and bluca committed Nov 8, 2023
1 parent 4cf3c23 commit a6dd347
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
5 changes: 4 additions & 1 deletion drivers/net/hns3/hns3_ethdev_vf.c
Original file line number Diff line number Diff line change
Expand Up @@ -2659,8 +2659,11 @@ hns3vf_reinit_dev(struct hns3_adapter *hns)
*/
if (pci_dev->kdrv == RTE_PCI_KDRV_IGB_UIO ||
pci_dev->kdrv == RTE_PCI_KDRV_UIO_GENERIC) {
if (hns3vf_enable_msix(pci_dev, true))
ret = hns3vf_enable_msix(pci_dev, true);
if (ret != 0) {
hns3_err(hw, "Failed to enable msix");
return ret;
}
}

rte_intr_enable(&pci_dev->intr_handle);
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/hns3/hns3_fdir.c
Original file line number Diff line number Diff line change
Expand Up @@ -962,7 +962,7 @@ int hns3_fdir_filter_program(struct hns3_adapter *hns,
rule->key_conf.spec.src_port,
rule->key_conf.spec.dst_port, ret);
else
hns3_remove_fdir_filter(hw, fdir_info, &rule->key_conf);
ret = hns3_remove_fdir_filter(hw, fdir_info, &rule->key_conf);

return ret;
}
Expand Down
10 changes: 8 additions & 2 deletions drivers/net/hns3/hns3_stats.c
Original file line number Diff line number Diff line change
Expand Up @@ -1144,9 +1144,15 @@ int
hns3_stats_init(struct hns3_hw *hw)
{
struct hns3_adapter *hns = HNS3_DEV_HW_TO_ADAPTER(hw);
int ret;

if (!hns->is_vf)
hns3_mac_stats_reset(hw);
if (!hns->is_vf) {
ret = hns3_mac_stats_reset(hw);
if (ret) {
hns3_err(hw, "reset mac stats failed, ret = %d", ret);
return ret;
}
}

return hns3_tqp_stats_init(hw);
}
Expand Down

0 comments on commit a6dd347

Please sign in to comment.