netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net 0/2] flow_offload: fix CVLAN support
@ 2019-05-14 20:16 Edward Cree
  2019-05-14 20:18 ` [PATCH net 1/2] flow_offload: support CVLAN match Edward Cree
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Edward Cree @ 2019-05-14 20:16 UTC (permalink / raw)
  To: David Miller; +Cc: Jiri Pirko, Pablo Neira Ayuso, netdev, Jianbo Liu

When the flow_offload infrastructure was added, CVLAN matches weren't
 plumbed through, and flow_rule_match_vlan() was incorrectly called in
 the mlx5 driver when populating CVLAN match information.  This series
 adds flow_rule_match_cvlan(), and uses it in the mlx5 code.
Both patches should also go to 5.1 stable.

Edward Cree (1):
  flow_offload: support CVLAN match

Jianbo Liu (1):
  net/mlx5e: Fix calling wrong function to get inner vlan key and mask

 drivers/net/ethernet/mellanox/mlx5/core/en_tc.c | 2 +-
 include/net/flow_offload.h                      | 2 ++
 net/core/flow_offload.c                         | 7 +++++++
 3 files changed, 10 insertions(+), 1 deletion(-)


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

* [PATCH net 1/2] flow_offload: support CVLAN match
  2019-05-14 20:16 [PATCH net 0/2] flow_offload: fix CVLAN support Edward Cree
@ 2019-05-14 20:18 ` Edward Cree
  2019-05-14 20:18 ` [PATCH net 2/2] net/mlx5e: Fix calling wrong function to get inner vlan key and mask Edward Cree
  2019-05-16 19:03 ` [PATCH net 0/2] flow_offload: fix CVLAN support David Miller
  2 siblings, 0 replies; 4+ messages in thread
From: Edward Cree @ 2019-05-14 20:18 UTC (permalink / raw)
  To: David Miller; +Cc: Jiri Pirko, Pablo Neira Ayuso, netdev, Jianbo Liu

Plumb it through from the flow_dissector.

Signed-off-by: Edward Cree <ecree@solarflare.com>
---
 include/net/flow_offload.h | 2 ++
 net/core/flow_offload.c    | 7 +++++++
 2 files changed, 9 insertions(+)

diff --git a/include/net/flow_offload.h b/include/net/flow_offload.h
index 6200900434e1..a2df99f9b196 100644
--- a/include/net/flow_offload.h
+++ b/include/net/flow_offload.h
@@ -71,6 +71,8 @@ void flow_rule_match_eth_addrs(const struct flow_rule *rule,
 			       struct flow_match_eth_addrs *out);
 void flow_rule_match_vlan(const struct flow_rule *rule,
 			  struct flow_match_vlan *out);
+void flow_rule_match_cvlan(const struct flow_rule *rule,
+			   struct flow_match_vlan *out);
 void flow_rule_match_ipv4_addrs(const struct flow_rule *rule,
 				struct flow_match_ipv4_addrs *out);
 void flow_rule_match_ipv6_addrs(const struct flow_rule *rule,
diff --git a/net/core/flow_offload.c b/net/core/flow_offload.c
index c3a00eac4804..5ce7d47a960e 100644
--- a/net/core/flow_offload.c
+++ b/net/core/flow_offload.c
@@ -54,6 +54,13 @@ void flow_rule_match_vlan(const struct flow_rule *rule,
 }
 EXPORT_SYMBOL(flow_rule_match_vlan);
 
+void flow_rule_match_cvlan(const struct flow_rule *rule,
+			   struct flow_match_vlan *out)
+{
+	FLOW_DISSECTOR_MATCH(rule, FLOW_DISSECTOR_KEY_CVLAN, out);
+}
+EXPORT_SYMBOL(flow_rule_match_cvlan);
+
 void flow_rule_match_ipv4_addrs(const struct flow_rule *rule,
 				struct flow_match_ipv4_addrs *out)
 {


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

* [PATCH net 2/2] net/mlx5e: Fix calling wrong function to get inner vlan key and mask
  2019-05-14 20:16 [PATCH net 0/2] flow_offload: fix CVLAN support Edward Cree
  2019-05-14 20:18 ` [PATCH net 1/2] flow_offload: support CVLAN match Edward Cree
@ 2019-05-14 20:18 ` Edward Cree
  2019-05-16 19:03 ` [PATCH net 0/2] flow_offload: fix CVLAN support David Miller
  2 siblings, 0 replies; 4+ messages in thread
From: Edward Cree @ 2019-05-14 20:18 UTC (permalink / raw)
  To: David Miller; +Cc: Jiri Pirko, Pablo Neira Ayuso, netdev, Jianbo Liu

From: Jianbo Liu <jianbol@mellanox.com>

When flow_rule_match_XYZ() functions were first introduced,
flow_rule_match_cvlan() for inner vlan is missing.

In mlx5_core driver, to get inner vlan key and mask, flow_rule_match_vlan()
is just called, which is wrong because it obtains outer vlan information by
FLOW_DISSECTOR_KEY_VLAN.

This commit fixes this by changing to call flow_rule_match_cvlan() after
it's added.

Fixes: 8f2566225ae2 ("flow_offload: add flow_rule and flow_match structures and use them")
Signed-off-by: Jianbo Liu <jianbol@mellanox.com>
Signed-off-by: Edward Cree <ecree@solarflare.com>
---
 drivers/net/ethernet/mellanox/mlx5/core/en_tc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
index 122f457091a2..542354b5eb4d 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
@@ -1595,7 +1595,7 @@ static int __parse_cls_flower(struct mlx5e_priv *priv,
 	if (flow_rule_match_key(rule, FLOW_DISSECTOR_KEY_CVLAN)) {
 		struct flow_match_vlan match;
 
-		flow_rule_match_vlan(rule, &match);
+		flow_rule_match_cvlan(rule, &match);
 		if (match.mask->vlan_id ||
 		    match.mask->vlan_priority ||
 		    match.mask->vlan_tpid) {

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

* Re: [PATCH net 0/2] flow_offload: fix CVLAN support
  2019-05-14 20:16 [PATCH net 0/2] flow_offload: fix CVLAN support Edward Cree
  2019-05-14 20:18 ` [PATCH net 1/2] flow_offload: support CVLAN match Edward Cree
  2019-05-14 20:18 ` [PATCH net 2/2] net/mlx5e: Fix calling wrong function to get inner vlan key and mask Edward Cree
@ 2019-05-16 19:03 ` David Miller
  2 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2019-05-16 19:03 UTC (permalink / raw)
  To: ecree; +Cc: jiri, pablo, netdev, jianbol

From: Edward Cree <ecree@solarflare.com>
Date: Tue, 14 May 2019 21:16:08 +0100

> When the flow_offload infrastructure was added, CVLAN matches weren't
>  plumbed through, and flow_rule_match_vlan() was incorrectly called in
>  the mlx5 driver when populating CVLAN match information.  This series
>  adds flow_rule_match_cvlan(), and uses it in the mlx5 code.
> Both patches should also go to 5.1 stable.

Series applied and queued up for -stable, thanks.

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

end of thread, other threads:[~2019-05-16 19:03 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-14 20:16 [PATCH net 0/2] flow_offload: fix CVLAN support Edward Cree
2019-05-14 20:18 ` [PATCH net 1/2] flow_offload: support CVLAN match Edward Cree
2019-05-14 20:18 ` [PATCH net 2/2] net/mlx5e: Fix calling wrong function to get inner vlan key and mask Edward Cree
2019-05-16 19:03 ` [PATCH net 0/2] flow_offload: fix CVLAN support David Miller

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).