#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)
{
/* VLAN stripping */
if (bwflags & CQ_ENET_RQ_DESC_FLAGS_VLAN_STRIPPED) {
- pkt_flags |= PKT_RX_VLAN_PKT;
+ pkt_flags |= PKT_RX_VLAN_PKT | PKT_RX_VLAN_STRIPPED;
mbuf->vlan_tci = enic_cq_rx_desc_vlan(cqrd);
} else {
mbuf->vlan_tci = 0;
enic_ring_add(uint32_t n_descriptors, uint32_t i0, uint32_t i1)
{
uint32_t d = i0 + i1;
- ASSERT(i0 < n_descriptors);
- ASSERT(i1 < n_descriptors);
+ RTE_ASSERT(i0 < n_descriptors);
+ RTE_ASSERT(i1 < n_descriptors);
d -= (d >= n_descriptors) ? n_descriptors : 0;
return d;
}
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;