Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F115271823
D24733.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D24733.diff
View Options
Index: head/sys/dev/ena/ena.c
===================================================================
--- head/sys/dev/ena/ena.c
+++ head/sys/dev/ena/ena.c
@@ -30,6 +30,8 @@
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
+#include "opt_rss.h"
+
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/bus.h>
@@ -61,6 +63,9 @@
#include <net/if_media.h>
#include <net/if_types.h>
#include <net/if_vlan_var.h>
+#ifdef RSS
+#include <net/rss_config.h>
+#endif
#include <netinet/in_systm.h>
#include <netinet/in.h>
@@ -2700,6 +2705,16 @@
}
}
+#ifdef RSS
+ uint8_t rss_algo = rss_gethashalgo();
+ if (rss_algo == RSS_HASH_TOEPLITZ) {
+ uint8_t hash_key[RSS_KEYSIZE];
+
+ rss_getkey(hash_key);
+ rc = ena_com_fill_hash_function(ena_dev, ENA_ADMIN_TOEPLITZ,
+ hash_key, RSS_KEYSIZE, 0xFFFFFFFF);
+ } else
+#endif
rc = ena_com_fill_hash_function(ena_dev, ENA_ADMIN_CRC32, NULL,
ENA_HASH_KEY_SIZE, 0xFFFFFFFF);
if (unlikely((rc != 0) && (rc != EOPNOTSUPP))) {
Index: head/sys/dev/ena/ena_datapath.c
===================================================================
--- head/sys/dev/ena/ena_datapath.c
+++ head/sys/dev/ena/ena_datapath.c
@@ -30,6 +30,7 @@
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
+#include "opt_rss.h"
#include "ena.h"
#include "ena_datapath.h"
#ifdef DEV_NETMAP
@@ -335,6 +336,19 @@
if (likely(ENA_FLAG_ISSET(ENA_FLAG_RSS_ACTIVE, adapter))) {
mbuf->m_pkthdr.flowid = ena_rx_ctx->hash;
+
+#ifdef RSS
+ /*
+ * Hardware and software RSS are in agreement only when both are
+ * configured to Toeplitz algorithm. This driver configures
+ * that algorithm only when software RSS is enabled and uses it.
+ */
+ if (adapter->ena_dev->rss.hash_func != ENA_ADMIN_TOEPLITZ &&
+ ena_rx_ctx->l3_proto != ENA_ETH_IO_L3_PROTO_UNKNOWN) {
+ M_HASHTYPE_SET(mbuf, M_HASHTYPE_OPAQUE_HASH);
+ return;
+ }
+#endif
if (ena_rx_ctx->frag &&
(ena_rx_ctx->l3_proto != ENA_ETH_IO_L3_PROTO_UNKNOWN)) {
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Apr 23, 2:34 AM (11 h, 32 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
17720493
Default Alt Text
D24733.diff (1 KB)
Attached To
Mode
D24733: teach ena driver about RSS kernel option
Attached
Detach File
Event Timeline
Log In to Comment