summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEli Britstein <elibr@mellanox.com>2020-07-08 06:38:23 +0000
committerIlya Maximets <i.maximets@ovn.org>2020-07-09 08:57:50 +0200
commit72c6f813a29942398a4284d3416fe36cb059a2c7 (patch)
treed9537f3298eae16cbc94b52e0fb07d86640d3038
parentb009c875dbda1592eb2d52b5d0fe6b31133c20a0 (diff)
downloadopenvswitch-72c6f813a29942398a4284d3416fe36cb059a2c7.tar.gz
netdev-offload-dpdk: Fix Ethernet matching for type only.
For OVS rule of the form "eth type is 0x1234 / end", rule is offloaded in the form of "eth / end", which is incorrect. Fix it. Fixes: e8a2b5bf92bb ("netdev-dpdk: implement flow offload with rte flow") Signed-off-by: Eli Britstein <elibr@mellanox.com> Reviewed-by: Roni Bar Yanai <roniba@mellanox.com> Acked-by: Sriharsha Basavapatna <sriharsha.basavapatna@broadcom.com> Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
-rw-r--r--lib/netdev-dpdk.c12
1 files changed, 2 insertions, 10 deletions
diff --git a/lib/netdev-dpdk.c b/lib/netdev-dpdk.c
index 676cca522..14374f12d 100644
--- a/lib/netdev-dpdk.c
+++ b/lib/netdev-dpdk.c
@@ -4600,7 +4600,8 @@ netdev_dpdk_add_rte_flow_offload(struct netdev *netdev,
struct rte_flow_item_eth eth_mask;
memset(&eth_spec, 0, sizeof(eth_spec));
memset(&eth_mask, 0, sizeof(eth_mask));
- if (!eth_addr_is_zero(match->wc.masks.dl_src) ||
+ if (match->wc.masks.dl_type ||
+ !eth_addr_is_zero(match->wc.masks.dl_src) ||
!eth_addr_is_zero(match->wc.masks.dl_dst)) {
rte_memcpy(&eth_spec.dst, &match->flow.dl_dst, sizeof(eth_spec.dst));
rte_memcpy(&eth_spec.src, &match->flow.dl_src, sizeof(eth_spec.src));
@@ -4614,15 +4615,6 @@ netdev_dpdk_add_rte_flow_offload(struct netdev *netdev,
add_flow_pattern(&patterns, RTE_FLOW_ITEM_TYPE_ETH,
&eth_spec, &eth_mask);
- } else {
- /*
- * If user specifies a flow (like UDP flow) without L2 patterns,
- * OVS will at least set the dl_type. Normally, it's enough to
- * create an eth pattern just with it. Unluckily, some Intel's
- * NIC (such as XL710) doesn't support that. Below is a workaround,
- * which simply matches any L2 pkts.
- */
- add_flow_pattern(&patterns, RTE_FLOW_ITEM_TYPE_ETH, NULL, NULL);
}
/* VLAN */