Commit d0671115 authored by Parav Pandit's avatar Parav Pandit Committed by David S. Miller

virtio-net: Reduce debug name field size to 16 bytes

virtio queue index can be maximum of 65535. 16 bytes are enough to store
the vq name with the existing string prefix.

With this change, send queue struct saves 24 bytes and receive
queue saves whole cache line worth 64 bytes per structure
due to saving in alignment bytes.

Pahole results before:

pahole -s drivers/net/virtio_net.o | \
    grep -e "send_queue" -e "receive_queue"
send_queue      1112    0
receive_queue   1280    1

Pahole results after:
pahole -s drivers/net/virtio_net.o | \
    grep -e "send_queue" -e "receive_queue"
send_queue      1088    0
receive_queue   1216    1
Signed-off-by: default avatarParav Pandit <parav@nvidia.com>
Reviewed-by: default avatarPavan Chebbi <pavan.chebbi@broadcom.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 4373a023
...@@ -134,7 +134,7 @@ struct send_queue { ...@@ -134,7 +134,7 @@ struct send_queue {
struct scatterlist sg[MAX_SKB_FRAGS + 2]; struct scatterlist sg[MAX_SKB_FRAGS + 2];
/* Name of the send queue: output.$index */ /* Name of the send queue: output.$index */
char name[40]; char name[16];
struct virtnet_sq_stats stats; struct virtnet_sq_stats stats;
...@@ -171,7 +171,7 @@ struct receive_queue { ...@@ -171,7 +171,7 @@ struct receive_queue {
unsigned int min_buf_len; unsigned int min_buf_len;
/* Name of this receive queue: input.$index */ /* Name of this receive queue: input.$index */
char name[40]; char name[16];
struct xdp_rxq_info xdp_rxq; struct xdp_rxq_info xdp_rxq;
}; };
......
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