]> git.droids-corp.org - dpdk.git/commitdiff
mbuf: rename deprecated VLAN flags
authorOlivier Matz <olivier.matz@6wind.com>
Wed, 25 Oct 2017 15:12:57 +0000 (17:12 +0200)
committerFerruh Yigit <ferruh.yigit@intel.com>
Thu, 26 Oct 2017 00:33:01 +0000 (02:33 +0200)
PKT_RX_VLAN_PKT and PKT_RX_QINQ_PKT are deprecated for a while.
As explained in [1], these flags were kept to let the applications and
PMDs move to the new flag. There is also a need to support Rx vlan
offload without vlan strip (at least for the ixgbe driver).

This patch renames the old flags for this feature, knowing that some
PMDs were using PKT_RX_VLAN_PKT and PKT_RX_QINQ_PKT to indicate that
the vlan tci has been saved in the mbuf structure.

It is likely that some PMDs do not set the proper flags when doing vlan
offload, and it would be worth making a pass on all of them.

Link: [1] http://dpdk.org/ml/archives/dev/2017-June/067712.html

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
32 files changed:
doc/guides/rel_notes/deprecation.rst
doc/guides/rel_notes/release_17_11.rst
drivers/net/af_packet/rte_eth_af_packet.c
drivers/net/avp/avp_ethdev.c
drivers/net/bnx2x/bnx2x_rxtx.c
drivers/net/bnxt/bnxt_rxr.c
drivers/net/bonding/rte_eth_bond_pmd.c
drivers/net/cxgbe/sge.c
drivers/net/dpaa/dpaa_rxtx.c
drivers/net/dpaa2/dpaa2_rxtx.c
drivers/net/e1000/em_rxtx.c
drivers/net/e1000/igb_rxtx.c
drivers/net/enic/enic_rxtx.c
drivers/net/fm10k/fm10k_rxtx.c
drivers/net/fm10k/fm10k_rxtx_vec.c
drivers/net/i40e/i40e_rxtx.c
drivers/net/i40e/i40e_rxtx_vec_altivec.c
drivers/net/i40e/i40e_rxtx_vec_neon.c
drivers/net/i40e/i40e_rxtx_vec_sse.c
drivers/net/ixgbe/ixgbe_ethdev.c
drivers/net/ixgbe/ixgbe_rxtx.c
drivers/net/ixgbe/ixgbe_rxtx_vec_neon.c
drivers/net/ixgbe/ixgbe_rxtx_vec_sse.c
drivers/net/mlx5/mlx5_rxtx.c
drivers/net/mlx5/mlx5_rxtx_vec_neon.h
drivers/net/mlx5/mlx5_rxtx_vec_sse.h
drivers/net/nfp/nfp_net.c
drivers/net/qede/qede_rxtx.c
drivers/net/vmxnet3/vmxnet3_rxtx.c
lib/librte_mbuf/rte_mbuf.c
lib/librte_mbuf/rte_mbuf.h
lib/librte_net/rte_ether.h

index a2faa2e5a2d52c349375e7efa4ba41c47b619a29..d07f38ca332150136aa64cdf213d69dc85363284 100644 (file)
@@ -28,11 +28,6 @@ Deprecation Notices
   The change will be only for the name.
   Functional aspects of the API or data-structure will remain same.
 
-* The mbuf flags PKT_RX_VLAN_PKT and PKT_RX_QINQ_PKT are deprecated and
-  are respectively replaced by PKT_RX_VLAN_STRIPPED and
-  PKT_RX_QINQ_STRIPPED, that are better described. The old flags and
-  their behavior will be kept until 17.08 and will be removed in 17.11.
-
 * ethdev: Tx offloads will no longer be enabled by default in 17.11.
   Instead, the ``rte_eth_txmode`` structure will be extended with
   bit field to enable each Tx offload.
index dafa4ba548494a7b3c5f3188b3cbcfd7318b2dca..8fcbc66ebe29f405034de49677e7c1e492d7539a 100644 (file)
@@ -349,6 +349,19 @@ API Changes
   ``rte_log_get_global_level()``, ``rte_log_set_level()`` and
   ``rte_log_get_level()``.
 
+* **Removed ``mbuf`` flags ``PKT_RX_VLAN_PKT`` and ``PKT_RX_QINQ_PKT``.**
+
+  The ``mbuf`` flags ``PKT_RX_VLAN_PKT`` and ``PKT_RX_QINQ_PKT`` have
+  been removed since their behavior were not properly described.
+
+* **Added ``mbuf`` flags ``PKT_RX_VLAN`` and ``PKT_RX_QINQ``.**
+
+  Two ``mbuf`` flags have been added to indicate that the VLAN
+  identifier has been saved in in the ``mbuf`` structure. For instance:
+
+  - if VLAN is not stripped and TCI is saved: ``PKT_RX_VLAN``
+  - if VLAN is stripped and TCI is saved: ``PKT_RX_VLAN | PKT_RX_VLAN_STRIPPED``
+
 
 ABI Changes
 -----------
