Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 20 Feb 2018 18:33:46 +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: r329651 - head/sys/net
Message-ID:  <201802201833.w1KIXkfk089596@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: shurd
Date: Tue Feb 20 18:33:45 2018
New Revision: 329651
URL: https://svnweb.freebsd.org/changeset/base/329651

Log:
  IFLIB: do not remove dmamap on buffer unload
  
  Dmamap is created only on IFC attach. If we remove it on
  buffer release, we won't be able to do ifconfig down&up. Only destroy
  when in detach.
  
  Reported by:	wma
  Reviewed by:	wma
  Sponsored by:	Limelight Networks
  Differential Revision:	https://reviews.freebsd.org/D14060

Modified:
  head/sys/net/iflib.c

Modified: head/sys/net/iflib.c
==============================================================================
--- head/sys/net/iflib.c	Tue Feb 20 18:24:20 2018	(r329650)
+++ head/sys/net/iflib.c	Tue Feb 20 18:33:45 2018	(r329651)
@@ -1984,7 +1984,8 @@ iflib_fl_bufs_free(iflib_fl_t fl)
 			if (fl->ifl_sds.ifsd_map != NULL) {
 				bus_dmamap_t sd_map = fl->ifl_sds.ifsd_map[i];
 				bus_dmamap_unload(fl->ifl_desc_tag, sd_map);
-				bus_dmamap_destroy(fl->ifl_desc_tag, sd_map);
+				if (fl->ifl_rxq->ifr_ctx->ifc_in_detach)
+					bus_dmamap_destroy(fl->ifl_desc_tag, sd_map);
 			}
 			if (*sd_m != NULL) {
 				m_init(*sd_m, M_NOWAIT, MT_DATA, 0);



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