linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sasha Levin <Alexander.Levin@microsoft.com>
To: "stable@vger.kernel.org" <stable@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Cc: Brett Creeley <brett.creeley@intel.com>,
	Anirudh Venkataramanan <anirudh.venkataramanan@intel.com>,
	Jeff Kirsher <jeffrey.t.kirsher@intel.com>,
	Sasha Levin <Alexander.Levin@microsoft.com>
Subject: [PATCH AUTOSEL 4.18 32/56] ice: Set VLAN flags correctly
Date: Thu, 20 Sep 2018 02:47:50 +0000	[thread overview]
Message-ID: <20180920024716.58490-32-alexander.levin@microsoft.com> (raw)
In-Reply-To: <20180920024716.58490-1-alexander.levin@microsoft.com>

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

[ Upstream commit 5d8778d803e21f235e9bc727b5bd619f02abb88b ]

In the struct ice_aqc_vsi_props the field port_vlan_flags is an
overloaded term because it is used for both port VLANs (PVLANs) and
regular VLANs. This is an issue and is very confusing especially when
dealing with VFs because normal VLANs and port VLANs are not the same.
To fix this the field was renamed to vlan_flags and all of the #define's
labeled *_PVLAN_* were renamed to *_VLAN_* if they are not specific to
port VLANs.

Also in ice_vsi_manage_vlan_stripping, set the ICE_AQ_VSI_VLAN_MODE_ALL
bit to allow the driver to add a VLAN tag to all packets it sends.

Signed-off-by: Brett Creeley <brett.creeley@intel.com>
Signed-off-by: Anirudh Venkataramanan <anirudh.venkataramanan@intel.com>
Tested-by: Tony Brelinski <tonyx.brelinski@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
---
 .../net/ethernet/intel/ice/ice_adminq_cmd.h   | 24 +++++++-------
 drivers/net/ethernet/intel/ice/ice_main.c     | 31 +++++++++++--------
 2 files changed, 30 insertions(+), 25 deletions(-)

