Skip to content

Commit de6df26

Browse files
fengidriPaolo Abeni
authored andcommitted
virtio_net: remove "_queue" from ethtool -S
The key size of ethtool -S is controlled by this macro. ETH_GSTRING_LEN 32 That includes the \0 at the end. So the max length of the key name must is 31. But the length of the prefix "rx_queue_0_" is 11. If the queue num is larger than 10, the length of the prefix is 12. So the key name max is 19. That is too short. We will introduce some keys such as "gso_packets_coalesced". So we should change the prefix to "rx0_". Signed-off-by: Xuan Zhuo <xuanzhuo@linux.alibaba.com> Acked-by: Jason Wang <jasowang@redhat.com> Signed-off-by: Paolo Abeni <pabeni@redhat.com>
1 parent 34cfe87 commit de6df26

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/net/virtio_net.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3317,13 +3317,13 @@ static void virtnet_get_strings(struct net_device *dev, u32 stringset, u8 *data)
33173317
case ETH_SS_STATS:
33183318
for (i = 0; i < vi->curr_queue_pairs; i++) {
33193319
for (j = 0; j < VIRTNET_RQ_STATS_LEN; j++)
3320-
ethtool_sprintf(&p, "rx_queue_%u_%s", i,
3320+
ethtool_sprintf(&p, "rx%u_%s", i,
33213321
virtnet_rq_stats_desc[j].desc);
33223322
}
33233323

33243324
for (i = 0; i < vi->curr_queue_pairs; i++) {
33253325
for (j = 0; j < VIRTNET_SQ_STATS_LEN; j++)
3326-
ethtool_sprintf(&p, "tx_queue_%u_%s", i,
3326+
ethtool_sprintf(&p, "tx%u_%s", i,
33273327
virtnet_sq_stats_desc[j].desc);
33283328
}
33293329
break;

0 commit comments

Comments
 (0)