From: Denis Kirjanov <kda@linux-powerpc.org>
To: netdev@vger.kernel.org
Cc: brouer@redhat.com, jgross@suse.com, wei.liu@kernel.org,
paul@xen.org, ilias.apalodimas@linaro.org
Subject: [PATCH net-next v12 1/3] xen: netif.h: add a new extra type for XDP
Date: Fri, 26 Jun 2020 14:27:04 +0300 [thread overview]
Message-ID: <1593170826-1600-2-git-send-email-kda@linux-powerpc.org> (raw)
In-Reply-To: <1593170826-1600-1-git-send-email-kda@linux-powerpc.org>
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>
---
include/xen/interface/io/netif.h | 20 +++++++++++++++++++-
1 file changed, 19 insertions(+), 1 deletion(-)
diff --git a/include/xen/interface/io/netif.h b/include/xen/interface/io/netif.h
index 4f20dbc..2194322 100644
--- a/include/xen/interface/io/netif.h
+++ b/include/xen/interface/io/netif.h
@@ -161,6 +161,19 @@
*/
/*
+ * "xdp-headroom" is used to request that extra space is added
+ * for XDP processing. The value is measured in bytes and passed by
+ * the frontend to be consistent between both ends.
+ * If the value is greater than zero that means that
+ * an RX response is going to be passed to an XDP program for processing.
+ * XEN_NETIF_MAX_XDP_HEADROOM defines the maximum headroom offset in bytes
+ *
+ * "feature-xdp-headroom" is set to "1" by the netback side like other features
+ * so a guest can check if an XDP program can be processed.
+ */
+#define XEN_NETIF_MAX_XDP_HEADROOM 0x7FFF
+
+/*
* Control ring
* ============
*
@@ -846,7 +859,8 @@ struct xen_netif_tx_request {
#define XEN_NETIF_EXTRA_TYPE_MCAST_ADD (2) /* u.mcast */
#define XEN_NETIF_EXTRA_TYPE_MCAST_DEL (3) /* u.mcast */
#define XEN_NETIF_EXTRA_TYPE_HASH (4) /* u.hash */
-#define XEN_NETIF_EXTRA_TYPE_MAX (5)
+#define XEN_NETIF_EXTRA_TYPE_XDP (5) /* u.xdp */
+#define XEN_NETIF_EXTRA_TYPE_MAX (6)
/* xen_netif_extra_info_t flags. */
#define _XEN_NETIF_EXTRA_FLAG_MORE (0)
@@ -879,6 +893,10 @@ struct xen_netif_extra_info {
uint8_t algorithm;
uint8_t value[4];
} hash;
+ struct {
+ uint16_t headroom;
+ uint16_t pad[2];
+ } xdp;
uint16_t pad[3];
} u;
};
--
1.8.3.1
next prev parent reply other threads:[~2020-06-26 11:27 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-26 11:27 [PATCH net-next v12 0/3] xen networking: add XDP support to xen-netfront Denis Kirjanov
2020-06-26 11:27 ` Denis Kirjanov [this message]
2020-06-26 11:27 ` [PATCH net-next v12 2/3] xen networking: add basic XDP support for xen-netfront Denis Kirjanov
2020-06-26 11:27 ` [PATCH net-next v12 3/3] xen networking: add XDP offset adjustment to xen-netback Denis Kirjanov
2020-06-26 11:28 ` Denis Kirjanov
2020-06-26 11:29 ` Paul Durrant
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1593170826-1600-2-git-send-email-kda@linux-powerpc.org \
--to=kda@linux-powerpc.org \
--cc=brouer@redhat.com \
--cc=ilias.apalodimas@linaro.org \
--cc=jgross@suse.com \
--cc=netdev@vger.kernel.org \
--cc=paul@xen.org \
--cc=wei.liu@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).