summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
2de74dc)
Since the return value of the '.stats_reset' and '.xstats_reset'
callback function is int, when failing to issue command to firmware to
execute clear statistics, the relevant callback function should return
non-zero value.
Fixes:
8839c5e202f3 ("net/hns3: support device stats")
Cc: stable@dpdk.org
Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
if (ret) {
hns3_err(hw, "Failed to reset RX No.%d queue stat: %d",
i, ret);
if (ret) {
hns3_err(hw, "Failed to reset RX No.%d queue stat: %d",
i, ret);
}
hns3_cmd_setup_basic_desc(&desc_reset, HNS3_OPC_QUERY_TX_STATUS,
}
hns3_cmd_setup_basic_desc(&desc_reset, HNS3_OPC_QUERY_TX_STATUS,
if (ret) {
hns3_err(hw, "Failed to reset TX No.%d queue stat: %d",
i, ret);
if (ret) {
hns3_err(hw, "Failed to reset TX No.%d queue stat: %d",
i, ret);
hns3_mac_stats_reset(__rte_unused struct rte_eth_dev *dev)
{
struct hns3_adapter *hns = dev->data->dev_private;
hns3_mac_stats_reset(__rte_unused struct rte_eth_dev *dev)
{
struct hns3_adapter *hns = dev->data->dev_private;
int ret;
ret = hns3_query_update_mac_stats(dev);
int ret;
ret = hns3_query_update_mac_stats(dev);
hns3_err(hw, "Clear Mac stats fail : %d", ret);
hns3_err(hw, "Clear Mac stats fail : %d", ret);
memset(mac_stats, 0, sizeof(struct hns3_mac_stats));
memset(mac_stats, 0, sizeof(struct hns3_mac_stats));
}
/* This function calculates the number of xstats based on the current config */
}
/* This function calculates the number of xstats based on the current config */
{
struct hns3_adapter *hns = dev->data->dev_private;
struct hns3_pf *pf = &hns->pf;
{
struct hns3_adapter *hns = dev->data->dev_private;
struct hns3_pf *pf = &hns->pf;
- (void)hns3_stats_reset(dev);
+ ret = hns3_stats_reset(dev);
+ if (ret)
+ return ret;
+
/* Clear reset stats */
memset(&hns->hw.reset.stats, 0, sizeof(struct hns3_reset_stats));
/* Clear reset stats */
memset(&hns->hw.reset.stats, 0, sizeof(struct hns3_reset_stats));
return 0;
/* HW registers are cleared on read */
return 0;
/* HW registers are cleared on read */
- hns3_mac_stats_reset(dev);
+ ret = hns3_mac_stats_reset(dev);
+ if (ret)
+ return ret;
+
/* Clear error stats */
memset(&pf->abn_int_stats, 0, sizeof(struct hns3_err_msix_intr_stats));
/* Clear error stats */
memset(&pf->abn_int_stats, 0, sizeof(struct hns3_err_msix_intr_stats));