net/sfc: add SPDX tag in meson file
[dpdk.git] / drivers / net / hinic / hinic_pmd_rx.c
index a9f3962..f865f2f 100644 (file)
@@ -853,10 +853,11 @@ static inline u32 hinic_rx_alloc_mbuf_bulk(struct hinic_rxq *rxq,
 static struct rte_mbuf *hinic_rx_alloc_mbuf(struct hinic_rxq *rxq,
                                        dma_addr_t *dma_addr)
 {
-       struct rte_mbuf *mbuf;
+       struct rte_mbuf *mbuf = NULL;
+       int rc;
 
-       mbuf = rte_mbuf_raw_alloc(rxq->mb_pool);
-       if (unlikely(!mbuf))
+       rc = rte_pktmbuf_alloc_bulk(rxq->mb_pool, &mbuf, 1);
+       if (unlikely(rc != HINIC_OK))
                return NULL;
 
        *dma_addr = rte_mbuf_data_iova_default(mbuf);
@@ -971,13 +972,10 @@ u16 hinic_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, u16 nb_pkts)
        while (pkts < nb_pkts) {
                 /* 2. current ci is done */
                rx_cqe = &rxq->rx_cqe[sw_ci];
-               status = rx_cqe->status;
+               status = __atomic_load_n(&rx_cqe->status, __ATOMIC_ACQUIRE);
                if (!HINIC_GET_RX_DONE_BE(status))
                        break;
 
-               /* read other cqe member after status */
-               rte_rmb();
-
                /* convert cqe and get packet length */
                hinic_rq_cqe_be_to_cpu32(&cqe, (volatile void *)rx_cqe);
                vlan_len = cqe.vlan_len;