index c6b86a3fb9d6f3f6015c98fcc67ee1fde0ff5c2c..28e6a9466ade2b6b2ddbbd86d1addb3ed24ab3c8 100644 (file)
@@ -167,7 +167,7 @@ eth_af_packet_rx(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
                /* check for vlan info */
                if (ppd->tp_status & TP_STATUS_VLAN_VALID) {
                        mbuf->vlan_tci = ppd->tp_vlan_tci;
-                       mbuf->ol_flags |= (PKT_RX_VLAN_PKT | PKT_RX_VLAN_STRIPPED);
+                       mbuf->ol_flags |= (PKT_RX_VLAN | PKT_RX_VLAN_STRIPPED);
                }
 
                /* release incoming frame and advance ring buffer */
index d729b26fda42bbe4499eab180c3d2b95685d5813..e01d0e8435f5ea8a70bdb53323b949d30c692406 100644 (file)
@@ -1359,7 +1359,7 @@ avp_dev_copy_from_buffers(struct avp_dev *avp,
        src_offset = 0;
 
        if (pkt_buf->ol_flags & RTE_AVP_RX_VLAN_PKT) {
-               ol_flags = PKT_RX_VLAN_PKT;
+               ol_flags = PKT_RX_VLAN;
                vlan_tci = pkt_buf->vlan_tci;
        } else {
                ol_flags = 0;
@@ -1617,7 +1617,7 @@ avp_recv_pkts(void *rx_queue,
                m->port = avp->port_id;
 
                if (pkt_buf->ol_flags & RTE_AVP_RX_VLAN_PKT) {
-                       m->ol_flags = PKT_RX_VLAN_PKT;
+                       m->ol_flags = PKT_RX_VLAN;
                        m->vlan_tci = pkt_buf->vlan_tci;
                }
 
index 5dd4aee7f2236976cb49fd5e4dbff3c36a04a873..c72067f6f6c3a2d9903953ff782f272888965fe5 100644 (file)
@@ -422,7 +422,7 @@ bnx2x_recv_pkts(void *p_rxq, struct rte_mbuf **rx_pkts, uint16_t nb_pkts)
                 */
                if (cqe_fp->pars_flags.flags & PARSING_FLAGS_VLAN) {
                        rx_mb->vlan_tci = cqe_fp->vlan_tag;
-                       rx_mb->ol_flags |= PKT_RX_VLAN_PKT;
+                       rx_mb->ol_flags |= PKT_RX_VLAN;
                }
 
                rx_pkts[nb_rx] = rx_mb;
index d68d26f174f08f771e6c2da7b0991c5b9cfb0610..30891b74faf5f33b0926b0cffd06e21caefdde4f 100644 (file)
@@ -199,7 +199,7 @@ static void bnxt_tpa_start(struct bnxt_rx_queue *rxq,
        if (tpa_start1->flags2 &
            rte_cpu_to_le_32(RX_TPA_START_CMPL_FLAGS2_META_FORMAT_VLAN)) {
                mbuf->vlan_tci = rte_le_to_cpu_32(tpa_start1->metadata);
-               mbuf->ol_flags |= PKT_RX_VLAN_PKT;
+               mbuf->ol_flags |= PKT_RX_VLAN;
        }
        if (likely(tpa_start1->flags2 &
                   rte_cpu_to_le_32(RX_TPA_START_CMPL_FLAGS2_L4_CS_CALC)))
@@ -464,7 +464,7 @@ static int bnxt_rx_pkt(struct rte_mbuf **rx_pkt,
                        (RX_PKT_CMPL_METADATA_VID_MASK |
                        RX_PKT_CMPL_METADATA_DE |
                        RX_PKT_CMPL_METADATA_PRI_MASK);
-               mbuf->ol_flags |= PKT_RX_VLAN_PKT;
+               mbuf->ol_flags |= PKT_RX_VLAN;
        }
 
        if (likely(RX_CMP_IP_CS_OK(rxcmp1)))
index cbc7ddd87ca9d9191761aff897395216de5a7504..af33529b5e6c836c8b71aef93ec98910aa64abcd 100644 (file)
@@ -129,7 +129,7 @@ is_lacp_packets(uint16_t ethertype, uint8_t subtype, struct rte_mbuf *mbuf)
 {
        const uint16_t ether_type_slow_be = rte_be_to_cpu_16(ETHER_TYPE_SLOW);
 
-       return !((mbuf->ol_flags & PKT_RX_VLAN_PKT) ? mbuf->vlan_tci : 0) &&
+       return !((mbuf->ol_flags & PKT_RX_VLAN) ? mbuf->vlan_tci : 0) &&
                (ethertype == ether_type_slow_be &&
                (subtype == SLOW_SUBTYPE_MARKER || subtype == SLOW_SUBTYPE_LACP));
 }
index 5376fc50078c031f4e835f74de6ca849fb6f3493..33f7f0bc202c7f160611d13b6250a4b6fba323ba 100644 (file)
@@ -1405,7 +1405,7 @@ int t4_ethrx_handler(struct sge_rspq *q, const __be64 *rsp,
        }
 
        if (pkt->vlan_ex) {
-               mbuf->ol_flags |= PKT_RX_VLAN_PKT;
+               mbuf->ol_flags |= PKT_RX_VLAN;
                mbuf->vlan_tci = ntohs(pkt->vlan);
        }
        rxq->stats.pkts++;
@@ -1550,7 +1550,7 @@ static int process_responses(struct sge_rspq *q, int budget,
                                }
 
                                if (cpl->vlan_ex) {
-                                       pkt->ol_flags |= PKT_RX_VLAN_PKT;
+                                       pkt->ol_flags |= PKT_RX_VLAN;
                                        pkt->vlan_tci = ntohs(cpl->vlan);
                                }
 
index 0433f3bb1bf7edcc1ee18e95e54d2c531f81cb2f..f7cfff7984fc3ffd267c83dad2126b6bef627667 100644 (file)
@@ -219,7 +219,7 @@ static inline void dpaa_eth_packet_info(struct rte_mbuf *m,
 
        /* Check if Vlan is present */
        if (prs & DPAA_PARSE_VLAN_MASK)
-               m->ol_flags |= PKT_RX_VLAN_PKT;
+               m->ol_flags |= PKT_RX_VLAN;
        /* Packet received without stripping the vlan */
 }
 
index a317f7f0a91a956cc075b07c1b6526bb8261f833..8ecd238ddbe168c081115f470aa86d16aa1fd1ab 100644 (file)
@@ -122,7 +122,7 @@ dpaa2_dev_rx_offload(uint64_t hw_annot_addr, struct rte_mbuf *mbuf)
 
        if (BIT_ISSET_AT_POS(annotation->word3,
                             L2_VLAN_1_PRESENT | L2_VLAN_N_PRESENT))
-               mbuf->ol_flags |= PKT_RX_VLAN_PKT;
+               mbuf->ol_flags |= PKT_RX_VLAN;
 
        if (BIT_ISSET_AT_POS(annotation->word8, DPAA2_ETH_FAS_L3CE))
                mbuf->ol_flags |= PKT_RX_IP_CKSUM_BAD;
index 92b66b0eae83c1f7ebc8cddfe16047e13461a69d..d4d5fe6e154f3785f59edb3e1a644ce0861d0cda 100644 (file)
@@ -675,7 +675,7 @@ rx_desc_status_to_pkt_flags(uint32_t rx_status)
 
        /* Check if VLAN present */
        pkt_flags = ((rx_status & E1000_RXD_STAT_VP) ?
-               PKT_RX_VLAN_PKT | PKT_RX_VLAN_STRIPPED : 0);
+               PKT_RX_VLAN | PKT_RX_VLAN_STRIPPED : 0);
 
        return pkt_flags;
 }
@@ -830,7 +830,7 @@ eth_em_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts,
                rxm->ol_flags = rxm->ol_flags |
                                rx_desc_error_to_pkt_flags(rxd.errors);
 
-               /* Only valid if PKT_RX_VLAN_PKT set in pkt_flags */
+               /* Only valid if PKT_RX_VLAN set in pkt_flags */
                rxm->vlan_tci = rte_le_to_cpu_16(rxd.special);
 
                /*
@@ -1056,7 +1056,7 @@ eth_em_recv_scattered_pkts(void *rx_queue, struct rte_mbuf **rx_pkts,
                first_seg->ol_flags = first_seg->ol_flags |
                                        rx_desc_error_to_pkt_flags(rxd.errors);
 
-               /* Only valid if PKT_RX_VLAN_PKT set in pkt_flags */
+               /* Only valid if PKT_RX_VLAN set in pkt_flags */
                rxm->vlan_tci = rte_le_to_cpu_16(rxd.special);
 
                /* Prefetch data of first segment, if configured to do so. */
index 8a1e5b18eb310cd07debeea4de55accd44032c05..d25ea048d5abed8cb1f0080bfbf88b3d2586b41f 100644 (file)
@@ -785,7 +785,7 @@ rx_desc_status_to_pkt_flags(uint32_t rx_status)
 
        /* Check if VLAN present */
        pkt_flags = ((rx_status & E1000_RXD_STAT_VP) ?
-               PKT_RX_VLAN_PKT | PKT_RX_VLAN_STRIPPED : 0);
+               PKT_RX_VLAN | PKT_RX_VLAN_STRIPPED : 0);
 
 #if defined(RTE_LIBRTE_IEEE1588)
        if (rx_status & E1000_RXD_STAT_TMST)
@@ -946,7 +946,7 @@ eth_igb_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts,
 
                rxm->hash.rss = rxd.wb.lower.hi_dword.rss;
                hlen_type_rss = rte_le_to_cpu_32(rxd.wb.lower.lo_dword.data);
-               /* Only valid if PKT_RX_VLAN_PKT set in pkt_flags */
+               /* Only valid if PKT_RX_VLAN set in pkt_flags */
                rxm->vlan_tci = rte_le_to_cpu_16(rxd.wb.upper.vlan);
 
                pkt_flags = rx_desc_hlen_type_rss_to_pkt_flags(rxq, hlen_type_rss);
@@ -1180,7 +1180,7 @@ eth_igb_recv_scattered_pkts(void *rx_queue, struct rte_mbuf **rx_pkts,
                first_seg->hash.rss = rxd.wb.lower.hi_dword.rss;
 
                /*
-                * The vlan_tci field is only valid when PKT_RX_VLAN_PKT is
+                * The vlan_tci field is only valid when PKT_RX_VLAN is
                 * set in the pkt_flags field.
                 */
                first_seg->vlan_tci = rte_le_to_cpu_16(rxd.wb.upper.vlan);
index a39172f14f9641a0b9347a646839d29e20a70bf7..1d43bde9ab4ef04f627b0e6a0abc492cb201c7aa 100644 (file)
@@ -243,7 +243,7 @@ enic_cq_rx_to_pkt_flags(struct cq_desc *cqd, struct rte_mbuf *mbuf)
 
        /* VLAN STRIPPED flag. The L2 packet type updated here also */
        if (bwflags & CQ_ENET_RQ_DESC_FLAGS_VLAN_STRIPPED) {
-               pkt_flags |= PKT_RX_VLAN_PKT | PKT_RX_VLAN_STRIPPED;
+               pkt_flags |= PKT_RX_VLAN | PKT_RX_VLAN_STRIPPED;
                mbuf->packet_type |= RTE_PTYPE_L2_ETHER;
        } else {
                if (vlan_tci != 0)
index 4e84926f8b30e8e1fb4923e1ead8c05145d8f25d..d6081e4858e38a1f33367571e19c094146b82f56 100644 (file)
@@ -158,10 +158,10 @@ fm10k_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts,
                 * Packets in fm10k device always carry at least one VLAN tag.
                 * For those packets coming in without VLAN tag,
                 * the port default VLAN tag will be used.
-                * So, always PKT_RX_VLAN_PKT flag is set and vlan_tci
+                * So, always PKT_RX_VLAN flag is set and vlan_tci
                 * is valid for each RX packet's mbuf.
                 */
-               mbuf->ol_flags |= PKT_RX_VLAN_PKT;
+               mbuf->ol_flags |= PKT_RX_VLAN;
                mbuf->vlan_tci = desc.w.vlan;
                /**
                 * mbuf->vlan_tci_outer is an idle field in fm10k driver,
@@ -319,10 +319,10 @@ fm10k_recv_scattered_pkts(void *rx_queue, struct rte_mbuf **rx_pkts,
                 * Packets in fm10k device always carry at least one VLAN tag.
                 * For those packets coming in without VLAN tag,
                 * the port default VLAN tag will be used.
-                * So, always PKT_RX_VLAN_PKT flag is set and vlan_tci
+                * So, always PKT_RX_VLAN flag is set and vlan_tci
                 * is valid for each RX packet's mbuf.
                 */
-               first_seg->ol_flags |= PKT_RX_VLAN_PKT;
+               first_seg->ol_flags |= PKT_RX_VLAN;
                first_seg->vlan_tci = desc.w.vlan;
                /**
                 * mbuf->vlan_tci_outer is an idle field in fm10k driver,
index d23bfe9b79ff99a190d88d433cff232524c78bc2..edc4ae16e5b7d4c3fb7a8ba2944a4db19e03fcc5 100644 (file)
@@ -81,8 +81,8 @@ fm10k_desc_to_olflags_v(__m128i descs[4], struct rte_mbuf **rx_pkts)
 
        const __m128i pkttype_msk = _mm_set_epi16(
                        0x0000, 0x0000, 0x0000, 0x0000,
-                       PKT_RX_VLAN_PKT, PKT_RX_VLAN_PKT,
-                       PKT_RX_VLAN_PKT, PKT_RX_VLAN_PKT);
+                       PKT_RX_VLAN, PKT_RX_VLAN,
+                       PKT_RX_VLAN, PKT_RX_VLAN);
 
        /* mask everything except rss type */
        const __m128i rsstype_msk = _mm_set_epi16(
index f21c1c5d21b959adc71749f52e5de841b77aa1e7..904d37f08f4dbb738ed29c9aa869b1c31c5962c5 100644 (file)
@@ -108,7 +108,7 @@ i40e_rxd_to_vlan_tci(struct rte_mbuf *mb, volatile union i40e_rx_desc *rxdp)
 {
        if (rte_le_to_cpu_64(rxdp->wb.qword1.status_error_len) &
                (1 << I40E_RX_DESC_STATUS_L2TAG1P_SHIFT)) {
-               mb->ol_flags |= PKT_RX_VLAN_PKT | PKT_RX_VLAN_STRIPPED;
+               mb->ol_flags |= PKT_RX_VLAN | PKT_RX_VLAN_STRIPPED;
                mb->vlan_tci =
                        rte_le_to_cpu_16(rxdp->wb.qword0.lo_dword.l2tag1);
                PMD_RX_LOG(DEBUG, "Descriptor l2tag1: %u",
index f4036ea287dd86c521052606272aa7cfd3dd8ebc..5ab9445ed3a73a24ba450c87ca6b5e6c56b9339e 100644 (file)
@@ -146,7 +146,7 @@ desc_to_olflags_v(vector unsigned long descs[4], struct rte_mbuf **rx_pkts)
        /* map rss and vlan type to rss hash and vlan flag */
        const vector unsigned char vlan_flags = (vector unsigned char){
                        0, 0, 0, 0,
-                       PKT_RX_VLAN_PKT | PKT_RX_VLAN_STRIPPED, 0, 0, 0,
+                       PKT_RX_VLAN | PKT_RX_VLAN_STRIPPED, 0, 0, 0,
                        0, 0, 0, 0,
                        0, 0, 0, 0};
 
index 694e91f33097af87c15bf89e98e2080f573ec9c3..d0e604068c5b5ac1cb799ad791ef356725860970 100644 (file)
@@ -137,7 +137,7 @@ desc_to_olflags_v(struct i40e_rx_queue *rxq, uint64x2_t descs[4],
        /* map rss and vlan type to rss hash and vlan flag */
        const uint8x16_t vlan_flags = {
                        0, 0, 0, 0,
-                       PKT_RX_VLAN_PKT | PKT_RX_VLAN_STRIPPED, 0, 0, 0,
+                       PKT_RX_VLAN | PKT_RX_VLAN_STRIPPED, 0, 0, 0,
                        0, 0, 0, 0,
                        0, 0, 0, 0};
 
index 779f14e53ededaaa76871cc297694c399fd12300..86e16ddf93ea284854024a14c3be38a62ab00a4c 100644 (file)
@@ -151,7 +151,7 @@ desc_to_olflags_v(struct i40e_rx_queue *rxq, __m128i descs[4],
        /* map rss and vlan type to rss hash and vlan flag */
        const __m128i vlan_flags = _mm_set_epi8(0, 0, 0, 0,
                        0, 0, 0, 0,
-                       0, 0, 0, PKT_RX_VLAN_PKT | PKT_RX_VLAN_STRIPPED,
+                       0, 0, 0, PKT_RX_VLAN | PKT_RX_VLAN_STRIPPED,
                        0, 0, 0, 0);
 
        const __m128i rss_flags = _mm_set_epi8(0, 0, 0, 0,
index f74ff642b9699a71cc637057555b93affa5c035c..dac6a3adc284d90fed29f44590295be49fccf5ec 100644 (file)
@@ -1966,9 +1966,9 @@ ixgbe_vlan_hw_strip_bitmap_set(struct rte_eth_dev *dev, uint16_t queue, bool on)
        rxq = dev->data->rx_queues[queue];
 
        if (on)
-               rxq->vlan_flags = PKT_RX_VLAN_PKT | PKT_RX_VLAN_STRIPPED;
+               rxq->vlan_flags = PKT_RX_VLAN | PKT_RX_VLAN_STRIPPED;
        else
-               rxq->vlan_flags = PKT_RX_VLAN_PKT;
+               rxq->vlan_flags = PKT_RX_VLAN;
 }
 
 static void
index 38a014a92dfd51939daf8a8b3b02ffdce64b19a2..9f66ebf060666fe8bb4e278f768d2e4e62482e67 100644 (file)
@@ -1881,7 +1881,7 @@ ixgbe_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts,
                rxm->port = rxq->port_id;
 
                pkt_info = rte_le_to_cpu_32(rxd.wb.lower.lo_dword.data);
-               /* Only valid if PKT_RX_VLAN_PKT set in pkt_flags */
+               /* Only valid if PKT_RX_VLAN set in pkt_flags */
                rxm->vlan_tci = rte_le_to_cpu_16(rxd.wb.upper.vlan);
 
                pkt_flags = rx_desc_status_to_pkt_flags(staterr, vlan_flags);
@@ -1972,7 +1972,7 @@ ixgbe_fill_cluster_head_buf(
 
        head->port = rxq->port_id;
 
-       /* The vlan_tci field is only valid when PKT_RX_VLAN_PKT is
+       /* The vlan_tci field is only valid when PKT_RX_VLAN is
         * set in the pkt_flags field.
         */
        head->vlan_tci = rte_le_to_cpu_16(desc->wb.upper.vlan);
index 44de1caac6b8e362211575a9d4ee24abb24b9d69..18e3d199f702b489bb58923b8068de73f825988d 100644 (file)
@@ -126,8 +126,8 @@ desc_to_olflags_v(uint8x16x2_t sterr_tmp1, uint8x16x2_t sterr_tmp2,
        } vol;
 
        const uint8x16_t pkttype_msk = {
-                       PKT_RX_VLAN_PKT, PKT_RX_VLAN_PKT,
-                       PKT_RX_VLAN_PKT, PKT_RX_VLAN_PKT,
+                       PKT_RX_VLAN, PKT_RX_VLAN,
+                       PKT_RX_VLAN, PKT_RX_VLAN,
                        0x00, 0x00, 0x00, 0x00,
                        0x00, 0x00, 0x00, 0x00,
                        0x00, 0x00, 0x00, 0x00};
index b65220f1bb1cb49cecb9c05df8abf0a6e7c54b31..6fe0d850f50a27cddbdca681457039a3ef4b3a0b 100644 (file)
@@ -451,7 +451,7 @@ _recv_raw_pkts_vec(struct ixgbe_rx_queue *rxq, struct rte_mbuf **rx_pkts,
        sw_ring = &rxq->sw_ring[rxq->rx_tail];
 
        /* ensure these 2 flags are in the lower 8 bits */
-       RTE_BUILD_BUG_ON((PKT_RX_VLAN_PKT | PKT_RX_VLAN_STRIPPED) > UINT8_MAX);
+       RTE_BUILD_BUG_ON((PKT_RX_VLAN | PKT_RX_VLAN_STRIPPED) > UINT8_MAX);
        vlan_flags = rxq->vlan_flags & UINT8_MAX;
 
        /* A. load 4 packet in one loop
index 67e7e06393e90cafdaa2a48aac7874a977b645a2..af0a75546280dbdc50fe5e0f7e53f98731827d7c 100644 (file)
@@ -1884,7 +1884,7 @@ mlx5_rx_burst(void *dpdk_rxq, struct rte_mbuf **pkts, uint16_t pkts_n)
                        if (rxq->vlan_strip &&
                            (cqe->hdr_type_etc &
                             rte_cpu_to_be_16(MLX5_CQE_VLAN_STRIPPED))) {
-                               pkt->ol_flags |= PKT_RX_VLAN_PKT |
+                               pkt->ol_flags |= PKT_RX_VLAN |
                                        PKT_RX_VLAN_STRIPPED;
                                pkt->vlan_tci =
                                        rte_be_to_cpu_16(cqe->vlan_info);
index 4cb7f28892924cb6b9633da01c8d2f0ed3aab688..da3c96f4a8870800964b041d6c687d6849a41479 100644 (file)
@@ -572,7 +572,7 @@ rxq_cq_to_ptype_oflags_v(struct mlx5_rxq_data *rxq,
        const uint32x4_t ptype_ol_mask = { 0x106, 0x106, 0x106, 0x106 };
        const uint8x16_t cv_flag_sel = {
                0,
-               (uint8_t)(PKT_RX_VLAN_PKT | PKT_RX_VLAN_STRIPPED),
+               (uint8_t)(PKT_RX_VLAN | PKT_RX_VLAN_STRIPPED),
                (uint8_t)(PKT_RX_IP_CKSUM_GOOD >> 1),
                0,
                (uint8_t)(PKT_RX_L4_CKSUM_GOOD >> 1),
@@ -582,7 +582,7 @@ rxq_cq_to_ptype_oflags_v(struct mlx5_rxq_data *rxq,
        };
        const uint32x4_t cv_mask =
                vdupq_n_u32(PKT_RX_IP_CKSUM_GOOD | PKT_RX_L4_CKSUM_GOOD |
-                           PKT_RX_VLAN_PKT | PKT_RX_VLAN_STRIPPED);
+                           PKT_RX_VLAN | PKT_RX_VLAN_STRIPPED);
        const uint64x1_t mbuf_init = vld1_u64(&rxq->mbuf_initializer);
        const uint64x1_t r32_mask = vcreate_u64(0xffffffff);
        uint64x2_t rearm0, rearm1, rearm2, rearm3;
index e9819b7620d84b6300922d06a967eebf1ace579c..95e41d51af996cf32cffea58c7da535be6378cbe 100644 (file)
@@ -563,17 +563,17 @@ rxq_cq_to_ptype_oflags_v(struct mlx5_rxq_data *rxq, __m128i cqes[4],
                             (uint8_t)(PKT_RX_L4_CKSUM_GOOD >> 1),
                             0,
                             (uint8_t)(PKT_RX_IP_CKSUM_GOOD >> 1),
-                            (uint8_t)(PKT_RX_VLAN_PKT | PKT_RX_VLAN_STRIPPED),
+                            (uint8_t)(PKT_RX_VLAN | PKT_RX_VLAN_STRIPPED),
                             0);
        const __m128i cv_mask =
                _mm_set_epi32(PKT_RX_IP_CKSUM_GOOD | PKT_RX_L4_CKSUM_GOOD |
-                             PKT_RX_VLAN_PKT | PKT_RX_VLAN_STRIPPED,
+                             PKT_RX_VLAN | PKT_RX_VLAN_STRIPPED,
                              PKT_RX_IP_CKSUM_GOOD | PKT_RX_L4_CKSUM_GOOD |
-                             PKT_RX_VLAN_PKT | PKT_RX_VLAN_STRIPPED,
+                             PKT_RX_VLAN | PKT_RX_VLAN_STRIPPED,
                              PKT_RX_IP_CKSUM_GOOD | PKT_RX_L4_CKSUM_GOOD |
-                             PKT_RX_VLAN_PKT | PKT_RX_VLAN_STRIPPED,
+                             PKT_RX_VLAN | PKT_RX_VLAN_STRIPPED,
                              PKT_RX_IP_CKSUM_GOOD | PKT_RX_L4_CKSUM_GOOD |
-                             PKT_RX_VLAN_PKT | PKT_RX_VLAN_STRIPPED);
+                             PKT_RX_VLAN | PKT_RX_VLAN_STRIPPED);
        const __m128i mbuf_init =
                _mm_loadl_epi64((__m128i *)&rxq->mbuf_initializer);
        __m128i rearm0, rearm1, rearm2, rearm3;
index b2ad20ee1d3c0a551a005a357054f55a7c9877c9..703c96efc611884a14eb04ec94506a019b7e7b15 100644 (file)
@@ -2067,7 +2067,7 @@ nfp_net_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts)
                if ((rxds->rxd.flags & PCIE_DESC_RX_VLAN) &&
                    (hw->ctrl & NFP_NET_CFG_CTRL_RXVLAN)) {
                        mb->vlan_tci = rte_cpu_to_le_32(rxds->rxd.vlan);
-                       mb->ol_flags |= PKT_RX_VLAN_PKT | PKT_RX_VLAN_STRIPPED;
+                       mb->ol_flags |= PKT_RX_VLAN | PKT_RX_VLAN_STRIPPED;
                }
 
                /* Adding the mbuff to the mbuff array passed by the app */
index aba51aba638f1ecb79c677f82710a39ccd72510a..49de13b489062189bfecdc48a7699f3e32cd0be2 100644 (file)
@@ -1450,7 +1450,7 @@ qede_recv_pkts(void *p_rxq, struct rte_mbuf **rx_pkts, uint16_t nb_pkts)
                if (CQE_HAS_VLAN(parse_flag) ||
                    CQE_HAS_OUTER_VLAN(parse_flag)) {
                        /* Note: FW doesn't indicate Q-in-Q packet */
-                       ol_flags |= PKT_RX_VLAN_PKT;
+                       ol_flags |= PKT_RX_VLAN;
                        if (qdev->vlan_strip_flg) {
                                ol_flags |= PKT_RX_VLAN_STRIPPED;
                                rx_mb->vlan_tci = vlan_tci;
index c9a2df3f4d62f30a954eb290f14a86469414a56f..01c85f138dcdedd14b23a6df8ecc71343bfccb5e 100644 (file)
@@ -847,7 +847,8 @@ vmxnet3_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts)
 
                        /* Check for hardware stripped VLAN tag */
                        if (rcd->ts) {
-                               start->ol_flags |= (PKT_RX_VLAN_PKT | PKT_RX_VLAN_STRIPPED);
+                               start->ol_flags |= (PKT_RX_VLAN |
+                                               PKT_RX_VLAN_STRIPPED);
                                start->vlan_tci = rte_le_to_cpu_16((uint16_t)rcd->tci);
                        }
 
index 6659261ef357b1d8959f42992f5049d44a039726..051dd0f049ac00b7ec7de98191b4c0b92eaa2611 100644 (file)
@@ -308,7 +308,7 @@ const void *__rte_pktmbuf_read(const struct rte_mbuf *m, uint32_t off,
 const char *rte_get_rx_ol_flag_name(uint64_t mask)
 {
        switch (mask) {
-       case PKT_RX_VLAN_PKT: return "PKT_RX_VLAN_PKT";
+       case PKT_RX_VLAN: return "PKT_RX_VLAN";
        case PKT_RX_RSS_HASH: return "PKT_RX_RSS_HASH";
        case PKT_RX_FDIR: return "PKT_RX_FDIR";
        case PKT_RX_L4_CKSUM_BAD: return "PKT_RX_L4_CKSUM_BAD";
@@ -341,7 +341,7 @@ int
 rte_get_rx_ol_flag_list(uint64_t mask, char *buf, size_t buflen)
 {
        const struct flag_mask rx_flags[] = {
-               { PKT_RX_VLAN_PKT, PKT_RX_VLAN_PKT, NULL },
+               { PKT_RX_VLAN, PKT_RX_VLAN, NULL },
                { PKT_RX_RSS_HASH, PKT_RX_RSS_HASH, NULL },
                { PKT_RX_FDIR, PKT_RX_FDIR, NULL },
                { PKT_RX_L4_CKSUM_BAD, PKT_RX_L4_CKSUM_MASK, NULL },
@@ -363,6 +363,7 @@ rte_get_rx_ol_flag_list(uint64_t mask, char *buf, size_t buflen)
                { PKT_RX_TIMESTAMP, PKT_RX_TIMESTAMP, NULL },
                { PKT_RX_SEC_OFFLOAD, PKT_RX_SEC_OFFLOAD, NULL },
                { PKT_RX_SEC_OFFLOAD_FAILED, PKT_RX_SEC_OFFLOAD_FAILED, NULL },
+               { PKT_RX_QINQ, PKT_RX_QINQ, NULL },
        };
        const char *name;
        unsigned int i;
index d88f8fe77b32cc2a00580c1cf3dd8f766c24618a..8aac0278dcbd4f346da95b91be7328bc028b6331 100644 (file)
@@ -89,12 +89,13 @@ extern "C" {
  */
 
 /**
- * RX packet is a 802.1q VLAN packet. This flag was set by PMDs when
- * the packet is recognized as a VLAN, but the behavior between PMDs
- * was not the same. This flag is kept for some time to avoid breaking
- * applications and should be replaced by PKT_RX_VLAN_STRIPPED.
+ * The RX packet is a 802.1q VLAN packet, and the tci has been
+ * saved in in mbuf->vlan_tci.
+ * If the flag PKT_RX_VLAN_STRIPPED is also present, the VLAN
+ * header has been stripped from mbuf data, else it is still
+ * present.
  */
-#define PKT_RX_VLAN_PKT      (1ULL << 0)
+#define PKT_RX_VLAN          (1ULL << 0)
 
 #define PKT_RX_RSS_HASH      (1ULL << 1)  /**< RX packet with RSS hash result. */
 #define PKT_RX_FDIR          (1ULL << 2)  /**< RX packet with FDIR match indicate. */
@@ -123,6 +124,7 @@ extern "C" {
  * A vlan has been stripped by the hardware and its tci is saved in
  * mbuf->vlan_tci. This can only happen if vlan stripping is enabled
  * in the RX configuration of the PMD.
+ * When PKT_RX_VLAN_STRIPPED is set, PKT_RX_VLAN must also be set.
  */
 #define PKT_RX_VLAN_STRIPPED (1ULL << 6)
 
@@ -165,18 +167,12 @@ extern "C" {
  * The 2 vlans have been stripped by the hardware and their tci are
  * saved in mbuf->vlan_tci (inner) and mbuf->vlan_tci_outer (outer).
  * This can only happen if vlan stripping is enabled in the RX
- * configuration of the PMD. If this flag is set, PKT_RX_VLAN_STRIPPED
- * must also be set.
+ * configuration of the PMD. If this flag is set,
+ * When PKT_RX_QINQ_STRIPPED is set, the flags (PKT_RX_VLAN |
+ * PKT_RX_VLAN_STRIPPED | PKT_RX_QINQ) must also be set.
  */
 #define PKT_RX_QINQ_STRIPPED (1ULL << 15)
 
-/**
- * Deprecated.
- * RX packet with double VLAN stripped.
- * This flag is replaced by PKT_RX_QINQ_STRIPPED.
- */
-#define PKT_RX_QINQ_PKT      PKT_RX_QINQ_STRIPPED
-
 /**
  * When packets are coalesced by a hardware or virtual driver, this flag
  * can be set in the RX mbuf, meaning that the m->tso_segsz field is
@@ -199,6 +195,15 @@ extern "C" {
  */
 #define PKT_RX_SEC_OFFLOAD_FAILED      (1ULL << 19)
 
+/**
+ * The RX packet is a double VLAN, and the outer tci has been
+ * saved in in mbuf->vlan_tci_outer.
+ * If the flag PKT_RX_QINQ_STRIPPED is also present, both VLANs
+ * headers have been stripped from mbuf data, else they are still
+ * present.
+ */
+#define PKT_RX_QINQ          (1ULL << 20)
+
 /* add new RX flags here */
 
 /* add new TX flags here */
index 917d42a1a17c7e74b55f397672dd1c722d814cae..06d7b486cbbcb1e10fd12a52f16b406e1359e3f8 100644 (file)
@@ -358,7 +358,7 @@ static inline int rte_vlan_strip(struct rte_mbuf *m)
                return -1;
 
        struct vlan_hdr *vh = (struct vlan_hdr *)(eh + 1);
-       m->ol_flags |= PKT_RX_VLAN_PKT | PKT_RX_VLAN_STRIPPED;
+       m->ol_flags |= PKT_RX_VLAN | PKT_RX_VLAN_STRIPPED;
        m->vlan_tci = rte_be_to_cpu_16(vh->vlan_tci);
 
        /* Copy ether header over rather than moving whole packet */