DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] net/mlx4: support flow w/o ETH spec and with VLAN
@ 2018-12-20  7:15 Dekel Peled
  2018-12-25 12:06 ` Matan Azrad
  0 siblings, 1 reply; 3+ messages in thread
From: Dekel Peled @ 2018-12-20  7:15 UTC (permalink / raw)
  To: matan, shahafs; +Cc: dev, orika, dekelp

This patch adds to MLX4 PMD the option to set flow rules
with wildcard 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>
---
 drivers/net/mlx4/mlx4_flow.c | 10 +++++++---
 1 file 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 @@ struct mlx4_drop {
 	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 @@ struct mlx4_drop {
 		.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 @@ struct mlx4_drop {
 	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,
-- 
1.8.3.1

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dpdk-dev] [PATCH] net/mlx4: support flow w/o ETH spec and with VLAN
  2018-12-20  7:15 [dpdk-dev] [PATCH] net/mlx4: support flow w/o ETH spec and with VLAN Dekel Peled
@ 2018-12-25 12:06 ` Matan Azrad
  2019-01-01  5:43   ` Shahaf Shuler
  0 siblings, 1 reply; 3+ messages in thread
From: Matan Azrad @ 2018-12-25 12:06 UTC (permalink / raw)
  To: Dekel Peled, Shahaf Shuler; +Cc: dev, Ori Kam, Dekel Peled



From: Dekel Peled 
> This patch adds to MLX4 PMD the option to set flow rules with wildcard ether
> MAC and specific VLAN ID.

with wildcard => with empty


> 
> 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>
Besides that, 
Acked-by: Matan Azrad <matan@mellanox.com>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dpdk-dev] [PATCH] net/mlx4: support flow w/o ETH spec and with VLAN
  2018-12-25 12:06 ` Matan Azrad
@ 2019-01-01  5:43   ` Shahaf Shuler
  0 siblings, 0 replies; 3+ messages in thread
From: Shahaf Shuler @ 2019-01-01  5:43 UTC (permalink / raw)
  To: Matan Azrad, Dekel Peled; +Cc: dev, Ori Kam, Dekel Peled

Tuesday, December 25, 2018 2:06 PM, Matan Azrad:
> Subject: RE: [PATCH] net/mlx4: support flow w/o ETH spec and with VLAN
> 
> 
> 
> From: Dekel Peled
> > This patch adds to MLX4 PMD the option to set flow rules with wildcard
> > ether MAC and specific VLAN ID.
> 
> with wildcard => with empty
> 
> 
> >
> > 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>
> Besides that,
> Acked-by: Matan Azrad <matan@mellanox.com>

Applied to next-net-mlx, with the cosmetic commit log change. Thanks. 

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-01-01  5:43 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-20  7:15 [dpdk-dev] [PATCH] net/mlx4: support flow w/o ETH spec and with VLAN Dekel Peled
2018-12-25 12:06 ` Matan Azrad
2019-01-01  5:43   ` Shahaf Shuler

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).