svn commit: r346862 - in stable/11/sys/dev/cxgbe: . common
Navdeep Parhar
np at FreeBSD.org
Mon Apr 29 00:31:59 UTC 2019
Author: np
Date: Mon Apr 29 00:31:58 2019
New Revision: 346862
URL: https://svnweb.freebsd.org/changeset/base/346862
Log:
MFC r334137:
cxgbe(4): Fix range checks in is_etid.
Modified:
stable/11/sys/dev/cxgbe/common/common.h
stable/11/sys/dev/cxgbe/t4_main.c
Directory Properties:
stable/11/ (props changed)
Modified: stable/11/sys/dev/cxgbe/common/common.h
==============================================================================
--- stable/11/sys/dev/cxgbe/common/common.h Mon Apr 29 00:22:34 2019 (r346861)
+++ stable/11/sys/dev/cxgbe/common/common.h Mon Apr 29 00:31:58 2019 (r346862)
@@ -357,7 +357,7 @@ struct adapter_params {
u_int ftid_min;
u_int ftid_max;
u_int etid_min;
- u_int netids;
+ u_int etid_max;
unsigned int cim_la_size;
@@ -449,7 +449,8 @@ static inline int is_ftid(const struct adapter *sc, u_
static inline int is_etid(const struct adapter *sc, u_int tid)
{
- return (tid >= sc->params.etid_min);
+ return (sc->params.etid_min > 0 && tid >= sc->params.etid_min &&
+ tid <= sc->params.etid_max);
}
static inline int is_offload(const struct adapter *adap)
Modified: stable/11/sys/dev/cxgbe/t4_main.c
==============================================================================
--- stable/11/sys/dev/cxgbe/t4_main.c Mon Apr 29 00:22:34 2019 (r346861)
+++ stable/11/sys/dev/cxgbe/t4_main.c Mon Apr 29 00:31:58 2019 (r346862)
@@ -4016,8 +4016,8 @@ get_params__post_init(struct adapter *sc)
}
sc->tids.etid_base = val[0];
sc->params.etid_min = val[0];
+ sc->params.etid_max = val[1];
sc->tids.netids = val[1] - val[0] + 1;
- sc->params.netids = sc->tids.netids;
sc->params.eo_wr_cred = val[2];
sc->params.ethoffload = 1;
}
More information about the svn-src-stable
mailing list