#define rte_packet_prefetch(p) do {} while (0)
#endif
-static inline struct rte_mbuf *
-rte_rxmbuf_alloc(struct rte_mempool *mp)
-{
- struct rte_mbuf *m;
-
- m = __rte_mbuf_raw_alloc(mp);
- __rte_mbuf_sanity_check_raw(m, 0);
- return m;
-}
-
static inline uint16_t
enic_cq_rx_desc_ciflags(struct cq_enet_rq_desc *crd)
{
rqd_ptr = (struct rq_enet_desc *)(rq->ring.descs) + rx_id;
/* allocate a new mbuf */
- nmb = rte_rxmbuf_alloc(rq->mp);
+ nmb = rte_mbuf_raw_alloc(rq->mp);
if (nmb == NULL) {
dev_err(enic, "RX mbuf alloc failed port=%u qid=%u",
enic->port_id, (unsigned)rq->index);
+ rx_id);
/* Push descriptor for newly allocated mbuf */
- dma_addr = (dma_addr_t)(nmb->buf_physaddr + nmb->data_off);
+ dma_addr = (dma_addr_t)(nmb->buf_physaddr
+ + RTE_PKTMBUF_HEADROOM);
rqd_ptr->address = rte_cpu_to_le_64(dma_addr);
- rqd_ptr->length_type = cpu_to_le16(nmb->buf_len);
+ rqd_ptr->length_type = cpu_to_le16(nmb->buf_len
+ - RTE_PKTMBUF_HEADROOM);
/* Fill in the rest of the mbuf */
rxmb->data_off = RTE_PKTMBUF_HEADROOM;