diff --git a/drivers/net/ethernet/intel/ice/ice_adminq_cmd.h b/drivers/net/ethernet/intel/ice/ice_adminq_cmd.h
index 6d3e11659ba5..a0614f472658 100644
--- a/drivers/net/ethernet/intel/ice/ice_adminq_cmd.h
+++ b/drivers/net/ethernet/intel/ice/ice_adminq_cmd.h
@@ -329,19 +329,19 @@ struct ice_aqc_vsi_props {
 	/* VLAN section */
 	__le16 pvid; /* VLANS include priority bits */
 	u8 pvlan_reserved[2];
-	u8 port_vlan_flags;
-#define ICE_AQ_VSI_PVLAN_MODE_S	0
-#define ICE_AQ_VSI_PVLAN_MODE_M	(0x3 << ICE_AQ_VSI_PVLAN_MODE_S)
-#define ICE_AQ_VSI_PVLAN_MODE_UNTAGGED	0x1
-#define ICE_AQ_VSI_PVLAN_MODE_TAGGED	0x2
-#define ICE_AQ_VSI_PVLAN_MODE_ALL	0x3
+	u8 vlan_flags;
+#define ICE_AQ_VSI_VLAN_MODE_S	0
+#define ICE_AQ_VSI_VLAN_MODE_M	(0x3 << ICE_AQ_VSI_VLAN_MODE_S)
+#define ICE_AQ_VSI_VLAN_MODE_UNTAGGED	0x1
+#define ICE_AQ_VSI_VLAN_MODE_TAGGED	0x2
+#define ICE_AQ_VSI_VLAN_MODE_ALL	0x3
 #define ICE_AQ_VSI_PVLAN_INSERT_PVID	BIT(2)
-#define ICE_AQ_VSI_PVLAN_EMOD_S	3
-#define ICE_AQ_VSI_PVLAN_EMOD_M	(0x3 << ICE_AQ_VSI_PVLAN_EMOD_S)
-#define ICE_AQ_VSI_PVLAN_EMOD_STR_BOTH	(0x0 << ICE_AQ_VSI_PVLAN_EMOD_S)
-#define ICE_AQ_VSI_PVLAN_EMOD_STR_UP	(0x1 << ICE_AQ_VSI_PVLAN_EMOD_S)
-#define ICE_AQ_VSI_PVLAN_EMOD_STR	(0x2 << ICE_AQ_VSI_PVLAN_EMOD_S)
-#define ICE_AQ_VSI_PVLAN_EMOD_NOTHING	(0x3 << ICE_AQ_VSI_PVLAN_EMOD_S)
+#define ICE_AQ_VSI_VLAN_EMOD_S		3
+#define ICE_AQ_VSI_VLAN_EMOD_M		(0x3 << ICE_AQ_VSI_VLAN_EMOD_S)
+#define ICE_AQ_VSI_VLAN_EMOD_STR_BOTH	(0x0 << ICE_AQ_VSI_VLAN_EMOD_S)
+#define ICE_AQ_VSI_VLAN_EMOD_STR_UP	(0x1 << ICE_AQ_VSI_VLAN_EMOD_S)
+#define ICE_AQ_VSI_VLAN_EMOD_STR	(0x2 << ICE_AQ_VSI_VLAN_EMOD_S)
+#define ICE_AQ_VSI_VLAN_EMOD_NOTHING	(0x3 << ICE_AQ_VSI_VLAN_EMOD_S)
 	u8 pvlan_reserved2[3];
 	/* ingress egress up sections */
 	__le32 ingress_table; /* bitmap, 3 bits per up */
diff --git a/drivers/net/ethernet/intel/ice/ice_main.c b/drivers/net/ethernet/intel/ice/ice_main.c
index db580d41dbf9..5458c3ae10c5 100644
--- a/drivers/net/ethernet/intel/ice/ice_main.c
+++ b/drivers/net/ethernet/intel/ice/ice_main.c
@@ -1367,13 +1367,15 @@ static void ice_set_dflt_vsi_ctx(struct ice_vsi_ctx *ctxt)
 	ctxt->info.sw_flags = ICE_AQ_VSI_SW_FLAG_SRC_PRUNE;
 	/* Traffic from VSI can be sent to LAN */
 	ctxt->info.sw_flags2 = ICE_AQ_VSI_SW_FLAG_LAN_ENA;
-	/* By default bits 3 and 4 in port_vlan_flags are 0's which results in
-	 * legacy behavior (show VLAN, DEI, and UP) in descriptor. Also, allow
-	 * all packets untagged/tagged.
+
+	/* By default bits 3 and 4 in vlan_flags are 0's which results in legacy
+	 * behavior (show VLAN, DEI, and UP) in descriptor. Also, allow all
+	 * packets untagged/tagged.
 	 */
-	ctxt->info.port_vlan_flags = ((ICE_AQ_VSI_PVLAN_MODE_ALL &
-				       ICE_AQ_VSI_PVLAN_MODE_M) >>
-				      ICE_AQ_VSI_PVLAN_MODE_S);
+	ctxt->info.vlan_flags = ((ICE_AQ_VSI_VLAN_MODE_ALL &
+				  ICE_AQ_VSI_VLAN_MODE_M) >>
+				 ICE_AQ_VSI_VLAN_MODE_S);
+
 	/* Have 1:1 UP mapping for both ingress/egress tables */
 	table |= ICE_UP_TABLE_TRANSLATE(0, 0);
 	table |= ICE_UP_TABLE_TRANSLATE(1, 1);
@@ -3732,10 +3734,10 @@ static int ice_vsi_manage_vlan_insertion(struct ice_vsi *vsi)
 	enum ice_status status;
 
 	/* Here we are configuring the VSI to let the driver add VLAN tags by
-	 * setting port_vlan_flags to ICE_AQ_VSI_PVLAN_MODE_ALL. The actual VLAN
-	 * tag insertion happens in the Tx hot path, in ice_tx_map.
+	 * setting vlan_flags to ICE_AQ_VSI_VLAN_MODE_ALL. The actual VLAN tag
+	 * insertion happens in the Tx hot path, in ice_tx_map.
 	 */
-	ctxt.info.port_vlan_flags = ICE_AQ_VSI_PVLAN_MODE_ALL;
+	ctxt.info.vlan_flags = ICE_AQ_VSI_VLAN_MODE_ALL;
 
 	ctxt.info.valid_sections = cpu_to_le16(ICE_AQ_VSI_PROP_VLAN_VALID);
 	ctxt.vsi_num = vsi->vsi_num;
@@ -3747,7 +3749,7 @@ static int ice_vsi_manage_vlan_insertion(struct ice_vsi *vsi)
 		return -EIO;
 	}
 
