public inbox for newlib-cvs@sourceware.org
help / color / mirror / Atom feed
From: Sebastian Huber <sh@sourceware.org>
To: newlib-cvs@sourceware.org
Subject: [newlib-cygwin] if: Add ioctls to get RSS key and hash type/function.
Date: Fri, 24 Aug 2018 13:09:00 -0000	[thread overview]
Message-ID: <20180824130951.123297.qmail@sourceware.org> (raw)

https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=1182b9fe17c9ed6567cc0012be83cf734c1390ff

commit 1182b9fe17c9ed6567cc0012be83cf734c1390ff
Author: sephe <sephe@FreeBSD.org>
Date:   Tue Sep 5 05:28:52 2017 +0000

    if: Add ioctls to get RSS key and hash type/function.
    
    It will be needed by hn(4) to configure its RSS key and hash
    type/function in the transparent VF mode in order to match VF's
    RSS settings. The description of the transparent VF mode and
    the RSS hash value issue are here:
    https://svnweb.freebsd.org/base?view=revision&revision=322299
    https://svnweb.freebsd.org/base?view=revision&revision=322485
    
    These are generic enough to promise two independent IOCs instead
    of abusing SIOCGDRVSPEC.
    
    Setting RSS key and hash type/function is a different story,
    which probably requires more discussion.
    
    Comment about UDP_{IPV4,IPV6,IPV6_EX} were only in the patch
    in the review request; these hash types are standardized now.
    
    Reviewed by:	gallatin
    MFC after:	1 week
    Sponsored by:	Microsoft
    Differential Revision:	https://reviews.freebsd.org/D12174

Diff:
---
 newlib/libc/sys/rtems/include/net/if.h     | 36 ++++++++++++++++++++++++++++++
 newlib/libc/sys/rtems/include/sys/sockio.h |  4 ++++
 2 files changed, 40 insertions(+)

diff --git a/newlib/libc/sys/rtems/include/net/if.h b/newlib/libc/sys/rtems/include/net/if.h
index a059e3f..40f5095 100644
--- a/newlib/libc/sys/rtems/include/net/if.h
+++ b/newlib/libc/sys/rtems/include/net/if.h
@@ -526,6 +526,42 @@ struct ifi2creq {
 	uint8_t data[8];	/* read buffer */
 }; 
 
+/*
+ * RSS hash.
+ */
+
+#define	RSS_FUNC_NONE		0		/* RSS disabled */
+#define	RSS_FUNC_PRIVATE	1		/* non-standard */
+#define	RSS_FUNC_TOEPLITZ	2
+
+#define	RSS_TYPE_IPV4		0x00000001
+#define	RSS_TYPE_TCP_IPV4	0x00000002
+#define	RSS_TYPE_IPV6		0x00000004
+#define	RSS_TYPE_IPV6_EX	0x00000008
+#define	RSS_TYPE_TCP_IPV6	0x00000010
+#define	RSS_TYPE_TCP_IPV6_EX	0x00000020
+#define	RSS_TYPE_UDP_IPV4	0x00000040
+#define	RSS_TYPE_UDP_IPV6	0x00000080
+#define	RSS_TYPE_UDP_IPV6_EX	0x00000100
+
+#define	RSS_KEYLEN		128
+
+struct ifrsskey {
+	char		ifrk_name[IFNAMSIZ];	/* if name, e.g. "en0" */
+	uint8_t		ifrk_func;		/* RSS_FUNC_ */
+	uint8_t		ifrk_spare0;
+	uint16_t	ifrk_keylen;
+	uint8_t		ifrk_key[RSS_KEYLEN];
+};
+
+struct ifrsshash {
+	char		ifrh_name[IFNAMSIZ];	/* if name, e.g. "en0" */
+	uint8_t		ifrh_func;		/* RSS_FUNC_ */
+	uint8_t		ifrh_spare0;
+	uint16_t	ifrh_spare1;
+	uint32_t	ifrh_types;		/* RSS_TYPE_ */
+};
+
 #endif /* __BSD_VISIBLE */
 
 #ifdef _KERNEL
diff --git a/newlib/libc/sys/rtems/include/sys/sockio.h b/newlib/libc/sys/rtems/include/sys/sockio.h
index 0fb01ee..185e46c 100644
--- a/newlib/libc/sys/rtems/include/sys/sockio.h
+++ b/newlib/libc/sys/rtems/include/sys/sockio.h
@@ -134,4 +134,8 @@
 #define	SIOCGIFGMEMB	_IOWR('i', 138, struct ifgroupreq) /* get members */
 #define	SIOCGIFXMEDIA	_IOWR('i', 139, struct ifmediareq) /* get net xmedia */
 
+#define	SIOCGIFRSSKEY	_IOWR('i', 150, struct ifrsskey)/* get RSS key */
+#define	SIOCGIFRSSHASH	_IOWR('i', 151, struct ifrsshash)/* get the current RSS
+							type/func settings */
+
 #endif /* !_SYS_SOCKIO_H_ */


                 reply	other threads:[~2018-08-24 13:09 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20180824130951.123297.qmail@sourceware.org \
    --to=sh@sourceware.org \
    --cc=newlib-cvs@sourceware.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 read-only IMAP folder(s) and NNTP newsgroup(s).