From owner-svn-src-all@freebsd.org Thu May 24 08:02:12 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A0EAAF6B257; Thu, 24 May 2018 08:02:12 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 554457C437; Thu, 24 May 2018 08:02:12 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 363397877; Thu, 24 May 2018 08:02:12 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4O82Cu0009889; Thu, 24 May 2018 08:02:12 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4O82BCG009886; Thu, 24 May 2018 08:02:11 GMT (envelope-from np@FreeBSD.org) Message-Id: <201805240802.w4O82BCG009886@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Thu, 24 May 2018 08:02:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334137 - in head/sys/dev/cxgbe: . common X-SVN-Group: head X-SVN-Commit-Author: np X-SVN-Commit-Paths: in head/sys/dev/cxgbe: . common X-SVN-Commit-Revision: 334137 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 May 2018 08:02:12 -0000 Author: np Date: Thu May 24 08:02:11 2018 New Revision: 334137 URL: https://svnweb.freebsd.org/changeset/base/334137 Log: cxgbe(4): Fix range checks in is_etid. Modified: head/sys/dev/cxgbe/common/common.h head/sys/dev/cxgbe/t4_main.c Modified: head/sys/dev/cxgbe/common/common.h ============================================================================== --- head/sys/dev/cxgbe/common/common.h Thu May 24 07:38:46 2018 (r334136) +++ head/sys/dev/cxgbe/common/common.h Thu May 24 08:02:11 2018 (r334137) @@ -358,7 +358,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; @@ -448,7 +448,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: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Thu May 24 07:38:46 2018 (r334136) +++ head/sys/dev/cxgbe/t4_main.c Thu May 24 08:02:11 2018 (r334137) @@ -3750,8 +3750,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; }