summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael S. Tsirkin <mst@redhat.com>2025-12-29 18:58:05 -0500
committerMichael S. Tsirkin <mst@redhat.com>2026-01-28 15:32:08 -0500
commitf9108dee782fe45318a2c9f007fb72ab370d476d (patch)
tree0090e51cb9daf6e3e51d5f05c1f5aa5bccaabcf8
parentd08fda2cf2e68b4e0865f1bf0b49010db74da079 (diff)
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>
-rw-r--r--net/vmw_vsock/virtio_transport.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/net/vmw_vsock/virtio_transport.c b/net/vmw_vsock/virtio_transport.c
index 999a0839726a..b333a7591b26 100644
--- a/net/vmw_vsock/virtio_transport.c
+++ b/net/vmw_vsock/virtio_transport.c
@@ -55,15 +55,6 @@ struct virtio_vsock {
int rx_buf_nr;
int rx_buf_max_nr;
- /* The following fields are protected by event_lock.
- * vqs[VSOCK_VQ_EVENT] must be accessed with event_lock held.
- */
- struct mutex event_lock;
- bool event_run;
- __dma_from_device_group_begin();
- struct virtio_vsock_event event_list[8];
- __dma_from_device_group_end();
-
u32 guest_cid;
bool seqpacket_allow;
@@ -77,6 +68,15 @@ struct virtio_vsock {
*/
struct scatterlist *out_sgs[MAX_SKB_FRAGS + 1];
struct scatterlist out_bufs[MAX_SKB_FRAGS + 1];
+
+ /* The following fields are protected by event_lock.
+ * vqs[VSOCK_VQ_EVENT] must be accessed with event_lock held.
+ */
+ struct mutex event_lock;
+ bool event_run;
+ __dma_from_device_group_begin();
+ struct virtio_vsock_event event_list[8];
+ __dma_from_device_group_end();
};
static u32 virtio_transport_get_local_cid(void)