netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Saeed Mahameed <saeed@kernel.org>
To: "David S. Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>
Cc: netdev@vger.kernel.org, Alaa Hleihel <alaa@nvidia.com>,
	Saeed Mahameed <saeedm@nvidia.com>
Subject: [net 06/11] net/mlx5: E-Switch, fix changing vf VLANID
Date: Thu,  7 Jan 2021 12:28:40 -0800	[thread overview]
Message-ID: <20210107202845.470205-7-saeed@kernel.org> (raw)
In-Reply-To: <20210107202845.470205-1-saeed@kernel.org>

From: Alaa Hleihel <alaa@nvidia.com>

Adding vf VLANID for the first time, or after having cleared previously
defined VLANID works fine, however, attempting to change an existing vf
VLANID clears the rules on the firmware, but does not add new rules for
the new vf VLANID.

Fix this by changing the logic in function esw_acl_egress_lgcy_setup()
so that it will always configure egress rules.

Fixes: ea651a86d468 ("net/mlx5: E-Switch, Refactor eswitch egress acl codes")
Signed-off-by: Alaa Hleihel <alaa@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
---
 .../mellanox/mlx5/core/esw/acl/egress_lgcy.c  | 27 +++++++++----------
 1 file changed, 13 insertions(+), 14 deletions(-)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/esw/acl/egress_lgcy.c b/drivers/net/ethernet/mellanox/mlx5/core/esw/acl/egress_lgcy.c
index 2b85d4777303..3e19b1721303 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/esw/acl/egress_lgcy.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/esw/acl/egress_lgcy.c
@@ -95,22 +95,21 @@ int esw_acl_egress_lgcy_setup(struct mlx5_eswitch *esw,
 		return 0;
 	}
 
-	if (!IS_ERR_OR_NULL(vport->egress.acl))
-		return 0;
-
-	vport->egress.acl = esw_acl_table_create(esw, vport->vport,
-						 MLX5_FLOW_NAMESPACE_ESW_EGRESS,
-						 table_size);
-	if (IS_ERR(vport->egress.acl)) {
-		err = PTR_ERR(vport->egress.acl);
-		vport->egress.acl = NULL;
-		goto out;
+	if (!vport->egress.acl) {
+		vport->egress.acl = esw_acl_table_create(esw, vport->vport,
+							 MLX5_FLOW_NAMESPACE_ESW_EGRESS,
+							 table_size);
+		if (IS_ERR(vport->egress.acl)) {
+			err = PTR_ERR(vport->egress.acl);
+			vport->egress.acl = NULL;
+			goto out;
+		}
+
+		err = esw_acl_egress_lgcy_groups_create(esw, vport);
+		if (err)
+			goto out;
 	}
 
-	err = esw_acl_egress_lgcy_groups_create(esw, vport);
-	if (err)
-		goto out;
-
 	esw_debug(esw->dev,
 		  "vport[%d] configure egress rules, vlan(%d) qos(%d)\n",
 		  vport->vport, vport->info.vlan, vport->info.qos);
-- 
2.26.2


  parent reply	other threads:[~2021-01-07 20:30 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-07 20:28 [pull request][net 00/11] mlx5 fixes 2021-01-07 Saeed Mahameed
2021-01-07 20:28 ` [net 01/11] net/mlx5: Check if lag is supported before creating one Saeed Mahameed
2021-01-07 20:28 ` [net 02/11] net/mlx5e: Add missing capability check for uplink follow Saeed Mahameed
2021-01-07 20:28 ` [net 03/11] net/mlx5: Use port_num 1 instead of 0 when delete a RoCE address Saeed Mahameed
2021-01-07 20:28 ` [net 04/11] net/mlx5e: CT: Use per flow counter when CT flow accounting is enabled Saeed Mahameed
2021-01-07 22:04   ` Marcelo Ricardo Leitner
2021-01-08  3:07   ` Jakub Kicinski
2021-01-08  4:06     ` Saeed Mahameed
2021-01-08  4:18       ` Saeed Mahameed
2021-01-08  4:40         ` Jakub Kicinski
2021-01-08  4:56           ` Saeed Mahameed
2021-01-07 20:28 ` [net 05/11] net/mlx5e: Fix SWP offsets when vlan inserted by driver Saeed Mahameed
2021-01-08  3:08   ` Jakub Kicinski
2021-01-08  4:07     ` Saeed Mahameed
2021-01-07 20:28 ` Saeed Mahameed [this message]
2021-01-07 20:28 ` [net 07/11] net/mlx5e: In skb build skip setting mark in switchdev mode Saeed Mahameed
2021-01-07 20:28 ` [net 08/11] net/mlx5e: ethtool, Fix restriction of autoneg with 56G Saeed Mahameed
2021-01-07 20:28 ` [net 09/11] net/mlx5: Release devlink object if adev fails Saeed Mahameed
2021-01-07 20:28 ` [net 10/11] net/mlx5e: Fix two double free cases Saeed Mahameed
2021-01-07 20:28 ` [net 11/11] net/mlx5e: Fix memleak in mlx5e_create_l2_table_groups Saeed Mahameed
2021-01-08  3:18 ` [pull request][net 00/11] mlx5 fixes 2021-01-07 Jakub Kicinski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210107202845.470205-7-saeed@kernel.org \
    --to=saeed@kernel.org \
    --cc=alaa@nvidia.com \
    --cc=davem@davemloft.net \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=saeedm@nvidia.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).