svn commit: r320972 - head/sys/dev/ixl
Eric Joyner
erj at FreeBSD.org
Thu Jul 13 22:12:42 UTC 2017
Author: erj
Date: Thu Jul 13 22:12:41 2017
New Revision: 320972
URL: https://svnweb.freebsd.org/changeset/base/320972
Log:
ixl(4)/ixlv(4): Stop leaking every busdma entry in receive path
From Brett:
In short, busdma maps for received packets were not being unloaded in the
interrupt handler before the packets were passed up the network stack. The fix
was to add a busdma sync and unload for the two receive maps.
This bug is significant for certain busdma providers, for example IOMMUs,
where not unloading the maps means that 1) the IOMMU mappings that allow the
NIC to DMA the received packets into host memory stay open indefinitely,
potentially violating a desired security policy, and 2) resources such as
device address space addresses and host memory for bookkeeping are never freed.
Without an IOMMU or bounce buffering enabled for the ixl device, I don't think
adding these calls will have any significant performance impact. With the
IOMMU enabled, I have noticed a performance impact on the receive side, which
is expected.
Submitted by: Brett Gutstein <bgutstein at rice.edu>
Reviewed by: erj@
MFC after: 1 week
Modified:
head/sys/dev/ixl/ixl_txrx.c
Modified: head/sys/dev/ixl/ixl_txrx.c
==============================================================================
--- head/sys/dev/ixl/ixl_txrx.c Thu Jul 13 22:01:38 2017 (r320971)
+++ head/sys/dev/ixl/ixl_txrx.c Thu Jul 13 22:12:41 2017 (r320972)
@@ -1578,6 +1578,18 @@ ixl_rxeof(struct ixl_queue *que, int count)
else
vtag = 0;
+ /* Remove device access to the rx buffers. */
+ if (rbuf->m_head != NULL) {
+ bus_dmamap_sync(rxr->htag, rbuf->hmap,
+ BUS_DMASYNC_POSTREAD);
+ bus_dmamap_unload(rxr->htag, rbuf->hmap);
+ }
+ if (rbuf->m_pack != NULL) {
+ bus_dmamap_sync(rxr->ptag, rbuf->pmap,
+ BUS_DMASYNC_POSTREAD);
+ bus_dmamap_unload(rxr->ptag, rbuf->pmap);
+ }
+
/*
** Make sure bad packets are discarded,
** note that only EOP descriptor has valid
More information about the svn-src-head
mailing list