Skip to content

Commit 2cef30d

Browse files
Denis Kirjanovdavem330
Denis Kirjanov
authored andcommitted
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 <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 6d79dc6 commit 2cef30d

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

include/xen/interface/io/netif.h

+19-1
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,19 @@
160160
* be applied if it is set.
161161
*/
162162

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+
163176
/*
164177
* Control ring
165178
* ============
@@ -846,7 +859,8 @@ struct xen_netif_tx_request {
846859
#define XEN_NETIF_EXTRA_TYPE_MCAST_ADD (2) /* u.mcast */
847860
#define XEN_NETIF_EXTRA_TYPE_MCAST_DEL (3) /* u.mcast */
848861
#define XEN_NETIF_EXTRA_TYPE_HASH (4) /* u.hash */
849-
#define XEN_NETIF_EXTRA_TYPE_MAX (5)
862+
#define XEN_NETIF_EXTRA_TYPE_XDP (5) /* u.xdp */
863+
#define XEN_NETIF_EXTRA_TYPE_MAX (6)
850864

851865
/* xen_netif_extra_info_t flags. */
852866
#define _XEN_NETIF_EXTRA_FLAG_MORE (0)
@@ -879,6 +893,10 @@ struct xen_netif_extra_info {
879893
uint8_t algorithm;
880894
uint8_t value[4];
881895
} hash;
896+
struct {
897+
uint16_t headroom;
898+
uint16_t pad[2];
899+
} xdp;
882900
uint16_t pad[3];
883901
} u;
884902
};

0 commit comments

Comments
 (0)