Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F153242711
D7927.id20481.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D7927.id20481.diff
View Options
Index: head/sys/dev/hyperv/netvsc/hv_net_vsc.h
===================================================================
--- head/sys/dev/hyperv/netvsc/hv_net_vsc.h
+++ head/sys/dev/hyperv/netvsc/hv_net_vsc.h
@@ -245,6 +245,8 @@
#define HN_FLAG_RXBUF_CONNECTED 0x0001
#define HN_FLAG_CHIM_CONNECTED 0x0002
+#define HN_FLAG_HAS_RSSKEY 0x0004
+#define HN_FLAG_HAS_RSSIND 0x0008
#define HN_CAP_VLAN 0x0001
#define HN_CAP_MTU 0x0002
Index: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c
===================================================================
--- head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c
+++ head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c
@@ -2146,6 +2146,7 @@
error = SYSCTL_IN(req, sc->hn_rss.rss_key, sizeof(sc->hn_rss.rss_key));
if (error)
goto back;
+ sc->hn_flags |= HN_FLAG_HAS_RSSKEY;
if (sc->hn_rx_ring_inuse > 1) {
error = hn_rss_reconfig(sc);
@@ -2182,6 +2183,7 @@
error = SYSCTL_IN(req, sc->hn_rss.rss_ind, sizeof(sc->hn_rss.rss_ind));
if (error)
goto back;
+ sc->hn_flags |= HN_FLAG_HAS_RSSIND;
hn_rss_ind_fixup(sc, sc->hn_rx_ring_inuse);
error = hn_rss_reconfig(sc);
@@ -3335,24 +3337,29 @@
* are allocated.
*/
- if (!device_is_attached(sc->hn_dev)) {
+ if ((sc->hn_flags & HN_FLAG_HAS_RSSKEY) == 0) {
/*
- * Setup default RSS key and indirect table for the
- * attach DEVMETHOD. They can be altered later on,
- * so don't mess them up once this interface is attached.
+ * RSS key is not set yet; set it to the default RSS key.
*/
- if (bootverbose) {
- if_printf(sc->hn_ifp, "setup default RSS key and "
- "indirect table\n");
- }
-
- /* Setup default RSS key. */
+ if (bootverbose)
+ if_printf(sc->hn_ifp, "setup default RSS key\n");
memcpy(rss->rss_key, hn_rss_key_default, sizeof(rss->rss_key));
+ sc->hn_flags |= HN_FLAG_HAS_RSSKEY;
+ }
- /* Setup default RSS indirect table. */
+ if ((sc->hn_flags & HN_FLAG_HAS_RSSIND) == 0) {
+ /*
+ * RSS indirect table is not set yet; set it up in round-
+ * robin fashion.
+ */
+ if (bootverbose) {
+ if_printf(sc->hn_ifp, "setup default RSS indirect "
+ "table\n");
+ }
/* TODO: Take ndis_rss_caps.ndis_nind into account. */
for (i = 0; i < NDIS_HASH_INDCNT; ++i)
rss->rss_ind[i] = i % nchan;
+ sc->hn_flags |= HN_FLAG_HAS_RSSIND;
} else {
/*
* # of usable channels may be changed, so we have to
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Apr 21, 12:41 AM (3 h, 27 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
31850447
Default Alt Text
D7927.id20481.diff (2 KB)
Attached To
Mode
D7927: hyperv/hn: Allow RSS capability flipping upon attach/reinit.
Attached
Detach File
Event Timeline
Log In to Comment