netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Amit Cohen <amcohen@nvidia.com>
To: <netdev@vger.kernel.org>
Cc: <davem@davemloft.net>, <kuba@kernel.org>, <mlxsw@nvidia.com>,
	<idosch@nvidia.com>, Amit Cohen <amcohen@nvidia.com>,
	Petr Machata <petrm@nvidia.com>
Subject: [PATCH net-next 1/8] mlxsw: spectrum_flower: Make vlan_id limitation more specific
Date: Tue, 21 Dec 2021 16:49:42 +0200	[thread overview]
Message-ID: <20211221144949.2527545-2-amcohen@nvidia.com> (raw)
In-Reply-To: <20211221144949.2527545-1-amcohen@nvidia.com>

Spectrum ASICs do not support matching of VLAN ID at egress.
Currently, mlxsw driver forbids matching of all VLAN related fields at
egress, which is too strict check.

For example, the following filter is not supported by the driver:
$ tc filter add dev swpX egress protocol 802.1q pref 1 handle 101 flower
vlan_ethtype ipv4 src_ip .. dst_ip .. skip_sw action pass
Error: mlxsw_spectrum: vlan_id key is not supported on egress.
We have an error talking to the kernel

The filter above does not match on VLAN ID, but is bounced anyway.

Make the check more specific, forbid only matching of 'vlan_id' at egress.

Signed-off-by: Amit Cohen <amcohen@nvidia.com>
Reviewed-by: Petr Machata <petrm@nvidia.com>
---
 drivers/net/ethernet/mellanox/mlxsw/spectrum_flower.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_flower.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_flower.c
index 186c556f0de1..bb417db773b9 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_flower.c
+++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_flower.c
@@ -508,7 +508,8 @@ static int mlxsw_sp_flower_parse(struct mlxsw_sp *mlxsw_sp,
 		struct flow_match_vlan match;
 
 		flow_rule_match_vlan(rule, &match);
-		if (mlxsw_sp_flow_block_is_egress_bound(block)) {
+		if (mlxsw_sp_flow_block_is_egress_bound(block) &&
+		    match.mask->vlan_id) {
 			NL_SET_ERR_MSG_MOD(f->common.extack, "vlan_id key is not supported on egress");
 			return -EOPNOTSUPP;
 		}
-- 
2.31.1


  reply	other threads:[~2021-12-21 14:50 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-21 14:49 [PATCH net-next 0/8] Add tests for VxLAN with IPv6 underlay Amit Cohen
2021-12-21 14:49 ` Amit Cohen [this message]
2021-12-21 14:49 ` [PATCH net-next 2/8] selftests: lib.sh: Add PING_COUNT to allow sending configurable amount of packets Amit Cohen
2021-12-21 14:49 ` [PATCH net-next 3/8] selftests: forwarding: Add VxLAN tests with a VLAN-unaware bridge for IPv6 Amit Cohen
2021-12-21 14:49 ` [PATCH net-next 4/8] selftests: forwarding: Add VxLAN tests with a VLAN-aware " Amit Cohen
2021-12-21 14:49 ` [PATCH net-next 5/8] selftests: forwarding: vxlan_bridge_1q: Remove unused function Amit Cohen
2021-12-21 14:49 ` [PATCH net-next 6/8] selftests: forwarding: Add a test for VxLAN asymmetric routing with IPv6 Amit Cohen
2021-12-21 14:49 ` [PATCH net-next 7/8] selftests: forwarding: Add a test for VxLAN symmetric " Amit Cohen
2021-12-21 14:49 ` [PATCH net-next 8/8] selftests: forwarding: Add Q-in-VNI test for IPv6 Amit Cohen
2021-12-23  1:30 ` [PATCH net-next 0/8] Add tests for VxLAN with IPv6 underlay patchwork-bot+netdevbpf

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=20211221144949.2527545-2-amcohen@nvidia.com \
    --to=amcohen@nvidia.com \
    --cc=davem@davemloft.net \
    --cc=idosch@nvidia.com \
    --cc=kuba@kernel.org \
    --cc=mlxsw@nvidia.com \
    --cc=netdev@vger.kernel.org \
    --cc=petrm@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).