Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/cxgbe/t4_sge.c
Show First 20 Lines • Show All 64 Lines • ▼ Show 20 Lines | |||||
#endif | #endif | ||||
#include "common/common.h" | #include "common/common.h" | ||||
#include "common/t4_regs.h" | #include "common/t4_regs.h" | ||||
#include "common/t4_regs_values.h" | #include "common/t4_regs_values.h" | ||||
#include "common/t4_msg.h" | #include "common/t4_msg.h" | ||||
#include "t4_mp_ring.h" | #include "t4_mp_ring.h" | ||||
/* | |||||
* Internal mbuf(9) knowledge. | |||||
*/ | |||||
uma_zone_t m_getzone(int); | |||||
void m_cljset(struct mbuf *m, void *cl, int type); | |||||
#ifdef T4_PKT_TIMESTAMP | #ifdef T4_PKT_TIMESTAMP | ||||
#define RX_COPY_THRESHOLD (MINCLSIZE - 8) | #define RX_COPY_THRESHOLD (MINCLSIZE - 8) | ||||
#else | #else | ||||
#define RX_COPY_THRESHOLD MINCLSIZE | #define RX_COPY_THRESHOLD MINCLSIZE | ||||
#endif | #endif | ||||
/* | /* | ||||
* Ethernet frames are DMA'd at this byte offset into the freelist buffer. | * Ethernet frames are DMA'd at this byte offset into the freelist buffer. | ||||
▲ Show 20 Lines • Show All 1,484 Lines • ▼ Show 20 Lines | #endif | ||||
/* | /* | ||||
* There's spare room in the cluster for an mbuf. Create one | * There's spare room in the cluster for an mbuf. Create one | ||||
* and associate it with the payload that's in the cluster. | * and associate it with the payload that's in the cluster. | ||||
*/ | */ | ||||
MPASS(clm != NULL); | MPASS(clm != NULL); | ||||
m = (struct mbuf *)(sd->cl + sd->nmbuf * MSIZE); | m = (struct mbuf *)(sd->cl + sd->nmbuf * MSIZE); | ||||
/* No bzero required */ | /* No bzero required */ | ||||
if (m_init(m, NULL, 0, M_NOWAIT, MT_DATA, | if (m_init(m, M_NOWAIT, MT_DATA, | ||||
fr_offset == 0 ? M_PKTHDR | M_NOFREE : M_NOFREE)) | fr_offset == 0 ? M_PKTHDR | M_NOFREE : M_NOFREE)) | ||||
return (NULL); | return (NULL); | ||||
fl->mbuf_inlined++; | fl->mbuf_inlined++; | ||||
m_extaddref(m, payload, blen, &clm->refcount, rxb_free, | m_extaddref(m, payload, blen, &clm->refcount, rxb_free, | ||||
swz->zone, sd->cl); | swz->zone, sd->cl); | ||||
if (sd->nmbuf++ == 0) | if (sd->nmbuf++ == 0) | ||||
counter_u64_add(extfree_refs, 1); | counter_u64_add(extfree_refs, 1); | ||||
▲ Show 20 Lines • Show All 3,157 Lines • Show Last 20 Lines |