Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 1 Mar 2019 01:57:23 +0000 (UTC)
From:      Conrad Meyer <cem@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r344678 - head/sys/dev/cxgb
Message-ID:  <201903010157.x211vN5w048586@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201903010157.x211vN5w048586>