Blame SOURCES/0014-Update-kernel-headers-and-import-virtio_net.patch

b99a4f
From e62789f726b0d7fb1f3102e7cb26f2a59fd74231 Mon Sep 17 00:00:00 2001
b99a4f
Message-Id: <e62789f726b0d7fb1f3102e7cb26f2a59fd74231.1647872200.git.aclaudi@redhat.com>
b99a4f
In-Reply-To: <b30268eda844bdebbb8e5e4f5735e3b1bb666368.1647872200.git.aclaudi@redhat.com>
b99a4f
References: <b30268eda844bdebbb8e5e4f5735e3b1bb666368.1647872200.git.aclaudi@redhat.com>
b99a4f
From: Andrea Claudi <aclaudi@redhat.com>
b99a4f
Date: Mon, 21 Mar 2022 15:01:57 +0100
b99a4f
Subject: [PATCH] Update kernel headers and import virtio_net
b99a4f
b99a4f
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2056827
b99a4f
Upstream Status: iproute2.git commit 5cb7ec0c
b99a4f
Conflicts: cherry-picked virtio_net header update, exclude unrelated bpf
b99a4f
	   and mptcp parts.
b99a4f
b99a4f
commit 5cb7ec0c8d554a7ea32c2f924d7a2fc66af4544a
b99a4f
Author: David Ahern <dsahern@kernel.org>
b99a4f
Date:   Sat Dec 18 14:00:29 2021 -0700
b99a4f
b99a4f
    Update kernel headers and import virtio_net
b99a4f
b99a4f
    Update kernel headers to commit:
b99a4f
        f85b244ee395 ("xdp: move the if dev statements to the first")
b99a4f
b99a4f
    and import virtio_net.h for vdpa.
b99a4f
b99a4f
    Signed-off-by: David Ahern <dsahern@kernel.org>
b99a4f
---
b99a4f
 include/uapi/linux/virtio_net.h | 358 ++++++++++++++++++++++++++++++++
b99a4f
 1 file changed, 358 insertions(+)
b99a4f
 create mode 100644 include/uapi/linux/virtio_net.h
