vFW: ARPICMP packets shouldn't be processed by vFW 53/37253/1
authorAnand B Jyoti <anand.b.jyoti@intel.com>
Wed, 12 Jul 2017 02:42:31 +0000 (08:12 +0530)
committerAnand B Jyoti <anand.b.jyoti@intel.com>
Wed, 12 Jul 2017 02:42:31 +0000 (08:12 +0530)
JIRA: SAMPLEVNF-52

The stats counters are wrong when ARPICMP pkts are received by VFW
pipeline in case of HWLB mode as the vFW is trying to process
these pkts.

The ARPICMP pkts shouldn't be processed by VFW pipeline, as these
packets are processed by ARPICMP pipeline in case of HWLB.

Change-Id: Iefe947a9f63fd4943f37900582656a9a4f957f5d
Signed-off-by: Anand B Jyoti <anand.b.jyoti@intel.com>
VNFs/vFW/pipeline/pipeline_vfw_be.c

index 7c532ed..97508a7 100644 (file)
@@ -599,9 +599,18 @@ rte_vfw_ipv4_packet_filter_and_process(struct rte_mbuf **pkts,
               /* remove this packet from remaining list */
               pkts_to_process &= ~pkt_mask;
 
-              if (enable_hwlb)
-                     if (!check_arp_icmp(pkt, vfw_pipe))
-                            discard = 1;
+             if (enable_hwlb) {
+                     if (!check_arp_icmp(pkt, vfw_pipe)) {
+                             /* make next packet data the current */
+                             pkts_to_process = next_pkts_to_process;
+                             pos = next_pos;
+                             pkt = next_pkt;
+                             ihdr4 = next_iphdr;
+                             pkt_mask = 1LLU << pos;
+                             valid_packets &= ~pkt_mask;
+                             continue;
+                    }
+             }
 
               uint32_t packet_length = rte_pktmbuf_pkt_len(pkt);
 
@@ -749,9 +758,18 @@ rte_vfw_ipv6_packet_filter_and_process(struct rte_mbuf **pkts,
               /* remove this packet from remaining list */
               pkts_to_process &= ~pkt_mask;
 
-              if (enable_hwlb)
-                     if (!check_arp_icmp(pkt, vfw_pipe))
-                            discard = 1;
+              if (enable_hwlb) {
+                     if (!check_arp_icmp(pkt, vfw_pipe)) {
+                            /* make next packet data the current */
+                            pkts_to_process = next_pkts_to_process;
+                            pos = next_pos;
+                            pkt = next_pkt;
+                            ihdr6 = next_iphdr;
+                            pkt_mask = 1LLU << pos;
+                            valid_packets &= ~pkt_mask;
+                            continue;
+                    }
+             }
 
               uint32_t packet_length = rte_pktmbuf_pkt_len(pkt);