net/enic: flow API mark and flag support
authorJohn Daley <johndale@cisco.com>
Wed, 17 May 2017 22:38:07 +0000 (15:38 -0700)
committerFerruh Yigit <ferruh.yigit@intel.com>
Mon, 12 Jun 2017 09:41:26 +0000 (10:41 +0100)
For VICs with filter tagging, support the MARK and FLAG actions
by setting appropriate mbuf ol_flags if there is a filter match.

Signed-off-by: John Daley <johndale@cisco.com>
Reviewed-by: Nelson Escobar <neescoba@cisco.com>
drivers/net/enic/enic_rxtx.c

index ba0cfd0..5867acf 100644 (file)
@@ -253,8 +253,20 @@ enic_cq_rx_to_pkt_flags(struct cq_desc *cqd, struct rte_mbuf *mbuf)
        }
        mbuf->vlan_tci = vlan_tci;
 
-       /* RSS flag */
-       if (enic_cq_rx_desc_rss_type(cqrd)) {
+       if ((cqd->type_color & CQ_DESC_TYPE_MASK) == CQ_DESC_TYPE_CLASSIFIER) {
+               struct cq_enet_rq_clsf_desc *clsf_cqd;
+               uint16_t filter_id;
+               clsf_cqd = (struct cq_enet_rq_clsf_desc *)cqd;
+               filter_id = clsf_cqd->filter_id;
+               if (filter_id) {
+                       pkt_flags |= PKT_RX_FDIR;
+                       if (filter_id != ENIC_MAGIC_FILTER_ID) {
+                               mbuf->hash.fdir.hi = clsf_cqd->filter_id;
+                               pkt_flags |= PKT_RX_FDIR_ID;
+                       }
+               }
+       } else if (enic_cq_rx_desc_rss_type(cqrd)) {
+               /* RSS flag */
                pkt_flags |= PKT_RX_RSS_HASH;
                mbuf->hash.rss = enic_cq_rx_desc_rss_hash(cqrd);
        }