Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/pci/ixgbe Apply RSS utility to ixg(4) and ixv(4).
details: https://anonhg.NetBSD.org/src/rev/436303b7c861
branches: trunk
changeset: 359571:436303b7c861
user: knakahara <knakahara%NetBSD.org@localhost>
date: Fri Feb 16 04:50:19 2018 +0000
description:
Apply RSS utility to ixg(4) and ixv(4).
ok by msaitoh@n.o.
diffstat:
sys/dev/pci/ixgbe/ixgbe.c | 7 ++++++-
sys/dev/pci/ixgbe/ixgbe_rss.h | 21 +++++++++++++++++++++
sys/dev/pci/ixgbe/ixv.c | 7 ++++++-
3 files changed, 33 insertions(+), 2 deletions(-)
diffs (92 lines):
diff -r 6a1253145d7f -r 436303b7c861 sys/dev/pci/ixgbe/ixgbe.c
--- a/sys/dev/pci/ixgbe/ixgbe.c Fri Feb 16 04:49:27 2018 +0000
+++ b/sys/dev/pci/ixgbe/ixgbe.c Fri Feb 16 04:50:19 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ixgbe.c,v 1.121 2018/02/14 10:38:28 msaitoh Exp $ */
+/* $NetBSD: ixgbe.c,v 1.122 2018/02/16 04:50:19 knakahara Exp $ */
/******************************************************************************
@@ -411,6 +411,10 @@
int i, j;
u32 rss_hash_config;
+ /* force use default RSS key. */
+#ifdef __NetBSD__
+ rss_getkey((uint8_t *) &rss_key);
+#else
if (adapter->feat_en & IXGBE_FEATURE_RSS) {
/* Fetch the configured RSS key */
rss_getkey((uint8_t *) &rss_key);
@@ -418,6 +422,7 @@
/* set up random bits */
cprng_fast(&rss_key, sizeof(rss_key));
}
+#endif
/* Set multiplier for RETA setup and table size based on MAC */
index_mult = 0x1;
diff -r 6a1253145d7f -r 436303b7c861 sys/dev/pci/ixgbe/ixgbe_rss.h
--- a/sys/dev/pci/ixgbe/ixgbe_rss.h Fri Feb 16 04:49:27 2018 +0000
+++ b/sys/dev/pci/ixgbe/ixgbe_rss.h Fri Feb 16 04:50:19 2018 +0000
@@ -35,6 +35,26 @@
#ifndef _IXGBE_RSS_H_
#define _IXGBE_RSS_H_
+#ifdef __NetBSD__
+#include <net/rss_config.h>
+
+#define RSS_HASHTYPE_RSS_IPV4 (1 << 1)
+#define RSS_HASHTYPE_RSS_TCP_IPV4 (1 << 2)
+#define RSS_HASHTYPE_RSS_IPV6 (1 << 3)
+#define RSS_HASHTYPE_RSS_TCP_IPV6 (1 << 4)
+#define RSS_HASHTYPE_RSS_IPV6_EX (1 << 5)
+#define RSS_HASHTYPE_RSS_TCP_IPV6_EX (1 << 6)
+#define RSS_HASHTYPE_RSS_UDP_IPV4 (1 << 7)
+#define RSS_HASHTYPE_RSS_UDP_IPV6 (1 << 9)
+#define RSS_HASHTYPE_RSS_UDP_IPV6_EX (1 << 10)
+
+#define rss_getcpu(_a) 0
+#define rss_getnumbuckets() 1
+#define rss_get_indirection_to_bucket(_a) 0
+#define rss_gethashconfig() 0x7E
+#define rss_hash2bucket(_a,_b,_c) -1
+
+#else
#ifdef RSS
#include <net/rss_config.h>
@@ -60,4 +80,5 @@
#define rss_hash2bucket(_a,_b,_c) -1
#endif
+#endif /* __NetBSD__ */
#endif /* _IXGBE_RSS_H_ */
diff -r 6a1253145d7f -r 436303b7c861 sys/dev/pci/ixgbe/ixv.c
--- a/sys/dev/pci/ixgbe/ixv.c Fri Feb 16 04:49:27 2018 +0000
+++ b/sys/dev/pci/ixgbe/ixv.c Fri Feb 16 04:50:19 2018 +0000
@@ -1,4 +1,4 @@
-/*$NetBSD: ixv.c,v 1.77 2017/12/21 06:49:26 msaitoh Exp $*/
+/*$NetBSD: ixv.c,v 1.78 2018/02/16 04:50:19 knakahara Exp $*/
/******************************************************************************
@@ -1520,6 +1520,10 @@
int i, j;
u32 rss_hash_config;
+ /* force use default RSS key. */
+#ifdef __NetBSD__
+ rss_getkey((uint8_t *) &rss_key);
+#else
if (adapter->feat_en & IXGBE_FEATURE_RSS) {
/* Fetch the configured RSS key */
rss_getkey((uint8_t *)&rss_key);
@@ -1527,6 +1531,7 @@
/* set up random bits */
cprng_fast(&rss_key, sizeof(rss_key));
}
+#endif
/* Now fill out hash function seeds */
for (i = 0; i < 10; i++)
Home |
Main Index |
Thread Index |
Old Index