mbuf: add raw allocation function
[dpdk.git] / drivers / net / i40e / i40e_rxtx.c
index 4d35d83..c833aa3 100644 (file)
@@ -841,17 +841,6 @@ i40e_txd_enable_checksum(uint64_t ol_flags,
        }
 }
 
-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;
-}
-
 /* Construct the tx flags */
 static inline uint64_t
 i40e_build_ctob(uint32_t td_cmd,
@@ -1225,7 +1214,7 @@ i40e_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts)
                if (!(rx_status & (1 << I40E_RX_DESC_STATUS_DD_SHIFT)))
                        break;
 
-               nmb = rte_rxmbuf_alloc(rxq->mp);
+               nmb = rte_mbuf_raw_alloc(rxq->mp);
                if (unlikely(!nmb))
                        break;
                rxd = *rxdp;
@@ -1336,7 +1325,7 @@ i40e_recv_scattered_pkts(void *rx_queue,
                if (!(rx_status & (1 << I40E_RX_DESC_STATUS_DD_SHIFT)))
                        break;
 
-               nmb = rte_rxmbuf_alloc(rxq->mp);
+               nmb = rte_mbuf_raw_alloc(rxq->mp);
                if (unlikely(!nmb))
                        break;
                rxd = *rxdp;
@@ -2774,7 +2763,7 @@ i40e_alloc_rx_queue_mbufs(struct i40e_rx_queue *rxq)
 
        for (i = 0; i < rxq->nb_rx_desc; i++) {
                volatile union i40e_rx_desc *rxd;
-               struct rte_mbuf *mbuf = rte_rxmbuf_alloc(rxq->mp);
+               struct rte_mbuf *mbuf = rte_mbuf_raw_alloc(rxq->mp);
 
                if (unlikely(!mbuf)) {
                        PMD_DRV_LOG(ERR, "Failed to allocate mbuf for RX");
@@ -2904,7 +2893,12 @@ i40e_rx_queue_init(struct i40e_rx_queue *rxq)
        rx_ctx.lrxqthresh = 2;
        rx_ctx.crcstrip = (rxq->crc_len == 0) ? 1 : 0;
        rx_ctx.l2tsel = 1;
-       rx_ctx.showiv = 1;
+       /* showiv indicates if inner VLAN is stripped inside of tunnel
+        * packet. When set it to 1, vlan information is stripped from
+        * the inner header, but the hardware does not put it in the
+        * descriptor. So set it zero by default.
+        */
+       rx_ctx.showiv = 0;
        rx_ctx.prefena = 1;
 
        err = i40e_clear_lan_rx_queue_context(hw, pf_q);