Date: Sun, 18 Sep 2016 08:10:40 +0000 (UTC) From: Sepherosa Ziehau <sephe@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305925 - head/sys/dev/hyperv/netvsc Message-ID: <201609180810.u8I8AeT4008378@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: sephe Date: Sun Sep 18 08:10:40 2016 New Revision: 305925 URL: https://svnweb.freebsd.org/changeset/base/305925 Log: hyperv/hn: Don't mess up RSS key and indirect table after attachment. MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7889 Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Sun Sep 18 07:47:57 2016 (r305924) +++ head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Sun Sep 18 08:10:40 2016 (r305925) @@ -3159,13 +3159,25 @@ hn_synth_attach(struct hn_softc *sc, int * are allocated. */ - /* Setup default RSS key. */ - memcpy(rss->rss_key, hn_rss_key_default, sizeof(rss->rss_key)); + if (!device_is_attached(sc->hn_dev)) { + /* + * 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. + */ + if (bootverbose) { + if_printf(sc->hn_ifp, "setup default RSS key and " + "indirect table\n"); + } - /* Setup default RSS indirect table. */ - /* TODO: Take ndis_rss_caps.ndis_nind into account. */ - for (i = 0; i < NDIS_HASH_INDCNT; ++i) - rss->rss_ind[i] = i % nchan; + /* Setup default RSS key. */ + memcpy(rss->rss_key, hn_rss_key_default, sizeof(rss->rss_key)); + + /* Setup default RSS indirect table. */ + /* TODO: Take ndis_rss_caps.ndis_nind into account. */ + for (i = 0; i < NDIS_HASH_INDCNT; ++i) + rss->rss_ind[i] = i % nchan; + } error = hn_rndis_conf_rss(sc); if (error) {
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201609180810.u8I8AeT4008378>