intel-wired-lan.lists.osuosl.org archive mirror
 help / color / mirror / Atom feed
From: Grzegorz Siwik <grzegorz.siwik@intel.com>
To: intel-wired-lan@lists.osuosl.org
Cc: Grzegorz Siwik <grzegorz.siwik@intel.com>
Subject: [Intel-wired-lan] [PATCH net v3 1/4] ice: Fix double VLAN error when entering promisc mode
Date: Wed, 10 Aug 2022 16:21:52 +0200	[thread overview]
Message-ID: <1660141315-216111-2-git-send-email-grzegorz.siwik@intel.com> (raw)
In-Reply-To: <1660141315-216111-1-git-send-email-grzegorz.siwik@intel.com>

Avoid enabling or disabling vlan 0 when trying to set promiscuous
vlan mode if double vlan mode is enabled. This fix is needed
because the driver tries to add the vlan 0 filter twice (once for
inner and once for outer) when double VLAN mode is enabled. The
filter program is rejected by the firmware when double vlan is
enabled, because the promiscuous filter only needs to be set once.

This issue was missed in the initial implementation of double vlan
mode.

Fixes: 5eda8afd6bcc ("ice: Add support for PF/VF promiscuous mode")
Signed-off-by: Grzegorz Siwik <grzegorz.siwik@intel.com>
Link: https://lore.kernel.org/all/CAK8fFZ7m-KR57M_rYX6xZN39K89O=LGooYkKsu6HKt0Bs+x6xQ@mail.gmail.com/
---
 v2: Fixed error message when setting same promiscuous mode
---
 v3: Fixed style issues, changed to return directly.
---
 drivers/net/ethernet/intel/ice/ice_switch.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/net/ethernet/intel/ice/ice_switch.c b/drivers/net/ethernet/intel/ice/ice_switch.c
index 8d8f3ee..8a60052 100644
--- a/drivers/net/ethernet/intel/ice/ice_switch.c
+++ b/drivers/net/ethernet/intel/ice/ice_switch.c
@@ -4414,6 +4414,13 @@ static u8 ice_determine_promisc_mask(struct ice_fltr_info *fi)
 		goto free_fltr_list;
 
 	list_for_each_entry(list_itr, &vsi_list_head, list_entry) {
+		/* Avoid enabling or disabling vlan zero twice when in double
+		 * vlan mode
+		 */
+		if (ice_is_dvm_ena(hw) &&
+		    list_itr->fltr_info.l_data.vlan.tpid == 0)
+			continue;
+
 		vlan_id = list_itr->fltr_info.l_data.vlan.vlan_id;
 		if (rm_vlan_promisc)
 			status = ice_clear_vsi_promisc(hw, vsi_handle,
-- 
1.8.3.1

_______________________________________________
Intel-wired-lan mailing list
Intel-wired-lan@osuosl.org
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan

  reply	other threads:[~2022-08-10 14:22 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-10 14:21 [Intel-wired-lan] [PATCH net v3 0/4] ice: Fixes for double vlan promiscuous mode Grzegorz Siwik
2022-08-10 14:21 ` Grzegorz Siwik [this message]
2022-08-10 14:21 ` [Intel-wired-lan] [PATCH net v3 2/4] ice: Ignore ERR_ALREADY_EXISTS when setting promisc mode Grzegorz Siwik
2022-08-10 14:21 ` [Intel-wired-lan] [PATCH net v3 3/4] ice: Fix clearing of promisc mode with bridge over bond Grzegorz Siwik
2022-08-10 14:21 ` [Intel-wired-lan] [PATCH net v3 4/4] ice: Ignore error message when setting same promiscuous mode Grzegorz Siwik
2022-08-10 16:33 ` [Intel-wired-lan] [PATCH net v3 0/4] ice: Fixes for double vlan " Tony Nguyen

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=1660141315-216111-2-git-send-email-grzegorz.siwik@intel.com \
    --to=grzegorz.siwik@intel.com \
    --cc=intel-wired-lan@lists.osuosl.org \
    /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).