hyperv/hn: Always query RSS capabilities.
- This avoid distributing NDIS version check. - Only NDIS 6.20 required (earlier NDIS uses different indirect table format). MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D8291
This commit is contained in:
parent
e0e8479b87
commit
0634f75c72
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=307710
@ -3408,10 +3408,9 @@ hn_synth_alloc_subchans(struct hn_softc *sc, int *nsubch)
|
||||
int nchan, rxr_cnt, error;
|
||||
|
||||
nchan = *nsubch + 1;
|
||||
if (sc->hn_ndis_ver < HN_NDIS_VERSION_6_30 || nchan == 1) {
|
||||
if (nchan == 1) {
|
||||
/*
|
||||
* Either RSS is not supported, or multiple RX/TX rings
|
||||
* are not requested.
|
||||
* Multiple RX/TX rings are not requested.
|
||||
*/
|
||||
*nsubch = 0;
|
||||
return (0);
|
||||
|
@ -744,15 +744,13 @@ hn_rndis_get_rsscaps(struct hn_softc *sc, int *rxr_cnt)
|
||||
|
||||
*rxr_cnt = 0;
|
||||
|
||||
if (sc->hn_ndis_ver < HN_NDIS_VERSION_6_20)
|
||||
return (EOPNOTSUPP);
|
||||
|
||||
memset(&in, 0, sizeof(in));
|
||||
in.ndis_hdr.ndis_type = NDIS_OBJTYPE_RSS_CAPS;
|
||||
if (sc->hn_ndis_ver < HN_NDIS_VERSION_6_30) {
|
||||
in.ndis_hdr.ndis_rev = NDIS_RSS_CAPS_REV_1;
|
||||
in.ndis_hdr.ndis_size = NDIS_RSS_CAPS_SIZE_6_0;
|
||||
} else {
|
||||
in.ndis_hdr.ndis_rev = NDIS_RSS_CAPS_REV_2;
|
||||
in.ndis_hdr.ndis_size = NDIS_RSS_CAPS_SIZE;
|
||||
}
|
||||
in.ndis_hdr.ndis_rev = NDIS_RSS_CAPS_REV_2;
|
||||
in.ndis_hdr.ndis_size = NDIS_RSS_CAPS_SIZE;
|
||||
|
||||
caps_len = NDIS_RSS_CAPS_SIZE;
|
||||
error = hn_rndis_query2(sc, OID_GEN_RECEIVE_SCALE_CAPABILITIES,
|
||||
@ -1027,10 +1025,12 @@ hn_rndis_conf_rss(struct hn_softc *sc, uint16_t flags)
|
||||
int error;
|
||||
|
||||
/*
|
||||
* Only NDIS 6.30+ is supported.
|
||||
* Only NDIS 6.20+ is supported:
|
||||
* We only support 4bytes element in indirect table, which has been
|
||||
* adopted since NDIS 6.20.
|
||||
*/
|
||||
KASSERT(sc->hn_ndis_ver >= HN_NDIS_VERSION_6_30,
|
||||
("NDIS 6.30+ is required, NDIS version 0x%08x", sc->hn_ndis_ver));
|
||||
KASSERT(sc->hn_ndis_ver >= HN_NDIS_VERSION_6_20,
|
||||
("NDIS 6.20+ is required, NDIS version 0x%08x", sc->hn_ndis_ver));
|
||||
|
||||
/*
|
||||
* NOTE:
|
||||
|
@ -36,6 +36,7 @@
|
||||
* NDIS protocol version numbers
|
||||
*/
|
||||
#define HN_NDIS_VERSION_6_1 0x00060001
|
||||
#define HN_NDIS_VERSION_6_20 0x00060014
|
||||
#define HN_NDIS_VERSION_6_30 0x0006001e
|
||||
#define HN_NDIS_VERSION_MAJOR(ver) (((ver) & 0xffff0000) >> 16)
|
||||
#define HN_NDIS_VERSION_MINOR(ver) ((ver) & 0xffff)
|
||||
|
Loading…
Reference in New Issue
Block a user