Skip to content

Commit f9108de

Browse files
committed
vsock/virtio: reorder fields to reduce padding
Reorder struct virtio_vsock fields to place the DMA buffer (event_list) last. This eliminates the padding from aligning the struct size on ARCH_DMA_MINALIGN. Message-ID: <ce44f61af415521e00ab7492aa16d3d19f00bd5e.1769632071.git.mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
1 parent d08fda2 commit f9108de

1 file changed

Lines changed: 9 additions & 9 deletions

File tree

net/vmw_vsock/virtio_transport.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -55,15 +55,6 @@ struct virtio_vsock {
5555
int rx_buf_nr;
5656
int rx_buf_max_nr;
5757

58-
/* The following fields are protected by event_lock.
59-
* vqs[VSOCK_VQ_EVENT] must be accessed with event_lock held.
60-
*/
61-
struct mutex event_lock;
62-
bool event_run;
63-
__dma_from_device_group_begin();
64-
struct virtio_vsock_event event_list[8];
65-
__dma_from_device_group_end();
66-
6758
u32 guest_cid;
6859
bool seqpacket_allow;
6960

@@ -77,6 +68,15 @@ struct virtio_vsock {
7768
*/
7869
struct scatterlist *out_sgs[MAX_SKB_FRAGS + 1];
7970
struct scatterlist out_bufs[MAX_SKB_FRAGS + 1];
71+
72+
/* The following fields are protected by event_lock.
73+
* vqs[VSOCK_VQ_EVENT] must be accessed with event_lock held.
74+
*/
75+
struct mutex event_lock;
76+
bool event_run;
77+
__dma_from_device_group_begin();
78+
struct virtio_vsock_event event_list[8];
79+
__dma_from_device_group_end();
8080
};
8181

8282
static u32 virtio_transport_get_local_cid(void)

0 commit comments

Comments
 (0)