Add a fastpath to allocate from packet zone when using m_getjcl.
This will add support for packet zone for at least igb and ixgbe and will avoid to check for that in bce and mxge. MFC after: 1 week
This commit is contained in:
parent
bd99a522e2
commit
7b5a899589
@ -5059,11 +5059,8 @@ bce_get_rx_buf(struct bce_softc *sc, struct mbuf *m, u16 *prod,
|
||||
#ifdef BCE_JUMBO_HDRSPLIT
|
||||
MGETHDR(m_new, M_DONTWAIT, MT_DATA);
|
||||
#else
|
||||
if (sc->rx_bd_mbuf_alloc_size <= MCLBYTES)
|
||||
m_new = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR);
|
||||
else
|
||||
m_new = m_getjcl(M_DONTWAIT, MT_DATA, M_PKTHDR,
|
||||
sc->rx_bd_mbuf_alloc_size);
|
||||
m_new = m_getjcl(M_DONTWAIT, MT_DATA, M_PKTHDR,
|
||||
sc->rx_bd_mbuf_alloc_size);
|
||||
#endif
|
||||
|
||||
if (m_new == NULL) {
|
||||
|
@ -2400,10 +2400,7 @@ mxge_get_buf_big(struct mxge_slice_state *ss, bus_dmamap_t map, int idx)
|
||||
mxge_rx_ring_t *rx = &ss->rx_big;
|
||||
int cnt, err, i;
|
||||
|
||||
if (rx->cl_size == MCLBYTES)
|
||||
m = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR);
|
||||
else
|
||||
m = m_getjcl(M_DONTWAIT, MT_DATA, M_PKTHDR, rx->cl_size);
|
||||
m = m_getjcl(M_DONTWAIT, MT_DATA, M_PKTHDR, rx->cl_size);
|
||||
if (m == NULL) {
|
||||
rx->alloc_fail++;
|
||||
err = ENOBUFS;
|
||||
|
@ -523,6 +523,9 @@ m_getjcl(int how, short type, int flags, int size)
|
||||
struct mbuf *m, *n;
|
||||
uma_zone_t zone;
|
||||
|
||||
if (size == MCLBYTES)
|
||||
return m_getcl(how, type, flags);
|
||||
|
||||
args.flags = flags;
|
||||
args.type = type;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user