Page MenuHomeFreeBSD

D6943.id17823.diff
No OneTemporary

D6943.id17823.diff

Index: sys/dev/ixgbe/if_ix.c
===================================================================
--- sys/dev/ixgbe/if_ix.c
+++ sys/dev/ixgbe/if_ix.c
@@ -370,7 +370,7 @@
#include <dev/netmap/ixgbe_netmap.h>
#endif /* DEV_NETMAP */
-static MALLOC_DEFINE(M_IXGBE, "ix", "ix driver allocations");
+MALLOC_DEFINE(M_IXGBE, "ix", "ix driver allocations");
/************************************************************************
* ixgbe_probe - Device identification routine
@@ -514,7 +514,7 @@
/* Allocate multicast array memory. */
adapter->mta = malloc(sizeof(*adapter->mta) *
- MAX_NUM_MULTICAST_ADDRESSES, M_DEVBUF, M_NOWAIT);
+ MAX_NUM_MULTICAST_ADDRESSES, M_IXGBE, M_NOWAIT);
if (adapter->mta == NULL) {
device_printf(dev, "Can not allocate multicast setup array\n");
error = ENOMEM;
@@ -651,7 +651,7 @@
if (adapter->ifp != NULL)
if_free(adapter->ifp);
ixgbe_free_pci_resources(adapter);
- free(adapter->mta, M_DEVBUF);
+ free(adapter->mta, M_IXGBE);
return (error);
} /* ixgbe_attach */
@@ -739,7 +739,7 @@
ixgbe_free_transmit_structures(adapter);
ixgbe_free_receive_structures(adapter);
- free(adapter->mta, M_DEVBUF);
+ free(adapter->mta, M_IXGBE);
IXGBE_CORE_LOCK_DESTROY(adapter);
Index: sys/dev/ixgbe/ix_txrx.c
===================================================================
--- sys/dev/ixgbe/ix_txrx.c
+++ sys/dev/ixgbe/ix_txrx.c
@@ -102,6 +102,7 @@
static __inline void ixgbe_rx_input(struct rx_ring *, struct ifnet *,
struct mbuf *, u32);
+MALLOC_DECLARE(M_IXGBE);
#ifdef IXGBE_LEGACY_TX
/************************************************************************
* ixgbe_legacy_start_locked - Transmit entry point
@@ -532,7 +533,7 @@
if (!(txr->tx_buffers =
(struct ixgbe_tx_buf *)malloc(sizeof(struct ixgbe_tx_buf) *
- adapter->num_tx_desc, M_DEVBUF, M_NOWAIT | M_ZERO))) {
+ adapter->num_tx_desc, M_IXGBE, M_NOWAIT | M_ZERO))) {
device_printf(dev, "Unable to allocate tx_buffer memory\n");
error = ENOMEM;
goto fail;
@@ -663,7 +664,7 @@
IXGBE_TX_UNLOCK(txr);
IXGBE_TX_LOCK_DESTROY(txr);
}
- free(adapter->tx_rings, M_DEVBUF);
+ free(adapter->tx_rings, M_IXGBE);
}
/************************************************************************
@@ -703,10 +704,10 @@
}
#ifdef IXGBE_LEGACY_TX
if (txr->br != NULL)
- buf_ring_free(txr->br, M_DEVBUF);
+ buf_ring_free(txr->br, M_IXGBE);
#endif
if (txr->tx_buffers != NULL) {
- free(txr->tx_buffers, M_DEVBUF);
+ free(txr->tx_buffers, M_IXGBE);
txr->tx_buffers = NULL;
}
if (txr->txtag != NULL) {
@@ -1387,7 +1388,7 @@
int bsize, error;
bsize = sizeof(struct ixgbe_rx_buf) * rxr->num_desc;
- if (!(rxr->rx_buffers = (struct ixgbe_rx_buf *)malloc(bsize, M_DEVBUF,
+ if (!(rxr->rx_buffers = (struct ixgbe_rx_buf *)malloc(bsize, M_IXGBE,
M_NOWAIT | M_ZERO))) {
device_printf(dev, "Unable to allocate rx_buffer memory\n");
error = ENOMEM;
@@ -1626,7 +1627,7 @@
ixgbe_dma_free(adapter, &rxr->rxdma);
}
- free(adapter->rx_rings, M_DEVBUF);
+ free(adapter->rx_rings, M_IXGBE);
}
@@ -1659,7 +1660,7 @@
}
}
if (rxr->rx_buffers != NULL) {
- free(rxr->rx_buffers, M_DEVBUF);
+ free(rxr->rx_buffers, M_IXGBE);
rxr->rx_buffers = NULL;
}
}
@@ -2151,7 +2152,7 @@
/* First, allocate the top level queue structs */
adapter->queues = (struct ix_queue *)malloc(sizeof(struct ix_queue) *
- adapter->num_queues, M_DEVBUF, M_NOWAIT | M_ZERO);
+ adapter->num_queues, M_IXGBE, M_NOWAIT | M_ZERO);
if (!adapter->queues) {
device_printf(dev, "Unable to allocate queue memory\n");
error = ENOMEM;
@@ -2160,7 +2161,7 @@
/* Second, allocate the TX ring struct memory */
adapter->tx_rings = (struct tx_ring *)malloc(sizeof(struct tx_ring) *
- adapter->num_queues, M_DEVBUF, M_NOWAIT | M_ZERO);
+ adapter->num_queues, M_IXGBE, M_NOWAIT | M_ZERO);
if (!adapter->tx_rings) {
device_printf(dev, "Unable to allocate TX ring memory\n");
error = ENOMEM;
@@ -2169,7 +2170,7 @@
/* Third, allocate the RX ring */
adapter->rx_rings = (struct rx_ring *)malloc(sizeof(struct rx_ring) *
- adapter->num_queues, M_DEVBUF, M_NOWAIT | M_ZERO);
+ adapter->num_queues, M_IXGBE, M_NOWAIT | M_ZERO);
if (!adapter->rx_rings) {
device_printf(dev, "Unable to allocate RX ring memory\n");
error = ENOMEM;
@@ -2226,7 +2227,7 @@
}
#ifndef IXGBE_LEGACY_TX
/* Allocate a buf ring */
- txr->br = buf_ring_alloc(IXGBE_BR_SIZE, M_DEVBUF,
+ txr->br = buf_ring_alloc(IXGBE_BR_SIZE, M_IXGBE,
M_WAITOK, &txr->tx_mtx);
if (txr->br == NULL) {
device_printf(dev,
@@ -2296,11 +2297,11 @@
err_tx_desc:
for (txr = adapter->tx_rings; txconf > 0; txr++, txconf--)
ixgbe_dma_free(adapter, &txr->txdma);
- free(adapter->rx_rings, M_DEVBUF);
+ free(adapter->rx_rings, M_IXGBE);
rx_fail:
- free(adapter->tx_rings, M_DEVBUF);
+ free(adapter->tx_rings, M_IXGBE);
tx_fail:
- free(adapter->queues, M_DEVBUF);
+ free(adapter->queues, M_IXGBE);
fail:
return (error);
} /* ixgbe_allocate_queues */

File Metadata

Mime Type
text/plain
Expires
Fri, Oct 24, 1:31 AM (15 h, 3 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
24111867
Default Alt Text
D6943.id17823.diff (4 KB)

Event Timeline