From owner-svn-src-head@freebsd.org Fri Mar 1 01:57:24 2019 Return-Path: Delivered-To: svn-src-head@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 08386152278F; Fri, 1 Mar 2019 01:57:24 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9C55A6D97A; Fri, 1 Mar 2019 01:57:23 +0000 (UTC) (envelope-from cem@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 8C429DD17; Fri, 1 Mar 2019 01:57:23 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x211vNrK048587; Fri, 1 Mar 2019 01:57:23 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x211vN5w048586; Fri, 1 Mar 2019 01:57:23 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201903010157.x211vN5w048586@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Fri, 1 Mar 2019 01:57:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r344678 - head/sys/dev/cxgb X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/dev/cxgb X-SVN-Commit-Revision: 344678 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9C55A6D97A X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.948,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Mar 2019 01:57:24 -0000 Author: cem Date: Fri Mar 1 01:57:22 2019 New Revision: 344678 URL: https://svnweb.freebsd.org/changeset/base/344678 Log: cxgb(4): Netdump: only reference allocated qsets SGE_QSETS is an upper bound -- fewer qsets may be allocated depending on the number of CPUs. Reviewed by: markj, np, vangyzen X-MFC-With: r333288 Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D17274 Modified: head/sys/dev/cxgb/cxgb_adapter.h head/sys/dev/cxgb/cxgb_main.c Modified: head/sys/dev/cxgb/cxgb_adapter.h ============================================================================== --- head/sys/dev/cxgb/cxgb_adapter.h Fri Mar 1 01:20:21 2019 (r344677) +++ head/sys/dev/cxgb/cxgb_adapter.h Fri Mar 1 01:57:22 2019 (r344678) @@ -363,6 +363,7 @@ struct adapter { unsigned int slow_intr_mask; unsigned long irq_stats[IRQ_NUM_STATS]; + unsigned nqsets; struct sge sge; struct mc7 pmrx; struct mc7 pmtx; Modified: head/sys/dev/cxgb/cxgb_main.c ============================================================================== --- head/sys/dev/cxgb/cxgb_main.c Fri Mar 1 01:20:21 2019 (r344677) +++ head/sys/dev/cxgb/cxgb_main.c Fri Mar 1 01:57:22 2019 (r344678) @@ -853,6 +853,8 @@ setup_sge_qsets(adapter_t *sc) } } + sc->nqsets = qset_idx; + return (0); } @@ -3598,7 +3600,7 @@ cxgb_netdump_init(struct ifnet *ifp, int *nrxr, int *n pi = if_getsoftc(ifp); adap = pi->adapter; ADAPTER_LOCK(adap); - *nrxr = SGE_QSETS; + *nrxr = adap->nqsets; *ncl = adap->sge.qs[0].fl[1].size; *clsize = adap->sge.qs[0].fl[1].buf_size; ADAPTER_UNLOCK(adap); @@ -3613,7 +3615,7 @@ cxgb_netdump_event(struct ifnet *ifp, enum netdump_ev pi = if_getsoftc(ifp); if (event == NETDUMP_START) - for (i = 0; i < SGE_QSETS; i++) { + for (i = 0; i < pi->adapter->nqsets; i++) { qs = &pi->adapter->sge.qs[i]; /* Need to reinit after netdump_mbuf_dump(). */ @@ -3650,7 +3652,7 @@ cxgb_netdump_poll(struct ifnet *ifp, int count) return (ENOENT); adap = pi->adapter; - for (i = 0; i < SGE_QSETS; i++) + for (i = 0; i < adap->nqsets; i++) (void)cxgb_netdump_poll_rx(adap, &adap->sge.qs[i]); (void)cxgb_netdump_poll_tx(&adap->sge.qs[pi->first_qset]); return (0);