All of lore.kernel.org
 help / color / mirror / Atom feed
From: Edward Cree <ecree@solarflare.com>
To: Ben Hutchings <ben@decadent.org.uk>
Cc: <netdev@vger.kernel.org>, Alexander Duyck <alexander.duyck@gmail.com>
Subject: [RFC PATCH] ethtool: add IPv6 to the NFC API
Date: Thu, 21 Jan 2016 19:14:49 +0000	[thread overview]
Message-ID: <56A12E29.7000507@solarflare.com> (raw)
In-Reply-To: <1453317771.3734.68.camel@decadent.org.uk>

Signed-off-by: Edward Cree <ecree@solarflare.com>
---
Haven't yet tried to write the ethtool client end of this (or a driver
implementation), but does it look reasonable?

 include/uapi/linux/ethtool.h | 30 +++++++++++++++++++++++++-----
 1 file changed, 25 insertions(+), 5 deletions(-)

diff --git a/include/uapi/linux/ethtool.h b/include/uapi/linux/ethtool.h
index 57fa390..74bef53 100644
--- a/include/uapi/linux/ethtool.h
+++ b/include/uapi/linux/ethtool.h
@@ -748,6 +748,24 @@ struct ethtool_usrip4_spec {
 	__u8    proto;
 };
 
+/**
+ * struct ethtool_ip6_spec - general flow specification for IPv6
+ * @ip6src: Source host
+ * @ip6dst: Destination host
+ * @l4_4_bytes: First 4 bytes of transport (layer 4) header
+ * @spi: Security parameters index, for %AH_V6_FLOW and %ESP_V6_FLOW
+ * @tos: Type-of-service
+ * @proto: Transport protocol number, for %IP6_USER_FLOW
+ */
+struct ethtool_ip6_spec {
+	__be32	ip6src[4];
+	__be32	ip6dst[4];
+	__be32	l4_4_bytes;
+	__be32	spi;
+	__u8	tos;
+	__u8	proto;
+};
+
 union ethtool_flow_union {
 	struct ethtool_tcpip4_spec		tcp_ip4_spec;
 	struct ethtool_tcpip4_spec		udp_ip4_spec;
@@ -755,6 +773,7 @@ union ethtool_flow_union {
 	struct ethtool_ah_espip4_spec		ah_ip4_spec;
 	struct ethtool_ah_espip4_spec		esp_ip4_spec;
 	struct ethtool_usrip4_spec		usr_ip4_spec;
+	struct ethtool_ip6_spec			ip6_spec;
 	struct ethhdr				ether_spec;
 	__u8					hdata[52];
 };
@@ -1367,18 +1386,19 @@ enum ethtool_sfeatures_retval_bits {
 #define	UDP_V4_FLOW	0x02	/* hash or spec (udp_ip4_spec) */
 #define	SCTP_V4_FLOW	0x03	/* hash or spec (sctp_ip4_spec) */
 #define	AH_ESP_V4_FLOW	0x04	/* hash only */
-#define	TCP_V6_FLOW	0x05	/* hash only */
-#define	UDP_V6_FLOW	0x06	/* hash only */
-#define	SCTP_V6_FLOW	0x07	/* hash only */
+#define	TCP_V6_FLOW	0x05	/* hash or spec (ip6_spec) */
+#define	UDP_V6_FLOW	0x06	/* hash or spec (ip6_spec) */
+#define	SCTP_V6_FLOW	0x07	/* hash or spec (ip6_spec) */
 #define	AH_ESP_V6_FLOW	0x08	/* hash only */
 #define	AH_V4_FLOW	0x09	/* hash or spec (ah_ip4_spec) */
 #define	ESP_V4_FLOW	0x0a	/* hash or spec (esp_ip4_spec) */
-#define	AH_V6_FLOW	0x0b	/* hash only */
-#define	ESP_V6_FLOW	0x0c	/* hash only */
+#define	AH_V6_FLOW	0x0b	/* hash or spec (ip6_spec) */
+#define	ESP_V6_FLOW	0x0c	/* hash or spec (ip6_spec) */
 #define	IP_USER_FLOW	0x0d	/* spec only (usr_ip4_spec) */
 #define	IPV4_FLOW	0x10	/* hash only */
 #define	IPV6_FLOW	0x11	/* hash only */
 #define	ETHER_FLOW	0x12	/* spec only (ether_spec) */
+#define	IP6_USER_FLOW	0x13	/* spec only (ip6_spec) */
 /* Flag to enable additional fields in struct ethtool_rx_flow_spec */
 #define	FLOW_EXT	0x80000000
 #define	FLOW_MAC_EXT	0x40000000

  reply	other threads:[~2016-01-21 20:00 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-20 17:10 ethtool NFC/ntuple API questions Edward Cree
2016-01-20 17:53 ` Alexander Duyck
2016-01-20 18:07   ` Ben Hutchings
2016-01-20 19:12     ` Edward Cree
2016-01-20 19:22       ` Ben Hutchings
2016-01-21 19:14         ` Edward Cree [this message]
2016-01-21 22:48           ` [RFC PATCH] ethtool: add IPv6 to the NFC API Alexander Duyck
2016-01-22 17:03             ` Edward Cree
2016-01-22 18:04               ` [RFC PATCH v2] " Edward Cree
2016-01-22 18:54                 ` Alexander Duyck
2016-01-25  3:34                   ` Ben Hutchings
2016-01-25  3:20                 ` Ben Hutchings

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=56A12E29.7000507@solarflare.com \
    --to=ecree@solarflare.com \
    --cc=alexander.duyck@gmail.com \
    --cc=ben@decadent.org.uk \
    --cc=netdev@vger.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.