Commit cf72fa63 authored by Jian Shen's avatar Jian Shen Committed by David S. Miller

net: hns3: Fix a response data read error of tqp statistics query

The result of tqp statistics query was read with an
error position, fix it according to the user manual.

Fixes: 46a3df9f ("net: hns3: Add HNS3 Acceleration Engine & Compatibility Layer Support")
Signed-off-by: default avatarJian Shen <shenjian15@huawei.com>
Signed-off-by: default avatarPeng Li <lipeng321@huawei.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 84910007
...@@ -525,7 +525,7 @@ static int hclge_tqps_update_stats(struct hnae3_handle *handle) ...@@ -525,7 +525,7 @@ static int hclge_tqps_update_stats(struct hnae3_handle *handle)
return ret; return ret;
} }
tqp->tqp_stats.rcb_rx_ring_pktnum_rcd += tqp->tqp_stats.rcb_rx_ring_pktnum_rcd +=
le32_to_cpu(desc[0].data[4]); le32_to_cpu(desc[0].data[1]);
} }
for (i = 0; i < kinfo->num_tqps; i++) { for (i = 0; i < kinfo->num_tqps; i++) {
...@@ -545,7 +545,7 @@ static int hclge_tqps_update_stats(struct hnae3_handle *handle) ...@@ -545,7 +545,7 @@ static int hclge_tqps_update_stats(struct hnae3_handle *handle)
return ret; return ret;
} }
tqp->tqp_stats.rcb_tx_ring_pktnum_rcd += tqp->tqp_stats.rcb_tx_ring_pktnum_rcd +=
le32_to_cpu(desc[0].data[4]); le32_to_cpu(desc[0].data[1]);
} }
return 0; return 0;
......
...@@ -49,7 +49,7 @@ static int hclgevf_tqps_update_stats(struct hnae3_handle *handle) ...@@ -49,7 +49,7 @@ static int hclgevf_tqps_update_stats(struct hnae3_handle *handle)
return status; return status;
} }
tqp->tqp_stats.rcb_rx_ring_pktnum_rcd += tqp->tqp_stats.rcb_rx_ring_pktnum_rcd +=
le32_to_cpu(desc.data[4]); le32_to_cpu(desc.data[1]);
hclgevf_cmd_setup_basic_desc(&desc, HCLGEVF_OPC_QUERY_TX_STATUS, hclgevf_cmd_setup_basic_desc(&desc, HCLGEVF_OPC_QUERY_TX_STATUS,
true); true);
...@@ -63,7 +63,7 @@ static int hclgevf_tqps_update_stats(struct hnae3_handle *handle) ...@@ -63,7 +63,7 @@ static int hclgevf_tqps_update_stats(struct hnae3_handle *handle)
return status; return status;
} }
tqp->tqp_stats.rcb_tx_ring_pktnum_rcd += tqp->tqp_stats.rcb_tx_ring_pktnum_rcd +=
le32_to_cpu(desc.data[4]); le32_to_cpu(desc.data[1]);
} }
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment