netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
To: davem@davemloft.net
Cc: Brett Creeley <brett.creeley@intel.com>,
	netdev@vger.kernel.org, nhorman@redhat.com, sassmann@redhat.com,
	Andrew Bowers <andrewx.bowers@intel.com>,
	Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Subject: [net-next 08/15] ice: Don't allow VLAN stripping change when pvid set
Date: Thu, 28 May 2020 00:25:31 -0700	[thread overview]
Message-ID: <20200528072538.1621790-9-jeffrey.t.kirsher@intel.com> (raw)
In-Reply-To: <20200528072538.1621790-1-jeffrey.t.kirsher@intel.com>

From: Brett Creeley <brett.creeley@intel.com>

Currently, if the PVID is set in the VLAN handling section of the VSI
context the driver still allows VLAN stripping to be enabled/disabled.
VLAN stripping should only be modifiable when the PVID is not set. Fix
this by preventing VLAN stripping modification when PVID is set.

Signed-off-by: Brett Creeley <brett.creeley@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 drivers/net/ethernet/intel/ice/ice_lib.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/net/ethernet/intel/ice/ice_lib.c b/drivers/net/ethernet/intel/ice/ice_lib.c
index f81bd4c30bbc..89962c14e31f 100644
--- a/drivers/net/ethernet/intel/ice/ice_lib.c
+++ b/drivers/net/ethernet/intel/ice/ice_lib.c
@@ -1812,6 +1812,12 @@ int ice_vsi_manage_vlan_stripping(struct ice_vsi *vsi, bool ena)
 	enum ice_status status;
 	int ret = 0;
 
+	/* do not allow modifying VLAN stripping when a port VLAN is configured
+	 * on this VSI
+	 */
+	if (vsi->info.pvid)
+		return 0;
+
 	ctxt = kzalloc(sizeof(*ctxt), GFP_KERNEL);
 	if (!ctxt)
 		return -ENOMEM;
-- 
2.26.2


  parent reply	other threads:[~2020-05-28  7:26 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-28  7:25 [net-next 00/15][pull request] 100GbE Intel Wired LAN Driver Updates 2020-05-27 Jeff Kirsher
2020-05-28  7:25 ` [net-next 01/15] ice: fix signed vs unsigned comparisons Jeff Kirsher
2020-05-28  7:25 ` [net-next 02/15] ice: remove unused macro Jeff Kirsher
2020-05-28  7:25 ` [net-next 03/15] ice: set VF default LAN address Jeff Kirsher
2020-05-28  7:25 ` [net-next 04/15] ice: fix MAC write command Jeff Kirsher
2020-05-28  7:25 ` [net-next 05/15] ice: Fix memory leak Jeff Kirsher
2020-05-28  7:25 ` [net-next 06/15] ice: Fix for memory leaks and modify ICE_FREE_CQ_BUFS Jeff Kirsher
2020-05-28  7:25 ` [net-next 07/15] ice: Add more Rx errors to netdev's rx_error counter Jeff Kirsher
2020-05-28  7:25 ` Jeff Kirsher [this message]
2020-05-28  7:25 ` [net-next 09/15] ice: Handle critical FW error during admin queue initialization Jeff Kirsher
2020-05-28  7:25 ` [net-next 10/15] ice: Change number of XDP TxQ to 0 when destroying rings Jeff Kirsher
2020-05-28  7:25 ` [net-next 11/15] ice: Add XDP Tx to VSI ring stats Jeff Kirsher
2020-05-28  7:25 ` [net-next 12/15] ice: Change number of XDP Tx queues to match number of Rx queues Jeff Kirsher
2020-05-28  7:25 ` [net-next 13/15] ice: avoid undefined behavior Jeff Kirsher
2020-05-28  7:25 ` [net-next 14/15] ice: Refactor Rx checksum checks Jeff Kirsher
2020-05-28  7:25 ` [net-next 15/15] ice: Check UMEM FQ size when allocating bufs Jeff Kirsher
2020-05-28 18:17 ` [net-next 00/15][pull request] 100GbE Intel Wired LAN Driver Updates 2020-05-27 David Miller

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=20200528072538.1621790-9-jeffrey.t.kirsher@intel.com \
    --to=jeffrey.t.kirsher@intel.com \
    --cc=andrewx.bowers@intel.com \
    --cc=brett.creeley@intel.com \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    --cc=nhorman@redhat.com \
    --cc=sassmann@redhat.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).