]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
virtio_net: Split struct virtio_net_rss_config
authorAkihiko Odaki <akihiko.odaki@daynix.com>
Fri, 21 Mar 2025 06:48:32 +0000 (15:48 +0900)
committerJakub Kicinski <kuba@kernel.org>
Tue, 25 Mar 2025 16:30:21 +0000 (09:30 -0700)
struct virtio_net_rss_config was less useful in actual code because of a
flexible array placed in the middle. Add new structures that split it
into two to avoid having a flexible array in the middle.

Suggested-by: Jason Wang <jasowang@redhat.com>
Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com>
Acked-by: Jason Wang <jasowang@redhat.com>
Reviewed-by: Xuan Zhuo <xuanzhuo@linux.alibaba.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Tested-by: Lei Yang <leiyang@redhat.com>
Link: https://patch.msgid.link/20250321-virtio-v2-1-33afb8f4640b@daynix.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
include/uapi/linux/virtio_net.h

index ac9174717ef139e55d9c50ca65b61f1b5cd624f6..963540deae66ad6e250932df1e05a97e6e277d08 100644 (file)
@@ -327,6 +327,19 @@ struct virtio_net_rss_config {
        __u8 hash_key_data[/* hash_key_length */];
 };
 
+struct virtio_net_rss_config_hdr {
+       __le32 hash_types;
+       __le16 indirection_table_mask;
+       __le16 unclassified_queue;
+       __le16 indirection_table[/* 1 + indirection_table_mask */];
+};
+
+struct virtio_net_rss_config_trailer {
+       __le16 max_tx_vq;
+       __u8 hash_key_length;
+       __u8 hash_key_data[/* hash_key_length */];
+};
+
  #define VIRTIO_NET_CTRL_MQ_RSS_CONFIG          1
 
 /*