net/qede: use new stripped VLAN mbuf flags
authorHarish Patil <harish.patil@cavium.com>
Tue, 25 Apr 2017 07:28:40 +0000 (00:28 -0700)
committerFerruh Yigit <ferruh.yigit@intel.com>
Fri, 28 Apr 2017 12:46:18 +0000 (14:46 +0200)
Use new mbuf flags PKT_RX_VLAN_STRIPPED and PKT_RX_QINQ_STRIPPED
introduced by the patch:
commit b37b528d957c ("mbuf: add new Rx flags for stripped VLAN")

Signed-off-by: Harish Patil <harish.patil@cavium.com>
drivers/net/qede/qede_ethdev.c
drivers/net/qede/qede_ethdev.h
drivers/net/qede/qede_rxtx.c

index b31a7df..fdb6bb1 100644 (file)
@@ -604,6 +604,7 @@ static int qede_vlan_stripping(struct rte_eth_dev *eth_dev, bool set_stripping)
                DP_ERR(edev, "Update V-PORT failed %d\n", rc);
                return rc;
        }
+       qdev->vlan_strip_flg = set_stripping;
 
        return 0;
 }
index f5549c2..6d5e616 100644 (file)
@@ -211,6 +211,7 @@ struct qede_dev {
        uint16_t num_tunn_filters;
        uint16_t vxlan_filter_type;
        struct qede_fdir_info fdir_info;
+       bool vlan_strip_flg;
        char drv_ver[QEDE_PMD_DRV_VER_STR_SIZE];
 };
 
index b180c0b..191d8af 100644 (file)
@@ -1132,11 +1132,17 @@ qede_recv_pkts(void *p_rxq, struct rte_mbuf **rx_pkts, uint16_t nb_pkts)
 
                if (CQE_HAS_VLAN(parse_flag)) {
                        ol_flags |= PKT_RX_VLAN_PKT;
-                       rx_mb->vlan_tci = vlan_tci;
+                       if (qdev->vlan_strip_flg) {
+                               ol_flags |= PKT_RX_VLAN_STRIPPED;
+                               rx_mb->vlan_tci = vlan_tci;
+                       }
                }
                if (CQE_HAS_OUTER_VLAN(parse_flag)) {
                        ol_flags |= PKT_RX_QINQ_PKT;
-                       rx_mb->vlan_tci = vlan_tci;
+                       if (qdev->vlan_strip_flg) {
+                               rx_mb->vlan_tci = vlan_tci;
+                               ol_flags |= PKT_RX_QINQ_STRIPPED;
+                       }
                        rx_mb->vlan_tci_outer = 0;
                }
                /* RSS Hash */