net: hns3: Adjust prefix of tx/rx statistic names
authorJian Shen <shenjian15@huawei.com>
Fri, 21 Sep 2018 15:41:39 +0000 (16:41 +0100)
committerDavid S. Miller <davem@davemloft.net>
Sat, 22 Sep 2018 02:29:32 +0000 (19:29 -0700)
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: Jian Shen <shenjian15@huawei.com>
Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: Salil Mehta <salil.mehta@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c

index 3cfb6b881c390acdf1ac969210c7f86dcfd0f38d..ce2e6ea11bb7d0e10144db2adb4739fa3a49ab55 100644 (file)
@@ -22,13 +22,13 @@ struct hns3_stats {
 static const struct hns3_stats hns3_txq_stats[] = {
        /* Tx per-queue statistics */
        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("packets", tx_pkts),
        HNS3_TQP_STAT("bytes", tx_bytes),
        HNS3_TQP_STAT("errors", tx_err_cnt),
-       HNS3_TQP_STAT("tx_wake", restart_queue),
-       HNS3_TQP_STAT("tx_busy", tx_busy),
+       HNS3_TQP_STAT("wake", restart_queue),
+       HNS3_TQP_STAT("busy", tx_busy),
 };
 
 #define HNS3_TXQ_STATS_COUNT ARRAY_SIZE(hns3_txq_stats)
@@ -36,7 +36,7 @@ static const struct hns3_stats hns3_txq_stats[] = {
 static const struct hns3_stats hns3_rxq_stats[] = {
        /* Rx per-queue statistics */
        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("packets", rx_pkts),
        HNS3_TQP_STAT("bytes", rx_bytes),
@@ -369,7 +369,7 @@ static void *hns3_update_strings(u8 *data, const struct hns3_stats *stats,
                        data[ETH_GSTRING_LEN - 1] = '\0';
 
                        /* first, prepend the prefix string */
-                       n1 = snprintf(data, MAX_PREFIX_SIZE, "%s#%d_",
+                       n1 = snprintf(data, MAX_PREFIX_SIZE, "%s%d_",
                                      prefix, i);
                        n1 = min_t(uint, n1, MAX_PREFIX_SIZE - 1);
                        size_left = (ETH_GSTRING_LEN - 1) - n1;
index e9625cee926e6bff805d58c284445085e600260a..86d3d8b6fd2b884f9728bf857a5e24f65c947add 100644 (file)
@@ -354,7 +354,7 @@ static u8 *hclge_tqps_get_strings(struct hnae3_handle *handle, u8 *data)
        for (i = 0; i < kinfo->num_tqps; i++) {
                struct hclge_tqp *tqp = container_of(handle->kinfo.tqp[i],
                        struct hclge_tqp, q);
-               snprintf(buff, ETH_GSTRING_LEN, "txq#%d_pktnum_rcd",
+               snprintf(buff, ETH_GSTRING_LEN, "txq%d_pktnum_rcd",
                         tqp->index);
                buff = buff + ETH_GSTRING_LEN;
        }
@@ -362,7 +362,7 @@ static u8 *hclge_tqps_get_strings(struct hnae3_handle *handle, u8 *data)
        for (i = 0; i < kinfo->num_tqps; i++) {
                struct hclge_tqp *tqp = container_of(kinfo->tqp[i],
                        struct hclge_tqp, q);
-               snprintf(buff, ETH_GSTRING_LEN, "rxq#%d_pktnum_rcd",
+               snprintf(buff, ETH_GSTRING_LEN, "rxq%d_pktnum_rcd",
                         tqp->index);
                buff = buff + ETH_GSTRING_LEN;
        }
index 166a2cfcafde2074e2ff6d6a5d69134b674d8a95..c220d9bcd80d1494fd35e62e3bf889a2678af5dd 100644 (file)
@@ -110,7 +110,7 @@ static u8 *hclgevf_tqps_get_strings(struct hnae3_handle *handle, u8 *data)
        for (i = 0; i < hdev->num_tqps; i++) {
                struct hclgevf_tqp *tqp = container_of(handle->kinfo.tqp[i],
                        struct hclgevf_tqp, q);
-               snprintf(buff, ETH_GSTRING_LEN, "txq#%d_pktnum_rcd",
+               snprintf(buff, ETH_GSTRING_LEN, "txq%d_pktnum_rcd",
                         tqp->index);
                buff += ETH_GSTRING_LEN;
        }
@@ -118,7 +118,7 @@ static u8 *hclgevf_tqps_get_strings(struct hnae3_handle *handle, u8 *data)
        for (i = 0; i < hdev->num_tqps; i++) {
                struct hclgevf_tqp *tqp = container_of(handle->kinfo.tqp[i],
                        struct hclgevf_tqp, q);
-               snprintf(buff, ETH_GSTRING_LEN, "rxq#%d_pktnum_rcd",
+               snprintf(buff, ETH_GSTRING_LEN, "rxq%d_pktnum_rcd",
                         tqp->index);
                buff += ETH_GSTRING_LEN;
        }