On 8/24/2021 6:08 PM, Finn, Emma wrote:
External email: Use caution opening links or attachments


-----Original Message-----
From: Eli Britstein <el...@nvidia.com>
Sent: Monday 16 August 2021 14:55
To: d...@openvswitch.org; Ilya Maximets <i.maxim...@ovn.org>
Cc: Finn, Emma <emma.f...@intel.com>; Stokes, Ian <ian.sto...@intel.com>; Sriharsha Basavapatna 
<sriharsha.basavapa...@broadcom.com>; Gaetan Rivet <gaet...@nvidia.com>; Majd Dibbiny 
<m...@nvidia.com>; Eli Britstein <el...@nvidia.com>; Salem Sol <sal...@nvidia.com>
Subject: [PATCH V3 1/2] netdev-offload-dpdk: Use has_vlan match attribute

DPDK 20.11 introduced an ability to specify existance/non-existance of VLAN tag 
by [1].
Use this attribute.

[1]: 09315fc83861 ("ethdev: add VLAN attributes to ethernet and VLAN items")

Signed-off-by: Eli Britstein <el...@nvidia.com>
Reviewed-by: Salem Sol <sal...@nvidia.com>

Hi Eli,

I tested this but currently we don't have support in the i40e pmd for the 
has_vlan match attribute and with these patches it is breaking offload for VLAN 
packets on Intel devices.

Hi Emma,

Thanks for testing.

Is adding such support in your plans?

How do you suggest to proceed? It is needed in order to fix OVS bug.

Thanks,

Eli


Thanks,
Emma
---
  lib/netdev-offload-dpdk.c | 16 ++++++++++++++++
  1 file changed, 16 insertions(+)

diff --git a/lib/netdev-offload-dpdk.c b/lib/netdev-offload-dpdk.c index 
f6706ee0c..28c4ba276 100644
--- a/lib/netdev-offload-dpdk.c
+++ b/lib/netdev-offload-dpdk.c
@@ -210,6 +210,8 @@ dump_flow_pattern(struct ds *s,

          ds_put_cstr(s, "eth ");
          if (eth_spec) {
+            uint32_t has_vlan_mask;
+
              if (!eth_mask) {
                  eth_mask = &rte_flow_item_eth_mask;
              }
@@ -222,6 +224,9 @@ dump_flow_pattern(struct ds *s,
              DUMP_PATTERN_ITEM(eth_mask->type, "type", "0x%04"PRIx16,
                                ntohs(eth_spec->type),
                                ntohs(eth_mask->type));
+            has_vlan_mask = eth_mask->has_vlan ? UINT32_MAX : 0;
+            DUMP_PATTERN_ITEM(has_vlan_mask, "has_vlan", "%d",
+                              eth_spec->has_vlan, eth_mask->has_vlan);
          }
          ds_put_cstr(s, "/ ");
      } else if (item->type == RTE_FLOW_ITEM_TYPE_VLAN) { @@ -1047,6 +1052,7 @@ 
parse_flow_match(struct netdev *netdev,
                   struct flow_patterns *patterns,
                   struct match *match)
  {
+    struct rte_flow_item_eth *eth_spec = NULL, *eth_mask = NULL;
      struct flow *consumed_masks;
      uint8_t proto = 0;

@@ -1092,6 +1098,11 @@ parse_flow_match(struct netdev *netdev,
          memset(&consumed_masks->dl_src, 0, sizeof consumed_masks->dl_src);
          consumed_masks->dl_type = 0;

+        spec->has_vlan = 0;
+        mask->has_vlan = 1;
+        eth_spec = spec;
+        eth_mask = mask;
+
          add_flow_pattern(patterns, RTE_FLOW_ITEM_TYPE_ETH, spec, mask);
      }

@@ -1108,6 +1119,11 @@ parse_flow_match(struct netdev *netdev,
          /* Match any protocols. */
          mask->inner_type = 0;

+        if (eth_spec && eth_mask) {
+            eth_spec->has_vlan = 1;
+            eth_mask->has_vlan = 1;
+        }
+
          add_flow_pattern(patterns, RTE_FLOW_ITEM_TYPE_VLAN, spec, mask);
      }
      /* For untagged matching match->wc.masks.vlans[0].tci is 0xFFFF and
--
2.28.0.2311.g225365fb51

_______________________________________________
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to