summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDekel Peled <dekelp@mellanox.com>2018-12-20 09:15:34 +0200
committerFerruh Yigit <ferruh.yigit@intel.com>2019-01-03 12:56:43 +0100
commitc0d2392631563a148111e76de25a02e4668762bb (patch)
tree3594eb5433fbde25adffb554127baac324b18467
parent4bb14c83df952bdb54a735873d4a5347b38e1117 (diff)
downloaddpdk-c0d2392631563a148111e76de25a02e4668762bb.zip
dpdk-c0d2392631563a148111e76de25a02e4668762bb.tar.gz
dpdk-c0d2392631563a148111e76de25a02e4668762bb.tar.xz
net/mlx4: support flow w/o ETH spec and with VLAN
This patch adds to MLX4 PMD the option to set flow rules with empty ether MAC and specific VLAN ID. Note that this fix works with 1. CX-3 FW 2.42.5016 or higher. 2. mlxconfig configuration STEER_FORCE_VLAN set to 1. Signed-off-by: Dekel Peled <dekelp@mellanox.com> Acked-by: Matan Azrad <matan@mellanox.com>
-rw-r--r--drivers/net/mlx4/mlx4_flow.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/drivers/net/mlx4/mlx4_flow.c b/drivers/net/mlx4/mlx4_flow.c
index b40e7e5..6c927a6 100644
--- a/drivers/net/mlx4/mlx4_flow.c
+++ b/drivers/net/mlx4/mlx4_flow.c
@@ -205,9 +205,7 @@ mlx4_flow_merge_eth(struct rte_flow *flow,
const char *msg;
unsigned int i;
- if (!mask) {
- flow->promisc = 1;
- } else {
+ if (mask) {
uint32_t sum_dst = 0;
uint32_t sum_src = 0;
@@ -249,6 +247,10 @@ mlx4_flow_merge_eth(struct rte_flow *flow,
.type = IBV_FLOW_SPEC_ETH,
.size = sizeof(*eth),
};
+ if (!mask) {
+ flow->ibv_attr->type = IBV_FLOW_ATTR_ALL_DEFAULT;
+ return 0;
+ }
memcpy(eth->val.dst_mac, spec->dst.addr_bytes, ETHER_ADDR_LEN);
memcpy(eth->mask.dst_mac, mask->dst.addr_bytes, ETHER_ADDR_LEN);
/* Remove unwanted bits from values. */
@@ -311,6 +313,8 @@ mlx4_flow_merge_vlan(struct rte_flow *flow,
eth->val.vlan_tag = spec->tci;
eth->mask.vlan_tag = mask->tci;
eth->val.vlan_tag &= eth->mask.vlan_tag;
+ if (flow->ibv_attr->type == IBV_FLOW_ATTR_ALL_DEFAULT)
+ flow->ibv_attr->type = IBV_FLOW_ATTR_NORMAL;
return 0;
error:
return rte_flow_error_set(error, ENOTSUP, RTE_FLOW_ERROR_TYPE_ITEM,