net/virtio: pack virtio HW struct
authorMaxime Coquelin <maxime.coquelin@redhat.com>
Tue, 26 Jan 2021 10:16:11 +0000 (11:16 +0100)
committerFerruh Yigit <ferruh.yigit@intel.com>
Fri, 29 Jan 2021 17:16:09 +0000 (18:16 +0100)
commit6e1d9c0c17831cc7eed882d5dde019f53cf9e780
tree96a3f29c082d6d9e618db724ae166ca2b3a6202f
parent266ece29c12c65381edea9bbdc10f18248fb6aac
net/virtio: pack virtio HW struct

This patch improves the virtio_hw struct packing,
going from 88 down to 80 bytes with a 6 bytes hole in
the end of the first cacheline. Fields only used in the
slow path are placed in the end, so that hot path only
uses the first cacheline.

The patch also changes booleans fields to uint8_t type, and
fix inconsistencies in their assignments.

Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
drivers/net/virtio/virtio_ethdev.c
drivers/net/virtio/virtio_pci.h
drivers/net/virtio/virtqueue.h