b99a4f
b99a4f
diff --git a/include/uapi/linux/virtio_net.h b/include/uapi/linux/virtio_net.h
b99a4f
new file mode 100644
b99a4f
index 00000000..ab08237f
b99a4f
--- /dev/null
b99a4f
+++ b/include/uapi/linux/virtio_net.h
b99a4f
@@ -0,0 +1,358 @@
b99a4f
+#ifndef _LINUX_VIRTIO_NET_H
b99a4f
+#define _LINUX_VIRTIO_NET_H
b99a4f
+/* This header is BSD licensed so anyone can use the definitions to implement
b99a4f
+ * compatible drivers/servers.
b99a4f
+ *
b99a4f
+ * Redistribution and use in source and binary forms, with or without
b99a4f
+ * modification, are permitted provided that the following conditions
b99a4f
+ * are met:
b99a4f
+ * 1. Redistributions of source code must retain the above copyright
b99a4f
+ *    notice, this list of conditions and the following disclaimer.
b99a4f
+ * 2. Redistributions in binary form must reproduce the above copyright
b99a4f
+ *    notice, this list of conditions and the following disclaimer in the
b99a4f
+ *    documentation and/or other materials provided with the distribution.
b99a4f
+ * 3. Neither the name of IBM nor the names of its contributors
b99a4f
+ *    may be used to endorse or promote products derived from this software
b99a4f
+ *    without specific prior written permission.
b99a4f
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' AND
b99a4f
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
b99a4f
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
b99a4f
+ * ARE DISCLAIMED.  IN NO EVENT SHALL IBM OR CONTRIBUTORS BE LIABLE
b99a4f
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
b99a4f
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
b99a4f
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
b99a4f
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
b99a4f
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
b99a4f
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
b99a4f
+ * SUCH DAMAGE. */
b99a4f
+#include <linux/types.h>
b99a4f
+#include <linux/virtio_ids.h>
b99a4f
+#include <linux/virtio_config.h>
b99a4f
+#include <linux/virtio_types.h>
b99a4f
+#include <linux/if_ether.h>
b99a4f
+
b99a4f
+/* The feature bitmap for virtio net */
b99a4f
+#define VIRTIO_NET_F_CSUM	0	/* Host handles pkts w/ partial csum */
b99a4f
+#define VIRTIO_NET_F_GUEST_CSUM	1	/* Guest handles pkts w/ partial csum */
b99a4f
+#define VIRTIO_NET_F_CTRL_GUEST_OFFLOADS 2 /* Dynamic offload configuration. */
b99a4f
+#define VIRTIO_NET_F_MTU	3	/* Initial MTU advice */
b99a4f
+#define VIRTIO_NET_F_MAC	5	/* Host has given MAC address. */
b99a4f
+#define VIRTIO_NET_F_GUEST_TSO4	7	/* Guest can handle TSOv4 in. */
b99a4f
+#define VIRTIO_NET_F_GUEST_TSO6	8	/* Guest can handle TSOv6 in. */
b99a4f
+#define VIRTIO_NET_F_GUEST_ECN	9	/* Guest can handle TSO[6] w/ ECN in. */
b99a4f
+#define VIRTIO_NET_F_GUEST_UFO	10	/* Guest can handle UFO in. */
b99a4f
+#define VIRTIO_NET_F_HOST_TSO4	11	/* Host can handle TSOv4 in. */
b99a4f
+#define VIRTIO_NET_F_HOST_TSO6	12	/* Host can handle TSOv6 in. */
b99a4f
+#define VIRTIO_NET_F_HOST_ECN	13	/* Host can handle TSO[6] w/ ECN in. */
b99a4f
+#define VIRTIO_NET_F_HOST_UFO	14	/* Host can handle UFO in. */
b99a4f
+#define VIRTIO_NET_F_MRG_RXBUF	15	/* Host can merge receive buffers. */
b99a4f
+#define VIRTIO_NET_F_STATUS	16	/* virtio_net_config.status available */
b99a4f
+#define VIRTIO_NET_F_CTRL_VQ	17	/* Control channel available */
b99a4f
+#define VIRTIO_NET_F_CTRL_RX	18	/* Control channel RX mode support */
b99a4f
+#define VIRTIO_NET_F_CTRL_VLAN	19	/* Control channel VLAN filtering */
b99a4f
+#define VIRTIO_NET_F_CTRL_RX_EXTRA 20	/* Extra RX mode control support */
b99a4f
+#define VIRTIO_NET_F_GUEST_ANNOUNCE 21	/* Guest can announce device on the
b99a4f
+					 * network */
b99a4f
+#define VIRTIO_NET_F_MQ	22	/* Device supports Receive Flow
b99a4f
+					 * Steering */
b99a4f
+#define VIRTIO_NET_F_CTRL_MAC_ADDR 23	/* Set MAC address */
b99a4f
+
b99a4f
+#define VIRTIO_NET_F_HASH_REPORT  57	/* Supports hash report */
b99a4f
+#define VIRTIO_NET_F_RSS	  60	/* Supports RSS RX steering */
b99a4f
+#define VIRTIO_NET_F_RSC_EXT	  61	/* extended coalescing info */
b99a4f
+#define VIRTIO_NET_F_STANDBY	  62	/* Act as standby for another device
b99a4f
+					 * with the same MAC.
b99a4f
+					 */
b99a4f
+#define VIRTIO_NET_F_SPEED_DUPLEX 63	/* Device set linkspeed and duplex */
b99a4f
+
b99a4f
+#ifndef VIRTIO_NET_NO_LEGACY
b99a4f
+#define VIRTIO_NET_F_GSO	6	/* Host handles pkts w/ any GSO type */
b99a4f
+#endif /* VIRTIO_NET_NO_LEGACY */
b99a4f
+
b99a4f
+#define VIRTIO_NET_S_LINK_UP	1	/* Link is up */
b99a4f
+#define VIRTIO_NET_S_ANNOUNCE	2	/* Announcement is needed */
b99a4f
+
b99a4f
+/* supported/enabled hash types */
b99a4f
+#define VIRTIO_NET_RSS_HASH_TYPE_IPv4          (1 << 0)
b99a4f
+#define VIRTIO_NET_RSS_HASH_TYPE_TCPv4         (1 << 1)
b99a4f
+#define VIRTIO_NET_RSS_HASH_TYPE_UDPv4         (1 << 2)
b99a4f
+#define VIRTIO_NET_RSS_HASH_TYPE_IPv6          (1 << 3)
b99a4f
+#define VIRTIO_NET_RSS_HASH_TYPE_TCPv6         (1 << 4)
b99a4f
+#define VIRTIO_NET_RSS_HASH_TYPE_UDPv6         (1 << 5)
b99a4f
+#define VIRTIO_NET_RSS_HASH_TYPE_IP_EX         (1 << 6)
b99a4f
+#define VIRTIO_NET_RSS_HASH_TYPE_TCP_EX        (1 << 7)
b99a4f
+#define VIRTIO_NET_RSS_HASH_TYPE_UDP_EX        (1 << 8)
b99a4f
+
b99a4f
+struct virtio_net_config {
b99a4f
+	/* The config defining mac address (if VIRTIO_NET_F_MAC) */
b99a4f
+	__u8 mac[ETH_ALEN];
b99a4f
+	/* See VIRTIO_NET_F_STATUS and VIRTIO_NET_S_* above */
b99a4f
+	__virtio16 status;
b99a4f
+	/* Maximum number of each of transmit and receive queues;
b99a4f
+	 * see VIRTIO_NET_F_MQ and VIRTIO_NET_CTRL_MQ.
b99a4f
+	 * Legal values are between 1 and 0x8000
b99a4f
+	 */
b99a4f
+	__virtio16 max_virtqueue_pairs;
b99a4f
+	/* Default maximum transmit unit advice */
b99a4f
+	__virtio16 mtu;
b99a4f
+	/*
b99a4f
+	 * speed, in units of 1Mb. All values 0 to INT_MAX are legal.
b99a4f
+	 * Any other value stands for unknown.
b99a4f
+	 */
b99a4f
+	__le32 speed;
b99a4f
+	/*
b99a4f
+	 * 0x00 - half duplex
b99a4f
+	 * 0x01 - full duplex
b99a4f
+	 * Any other value stands for unknown.
b99a4f
+	 */
b99a4f
+	__u8 duplex;
b99a4f
+	/* maximum size of RSS key */
b99a4f
+	__u8 rss_max_key_size;
b99a4f
+	/* maximum number of indirection table entries */
b99a4f
+	__le16 rss_max_indirection_table_length;
b99a4f
+	/* bitmask of supported VIRTIO_NET_RSS_HASH_ types */
b99a4f
+	__le32 supported_hash_types;
b99a4f
+} __attribute__((packed));
b99a4f
+
b99a4f
+/*
b99a4f
+ * This header comes first in the scatter-gather list.  If you don't
b99a4f
+ * specify GSO or CSUM features, you can simply ignore the header.
b99a4f
+ *
b99a4f
+ * This is bitwise-equivalent to the legacy struct virtio_net_hdr_mrg_rxbuf,
b99a4f
+ * only flattened.
b99a4f
+ */
b99a4f
+struct virtio_net_hdr_v1 {
b99a4f
+#define VIRTIO_NET_HDR_F_NEEDS_CSUM	1	/* Use csum_start, csum_offset */
b99a4f
+#define VIRTIO_NET_HDR_F_DATA_VALID	2	/* Csum is valid */
b99a4f
+#define VIRTIO_NET_HDR_F_RSC_INFO	4	/* rsc info in csum_ fields */
b99a4f
+	__u8 flags;
b99a4f
+#define VIRTIO_NET_HDR_GSO_NONE		0	/* Not a GSO frame */
b99a4f
+#define VIRTIO_NET_HDR_GSO_TCPV4	1	/* GSO frame, IPv4 TCP (TSO) */
b99a4f
+#define VIRTIO_NET_HDR_GSO_UDP		3	/* GSO frame, IPv4 UDP (UFO) */
b99a4f
+#define VIRTIO_NET_HDR_GSO_TCPV6	4	/* GSO frame, IPv6 TCP */
b99a4f
+#define VIRTIO_NET_HDR_GSO_ECN		0x80	/* TCP has ECN set */
b99a4f
+	__u8 gso_type;
b99a4f
+	__virtio16 hdr_len;	/* Ethernet + IP + tcp/udp hdrs */
b99a4f
+	__virtio16 gso_size;	/* Bytes to append to hdr_len per frame */
b99a4f
+	union {
b99a4f
+		struct {
b99a4f
+			__virtio16 csum_start;
b99a4f
+			__virtio16 csum_offset;
b99a4f
+		};
b99a4f
+		/* Checksum calculation */
b99a4f
+		struct {
b99a4f
+			/* Position to start checksumming from */
b99a4f
+			__virtio16 start;
b99a4f
+			/* Offset after that to place checksum */
b99a4f
+			__virtio16 offset;
b99a4f
+		} csum;
b99a4f
+		/* Receive Segment Coalescing */
b99a4f
+		struct {
b99a4f
+			/* Number of coalesced segments */
b99a4f
+			__le16 segments;
b99a4f
+			/* Number of duplicated acks */
b99a4f
+			__le16 dup_acks;
b99a4f
+		} rsc;
b99a4f
+	};
b99a4f
+	__virtio16 num_buffers;	/* Number of merged rx buffers */
b99a4f
+};
b99a4f
+
b99a4f
+struct virtio_net_hdr_v1_hash {
b99a4f
+	struct virtio_net_hdr_v1 hdr;
b99a4f
+	__le32 hash_value;
b99a4f
+#define VIRTIO_NET_HASH_REPORT_NONE            0
b99a4f
+#define VIRTIO_NET_HASH_REPORT_IPv4            1
b99a4f
+#define VIRTIO_NET_HASH_REPORT_TCPv4           2
b99a4f
+#define VIRTIO_NET_HASH_REPORT_UDPv4           3
b99a4f
+#define VIRTIO_NET_HASH_REPORT_IPv6            4
b99a4f
+#define VIRTIO_NET_HASH_REPORT_TCPv6           5
b99a4f
+#define VIRTIO_NET_HASH_REPORT_UDPv6           6
b99a4f
+#define VIRTIO_NET_HASH_REPORT_IPv6_EX         7
b99a4f
+#define VIRTIO_NET_HASH_REPORT_TCPv6_EX        8
b99a4f
+#define VIRTIO_NET_HASH_REPORT_UDPv6_EX        9
b99a4f
+	__le16 hash_report;
b99a4f
+	__le16 padding;
b99a4f
+};
b99a4f
+
b99a4f
+#ifndef VIRTIO_NET_NO_LEGACY
b99a4f
+/* This header comes first in the scatter-gather list.
b99a4f
+ * For legacy virtio, if VIRTIO_F_ANY_LAYOUT is not negotiated, it must
b99a4f
+ * be the first element of the scatter-gather list.  If you don't
b99a4f
+ * specify GSO or CSUM features, you can simply ignore the header. */
b99a4f
+struct virtio_net_hdr {
b99a4f
+	/* See VIRTIO_NET_HDR_F_* */
b99a4f
+	__u8 flags;
b99a4f
+	/* See VIRTIO_NET_HDR_GSO_* */
b99a4f
+	__u8 gso_type;
b99a4f
+	__virtio16 hdr_len;		/* Ethernet + IP + tcp/udp hdrs */
b99a4f
+	__virtio16 gso_size;		/* Bytes to append to hdr_len per frame */
b99a4f
+	__virtio16 csum_start;	/* Position to start checksumming from */
b99a4f
+	__virtio16 csum_offset;	/* Offset after that to place checksum */
b99a4f
+};
b99a4f
+
b99a4f
+/* This is the version of the header to use when the MRG_RXBUF
b99a4f
+ * feature has been negotiated. */
b99a4f
+struct virtio_net_hdr_mrg_rxbuf {
b99a4f
+	struct virtio_net_hdr hdr;
b99a4f
+	__virtio16 num_buffers;	/* Number of merged rx buffers */
b99a4f
+};
b99a4f
+#endif /* ...VIRTIO_NET_NO_LEGACY */
b99a4f
+
b99a4f
+/*
b99a4f
+ * Control virtqueue data structures
b99a4f
+ *
b99a4f
+ * The control virtqueue expects a header in the first sg entry
b99a4f
+ * and an ack/status response in the last entry.  Data for the
b99a4f
+ * command goes in between.
b99a4f
+ */
b99a4f
+struct virtio_net_ctrl_hdr {
b99a4f
+	__u8 class;
b99a4f
+	__u8 cmd;
b99a4f
+} __attribute__((packed));
b99a4f
+
b99a4f
+typedef __u8 virtio_net_ctrl_ack;
b99a4f
+
b99a4f
+#define VIRTIO_NET_OK     0
b99a4f
+#define VIRTIO_NET_ERR    1
b99a4f
+
b99a4f
+/*
b99a4f
+ * Control the RX mode, ie. promisucous, allmulti, etc...
b99a4f
+ * All commands require an "out" sg entry containing a 1 byte
b99a4f
+ * state value, zero = disable, non-zero = enable.  Commands
b99a4f
+ * 0 and 1 are supported with the VIRTIO_NET_F_CTRL_RX feature.
b99a4f
+ * Commands 2-5 are added with VIRTIO_NET_F_CTRL_RX_EXTRA.
b99a4f
+ */
b99a4f
+#define VIRTIO_NET_CTRL_RX    0
b99a4f
+ #define VIRTIO_NET_CTRL_RX_PROMISC      0
b99a4f
+ #define VIRTIO_NET_CTRL_RX_ALLMULTI     1
b99a4f
+ #define VIRTIO_NET_CTRL_RX_ALLUNI       2
b99a4f
+ #define VIRTIO_NET_CTRL_RX_NOMULTI      3
b99a4f
+ #define VIRTIO_NET_CTRL_RX_NOUNI        4
b99a4f
+ #define VIRTIO_NET_CTRL_RX_NOBCAST      5
b99a4f
+
b99a4f
+/*
b99a4f
+ * Control the MAC
b99a4f
+ *
b99a4f
+ * The MAC filter table is managed by the hypervisor, the guest should
b99a4f
+ * assume the size is infinite.  Filtering should be considered
b99a4f
+ * non-perfect, ie. based on hypervisor resources, the guest may
b99a4f
+ * received packets from sources not specified in the filter list.
b99a4f
+ *
b99a4f
+ * In addition to the class/cmd header, the TABLE_SET command requires
b99a4f
+ * two out scatterlists.  Each contains a 4 byte count of entries followed
b99a4f
+ * by a concatenated byte stream of the ETH_ALEN MAC addresses.  The
b99a4f
+ * first sg list contains unicast addresses, the second is for multicast.
b99a4f
+ * This functionality is present if the VIRTIO_NET_F_CTRL_RX feature
b99a4f
+ * is available.
b99a4f
+ *
b99a4f
+ * The ADDR_SET command requests one out scatterlist, it contains a
b99a4f
+ * 6 bytes MAC address. This functionality is present if the
b99a4f
+ * VIRTIO_NET_F_CTRL_MAC_ADDR feature is available.
b99a4f
+ */
b99a4f
+struct virtio_net_ctrl_mac {
b99a4f
+	__virtio32 entries;
b99a4f
+	__u8 macs[][ETH_ALEN];
b99a4f
+} __attribute__((packed));
b99a4f
+
b99a4f
+#define VIRTIO_NET_CTRL_MAC    1
b99a4f
+ #define VIRTIO_NET_CTRL_MAC_TABLE_SET        0
b99a4f
+ #define VIRTIO_NET_CTRL_MAC_ADDR_SET         1
b99a4f
+
b99a4f
+/*
b99a4f
+ * Control VLAN filtering
b99a4f
+ *
b99a4f
+ * The VLAN filter table is controlled via a simple ADD/DEL interface.
b99a4f
+ * VLAN IDs not added may be filterd by the hypervisor.  Del is the
b99a4f
+ * opposite of add.  Both commands expect an out entry containing a 2
b99a4f
+ * byte VLAN ID.  VLAN filterting is available with the
b99a4f
+ * VIRTIO_NET_F_CTRL_VLAN feature bit.
b99a4f
+ */
b99a4f
+#define VIRTIO_NET_CTRL_VLAN       2
b99a4f
+ #define VIRTIO_NET_CTRL_VLAN_ADD             0
b99a4f
+ #define VIRTIO_NET_CTRL_VLAN_DEL             1
b99a4f
+
b99a4f
+/*
b99a4f
+ * Control link announce acknowledgement
b99a4f
+ *
b99a4f
+ * The command VIRTIO_NET_CTRL_ANNOUNCE_ACK is used to indicate that
b99a4f
+ * driver has recevied the notification; device would clear the
b99a4f
+ * VIRTIO_NET_S_ANNOUNCE bit in the status field after it receives
b99a4f
+ * this command.
b99a4f
+ */
b99a4f
+#define VIRTIO_NET_CTRL_ANNOUNCE       3
b99a4f
+ #define VIRTIO_NET_CTRL_ANNOUNCE_ACK         0
b99a4f
+
b99a4f
+/*
b99a4f
+ * Control Receive Flow Steering
b99a4f
+ */
b99a4f
+#define VIRTIO_NET_CTRL_MQ   4
b99a4f
+/*
b99a4f
+ * The command VIRTIO_NET_CTRL_MQ_VQ_PAIRS_SET
b99a4f
+ * enables Receive Flow Steering, specifying the number of the transmit and
b99a4f
+ * receive queues that will be used. After the command is consumed and acked by
b99a4f
+ * the device, the device will not steer new packets on receive virtqueues
b99a4f
+ * other than specified nor read from transmit virtqueues other than specified.
b99a4f
+ * Accordingly, driver should not transmit new packets  on virtqueues other than
b99a4f
+ * specified.
b99a4f
+ */
b99a4f
+struct virtio_net_ctrl_mq {
b99a4f
+	__virtio16 virtqueue_pairs;
b99a4f
+};
b99a4f
+
b99a4f
+ #define VIRTIO_NET_CTRL_MQ_VQ_PAIRS_SET        0
b99a4f
+ #define VIRTIO_NET_CTRL_MQ_VQ_PAIRS_MIN        1
b99a4f
+ #define VIRTIO_NET_CTRL_MQ_VQ_PAIRS_MAX        0x8000
b99a4f
+
b99a4f
+/*
b99a4f
+ * The command VIRTIO_NET_CTRL_MQ_RSS_CONFIG has the same effect as
b99a4f
+ * VIRTIO_NET_CTRL_MQ_VQ_PAIRS_SET does and additionally configures
b99a4f
+ * the receive steering to use a hash calculated for incoming packet
b99a4f
+ * to decide on receive virtqueue to place the packet. The command
b99a4f
+ * also provides parameters to calculate a hash and receive virtqueue.
b99a4f
+ */
b99a4f
+struct virtio_net_rss_config {
b99a4f
+	__le32 hash_types;
b99a4f
+	__le16 indirection_table_mask;
b99a4f
+	__le16 unclassified_queue;
b99a4f
+	__le16 indirection_table[1/* + indirection_table_mask */];
b99a4f
+	__le16 max_tx_vq;
b99a4f
+	__u8 hash_key_length;
b99a4f
+	__u8 hash_key_data[/* hash_key_length */];
b99a4f
+};
b99a4f
+
b99a4f
+ #define VIRTIO_NET_CTRL_MQ_RSS_CONFIG          1
b99a4f
+
b99a4f
+/*
b99a4f
+ * The command VIRTIO_NET_CTRL_MQ_HASH_CONFIG requests the device
b99a4f
+ * to include in the virtio header of the packet the value of the
b99a4f
+ * calculated hash and the report type of hash. It also provides
b99a4f
+ * parameters for hash calculation. The command requires feature
b99a4f
+ * VIRTIO_NET_F_HASH_REPORT to be negotiated to extend the
b99a4f
+ * layout of virtio header as defined in virtio_net_hdr_v1_hash.
b99a4f
+ */
b99a4f
+struct virtio_net_hash_config {
b99a4f
+	__le32 hash_types;
b99a4f
+	/* for compatibility with virtio_net_rss_config */
b99a4f
+	__le16 reserved[4];
b99a4f
+	__u8 hash_key_length;
b99a4f
+	__u8 hash_key_data[/* hash_key_length */];
b99a4f
+};
b99a4f
+
b99a4f
+ #define VIRTIO_NET_CTRL_MQ_HASH_CONFIG         2
b99a4f
+
b99a4f
+/*
b99a4f
+ * Control network offloads
b99a4f
+ *
b99a4f
+ * Reconfigures the network offloads that Guest can handle.
b99a4f
+ *
b99a4f
+ * Available with the VIRTIO_NET_F_CTRL_GUEST_OFFLOADS feature bit.
b99a4f
+ *
b99a4f
+ * Command data format matches the feature bit mask exactly.
b99a4f
+ *
b99a4f
+ * See VIRTIO_NET_F_GUEST_* for the list of offloads
b99a4f
+ * that can be enabled/disabled.
b99a4f
+ */
b99a4f
+#define VIRTIO_NET_CTRL_GUEST_OFFLOADS   5
b99a4f
+#define VIRTIO_NET_CTRL_GUEST_OFFLOADS_SET        0
b99a4f
+
b99a4f
+#endif /* _LINUX_VIRTIO_NET_H */
b99a4f
-- 
b99a4f
2.35.1
b99a4f