Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

xen: netif.h: add a new extra type for XDP

The patch adds a new extra type to be able to diffirentiate
between RX responses on xen-netfront side with the adjusted offset
required for XDP processing.

The offset value from a guest is passed via xenstore.

Signed-off-by: Denis Kirjanov <kda@linux-powerpc.org>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Denis Kirjanov and committed by
David S. Miller
2cef30d7 6d79dc67

+19 -1
+19 -1
include/xen/interface/io/netif.h
··· 161 161 */ 162 162 163 163 /* 164 + * "xdp-headroom" is used to request that extra space is added 165 + * for XDP processing. The value is measured in bytes and passed by 166 + * the frontend to be consistent between both ends. 167 + * If the value is greater than zero that means that 168 + * an RX response is going to be passed to an XDP program for processing. 169 + * XEN_NETIF_MAX_XDP_HEADROOM defines the maximum headroom offset in bytes 170 + * 171 + * "feature-xdp-headroom" is set to "1" by the netback side like other features 172 + * so a guest can check if an XDP program can be processed. 173 + */ 174 + #define XEN_NETIF_MAX_XDP_HEADROOM 0x7FFF 175 + 176 + /* 164 177 * Control ring 165 178 * ============ 166 179 * ··· 859 846 #define XEN_NETIF_EXTRA_TYPE_MCAST_ADD (2) /* u.mcast */ 860 847 #define XEN_NETIF_EXTRA_TYPE_MCAST_DEL (3) /* u.mcast */ 861 848 #define XEN_NETIF_EXTRA_TYPE_HASH (4) /* u.hash */ 862 - #define XEN_NETIF_EXTRA_TYPE_MAX (5) 849 + #define XEN_NETIF_EXTRA_TYPE_XDP (5) /* u.xdp */ 850 + #define XEN_NETIF_EXTRA_TYPE_MAX (6) 863 851 864 852 /* xen_netif_extra_info_t flags. */ 865 853 #define _XEN_NETIF_EXTRA_FLAG_MORE (0) ··· 893 879 uint8_t algorithm; 894 880 uint8_t value[4]; 895 881 } hash; 882 + struct { 883 + uint16_t headroom; 884 + uint16_t pad[2]; 885 + } xdp; 896 886 uint16_t pad[3]; 897 887 } u; 898 888 };