avf dpdk: fix incorrect handling of IPv6 src address in flow 88/38188/2
authorTing Xu <ting.xu@intel.com>
Tue, 13 Dec 2022 03:10:54 +0000 (03:10 +0000)
committerDave Wallace <dwallacelf@gmail.com>
Fri, 3 Mar 2023 13:01:32 +0000 (13:01 +0000)
In current flow creating process in native avf and dpdk-plugins, when
parsing the input arguments, it does not copy IPv6 src address correctly,
so that IPv6 src address will not be configured in any flow rule, and
any packet with the same address will not be matched.

Type: fix

Signed-off-by: Ting Xu <ting.xu@intel.com>
Change-Id: Ic957c57e3e1488b74e6281f4ed1df7fd491af35c
(cherry picked from commit 11d9d02459ee3ac6ae402dd565aabbdfeea2c4fb)

src/plugins/avf/avf_fdir_lib.c
src/plugins/dpdk/device/flow.c

index b16c09f..efb67cb 100644 (file)
@@ -257,9 +257,9 @@ avf_fdir_rcfg_set_field (struct avf_fdir_conf *rcfg, int layer,
            {
              rcfg->input_set |= AVF_INSET_IPV6_DST;
              VIRTCHNL_ADD_PROTO_HDR_FIELD_BIT (hdr, IPV6, DST);
-
-             clib_memcpy (hdr->buffer, ipv6_spec, sizeof (*ipv6_spec));
            }
+
+         clib_memcpy (hdr->buffer, ipv6_spec, sizeof (*ipv6_spec));
        }
 
       break;
index 9f765a6..c47cb65 100644 (file)
@@ -319,7 +319,8 @@ dpdk_flow_add (dpdk_device_t * xd, vnet_flow_t * f, dpdk_flow_entry_t * fe)
 
       if ((ip6_ptr->src_addr.mask.as_u64[0] == 0) &&
          (ip6_ptr->src_addr.mask.as_u64[1] == 0) &&
-         (!ip6_ptr->protocol.mask))
+         (ip6_ptr->dst_addr.mask.as_u64[0] == 0) &&
+         (ip6_ptr->dst_addr.mask.as_u64[1] == 0) && (!ip6_ptr->protocol.mask))
        {
          item->spec = NULL;
          item->mask = NULL;