-	vsi->info.port_vlan_flags = ctxt.info.port_vlan_flags;
+	vsi->info.vlan_flags = ctxt.info.vlan_flags;
 	return 0;
 }
 
@@ -3769,12 +3771,15 @@ static int ice_vsi_manage_vlan_stripping(struct ice_vsi *vsi, bool ena)
 	 */
 	if (ena) {
 		/* Strip VLAN tag from Rx packet and put it in the desc */
-		ctxt.info.port_vlan_flags = ICE_AQ_VSI_PVLAN_EMOD_STR_BOTH;
+		ctxt.info.vlan_flags = ICE_AQ_VSI_VLAN_EMOD_STR_BOTH;
 	} else {
 		/* Disable stripping. Leave tag in packet */
-		ctxt.info.port_vlan_flags = ICE_AQ_VSI_PVLAN_EMOD_NOTHING;
+		ctxt.info.vlan_flags = ICE_AQ_VSI_VLAN_EMOD_NOTHING;
 	}
 
+	/* Allow all packets untagged/tagged */
+	ctxt.info.vlan_flags |= ICE_AQ_VSI_VLAN_MODE_ALL;
+
 	ctxt.info.valid_sections = cpu_to_le16(ICE_AQ_VSI_PROP_VLAN_VALID);
 	ctxt.vsi_num = vsi->vsi_num;
 
@@ -3785,7 +3790,7 @@ static int ice_vsi_manage_vlan_stripping(struct ice_vsi *vsi, bool ena)
 		return -EIO;
 	}
 
-	vsi->info.port_vlan_flags = ctxt.info.port_vlan_flags;
+	vsi->info.vlan_flags = ctxt.info.vlan_flags;
 	return 0;
 }
 
-- 
2.17.1

  parent reply	other threads:[~2018-09-20  2:48 UTC|newest]

