Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 11 Apr 2018 21:41:59 +0000 (UTC)
From:      Stephen Hurd <shurd@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r332419 - head/sys/net
Message-ID:  <201804112141.w3BLfxho048321@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: shurd
Date: Wed Apr 11 21:41:59 2018
New Revision: 332419
URL: https://svnweb.freebsd.org/changeset/base/332419

Log:
  Properly initialize ifc_nhwtxqs.
  
  Also, since ifc_nhwrxqs is only used in one place, remove it from the struct.
  This was preventing iflib_dma_free() from being called via
  iflib_device_detach().
  
  Submitted by:	Matthew Macy <mmacy@mattmacy.io>
  Reviewed by:	shurd
  Sponsored by:	Limelight Networks

Modified:
  head/sys/net/iflib.c

Modified: head/sys/net/iflib.c
==============================================================================
--- head/sys/net/iflib.c	Wed Apr 11 20:04:06 2018	(r332418)
+++ head/sys/net/iflib.c	Wed Apr 11 21:41:59 2018	(r332419)
@@ -166,7 +166,6 @@ struct iflib_ctx {
 	struct mtx ifc_mtx;
 
 	uint16_t ifc_nhwtxqs;
-	uint16_t ifc_nhwrxqs;
 
 	iflib_txq_t ifc_txqs;
 	iflib_rxq_t ifc_rxqs;
@@ -2289,7 +2288,7 @@ iflib_stop(if_ctx_t ctx)
 	for (i = 0; i < scctx->isc_nrxqsets; i++, rxq++) {
 		/* make sure all transmitters have completed before proceeding XXX */
 
-		for (j = 0, di = txq->ift_ifdi; j < ctx->ifc_nhwrxqs; j++, di++)
+		for (j = 0, di = txq->ift_ifdi; j < rxq->ifr_nfl; j++, di++)
 			bzero((void *)di->idi_vaddr, di->idi_size);
 		/* also resets the free lists pidx/cidx */
 		for (j = 0, fl = rxq->ifr_fl; j < rxq->ifr_nfl; j++, fl++)
@@ -4198,6 +4197,7 @@ iflib_device_register(device_t dev, void *sc, if_share
 
 	scctx = &ctx->ifc_softc_ctx;
 	ifp = ctx->ifc_ifp;
+	ctx->ifc_nhwtxqs = sctx->isc_ntxqs;
 
 	/*
 	 * XXX sanity check that ntxd & nrxd are a power of 2



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