Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F103042254
D22203.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D22203.diff
View Options
Index: head/sys/net/iflib.c
===================================================================
--- head/sys/net/iflib.c
+++ head/sys/net/iflib.c
@@ -1696,20 +1696,16 @@
{
bus_dmamap_t map;
- map = NULL;
- if (txq->ift_sds.ifsd_map != NULL)
+ if (txq->ift_sds.ifsd_map != NULL) {
map = txq->ift_sds.ifsd_map[i];
- if (map != NULL) {
bus_dmamap_sync(txq->ift_buf_tag, map, BUS_DMASYNC_POSTWRITE);
bus_dmamap_unload(txq->ift_buf_tag, map);
bus_dmamap_destroy(txq->ift_buf_tag, map);
txq->ift_sds.ifsd_map[i] = NULL;
}
- map = NULL;
- if (txq->ift_sds.ifsd_tso_map != NULL)
+ if (txq->ift_sds.ifsd_tso_map != NULL) {
map = txq->ift_sds.ifsd_tso_map[i];
- if (map != NULL) {
bus_dmamap_sync(txq->ift_tso_buf_tag, map,
BUS_DMASYNC_POSTWRITE);
bus_dmamap_unload(txq->ift_tso_buf_tag, map);
@@ -2120,9 +2116,6 @@
bus_dmamap_unload(fl->ifl_buf_tag, sd_map);
if (*sd_cl != NULL)
uma_zfree(fl->ifl_zone, *sd_cl);
- // XXX: Should this get moved out?
- if (iflib_in_detach(fl->ifl_rxq->ifr_ctx))
- bus_dmamap_destroy(fl->ifl_buf_tag, sd_map);
if (*sd_m != NULL) {
m_init(*sd_m, M_NOWAIT, MT_DATA, 0);
uma_zfree(zone_mbuf, *sd_m);
@@ -2210,9 +2203,6 @@
if (fl->ifl_buf_tag != NULL) {
if (fl->ifl_sds.ifsd_map != NULL) {
for (j = 0; j < fl->ifl_size; j++) {
- if (fl->ifl_sds.ifsd_map[j] ==
- NULL)
- continue;
bus_dmamap_sync(
fl->ifl_buf_tag,
fl->ifl_sds.ifsd_map[j],
@@ -2220,6 +2210,9 @@
bus_dmamap_unload(
fl->ifl_buf_tag,
fl->ifl_sds.ifsd_map[j]);
+ bus_dmamap_destroy(
+ fl->ifl_buf_tag,
+ fl->ifl_sds.ifsd_map[j]);
}
}
bus_dma_tag_destroy(fl->ifl_buf_tag);
@@ -5735,9 +5728,12 @@
iflib_rx_structures_free(if_ctx_t ctx)
{
iflib_rxq_t rxq = ctx->ifc_rxqs;
- int i;
+ if_shared_ctx_t sctx = ctx->ifc_sctx;
+ int i, j;
for (i = 0; i < ctx->ifc_softc_ctx.isc_nrxqsets; i++, rxq++) {
+ for (j = 0; j < sctx->isc_nrxqs; j++)
+ iflib_dma_free(&rxq->ifr_ifdi[j]);
iflib_rx_sds_free(rxq);
#if defined(INET6) || defined(INET)
if (if_getcapabilities(ctx->ifc_ifp) & IFCAP_LRO)
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Nov 21, 4:33 AM (21 h, 51 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
14754502
Default Alt Text
D22203.diff (2 KB)
Attached To
Mode
D22203: iflib: properly release memory allocated for DMA
Attached
Detach File
Event Timeline
Log In to Comment