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

net: hns3: Adjust prefix of tx/rx statistic names

Some prefix of tx/rx statistic names are redundant, this patch modifies
these names.

The new prefix looks like below:
rxq#1_ -> rxq1_
txq#1_ -> txq1_
tx_dropped -> dropped
tx_wake -> wake
tx_busy -> busy
rx_dropped -> dropped
Signed-off-by: default avatarJian Shen <shenjian15@huawei.com>
Signed-off-by: default avatarPeng Li <lipeng321@huawei.com>
Signed-off-by: default avatarSalil Mehta <salil.mehta@huawei.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent d0d72bac
...@@ -22,13 +22,13 @@ struct hns3_stats { ...@@ -22,13 +22,13 @@ struct hns3_stats {
static const struct hns3_stats hns3_txq_stats[] = { static const struct hns3_stats hns3_txq_stats[] = {
/* Tx per-queue statistics */ /* Tx per-queue statistics */
HNS3_TQP_STAT("io_err_cnt", io_err_cnt), HNS3_TQP_STAT("io_err_cnt", io_err_cnt),
HNS3_TQP_STAT("tx_dropped", sw_err_cnt), HNS3_TQP_STAT("dropped", sw_err_cnt),
HNS3_TQP_STAT("seg_pkt_cnt", seg_pkt_cnt), HNS3_TQP_STAT("seg_pkt_cnt", seg_pkt_cnt),
HNS3_TQP_STAT("packets", tx_pkts), HNS3_TQP_STAT("packets", tx_pkts),
HNS3_TQP_STAT("bytes", tx_bytes), HNS3_TQP_STAT("bytes", tx_bytes),
HNS3_TQP_STAT("errors", tx_err_cnt), HNS3_TQP_STAT("errors", tx_err_cnt),
HNS3_TQP_STAT("tx_wake", restart_queue), HNS3_TQP_STAT("wake", restart_queue),
HNS3_TQP_STAT("tx_busy", tx_busy), HNS3_TQP_STAT("busy", tx_busy),
}; };
#define HNS3_TXQ_STATS_COUNT ARRAY_SIZE(hns3_txq_stats) #define HNS3_TXQ_STATS_COUNT ARRAY_SIZE(hns3_txq_stats)
...@@ -36,7 +36,7 @@ static const struct hns3_stats hns3_txq_stats[] = { ...@@ -36,7 +36,7 @@ static const struct hns3_stats hns3_txq_stats[] = {
static const struct hns3_stats hns3_rxq_stats[] = { static const struct hns3_stats hns3_rxq_stats[] = {
/* Rx per-queue statistics */ /* Rx per-queue statistics */
HNS3_TQP_STAT("io_err_cnt", io_err_cnt), HNS3_TQP_STAT("io_err_cnt", io_err_cnt),
HNS3_TQP_STAT("rx_dropped", sw_err_cnt), HNS3_TQP_STAT("dropped", sw_err_cnt),
HNS3_TQP_STAT("seg_pkt_cnt", seg_pkt_cnt), HNS3_TQP_STAT("seg_pkt_cnt", seg_pkt_cnt),
HNS3_TQP_STAT("packets", rx_pkts), HNS3_TQP_STAT("packets", rx_pkts),
HNS3_TQP_STAT("bytes", rx_bytes), HNS3_TQP_STAT("bytes", rx_bytes),
...@@ -369,7 +369,7 @@ static void *hns3_update_strings(u8 *data, const struct hns3_stats *stats, ...@@ -369,7 +369,7 @@ static void *hns3_update_strings(u8 *data, const struct hns3_stats *stats,
data[ETH_GSTRING_LEN - 1] = '\0'; data[ETH_GSTRING_LEN - 1] = '\0';
/* first, prepend the prefix string */ /* first, prepend the prefix string */
n1 = snprintf(data, MAX_PREFIX_SIZE, "%s#%d_", n1 = snprintf(data, MAX_PREFIX_SIZE, "%s%d_",
prefix, i); prefix, i);
n1 = min_t(uint, n1, MAX_PREFIX_SIZE - 1); n1 = min_t(uint, n1, MAX_PREFIX_SIZE - 1);
size_left = (ETH_GSTRING_LEN - 1) - n1; size_left = (ETH_GSTRING_LEN - 1) - n1;
......
...@@ -354,7 +354,7 @@ static u8 *hclge_tqps_get_strings(struct hnae3_handle *handle, u8 *data) ...@@ -354,7 +354,7 @@ static u8 *hclge_tqps_get_strings(struct hnae3_handle *handle, u8 *data)
for (i = 0; i < kinfo->num_tqps; i++) { for (i = 0; i < kinfo->num_tqps; i++) {
struct hclge_tqp *tqp = container_of(handle->kinfo.tqp[i], struct hclge_tqp *tqp = container_of(handle->kinfo.tqp[i],
struct hclge_tqp, q); struct hclge_tqp, q);
snprintf(buff, ETH_GSTRING_LEN, "txq#%d_pktnum_rcd", snprintf(buff, ETH_GSTRING_LEN, "txq%d_pktnum_rcd",
tqp->index); tqp->index);
buff = buff + ETH_GSTRING_LEN; buff = buff + ETH_GSTRING_LEN;
} }
...@@ -362,7 +362,7 @@ static u8 *hclge_tqps_get_strings(struct hnae3_handle *handle, u8 *data) ...@@ -362,7 +362,7 @@ static u8 *hclge_tqps_get_strings(struct hnae3_handle *handle, u8 *data)
for (i = 0; i < kinfo->num_tqps; i++) { for (i = 0; i < kinfo->num_tqps; i++) {
struct hclge_tqp *tqp = container_of(kinfo->tqp[i], struct hclge_tqp *tqp = container_of(kinfo->tqp[i],
struct hclge_tqp, q); struct hclge_tqp, q);
snprintf(buff, ETH_GSTRING_LEN, "rxq#%d_pktnum_rcd", snprintf(buff, ETH_GSTRING_LEN, "rxq%d_pktnum_rcd",
tqp->index); tqp->index);
buff = buff + ETH_GSTRING_LEN; buff = buff + ETH_GSTRING_LEN;
} }
......
...@@ -110,7 +110,7 @@ static u8 *hclgevf_tqps_get_strings(struct hnae3_handle *handle, u8 *data) ...@@ -110,7 +110,7 @@ static u8 *hclgevf_tqps_get_strings(struct hnae3_handle *handle, u8 *data)
for (i = 0; i < hdev->num_tqps; i++) { for (i = 0; i < hdev->num_tqps; i++) {
struct hclgevf_tqp *tqp = container_of(handle->kinfo.tqp[i], struct hclgevf_tqp *tqp = container_of(handle->kinfo.tqp[i],
struct hclgevf_tqp, q); struct hclgevf_tqp, q);
snprintf(buff, ETH_GSTRING_LEN, "txq#%d_pktnum_rcd", snprintf(buff, ETH_GSTRING_LEN, "txq%d_pktnum_rcd",
tqp->index); tqp->index);
buff += ETH_GSTRING_LEN; buff += ETH_GSTRING_LEN;
} }
...@@ -118,7 +118,7 @@ static u8 *hclgevf_tqps_get_strings(struct hnae3_handle *handle, u8 *data) ...@@ -118,7 +118,7 @@ static u8 *hclgevf_tqps_get_strings(struct hnae3_handle *handle, u8 *data)
for (i = 0; i < hdev->num_tqps; i++) { for (i = 0; i < hdev->num_tqps; i++) {
struct hclgevf_tqp *tqp = container_of(handle->kinfo.tqp[i], struct hclgevf_tqp *tqp = container_of(handle->kinfo.tqp[i],
struct hclgevf_tqp, q); struct hclgevf_tqp, q);
snprintf(buff, ETH_GSTRING_LEN, "rxq#%d_pktnum_rcd", snprintf(buff, ETH_GSTRING_LEN, "rxq%d_pktnum_rcd",
tqp->index); tqp->index);
buff += ETH_GSTRING_LEN; buff += ETH_GSTRING_LEN;
} }
......
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