From: Paul Durrant <paul.durrant@citrix.com>
To: xen-devel@lists.xenproject.org
Cc: Keir Fraser <keir@xen.org>,
Ian Campbell <ian.campbell@citrix.com>, Tim Deegan <tim@xen.org>,
Ian Jackson <ian.jackson@eu.citrix.com>,
Paul Durrant <paul.durrant@citrix.com>,
Jan Beulich <jbeulich@suse.com>
Subject: [PATCH v2 4/4] public/io/netif.h: add extra info slots for passing hash values
Date: Fri, 16 Oct 2015 13:40:39 +0100 [thread overview]
Message-ID: <1444999239-24681-5-git-send-email-paul.durrant@citrix.com> (raw)
In-Reply-To: <1444999239-24681-1-git-send-email-paul.durrant@citrix.com>
To properly support NDIS RSS, the Windows frontend PV driver needs the
Toeplitz hash value calculated by the backend (otherwise it would have to
duplicate the calculation).
This patch adds documentation for "feature-hash" and a definition of a
new XEN_NETIF_EXTRA_TYPE_HASH extra info segment.
Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
Cc: Ian Campbell <ian.campbell@citrix.com>
Cc: Ian Jackson <ian.jackson@eu.citrix.com>
Cc: Jan Beulich <jbeulich@suse.com>
Cc: Keir Fraser <keir@xen.org>
Cc: Tim Deegan <tim@xen.org>
---
xen/include/public/io/netif.h | 52 ++++++++++++++++++++++++++++++++++++++-----
1 file changed, 47 insertions(+), 5 deletions(-)
diff --git a/xen/include/public/io/netif.h b/xen/include/public/io/netif.h
index d7c978e..97734b7 100644
--- a/xen/include/public/io/netif.h
+++ b/xen/include/public/io/netif.h
@@ -252,6 +252,12 @@
*/
/*
+ * "feature-hash" advertises the capability to accept extra info slots of
+ * type XEN_NETIF_EXTRA_TYPE_HASH. They will not be sent by either end
+ * unless the other end advertises this feature.
+ */
+
+/*
* This is the 'wire' format for packets:
* Request 1: netif_tx_request_t -- NETTXF_* (any flags)
* [Request 2: netif_extra_info_t] (only if request 1 has NETTXF_extra_info)
@@ -383,6 +389,18 @@
* type: Must be XEN_NETIF_EXTRA_TYPE_MCAST_{ADD,DEL}
* flags: XEN_NETIF_EXTRA_FLAG_*
* addr: address to add/remove
+ *
+ * XEN_NETIF_EXTRA_TYPE_HASH:
+ *
+ * 0 1 2 3 4 5 6 7 octet
+ * +-----+-----+-----+-----+-----+-----+-----+-----+
+ * |type |flags|htype| pad |LSB ---- value ---- MSB|
+ * +-----+-----+-----+-----+-----+-----+-----+-----+
+ *
+ * type: Must be XEN_NETIF_EXTRA_TYPE_HASH
+ * flags: XEN_NETIF_EXTRA_FLAG_*
+ * htype: XEN_NETIF_HASH_TYPE_*
+ * value: Hash value
*/
/* Protocol checksum field is blank in the packet (hardware offload)? */
@@ -412,11 +430,12 @@ struct netif_tx_request {
typedef struct netif_tx_request netif_tx_request_t;
/* Types of netif_extra_info descriptors. */
-#define XEN_NETIF_EXTRA_TYPE_NONE (0) /* Never used - invalid */
-#define XEN_NETIF_EXTRA_TYPE_GSO (1) /* u.gso */
-#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_MAX (4)
+#define XEN_NETIF_EXTRA_TYPE_NONE (0) /* Never used - invalid */
+#define XEN_NETIF_EXTRA_TYPE_GSO (1) /* u.gso */
+#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_MCAST_HASH (4) /* u.hash */
+#define XEN_NETIF_EXTRA_TYPE_MAX (5)
/* netif_extra_info_t flags. */
#define _XEN_NETIF_EXTRA_FLAG_MORE (0)
@@ -427,6 +446,13 @@ typedef struct netif_tx_request netif_tx_request_t;
#define XEN_NETIF_GSO_TYPE_TCPV4 (1)
#define XEN_NETIF_GSO_TYPE_TCPV6 (2)
+/* Hash types */
+#define XEN_NETIF_HASH_TYPE_NONE (0)
+#define XEN_NETIF_HASH_TYPE_TCPV4 (1)
+#define XEN_NETIF_HASH_TYPE_IPV4 (2)
+#define XEN_NETIF_HASH_TYPE_TCPV6 (3)
+#define XEN_NETIF_HASH_TYPE_IPV6 (4)
+
/*
* This structure needs to fit within both netif_tx_request_t and
* netif_rx_response_t for compatibility.
@@ -469,6 +495,22 @@ struct netif_extra_info {
uint8_t addr[6]; /* Address to add/remove. */
} mcast;
+ /*
+ * XEN_NETIF_EXTRA_TYPE_HASH:
+ */
+ struct {
+ /* Hash type. This indicates the sections of header over which
+ * the hash has been calculated.
+ */
+ uint8_t type; /* XEN_NETIF_HASH_TYPE_* */
+
+ /* Future expansion. */
+ uint8_t pad;
+
+ /* Hash value. */
+ uint8_t value[4];
+ } hash;
+
uint16_t pad[3];
} u;
};
--
2.1.4
prev parent reply other threads:[~2015-10-16 12:41 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-16 12:40 [PATCH v2 0/4] Updates to public/io/netif.h Paul Durrant
2015-10-16 12:40 ` [PATCH v2 1/4] public/io/netif.h: document the reality of netif_rx_request/reponse id Paul Durrant
2015-10-16 12:40 ` [PATCH v2 2/4] public/io/netif.h: add definition of gso_prefix flag Paul Durrant
2015-10-16 15:14 ` Paul Durrant
2015-10-16 12:40 ` [PATCH v2 3/4] public/io/netif.h: add documentation for hash negotiation and mapping Paul Durrant
2015-10-16 12:40 ` Paul Durrant [this message]
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=1444999239-24681-5-git-send-email-paul.durrant@citrix.com \
--to=paul.durrant@citrix.com \
--cc=ian.campbell@citrix.com \
--cc=ian.jackson@eu.citrix.com \
--cc=jbeulich@suse.com \
--cc=keir@xen.org \
--cc=tim@xen.org \
--cc=xen-devel@lists.xenproject.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).