Thread overview: 56+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-20  2:47 [PATCH AUTOSEL 4.18 01/56] ARM: OMAP2+: Fix null hwmod for ti-sysc debug Sasha Levin
2018-09-20  2:47 ` [PATCH AUTOSEL 4.18 02/56] ARM: OMAP2+: Fix module address for modules using mpu_rt_idx Sasha Levin
2018-09-20  2:47 ` [PATCH AUTOSEL 4.18 03/56] bus: ti-sysc: Fix module register ioremap for larger offsets Sasha Levin
2018-09-20  2:47 ` [PATCH AUTOSEL 4.18 04/56] qed: Wait for ready indication before rereading the shmem Sasha Levin
2018-09-20  2:47 ` [PATCH AUTOSEL 4.18 05/56] qed: Wait for MCP halt and resume commands to take place Sasha Levin
2018-09-20  2:47 ` [PATCH AUTOSEL 4.18 07/56] qed: Avoid sending mailbox commands when MFW is not responsive Sasha Levin
2018-09-20  2:47 ` [PATCH AUTOSEL 4.18 06/56] qed: Prevent a possible deadlock during driver load and unload Sasha Levin
2018-09-20  2:47 ` [PATCH AUTOSEL 4.18 08/56] thermal: of-thermal: disable passive polling when thermal zone is disabled Sasha Levin
2018-09-20  2:47 ` [PATCH AUTOSEL 4.18 09/56] isofs: reject hardware sector size > 2048 bytes Sasha Levin
2018-09-20  2:47 ` [PATCH AUTOSEL 4.18 10/56] mmc: atmel-mci: fix bad logic of sg_copy_{from,to}_buffer conversion Sasha Levin
2018-09-20  2:47 ` [PATCH AUTOSEL 4.18 11/56] mmc: android-goldfish: " Sasha Levin
2018-09-20  2:47 ` [PATCH AUTOSEL 4.18 12/56] bus: ti-sysc: Fix no_console_suspend handling Sasha Levin
2018-09-20  2:47 ` [PATCH AUTOSEL 4.18 13/56] ARM: dts: omap4-droid4: fix vibrations on Droid 4 Sasha Levin
2018-09-20  2:47 ` [PATCH AUTOSEL 4.18 14/56] bpf, sockmap: fix sock_hash_alloc and reject zero-sized keys Sasha Levin
2018-09-20  2:47 ` [PATCH AUTOSEL 4.18 15/56] bpf, sockmap: fix sock hash count in alloc_sock_hash_elem Sasha Levin
2018-09-20  2:47 ` [PATCH AUTOSEL 4.18 16/56] tls: possible hang when do_tcp_sendpages hits sndbuf is full case Sasha Levin
2018-09-20  2:47 ` [PATCH AUTOSEL 4.18 17/56] bpf: sockmap: write_space events need to be passed to TCP handler Sasha Levin
2018-09-20  2:47 ` [PATCH AUTOSEL 4.18 18/56] drm/amdgpu: fix VM clearing for the root PD Sasha Levin
2018-09-20  2:47 ` [PATCH AUTOSEL 4.18 19/56] drm/amdgpu: fix preamble handling Sasha Levin
2018-09-20  2:47 ` [PATCH AUTOSEL 4.18 21/56] net/ncsi: Fixup .dumpit message flags and ID check in Netlink handler Sasha Levin
2018-09-20  2:47 ` [PATCH AUTOSEL 4.18 20/56] amdgpu: fix multi-process hang issue Sasha Levin
2018-09-20  2:47 ` [PATCH AUTOSEL 4.18 22/56] tcp_bbr: add bbr_check_probe_rtt_done() helper Sasha Levin
2018-09-20  2:47 ` [PATCH AUTOSEL 4.18 24/56] net: hns: fix length and page_offset overflow when CONFIG_ARM64_64K_PAGES Sasha Levin
2018-09-20  2:47 ` [PATCH AUTOSEL 4.18 23/56] tcp_bbr: in restart from idle, see if we should exit PROBE_RTT Sasha Levin
2018-09-20  2:47 ` [PATCH AUTOSEL 4.18 25/56] net: hns: fix skb->truesize underestimation Sasha Levin
2018-09-20  2:47 ` [PATCH AUTOSEL 4.18 26/56] net: hns3: fix page_offset overflow when CONFIG_ARM64_64K_PAGES Sasha Levin
2018-09-20  2:47 ` [PATCH AUTOSEL 4.18 27/56] ice: Fix multiple static analyser warnings Sasha Levin
2018-09-20  2:47 ` [PATCH AUTOSEL 4.18 28/56] ice: Report stats for allocated queues via ethtool stats Sasha Levin
2018-09-20  2:47 ` [PATCH AUTOSEL 4.18 29/56] ice: Clean control queues only when they are initialized Sasha Levin
2018-09-20  2:47 ` [PATCH AUTOSEL 4.18 30/56] ice: Fix bugs in control queue processing Sasha Levin
2018-09-20  2:47 ` [PATCH AUTOSEL 4.18 31/56] ice: Use order_base_2 to calculate higher power of 2 Sasha Levin
2018-09-20  2:47 ` Sasha Levin [this message]
2018-09-20  2:47 ` [PATCH AUTOSEL 4.18 33/56] tools: bpftool: return from do_event_pipe() on bad arguments Sasha Levin
2018-09-20  2:47 ` [PATCH AUTOSEL 4.18 34/56] ice: Fix a few null pointer dereference issues Sasha Levin
2018-09-20  2:47 ` [PATCH AUTOSEL 4.18 36/56] e1000: check on netif_running() before calling e1000_up() Sasha Levin
2018-09-20  2:47 ` [PATCH AUTOSEL 4.18 35/56] ice: Fix potential return of uninitialized value Sasha Levin
2018-09-20  2:47 ` [PATCH AUTOSEL 4.18 38/56] ixgbe: fix driver behaviour after issuing VFLR Sasha Levin
2018-09-20  2:47 ` [PATCH AUTOSEL 4.18 37/56] e1000: ensure to free old tx/rx rings in set_ringparam() Sasha Levin
2018-09-20  2:47 ` [PATCH AUTOSEL 4.18 39/56] i40e: Fix for Tx timeouts when interface is brought up if DCB is enabled Sasha Levin
2018-09-20  2:47 ` [PATCH AUTOSEL 4.18 40/56] i40e: fix condition of WARN_ONCE for stat strings Sasha Levin
2018-09-20  2:47 ` [PATCH AUTOSEL 4.18 41/56] crypto: chtls - fix null dereference chtls_free_uld() Sasha Levin
2018-09-20  2:47 ` [PATCH AUTOSEL 4.18 42/56] crypto: cavium/nitrox - fix for command corruption in queue full case with backlog submissions Sasha Levin
2018-09-20  2:47 ` [PATCH AUTOSEL 4.18 43/56] hwmon: (ina2xx) fix sysfs shunt resistor read access Sasha Levin
2018-09-20  2:47 ` [PATCH AUTOSEL 4.18 44/56] hwmon: (adt7475) Make adt7475_read_word() return errors Sasha Levin
2018-09-20  2:47 ` [PATCH AUTOSEL 4.18 45/56] Revert "ARM: dts: imx7d: Invert legacy PCI irq mapping" Sasha Levin
2018-09-20  2:48 ` [PATCH AUTOSEL 4.18 47/56] drm/amdgpu: Update power state at the end of smu hw_init Sasha Levin
2018-09-20  2:48 ` [PATCH AUTOSEL 4.18 46/56] drm/amdgpu: Enable/disable gfx PG feature in rlc safe mode Sasha Levin
2018-09-20  2:48 ` [PATCH AUTOSEL 4.18 48/56] ata: ftide010: Add a quirk for SQ201 Sasha Levin
2018-09-20  2:48 ` [PATCH AUTOSEL 4.18 49/56] nvme-fcloop: Fix dropped LS's to removed target port Sasha Levin
2018-09-20  2:48 ` [PATCH AUTOSEL 4.18 51/56] drm/amdgpu: Need to set moved to true when evict bo Sasha Levin
2018-09-20  2:48 ` [PATCH AUTOSEL 4.18 50/56] ARM: dts: omap4-droid4: Fix emmc errors seen on some devices Sasha Levin
2018-09-20  2:48 ` [PATCH AUTOSEL 4.18 52/56] arm/arm64: smccc-1.1: Make return values unsigned long Sasha Levin
2018-09-20  2:48 ` [PATCH AUTOSEL 4.18 54/56] i2c: i801: Allow ACPI AML access I/O ports not reserved for SMBus Sasha Levin
2018-09-20  2:48 ` [PATCH AUTOSEL 4.18 53/56] arm/arm64: smccc-1.1: Handle function result as parameters Sasha Levin
2018-09-20  2:48 ` [PATCH AUTOSEL 4.18 56/56] x86/pti: Fix section mismatch warning/error Sasha Levin
2018-09-20  2:48 ` [PATCH AUTOSEL 4.18 55/56] clk: x86: Set default parent to 48Mhz Sasha Levin

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=20180920024716.58490-32-alexander.levin@microsoft.com \
    --to=alexander.levin@microsoft.com \
    --cc=anirudh.venkataramanan@intel.com \
    --cc=brett.creeley@intel.com \
    --cc=jeffrey.t.kirsher@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stable@vger.kernel.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).