Skip to content

Commit

Permalink
net/hns3: fix error code in xstats
Browse files Browse the repository at this point in the history
[ upstream commit dcb33fd ]

The ethdev API has processed the failure to obtain
xstats statistics. Therefore, driver should return
an error code instead of 0 in 'hns3_dev_xstats_get'
API.

Fixes: 8839c5e ("net/hns3: support device stats")

Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Lijun Ou <oulijun@huawei.com>
  • Loading branch information
LiHuiSong1 authored and cpaelzer committed Feb 3, 2021
1 parent 7313ffa commit 4c52a6f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/net/hns3/hns3_stats.c
Original file line number Diff line number Diff line change
Expand Up @@ -596,9 +596,9 @@ hns3_dev_xstats_get(struct rte_eth_dev *dev, struct rte_eth_xstat *xstats,
if (!hns->is_vf) {
/* Update Mac stats */
ret = hns3_query_update_mac_stats(dev);
if (ret) {
if (ret < 0) {
hns3_err(hw, "Update Mac stats fail : %d", ret);
return 0;
return ret;
}

/* Get MAC stats from hw->hw_xstats.mac_stats struct */
Expand Down

0 comments on commit 4c52a6f

Please sign in to comment.