Skip to contentSkip to conversation

i40e base code update

PATCH Superseded Robin Zhang 5 participants 122 messages Jun 18, 2021 – Oct 9, 2021 Network drivers

lore
Share & tools
lore
#0 lore raw

cover i40e base code update

update i40e base code.

source code of i40e driver:
cid-i40e.2021.04.29.tar.gz

changelog in ND share repo:
From 59a080f4fafe ("i40e-shared: Add opcode 0x0406 and 0x0416 to Linux support") To bedcbea1063 ("i40e-shared: Fix potentially uninitialized variables in NVM code")

The following commits are ignored:
cb9139e3bce8 ("i40e-shared: Fix not blinking X722 with x557 PHY via ‘ethtool -p'")
c09d4f9cf390 ("i40e-shared: i40e-shared: Fix build warning -Wformat related to integer size")
ff8a1abc6c17 ("i40e-shared: Fix build warning with __packed") 59a080f4fafe ("i40e-shared: Add opcode 0x0406 and 0x0416 to Linux support")

Robin Zhang (14):
net/i40e/base: add new versions of send ASQ command functions net/i40e/base: update FVL FW API version to 1.14 net/i40e/base: add support for Min Rollback Revision for 4 more FPK
modules
net/i40e/base: set TSA table values when parsing CEE configuration net/i40e/base: define new Shadow RAM pointers net/i40e/base: fix PHY type identifiers for 2.5G and 5G adapters net/i40e/base: fix PF reset failed
net/i40e/base: fix update link data for X722 net/i40e/base: fix AOC media type reported by ethtool net/i40e/base: add flags and fields for double vlan processing net/i40e/base: 10GBASE-ER Optical modules recognition net/i40e/base: fix headers to match functions net/i40e/base: fix potentially uninitialized variables in NVM code net/i40e/base: update version in readme

 drivers/net/i40e/base/README            |   2 +-
 drivers/net/i40e/base/i40e_adminq.c     |  79 +++++++++--
 drivers/net/i40e/base/i40e_adminq_cmd.h |  48 +++++--
 drivers/net/i40e/base/i40e_common.c     | 176 +++++++++++++++++++-----
 drivers/net/i40e/base/i40e_dcb.c        |  10 +-
 drivers/net/i40e/base/i40e_lan_hmc.c    |   2 +-
 drivers/net/i40e/base/i40e_nvm.c        |   7 +-
 drivers/net/i40e/base/i40e_prototype.h  |  17 +++
 drivers/net/i40e/base/i40e_type.h       |  12 +-
 9 files changed, 288 insertions(+), 65 deletions(-)
Signature · 1 line
2.25.1
#1 lore raw

PATCH 1/14 net/i40e/base: add new versions of send ASQ command functions

ASQ send command functions are returning only i40e status codes yet some calling functions also need Admin Queue status that is stored in hw->aq.asq_last_status. Since hw object is stored on a heap it introduces a possibility for
a race condition in access to hw if calling function is not fast enough to read hw->aq.asq_last_status before next send ASQ command is executed.

Added new versions of send ASQ command functions that return Admin Queue status on the stack to avoid race conditions
in access to hw->aq.asq_last_status.
Added new _v2 version of i40e_aq_remove_macvlan and i40e_aq_add_macvlan that is using new _v2 versions of ASQ send command functions and returns the Admin Queue status on the stack.

---
 drivers/net/i40e/base/i40e_adminq.c    |  73 +++++++++++--
 drivers/net/i40e/base/i40e_common.c    | 139 ++++++++++++++++++++++---
 drivers/net/i40e/base/i40e_prototype.h |  17 +++
 3 files changed, 205 insertions(+), 24 deletions(-)
drivers/net/i40e/base/i40e_adminq.c +65 -8
index 0da45f03e4..eafacbdbec 100644
@@ -834,7 +834,7 @@ STATIC bool i40e_asq_done(struct i40e_hw *hw)
 }
 
 /**
- *  i40e_asq_send_command - send command to Admin Queue
+ *  i40e_asq_send_command_exec - send command to Admin Queue
  *  @hw: pointer to the hw struct
  *  @desc: prefilled descriptor describing the command (non DMA mem)
  *  @buff: buffer to use for indirect commands
@@ -844,11 +844,12 @@ STATIC bool i40e_asq_done(struct i40e_hw *hw)
  *  This is the main send command driver routine for the Admin Queue send
  *  queue.  It runs the queue, cleans the queue, etc
  **/
-enum i40e_status_code i40e_asq_send_command(struct i40e_hw *hw,
-				struct i40e_aq_desc *desc,
-				void *buff, /* can be NULL */
-				u16  buff_size,
-				struct i40e_asq_cmd_details *cmd_details)
+STATIC enum i40e_status_code
+i40e_asq_send_command_exec(struct i40e_hw *hw,
+			   struct i40e_aq_desc *desc,
+			   void *buff, /* can be NULL */
+			   u16  buff_size,
+			   struct i40e_asq_cmd_details *cmd_details)
 {
 	enum i40e_status_code status = I40E_SUCCESS;
 	struct i40e_dma_mem *dma_buff = NULL;
@@ -858,8 +859,6 @@ enum i40e_status_code i40e_asq_send_command(struct i40e_hw *hw,
 	u16  retval = 0;
 	u32  val = 0;
 
-	i40e_acquire_spinlock(&hw->aq.asq_spinlock);
-
 	hw->aq.asq_last_status = I40E_AQ_RC_OK;
 
 	if (hw->aq.asq.count == 0) {
@@ -1042,6 +1041,64 @@ enum i40e_status_code i40e_asq_send_command(struct i40e_hw *hw,
 	}
 
 asq_send_command_error:
+	return status;
+}
+
+/**
+ *  i40e_asq_send_command - send command to Admin Queue
+ *  @hw: pointer to the hw struct
+ *  @desc: prefilled descriptor describing the command (non DMA mem)
+ *  @buff: buffer to use for indirect commands
+ *  @buff_size: size of buffer for indirect commands
+ *  @cmd_details: pointer to command details structure
+ *
+ *  Acquires the lock and calls the main send command execution
+ *  routine.
+ **/
+enum i40e_status_code
+i40e_asq_send_command(struct i40e_hw *hw,
+		      struct i40e_aq_desc *desc,
+		      void *buff, /* can be NULL */
+		      u16  buff_size,
+		      struct i40e_asq_cmd_details *cmd_details)
+{
+	enum i40e_status_code status = I40E_SUCCESS;
+
+	i40e_acquire_spinlock(&hw->aq.asq_spinlock);
+	status = i40e_asq_send_command_exec(hw, desc, buff, buff_size,
+					    cmd_details);
+	i40e_release_spinlock(&hw->aq.asq_spinlock);
+	return status;
+}
+
+/**
+ *  i40e_asq_send_command_v2 - send command to Admin Queue
+ *  @hw: pointer to the hw struct
+ *  @desc: prefilled descriptor describing the command (non DMA mem)
+ *  @buff: buffer to use for indirect commands
+ *  @buff_size: size of buffer for indirect commands
+ *  @cmd_details: pointer to command details structure
+ *  @aq_status: pointer to Admin Queue status return value
+ *
+ *  Acquires the lock and calls the main send command execution
+ *  routine. Returns the last Admin Queue status in aq_status
+ *  to avoid race conditions in access to hw->aq.asq_last_status.
+ **/
+enum i40e_status_code
+i40e_asq_send_command_v2(struct i40e_hw *hw,
+			 struct i40e_aq_desc *desc,
+			 void *buff, /* can be NULL */
+			 u16  buff_size,
+			 struct i40e_asq_cmd_details *cmd_details,
+			 enum i40e_admin_queue_err *aq_status)
+{
+	enum i40e_status_code status = I40E_SUCCESS;
+
+	i40e_acquire_spinlock(&hw->aq.asq_spinlock);
+	status = i40e_asq_send_command_exec(hw, desc, buff, buff_size,
+					    cmd_details);
+	if (aq_status)
+		*aq_status = hw->aq.asq_last_status;
 	i40e_release_spinlock(&hw->aq.asq_spinlock);
 	return status;
 }
drivers/net/i40e/base/i40e_common.c +123 -16

187 lines not on this page · raw message

drivers/net/i40e/base/i40e_prototype.h +17 -0
index 124222e476..29c86c7fe8 100644
@@ -38,6 +38,13 @@ enum i40e_status_code i40e_asq_send_command(struct i40e_hw *hw,
 				void *buff, /* can be NULL */
 				u16  buff_size,
 				struct i40e_asq_cmd_details *cmd_details);
+enum i40e_status_code
+i40e_asq_send_command_v2(struct i40e_hw *hw,
+			 struct i40e_aq_desc *desc,
+			 void *buff, /* can be NULL */
+			 u16  buff_size,
+			 struct i40e_asq_cmd_details *cmd_details,
+			 enum i40e_admin_queue_err *aq_status);
 #ifdef VF_DRIVER
 bool i40e_asq_done(struct i40e_hw *hw);
 #endif
@@ -188,9 +195,19 @@ enum i40e_status_code i40e_aq_get_veb_parameters(struct i40e_hw *hw,
 enum i40e_status_code i40e_aq_add_macvlan(struct i40e_hw *hw, u16 vsi_id,
 			struct i40e_aqc_add_macvlan_element_data *mv_list,
 			u16 count, struct i40e_asq_cmd_details *cmd_details);
+enum i40e_status_code
+i40e_aq_add_macvlan_v2(struct i40e_hw *hw, u16 seid,
+		       struct i40e_aqc_add_macvlan_element_data *mv_list,
+		       u16 count, struct i40e_asq_cmd_details *cmd_details,
+		       enum i40e_admin_queue_err *aq_status);
 enum i40e_status_code i40e_aq_remove_macvlan(struct i40e_hw *hw, u16 vsi_id,
 			struct i40e_aqc_remove_macvlan_element_data *mv_list,
 			u16 count, struct i40e_asq_cmd_details *cmd_details);
+enum i40e_status_code
+i40e_aq_remove_macvlan_v2(struct i40e_hw *hw, u16 seid,
+			  struct i40e_aqc_remove_macvlan_element_data *mv_list,
+			  u16 count, struct i40e_asq_cmd_details *cmd_details,
+			  enum i40e_admin_queue_err *aq_status);
 enum i40e_status_code i40e_aq_add_mirrorrule(struct i40e_hw *hw, u16 sw_seid,
 			u16 rule_type, u16 dest_vsi, u16 count, __le16 *mr_list,
 			struct i40e_asq_cmd_details *cmd_details,
Signature · 1 line
2.25.1
#2 lore raw

PATCH 2/14 net/i40e/base: update FVL FW API version to 1.14

In reply to Robin Zhang

Update FVL FW increment API version to 1.14

---
 drivers/net/i40e/base/i40e_adminq_cmd.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/i40e/base/i40e_adminq_cmd.h +1 -1
index 2ca41db5d3..b5ac74787b 100644
@@ -13,7 +13,7 @@
 
 #define I40E_FW_API_VERSION_MAJOR	0x0001
 #define I40E_FW_API_VERSION_MINOR_X722	0x000B
-#define I40E_FW_API_VERSION_MINOR_X710	0x000C
+#define I40E_FW_API_VERSION_MINOR_X710	0x000E
 
 #define I40E_FW_MINOR_VERSION(_h) ((_h)->mac.type == I40E_MAC_XL710 ? \
 					I40E_FW_API_VERSION_MINOR_X710 : \
Signature · 1 line
2.25.1
#3 lore raw

PATCH 3/14 net/i40e/base: add support for Min Rollback Revision for 4 more FPK modules

In reply to Robin Zhang

This change increments FPK API version and adds new constants related to the extended implementation of Security Version Opt-In.

---
 drivers/net/i40e/base/i40e_adminq_cmd.h | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)
drivers/net/i40e/base/i40e_adminq_cmd.h +10 -6
index b5ac74787b..a73a08aae6 100644
@@ -12,7 +12,7 @@
  */
 
 #define I40E_FW_API_VERSION_MAJOR	0x0001
-#define I40E_FW_API_VERSION_MINOR_X722	0x000B
+#define I40E_FW_API_VERSION_MINOR_X722	0x000C
 #define I40E_FW_API_VERSION_MINOR_X710	0x000E
 
 #define I40E_FW_MINOR_VERSION(_h) ((_h)->mac.type == I40E_MAC_XL710 ? \
@@ -2425,11 +2425,15 @@ struct i40e_aqc_rollback_revision_update {
 	u8	optin_mode; /* bool */
 #define I40E_AQ_RREV_OPTION_MODE			0x01
 	u8	module_selected;
-#define I40E_AQ_RREV_MODULE_PCIE_ANALOG		0
-#define I40E_AQ_RREV_MODULE_PHY_ANALOG		1
-#define I40E_AQ_RREV_MODULE_OPTION_ROM		2
-#define I40E_AQ_RREV_MODULE_EMP_IMAGE		3
-#define I40E_AQ_RREV_MODULE_PE_IMAGE		4
+#define I40E_AQ_RREV_MODULE_PCIE_ANALOG			0
+#define I40E_AQ_RREV_MODULE_PHY_ANALOG			1
+#define I40E_AQ_RREV_MODULE_OPTION_ROM			2
+#define I40E_AQ_RREV_MODULE_EMP_IMAGE			3
+#define I40E_AQ_RREV_MODULE_PE_IMAGE			4
+#define I40E_AQ_RREV_MODULE_PHY_PLL_O_CONFIGURATION	5
+#define I40E_AQ_RREV_MODULE_PHY_0_CONFIGURATION		6
+#define I40E_AQ_RREV_MODULE_PHY_PLL_1_CONFIGURATION	7
+#define I40E_AQ_RREV_MODULE_PHY_1_CONFIGURATION		8
 	u8	reserved1[2];
 	u32	min_rrev;
 	u8	reserved2[8];
Signature · 1 line
2.25.1
#4 lore raw

PATCH 4/14 net/i40e/base: set TSA table values when parsing CEE configuration

In reply to Robin Zhang

Driver did not Set TSA table values when parsing CEE configuration obtained from FW.

---
 drivers/net/i40e/base/i40e_dcb.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
drivers/net/i40e/base/i40e_dcb.c +7 -1
index 388af3d64d..27b52bc365 100644
@@ -315,9 +315,15 @@ static void i40e_parse_cee_pgcfg_tlv(struct i40e_cee_feat_tlv *tlv,
 	 *        |pg0|pg1|pg2|pg3|pg4|pg5|pg6|pg7|
 	 *        ---------------------------------
 	 */
-	for (i = 0; i < I40E_MAX_TRAFFIC_CLASS; i++)
+	for (i = 0; i < I40E_MAX_TRAFFIC_CLASS; i++) {
 		etscfg->tcbwtable[i] = buf[offset++];
 
+		if (etscfg->prioritytable[i] == I40E_CEE_PGID_STRICT)
+			dcbcfg->etscfg.tsatable[i] = I40E_IEEE_TSA_STRICT;
+		else
+			dcbcfg->etscfg.tsatable[i] = I40E_IEEE_TSA_ETS;
+	}
+
 	/* Number of TCs supported (1 octet) */
 	etscfg->maxtcs = buf[offset];
 }
Signature · 1 line
2.25.1
#5 lore raw

PATCH 5/14 net/i40e/base: define new Shadow RAM pointers

In reply to Robin Zhang

Add definitions for Shadow RAM pointers: 6th FPA module, 5th FPA module in FortPark and Preservation Rules Module.

---
 drivers/net/i40e/base/i40e_type.h | 3 +++
 1 file changed, 3 insertions(+)
drivers/net/i40e/base/i40e_type.h +3 -0
index cf41345834..007484f227 100644
@@ -1555,6 +1555,9 @@ struct i40e_hw_port_stats {
 #define I40E_SR_FEATURE_CONFIGURATION_PTR	0x49
 #define I40E_SR_CONFIGURATION_METADATA_PTR	0x4D
 #define I40E_SR_IMMEDIATE_VALUES_PTR		0x4E
+#define I40E_SR_PRESERVATION_RULES_PTR		0x70
+#define I40E_FPK_SR_5TH_FREE_PROVISION_AREA_PTR	0x71
+#define I40E_SR_6TH_FREE_PROVISION_AREA_PTR	0x71
 
 /* Auxiliary field, mask and shift definition for Shadow RAM and NVM Flash */
 #define I40E_SR_VPD_MODULE_MAX_SIZE		1024
Signature · 1 line
2.25.1
#6 lore raw

PATCH 6/14 net/i40e/base: fix PHY type identifiers for 2.5G and 5G adapters

In reply to Robin Zhang

Unlike other supported adapters, 2.5G and 5G use different PHY type identifiers for reading/writing PHY settings and for reading link status. This commit intruduces separate PHY identifiers for these two operation types.

Fixes 988ed63c7441 ("net/i40e/base: add support for Carlsville device")
---
 drivers/net/i40e/base/i40e_adminq_cmd.h | 6 ++++--
 drivers/net/i40e/base/i40e_common.c     | 4 ++--
 drivers/net/i40e/base/i40e_type.h       | 8 ++------
 3 files changed, 8 insertions(+), 10 deletions(-)
drivers/net/i40e/base/i40e_adminq_cmd.h +4 -2
index a73a08aae6..1aafe1de38 100644
@@ -1947,8 +1947,10 @@ enum i40e_aq_phy_type {
 	I40E_PHY_TYPE_25GBASE_LR		= 0x22,
 	I40E_PHY_TYPE_25GBASE_AOC		= 0x23,
 	I40E_PHY_TYPE_25GBASE_ACC		= 0x24,
-	I40E_PHY_TYPE_2_5GBASE_T		= 0x30,
-	I40E_PHY_TYPE_5GBASE_T			= 0x31,
+	I40E_PHY_TYPE_2_5GBASE_T		= 0x26,
+	I40E_PHY_TYPE_5GBASE_T			= 0x27,
+	I40E_PHY_TYPE_2_5GBASE_T_LINK_STATUS	= 0x30,
+	I40E_PHY_TYPE_5GBASE_T_LINK_STATUS	= 0x31,
 	I40E_PHY_TYPE_MAX,
 	I40E_PHY_TYPE_NOT_SUPPORTED_HIGH_TEMP	= 0xFD,
 	I40E_PHY_TYPE_EMPTY			= 0xFE,
drivers/net/i40e/base/i40e_common.c +2 -2
index 32642f3e2b..ceedec68bf 100644
@@ -1280,8 +1280,8 @@ STATIC enum i40e_media_type i40e_get_media_type(struct i40e_hw *hw)
 		break;
 	case I40E_PHY_TYPE_100BASE_TX:
 	case I40E_PHY_TYPE_1000BASE_T:
-	case I40E_PHY_TYPE_2_5GBASE_T:
-	case I40E_PHY_TYPE_5GBASE_T:
+	case I40E_PHY_TYPE_2_5GBASE_T_LINK_STATUS:
+	case I40E_PHY_TYPE_5GBASE_T_LINK_STATUS:
 	case I40E_PHY_TYPE_10GBASE_T:
 		media = I40E_MEDIA_TYPE_BASET;
 		break;
drivers/net/i40e/base/i40e_type.h +2 -6
index 007484f227..a9e019d101 100644
@@ -329,12 +329,8 @@ struct i40e_phy_info {
 					     I40E_PHY_TYPE_OFFSET)
 #define I40E_CAP_PHY_TYPE_25GBASE_ACC BIT_ULL(I40E_PHY_TYPE_25GBASE_ACC + \
 					     I40E_PHY_TYPE_OFFSET)
-/* Offset for 2.5G/5G PHY Types value to bit number conversion */
-#define I40E_PHY_TYPE_OFFSET2 (-10)
-#define I40E_CAP_PHY_TYPE_2_5GBASE_T BIT_ULL(I40E_PHY_TYPE_2_5GBASE_T + \
-					     I40E_PHY_TYPE_OFFSET2)
-#define I40E_CAP_PHY_TYPE_5GBASE_T BIT_ULL(I40E_PHY_TYPE_5GBASE_T + \
-					     I40E_PHY_TYPE_OFFSET2)
+#define I40E_CAP_PHY_TYPE_2_5GBASE_T BIT_ULL(I40E_PHY_TYPE_2_5GBASE_T)
+#define I40E_CAP_PHY_TYPE_5GBASE_T BIT_ULL(I40E_PHY_TYPE_5GBASE_T)
 #define I40E_HW_CAP_MAX_GPIO			30
 #define I40E_HW_CAP_MDIO_PORT_MODE_MDIO		0
 #define I40E_HW_CAP_MDIO_PORT_MODE_I2C		1
Signature · 1 line
2.25.1
#7 lore raw

PATCH 7/14 net/i40e/base: fix PF reset failed

In reply to Robin Zhang

PF has to delete all the filters during reset.
If it is fully loaded with filters then it is possible that it will take more than 200 ms to finish the reset resulting in timeout during pf_reset and
PF reset failed, -15 error indication.
Increasing the timeout value for PF reset from 200 to 1000 to give PF more time to finish reset if it is loaded with filters.

Fixes 1e32378f0774 ("i40e/base: increase PF reset max loop limit")
---
 drivers/net/i40e/base/i40e_common.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/i40e/base/i40e_common.c +1 -1
index ceedec68bf..aa424e6010 100644
@@ -1341,7 +1341,7 @@ STATIC enum i40e_status_code i40e_poll_globr(struct i40e_hw *hw,
 	return I40E_ERR_RESET_FAILED;
 }
 
-#define I40E_PF_RESET_WAIT_COUNT	200
+#define I40E_PF_RESET_WAIT_COUNT	1000
 /**
  * i40e_pf_reset - Reset the PF
  * @hw: pointer to the hardware structure
Signature · 1 line
2.25.1
#8 lore raw

PATCH 8/14 net/i40e/base: fix update link data for X722

In reply to Robin Zhang

The X722 card has 'Link Type' information elsewhere than the X710. Previously, for all cards, the 'Link Type' information was retrieved by opcode 0x0607 and this value was wrong for all X722 cards. Now this information for X722 only is taken by opcode 0x0600 (function: i40e_aq_get_phy_capabilities) instead of an opcode 0x0607 (function: i40e_aq_get_link_info).
All other parameters read by opcode 0x0607 unchanged.

Fixes e6691b428eb1 ("i40e/base: fix PHY NVM interaction")
Fixes 75c3de654ead ("net/i40e/base: fix long link down notification time")
---
 drivers/net/i40e/base/i40e_common.c | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)
drivers/net/i40e/base/i40e_common.c +10 -4
index aa424e6010..ef061a6b63 100644
@@ -2078,6 +2078,9 @@ enum i40e_status_code i40e_aq_get_link_info(struct i40e_hw *hw,
 	     hw->aq.fw_min_ver < 40)) && hw_link_info->phy_type == 0xE)
 		hw_link_info->phy_type = I40E_PHY_TYPE_10GBASE_SFPP_CU;
 
+	/* 'Get Link Status' response data structure from X722 FW has
+	 * different format and does not contain this information
+	 */
 	if (hw->flags & I40E_HW_FLAG_AQ_PHY_ACCESS_CAPABLE &&
 	    hw->mac.type != I40E_MAC_X722) {
 		__le32 tmp;
@@ -2948,10 +2951,13 @@ enum i40e_status_code i40e_update_link_info(struct i40e_hw *hw)
 		return status;
 
 	/* extra checking needed to ensure link info to user is timely */
-	if ((hw->phy.link_info.link_info & I40E_AQ_MEDIA_AVAILABLE) &&
-	    ((hw->phy.link_info.link_info & I40E_AQ_LINK_UP) ||
-	     !(hw->phy.link_info_old.link_info & I40E_AQ_LINK_UP))) {
-		status = i40e_aq_get_phy_capabilities(hw, false, false,
+	if (((hw->phy.link_info.link_info & I40E_AQ_MEDIA_AVAILABLE) &&
+	     ((hw->phy.link_info.link_info & I40E_AQ_LINK_UP) ||
+	      !(hw->phy.link_info_old.link_info & I40E_AQ_LINK_UP))) ||
+		hw->mac.type == I40E_MAC_X722) {
+		status = i40e_aq_get_phy_capabilities(hw, false,
+						      hw->mac.type ==
+						      I40E_MAC_X722,
 						      &abilities, NULL);
 		if (status)
 			return status;
Signature · 1 line
2.25.1
#9 lore raw

PATCH 9/14 net/i40e/base: fix AOC media type reported by ethtool

In reply to Robin Zhang

For Active Optical Cable (AOC) the correct media type is "Fibre", not "Direct Attach Copper".

Fixes d749d4d89969 ("i40e/base: add AOC PHY types")
Fixes aa153cc89ff0 ("net/i40e/base: add new PHY types for 25G AOC and

ACC")
Cc: [email protected]

---
 drivers/net/i40e/base/i40e_common.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/net/i40e/base/i40e_common.c +3 -3
index ef061a6b63..2ca6a13e79 100644
@@ -1276,6 +1276,9 @@ STATIC enum i40e_media_type i40e_get_media_type(struct i40e_hw *hw)
 	case I40E_PHY_TYPE_40GBASE_LR4:
 	case I40E_PHY_TYPE_25GBASE_LR:
 	case I40E_PHY_TYPE_25GBASE_SR:
+	case I40E_PHY_TYPE_10GBASE_AOC:
+	case I40E_PHY_TYPE_25GBASE_AOC:
+	case I40E_PHY_TYPE_40GBASE_AOC:
 		media = I40E_MEDIA_TYPE_FIBER;
 		break;
 	case I40E_PHY_TYPE_100BASE_TX:
@@ -1290,10 +1293,7 @@ STATIC enum i40e_media_type i40e_get_media_type(struct i40e_hw *hw)
 	case I40E_PHY_TYPE_10GBASE_CR1:
 	case I40E_PHY_TYPE_40GBASE_CR4:
 	case I40E_PHY_TYPE_10GBASE_SFPP_CU:
-	case I40E_PHY_TYPE_40GBASE_AOC:
-	case I40E_PHY_TYPE_10GBASE_AOC:
 	case I40E_PHY_TYPE_25GBASE_CR:
-	case I40E_PHY_TYPE_25GBASE_AOC:
 	case I40E_PHY_TYPE_25GBASE_ACC:
 		media = I40E_MEDIA_TYPE_DA;
 		break;
Signature · 1 line
2.25.1
#10 lore raw

PATCH 10/14 net/i40e/base: add flags and fields for double vlan processing

In reply to Robin Zhang

Add flags for outer vlan and include set port parameters in Linux compilation.
Add flags, which describe port and switch state for both double vlan functionality and outer vlan processing.

---
 drivers/net/i40e/base/i40e_adminq_cmd.h | 22 ++++++++++++++++++++--
 1 file changed, 20 insertions(+), 2 deletions(-)
drivers/net/i40e/base/i40e_adminq_cmd.h +20 -2
index 1aafe1de38..646cfd0398 100644
@@ -768,6 +768,7 @@ struct i40e_aqc_set_switch_config {
 #define I40E_AQ_SET_SWITCH_CFG_PROMISC		0x0001
 #define I40E_AQ_SET_SWITCH_CFG_L2_FILTER	0x0002
 #define I40E_AQ_SET_SWITCH_CFG_HW_ATR_EVICT	0x0004
+#define I40E_AQ_SET_SWITCH_CFG_OUTER_VLAN	0x0008
 	__le16	valid_flags;
 	/* The ethertype in switch_tag is dropped on ingress and used
 	 * internally by the switch. Set this to zero for the default
@@ -904,7 +905,7 @@ struct i40e_aqc_vsi_properties_data {
 	u8	sec_reserved;
 	/* VLAN section */
 	__le16	pvid; /* VLANS include priority bits */
-	__le16	fcoe_pvid;
+	__le16	outer_vlan;
 	u8	port_vlan_flags;
 #define I40E_AQ_VSI_PVLAN_MODE_SHIFT	0x00
 #define I40E_AQ_VSI_PVLAN_MODE_MASK	(0x03 << \
@@ -920,7 +921,24 @@ struct i40e_aqc_vsi_properties_data {
 #define I40E_AQ_VSI_PVLAN_EMOD_STR_UP	0x08
 #define I40E_AQ_VSI_PVLAN_EMOD_STR	0x10
 #define I40E_AQ_VSI_PVLAN_EMOD_NOTHING	0x18
-	u8	pvlan_reserved[3];
+	u8	outer_vlan_flags;
+#define I40E_AQ_VSI_OVLAN_MODE_SHIFT	0x00
+#define I40E_AQ_VSI_OVLAN_MODE_MASK	(0x03 << \
+					 I40E_AQ_VSI_OVLAN_MODE_SHIFT)
+#define I40E_AQ_VSI_OVLAN_MODE_UNTAGGED	0x01
+#define I40E_AQ_VSI_OVLAN_MODE_TAGGED	0x02
+#define I40E_AQ_VSI_OVLAN_MODE_ALL	0x03
+#define I40E_AQ_VSI_OVLAN_INSERT_PVID	0x04
+#define I40E_AQ_VSI_OVLAN_EMOD_SHIFT	0x03
+#define I40E_AQ_VSI_OVLAN_EMOD_MASK	(0x03 <<\
+					 I40E_AQ_VSI_OVLAN_EMOD_SHIFT)
+#define I40E_AQ_VSI_OVLAN_EMOD_SHOW_ALL	0x00
+#define I40E_AQ_VSI_OVLAN_EMOD_SHOW_UP	0x01
+#define I40E_AQ_VSI_OVLAN_EMOD_HIDE_ALL	0x02
+#define I40E_AQ_VSI_OVLAN_EMOD_NOTHING	0x03
+#define I40E_AQ_VSI_OVLAN_CTRL_ENA	0x04
+
+	u8	pvlan_reserved[2];
 	/* ingress egress up sections */
 	__le32	ingress_table; /* bitmap, 3 bits per up */
 #define I40E_AQ_VSI_UP_TABLE_UP0_SHIFT	0
Signature · 1 line
2.25.1
#11 lore raw

PATCH 11/14 net/i40e/base: 10GBASE-ER Optical modules recognition

In reply to Robin Zhang

This change adds a new PHY type for 10GBASE-ER modules.

---
 drivers/net/i40e/base/i40e_adminq_cmd.h | 2 ++
 drivers/net/i40e/base/i40e_common.c     | 1 +
 drivers/net/i40e/base/i40e_type.h       | 1 +
 3 files changed, 4 insertions(+)
drivers/net/i40e/base/i40e_adminq_cmd.h +2 -0
index 646cfd0398..c41dc71cdf 100644
@@ -1945,6 +1945,7 @@ enum i40e_aq_phy_type {
 	I40E_PHY_TYPE_40GBASE_AOC		= 0xD,
 	I40E_PHY_TYPE_UNRECOGNIZED		= 0xE,
 	I40E_PHY_TYPE_UNSUPPORTED		= 0xF,
+	I40E_PHY_TYPE_10GBASE_ER		= 0x10,
 	I40E_PHY_TYPE_100BASE_TX		= 0x11,
 	I40E_PHY_TYPE_1000BASE_T		= 0x12,
 	I40E_PHY_TYPE_10GBASE_T			= 0x13,
@@ -1991,6 +1992,7 @@ enum i40e_aq_phy_type {
 				BIT_ULL(I40E_PHY_TYPE_40GBASE_AOC) | \
 				BIT_ULL(I40E_PHY_TYPE_UNRECOGNIZED) | \
 				BIT_ULL(I40E_PHY_TYPE_UNSUPPORTED) | \
+				BIT_ULL(I40E_PHY_TYPE_10GBASE_ER) | \
 				BIT_ULL(I40E_PHY_TYPE_100BASE_TX) | \
 				BIT_ULL(I40E_PHY_TYPE_1000BASE_T) | \
 				BIT_ULL(I40E_PHY_TYPE_10GBASE_T) | \
drivers/net/i40e/base/i40e_common.c +1 -0
index 2ca6a13e79..e077bf8fd3 100644
@@ -1268,6 +1268,7 @@ STATIC enum i40e_media_type i40e_get_media_type(struct i40e_hw *hw)
 	enum i40e_media_type media;
 
 	switch (hw->phy.link_info.phy_type) {
+	case I40E_PHY_TYPE_10GBASE_ER:
 	case I40E_PHY_TYPE_10GBASE_SR:
 	case I40E_PHY_TYPE_10GBASE_LR:
 	case I40E_PHY_TYPE_1000BASE_SX:
drivers/net/i40e/base/i40e_type.h +1 -0
index a9e019d101..a309636b9f 100644
@@ -294,6 +294,7 @@ struct i40e_phy_info {
 #define I40E_CAP_PHY_TYPE_10GBASE_CR1_CU BIT_ULL(I40E_PHY_TYPE_10GBASE_CR1_CU)
 #define I40E_CAP_PHY_TYPE_10GBASE_AOC BIT_ULL(I40E_PHY_TYPE_10GBASE_AOC)
 #define I40E_CAP_PHY_TYPE_40GBASE_AOC BIT_ULL(I40E_PHY_TYPE_40GBASE_AOC)
+#define I40E_CAP_PHY_TYPE_10GBASE_ER BIT_ULL(I40E_PHY_TYPE_10GBASE_ER)
 #define I40E_CAP_PHY_TYPE_100BASE_TX BIT_ULL(I40E_PHY_TYPE_100BASE_TX)
 #define I40E_CAP_PHY_TYPE_1000BASE_T BIT_ULL(I40E_PHY_TYPE_1000BASE_T)
 #define I40E_CAP_PHY_TYPE_10GBASE_T BIT_ULL(I40E_PHY_TYPE_10GBASE_T)
Signature · 1 line
2.25.1
#12 lore raw

PATCH 12/14 net/i40e/base: fix headers to match functions

In reply to Robin Zhang

Fix several kernel-doc warnings when building with W=1. These changes are only to comments.

Fixes 8db9e2a1b232 ("i40e: base driver")
Fixes 842ea1996335 ("i40e/base: save link module type")
Fixes fd72a2284a89 ("i40e/base: support LED blinking with new PHY")
Fixes 788fc17b2dec ("i40e/base: support proxy config for X722")
---
 drivers/net/i40e/base/i40e_common.c  | 10 +++++-----
 drivers/net/i40e/base/i40e_dcb.c     |  2 +-
 drivers/net/i40e/base/i40e_lan_hmc.c |  2 +-
 drivers/net/i40e/base/i40e_nvm.c     |  2 +-
 4 files changed, 8 insertions(+), 8 deletions(-)
drivers/net/i40e/base/i40e_common.c +5 -5
index e077bf8fd3..3f3896aea4 100644
@@ -2678,7 +2678,7 @@ enum i40e_status_code i40e_aq_set_vsi_vlan_promisc(struct i40e_hw *hw,
 }
 
 /**
- * i40e_get_vsi_params - get VSI configuration info
+ * i40e_aq_get_vsi_params - get VSI configuration info
  * @hw: pointer to the hw struct
  * @vsi_ctx: pointer to a vsi context struct
  * @cmd_details: pointer to command details structure or NULL
@@ -2939,7 +2939,7 @@ enum i40e_status_code i40e_get_link_status(struct i40e_hw *hw, bool *link_up)
 }
 
 /**
- * i40e_updatelink_status - update status of the HW network link
+ * i40e_update_link_info - update status of the HW network link
  * @hw: pointer to the hw struct
  **/
 enum i40e_status_code i40e_update_link_info(struct i40e_hw *hw)
@@ -4831,7 +4831,7 @@ enum i40e_status_code i40e_aq_del_udp_tunnel(struct i40e_hw *hw, u8 index,
 }
 
 /**
- * i40e_aq_get_switch_resource_alloc (0x0204)
+ * i40e_aq_get_switch_resource_alloc - command (0x0204) to get allocations
  * @hw: pointer to the hw struct
  * @num_entries: pointer to u8 to store the number of resource entries returned
  * @buf: pointer to a user supplied buffer.  This buffer must be large enough
@@ -6978,7 +6978,7 @@ u8 i40e_get_phy_address(struct i40e_hw *hw, u8 dev_num)
 }
 
 /**
- * i40e_blink_phy_led
+ * i40e_blink_phy_link_led
  * @hw: pointer to the HW structure
  * @time: time how long led will blinks in secs
  * @interval: gap between LED on and off in msecs
@@ -7825,7 +7825,7 @@ enum i40e_status_code i40e_aq_set_arp_proxy_config(struct i40e_hw *hw,
 }
 
 /**
- * i40e_aq_opc_set_ns_proxy_table_entry
+ * i40e_aq_set_ns_proxy_table_entry
  * @hw: pointer to the HW structure
  * @ns_proxy_table_entry: pointer to NS table entry command struct
  * @cmd_details: pointer to command details
drivers/net/i40e/base/i40e_dcb.c +1 -1
index 27b52bc365..8f9b7e823f 100644
@@ -235,7 +235,7 @@ static void i40e_parse_ieee_app_tlv(struct i40e_lldp_org_tlv *tlv,
 }
 
 /**
- * i40e_parse_ieee_etsrec_tlv
+ * i40e_parse_ieee_tlv
  * @tlv: IEEE 802.1Qaz TLV
  * @dcbcfg: Local store to update ETS REC data
  *
drivers/net/i40e/base/i40e_lan_hmc.c +1 -1
index d3969396f0..d3bd683ff3 100644
@@ -516,7 +516,7 @@ enum i40e_status_code i40e_configure_lan_hmc(struct i40e_hw *hw,
 }
 
 /**
- * i40e_delete_hmc_object - remove hmc objects
+ * i40e_delete_lan_hmc_object - remove hmc objects
  * @hw: pointer to the HW structure
  * @info: pointer to i40e_hmc_delete_obj_info struct
  *
drivers/net/i40e/base/i40e_nvm.c +1 -1
index 561ed21136..67e58cc195 100644
@@ -7,7 +7,7 @@
 #include "i40e_prototype.h"
 
 /**
- * i40e_init_nvm_ops - Initialize NVM function pointers
+ * i40e_init_nvm - Initialize NVM function pointers
  * @hw: pointer to the HW structure
  *
  * Setup the function pointers and the NVM info structure. Should be called
Signature · 1 line
2.25.1
#13 lore raw

PATCH 13/14 net/i40e/base: fix potentially uninitialized variables in NVM code

In reply to Robin Zhang

The status of i40e_read_nvm_word is not checked, so variables set from this function could be used uninitialized. In this case, preserve the existing flow that does not block initialization by initializing these values from the start.

The variable checksum from i40e_calc_nvm_checksum is used before return value is checked. Fix this logic.

Fixes 8d6c51fcd24b ("i40e/base: get OEM version")
Fixes 2db70574247b ("net/i40e/base: limit PF/VF specific code to that driver only")
Fixes 8db9e2a1b232 ("i40e: base driver")
Fixes 3ed6c3246f43 ("i40e/base: handle AQ timeout when releasing NVM")
---
 drivers/net/i40e/base/i40e_adminq.c | 6 ++++--
 drivers/net/i40e/base/i40e_nvm.c    | 5 +++--
 2 files changed, 7 insertions(+), 4 deletions(-)
drivers/net/i40e/base/i40e_adminq.c +4 -2
index eafacbdbec..d27ccde29a 100644
@@ -648,8 +648,10 @@ enum i40e_status_code i40e_init_adminq(struct i40e_hw *hw)
 {
 	struct i40e_adminq_info *aq = &hw->aq;
 	enum i40e_status_code ret_code;
-	u16 cfg_ptr, oem_hi, oem_lo;
-	u16 eetrack_lo, eetrack_hi;
+	u16 oem_hi = 0, oem_lo = 0;
+	u16 eetrack_hi = 0;
+	u16 eetrack_lo = 0;
+	u16 cfg_ptr = 0;
 	int retry = 0;
 
 	/* verify input for valid configuration */
drivers/net/i40e/base/i40e_nvm.c +3 -2
index 67e58cc195..f385042601 100644
@@ -755,10 +755,11 @@ enum i40e_status_code i40e_update_nvm_checksum(struct i40e_hw *hw)
 	DEBUGFUNC("i40e_update_nvm_checksum");
 
 	ret_code = i40e_calc_nvm_checksum(hw, &checksum);
-	le_sum = CPU_TO_LE16(checksum);
-	if (ret_code == I40E_SUCCESS)
+	if (ret_code == I40E_SUCCESS) {
+		le_sum = CPU_TO_LE16(checksum);
 		ret_code = i40e_write_nvm_aq(hw, 0x00, I40E_SR_SW_CHECKSUM_WORD,
 					     1, &le_sum, true);
+	}
 
 	return ret_code;
 }
Signature · 1 line
2.25.1
#14 lore raw

Re: [dpdk-dev] [PATCH 13/14] net/i40e/base: fix potentially uninitialized variables in NVM code

Quoted 12 lines

-----Original Message-----
From: Zhang, RobinX <[email protected]>
Sent: Friday, June 18, 2021 2:39 PM
To: [email protected]
Cc: Xing, Beilei <[email protected]>; Guo, Junfeng <[email protected]>; Yang, SteveX <[email protected]>; Zhang, RobinX <[email protected]>; [email protected]; Pau, Christopher <[email protected]>
Subject: [PATCH 13/14] net/i40e/base: fix potentially uninitialized variables in NVM code

Seems there're 2 fixes in the patch, please split them.

Quoted 62 lines

The status of i40e_read_nvm_word is not checked, so variables set from this function could be used uninitialized. In this case, preserve the existing flow that does not block initialization by initializing these values from the start.

The variable checksum from i40e_calc_nvm_checksum is used before return value is checked. Fix this logic.

Fixes 8d6c51fcd24b ("i40e/base: get OEM version")
Fixes 2db70574247b ("net/i40e/base: limit PF/VF specific code to that driver

only")

Fixes 8db9e2a1b232 ("i40e: base driver")
Fixes 3ed6c3246f43 ("i40e/base: handle AQ timeout when releasing NVM")
---
 drivers/net/i40e/base/i40e_adminq.c | 6 ++++--
 drivers/net/i40e/base/i40e_nvm.c    | 5 +++--
 2 files changed, 7 insertions(+), 4 deletions(-)
drivers/net/i40e/base/i40e_adminq.c +4 -2
index eafacbdbec..d27ccde29a 100644
@@ -648,8 +648,10 @@ enum i40e_status_code i40e_init_adminq(struct
 i40e_hw *hw)  {
 	struct i40e_adminq_info *aq = &hw->aq;
 	enum i40e_status_code ret_code;
-	u16 cfg_ptr, oem_hi, oem_lo;
-	u16 eetrack_lo, eetrack_hi;
+	u16 oem_hi = 0, oem_lo = 0;
+	u16 eetrack_hi = 0;
+	u16 eetrack_lo = 0;
+	u16 cfg_ptr = 0;
 	int retry = 0;
 
 	/* verify input for valid configuration */ diff --git

a/drivers/net/i40e/base/i40e_nvm.c b/drivers/net/i40e/base/i40e_nvm.c index 67e58cc195..f385042601 100644

drivers/net/i40e/base/i40e_nvm.c +3 -2
@@ -755,10 +755,11 @@ enum i40e_status_code
 i40e_update_nvm_checksum(struct i40e_hw *hw)
 	DEBUGFUNC("i40e_update_nvm_checksum");
 
 	ret_code = i40e_calc_nvm_checksum(hw, &checksum);
-	le_sum = CPU_TO_LE16(checksum);
-	if (ret_code == I40E_SUCCESS)
+	if (ret_code == I40E_SUCCESS) {
+		le_sum = CPU_TO_LE16(checksum);
 		ret_code = i40e_write_nvm_aq(hw, 0x00,
 I40E_SR_SW_CHECKSUM_WORD,
 					     1, &le_sum, true);
+	}
 

return ret_code;
}
--
2.25.1

#15 lore raw

PATCH 14/14 net/i40e/base: update version in readme

In reply to Robin Zhang

Update base code version in README.

---
 drivers/net/i40e/base/README | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/i40e/base/README +1 -1
index 6af2993116..c84764005b 100644
@@ -6,7 +6,7 @@ Intel® I40E driver
 ==================
 
 This directory contains source code of FreeBSD i40e driver of version
-cid-i40e.2020.08.27.tar.gz released by the team which develops
+cid-i40e.2021.04.29.tar.gz released by the team which develops
 basic drivers for any i40e NIC. The directory of base/ contains the
 original source package.
 This driver is valid for the product(s) listed below
Signature · 1 line
2.25.1
#16 lore raw

v2 cover i40e base code update

In reply to Robin Zhang

update i40e base code.

source code of i40e driver:
cid-i40e.2021.04.29.tar.gz

changelog in share repo:
From 59a080f4fafe ("i40e-shared: Add opcode 0x0406 and 0x0416 to Linux support") To bedcbea1063 ("i40e-shared: Fix potentially uninitialized variables in NVM code")

The following commits are ignored:
cb9139e3bce8 ("i40e-shared: Fix not blinking X722 with x557 PHY via ‘ethtool -p'")
c09d4f9cf390 ("i40e-shared: i40e-shared: Fix build warning -Wformat related to integer size")
ff8a1abc6c17 ("i40e-shared: Fix build warning with __packed") 59a080f4fafe ("i40e-shared: Add opcode 0x0406 and 0x0416 to Linux support")

v2:
- refine commit messages and macro name

Robin Zhang (14):
net/i40e/base: add new versions of send ASQ command functions net/i40e/base: update FW API version to 1.14 net/i40e/base: add support for Min Rollback Revision for 4 more X722
modules
net/i40e/base: set TSA table values when parsing CEE configuration net/i40e/base: define new Shadow RAM pointers net/i40e/base: fix PHY type identifiers for 2.5G and 5G adapters net/i40e/base: fix PF reset failed
net/i40e/base: fix update link data for X722 net/i40e/base: fix AOC media type reported by ethtool net/i40e/base: add flags and fields for double vlan processing net/i40e/base: 10GBASE-ER Optical modules recognition net/i40e/base: fix headers to match functions net/i40e/base: fix potentially uninitialized variables in NVM code net/i40e/base: update version in readme

 drivers/net/i40e/base/README            |   2 +-
 drivers/net/i40e/base/i40e_adminq.c     |  79 +++++++++--
 drivers/net/i40e/base/i40e_adminq_cmd.h |  48 +++++--
 drivers/net/i40e/base/i40e_common.c     | 176 +++++++++++++++++++-----
 drivers/net/i40e/base/i40e_dcb.c        |  10 +-
 drivers/net/i40e/base/i40e_lan_hmc.c    |   2 +-
 drivers/net/i40e/base/i40e_nvm.c        |   7 +-
 drivers/net/i40e/base/i40e_prototype.h  |  17 +++
 drivers/net/i40e/base/i40e_type.h       |  12 +-
 9 files changed, 288 insertions(+), 65 deletions(-)
Signature · 1 line
2.25.1
#17 lore raw

PATCH v2 1/14 net/i40e/base: add new versions of send ASQ command functions

ASQ send command functions are returning only i40e status codes yet some calling functions also need Admin Queue status that is stored in hw->aq.asq_last_status. Since hw object is stored on a heap it introduces a possibility for
a race condition in access to hw if calling function is not fast enough to read hw->aq.asq_last_status before next send ASQ command is executed.

Added new versions of send ASQ command functions that return Admin Queue status on the stack to avoid race conditions
in access to hw->aq.asq_last_status.
Added new _v2 version of i40e_aq_remove_macvlan and i40e_aq_add_macvlan that is using new _v2 versions of ASQ send command functions and returns the Admin Queue status on the stack.

---
 drivers/net/i40e/base/i40e_adminq.c    |  73 +++++++++++--
 drivers/net/i40e/base/i40e_common.c    | 139 ++++++++++++++++++++++---
 drivers/net/i40e/base/i40e_prototype.h |  17 +++
 3 files changed, 205 insertions(+), 24 deletions(-)
drivers/net/i40e/base/i40e_adminq.c +65 -8
index 0da45f03e4..eafacbdbec 100644
@@ -834,7 +834,7 @@ STATIC bool i40e_asq_done(struct i40e_hw *hw)
 }
 
 /**
- *  i40e_asq_send_command - send command to Admin Queue
+ *  i40e_asq_send_command_exec - send command to Admin Queue
  *  @hw: pointer to the hw struct
  *  @desc: prefilled descriptor describing the command (non DMA mem)
  *  @buff: buffer to use for indirect commands
@@ -844,11 +844,12 @@ STATIC bool i40e_asq_done(struct i40e_hw *hw)
  *  This is the main send command driver routine for the Admin Queue send
  *  queue.  It runs the queue, cleans the queue, etc
  **/
-enum i40e_status_code i40e_asq_send_command(struct i40e_hw *hw,
-				struct i40e_aq_desc *desc,
-				void *buff, /* can be NULL */
-				u16  buff_size,
-				struct i40e_asq_cmd_details *cmd_details)
+STATIC enum i40e_status_code
+i40e_asq_send_command_exec(struct i40e_hw *hw,
+			   struct i40e_aq_desc *desc,
+			   void *buff, /* can be NULL */
+			   u16  buff_size,
+			   struct i40e_asq_cmd_details *cmd_details)
 {
 	enum i40e_status_code status = I40E_SUCCESS;
 	struct i40e_dma_mem *dma_buff = NULL;
@@ -858,8 +859,6 @@ enum i40e_status_code i40e_asq_send_command(struct i40e_hw *hw,
 	u16  retval = 0;
 	u32  val = 0;
 
-	i40e_acquire_spinlock(&hw->aq.asq_spinlock);
-
 	hw->aq.asq_last_status = I40E_AQ_RC_OK;
 
 	if (hw->aq.asq.count == 0) {
@@ -1042,6 +1041,64 @@ enum i40e_status_code i40e_asq_send_command(struct i40e_hw *hw,
 	}
 
 asq_send_command_error:
+	return status;
+}
+
+/**
+ *  i40e_asq_send_command - send command to Admin Queue
+ *  @hw: pointer to the hw struct
+ *  @desc: prefilled descriptor describing the command (non DMA mem)
+ *  @buff: buffer to use for indirect commands
+ *  @buff_size: size of buffer for indirect commands
+ *  @cmd_details: pointer to command details structure
+ *
+ *  Acquires the lock and calls the main send command execution
+ *  routine.
+ **/
+enum i40e_status_code
+i40e_asq_send_command(struct i40e_hw *hw,
+		      struct i40e_aq_desc *desc,
+		      void *buff, /* can be NULL */
+		      u16  buff_size,
+		      struct i40e_asq_cmd_details *cmd_details)
+{
+	enum i40e_status_code status = I40E_SUCCESS;
+
+	i40e_acquire_spinlock(&hw->aq.asq_spinlock);
+	status = i40e_asq_send_command_exec(hw, desc, buff, buff_size,
+					    cmd_details);
+	i40e_release_spinlock(&hw->aq.asq_spinlock);
+	return status;
+}
+
+/**
+ *  i40e_asq_send_command_v2 - send command to Admin Queue
+ *  @hw: pointer to the hw struct
+ *  @desc: prefilled descriptor describing the command (non DMA mem)
+ *  @buff: buffer to use for indirect commands
+ *  @buff_size: size of buffer for indirect commands
+ *  @cmd_details: pointer to command details structure
+ *  @aq_status: pointer to Admin Queue status return value
+ *
+ *  Acquires the lock and calls the main send command execution
+ *  routine. Returns the last Admin Queue status in aq_status
+ *  to avoid race conditions in access to hw->aq.asq_last_status.
+ **/
+enum i40e_status_code
+i40e_asq_send_command_v2(struct i40e_hw *hw,
+			 struct i40e_aq_desc *desc,
+			 void *buff, /* can be NULL */
+			 u16  buff_size,
+			 struct i40e_asq_cmd_details *cmd_details,
+			 enum i40e_admin_queue_err *aq_status)
+{
+	enum i40e_status_code status = I40E_SUCCESS;
+
+	i40e_acquire_spinlock(&hw->aq.asq_spinlock);
+	status = i40e_asq_send_command_exec(hw, desc, buff, buff_size,
+					    cmd_details);
+	if (aq_status)
+		*aq_status = hw->aq.asq_last_status;
 	i40e_release_spinlock(&hw->aq.asq_spinlock);
 	return status;
 }
drivers/net/i40e/base/i40e_common.c +123 -16

187 lines not on this page · raw message

drivers/net/i40e/base/i40e_prototype.h +17 -0
index 124222e476..29c86c7fe8 100644
@@ -38,6 +38,13 @@ enum i40e_status_code i40e_asq_send_command(struct i40e_hw *hw,
 				void *buff, /* can be NULL */
 				u16  buff_size,
 				struct i40e_asq_cmd_details *cmd_details);
+enum i40e_status_code
+i40e_asq_send_command_v2(struct i40e_hw *hw,
+			 struct i40e_aq_desc *desc,
+			 void *buff, /* can be NULL */
+			 u16  buff_size,
+			 struct i40e_asq_cmd_details *cmd_details,
+			 enum i40e_admin_queue_err *aq_status);
 #ifdef VF_DRIVER
 bool i40e_asq_done(struct i40e_hw *hw);
 #endif
@@ -188,9 +195,19 @@ enum i40e_status_code i40e_aq_get_veb_parameters(struct i40e_hw *hw,
 enum i40e_status_code i40e_aq_add_macvlan(struct i40e_hw *hw, u16 vsi_id,
 			struct i40e_aqc_add_macvlan_element_data *mv_list,
 			u16 count, struct i40e_asq_cmd_details *cmd_details);
+enum i40e_status_code
+i40e_aq_add_macvlan_v2(struct i40e_hw *hw, u16 seid,
+		       struct i40e_aqc_add_macvlan_element_data *mv_list,
+		       u16 count, struct i40e_asq_cmd_details *cmd_details,
+		       enum i40e_admin_queue_err *aq_status);
 enum i40e_status_code i40e_aq_remove_macvlan(struct i40e_hw *hw, u16 vsi_id,
 			struct i40e_aqc_remove_macvlan_element_data *mv_list,
 			u16 count, struct i40e_asq_cmd_details *cmd_details);
+enum i40e_status_code
+i40e_aq_remove_macvlan_v2(struct i40e_hw *hw, u16 seid,
+			  struct i40e_aqc_remove_macvlan_element_data *mv_list,
+			  u16 count, struct i40e_asq_cmd_details *cmd_details,
+			  enum i40e_admin_queue_err *aq_status);
 enum i40e_status_code i40e_aq_add_mirrorrule(struct i40e_hw *hw, u16 sw_seid,
 			u16 rule_type, u16 dest_vsi, u16 count, __le16 *mr_list,
 			struct i40e_asq_cmd_details *cmd_details,
Signature · 1 line
2.25.1
#18 lore raw

PATCH v2 2/14 net/i40e/base: update FW API version to 1.14

In reply to Robin Zhang

Update FW increment API version to 1.14

---
 drivers/net/i40e/base/i40e_adminq_cmd.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/i40e/base/i40e_adminq_cmd.h +1 -1
index 2ca41db5d3..b5ac74787b 100644
@@ -13,7 +13,7 @@
 
 #define I40E_FW_API_VERSION_MAJOR	0x0001
 #define I40E_FW_API_VERSION_MINOR_X722	0x000B
-#define I40E_FW_API_VERSION_MINOR_X710	0x000C
+#define I40E_FW_API_VERSION_MINOR_X710	0x000E
 
 #define I40E_FW_MINOR_VERSION(_h) ((_h)->mac.type == I40E_MAC_XL710 ? \
 					I40E_FW_API_VERSION_MINOR_X710 : \
Signature · 1 line
2.25.1
#19 lore raw

PATCH v2 3/14 net/i40e/base: add support for Min Rollback Revision for 4 more X722 modules

In reply to Robin Zhang

This change increments X722 API version and adds new constants related to the extended implementation of Security Version Opt-In.

---
 drivers/net/i40e/base/i40e_adminq_cmd.h | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)
drivers/net/i40e/base/i40e_adminq_cmd.h +10 -6
index b5ac74787b..a73a08aae6 100644
@@ -12,7 +12,7 @@
  */
 
 #define I40E_FW_API_VERSION_MAJOR	0x0001
-#define I40E_FW_API_VERSION_MINOR_X722	0x000B
+#define I40E_FW_API_VERSION_MINOR_X722	0x000C
 #define I40E_FW_API_VERSION_MINOR_X710	0x000E
 
 #define I40E_FW_MINOR_VERSION(_h) ((_h)->mac.type == I40E_MAC_XL710 ? \
@@ -2425,11 +2425,15 @@ struct i40e_aqc_rollback_revision_update {
 	u8	optin_mode; /* bool */
 #define I40E_AQ_RREV_OPTION_MODE			0x01
 	u8	module_selected;
-#define I40E_AQ_RREV_MODULE_PCIE_ANALOG		0
-#define I40E_AQ_RREV_MODULE_PHY_ANALOG		1
-#define I40E_AQ_RREV_MODULE_OPTION_ROM		2
-#define I40E_AQ_RREV_MODULE_EMP_IMAGE		3
-#define I40E_AQ_RREV_MODULE_PE_IMAGE		4
+#define I40E_AQ_RREV_MODULE_PCIE_ANALOG			0
+#define I40E_AQ_RREV_MODULE_PHY_ANALOG			1
+#define I40E_AQ_RREV_MODULE_OPTION_ROM			2
+#define I40E_AQ_RREV_MODULE_EMP_IMAGE			3
+#define I40E_AQ_RREV_MODULE_PE_IMAGE			4
+#define I40E_AQ_RREV_MODULE_PHY_PLL_O_CONFIGURATION	5
+#define I40E_AQ_RREV_MODULE_PHY_0_CONFIGURATION		6
+#define I40E_AQ_RREV_MODULE_PHY_PLL_1_CONFIGURATION	7
+#define I40E_AQ_RREV_MODULE_PHY_1_CONFIGURATION		8
 	u8	reserved1[2];
 	u32	min_rrev;
 	u8	reserved2[8];
Signature · 1 line
2.25.1
#20 lore raw

PATCH v2 4/14 net/i40e/base: set TSA table values when parsing CEE configuration

In reply to Robin Zhang

Driver did not Set TSA table values when parsing CEE configuration obtained from FW.

---
 drivers/net/i40e/base/i40e_dcb.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
drivers/net/i40e/base/i40e_dcb.c +7 -1
index 388af3d64d..27b52bc365 100644
@@ -315,9 +315,15 @@ static void i40e_parse_cee_pgcfg_tlv(struct i40e_cee_feat_tlv *tlv,
 	 *        |pg0|pg1|pg2|pg3|pg4|pg5|pg6|pg7|
 	 *        ---------------------------------
 	 */
-	for (i = 0; i < I40E_MAX_TRAFFIC_CLASS; i++)
+	for (i = 0; i < I40E_MAX_TRAFFIC_CLASS; i++) {
 		etscfg->tcbwtable[i] = buf[offset++];
 
+		if (etscfg->prioritytable[i] == I40E_CEE_PGID_STRICT)
+			dcbcfg->etscfg.tsatable[i] = I40E_IEEE_TSA_STRICT;
+		else
+			dcbcfg->etscfg.tsatable[i] = I40E_IEEE_TSA_ETS;
+	}
+
 	/* Number of TCs supported (1 octet) */
 	etscfg->maxtcs = buf[offset];
 }
Signature · 1 line
2.25.1
#21 lore raw

PATCH v2 5/14 net/i40e/base: define new Shadow RAM pointers

In reply to Robin Zhang

Add definitions for Shadow RAM pointers: 6th FPA module, 5th FPA module in X722 and Preservation Rules Module.

---
 drivers/net/i40e/base/i40e_type.h | 3 +++
 1 file changed, 3 insertions(+)
drivers/net/i40e/base/i40e_type.h +3 -0
index cf41345834..e5a3729183 100644
@@ -1555,6 +1555,9 @@ struct i40e_hw_port_stats {
 #define I40E_SR_FEATURE_CONFIGURATION_PTR	0x49
 #define I40E_SR_CONFIGURATION_METADATA_PTR	0x4D
 #define I40E_SR_IMMEDIATE_VALUES_PTR		0x4E
+#define I40E_SR_PRESERVATION_RULES_PTR		0x70
+#define I40E_X722_SR_5TH_FREE_PROVISION_AREA_PTR	0x71
+#define I40E_SR_6TH_FREE_PROVISION_AREA_PTR	0x71
 
 /* Auxiliary field, mask and shift definition for Shadow RAM and NVM Flash */
 #define I40E_SR_VPD_MODULE_MAX_SIZE		1024
Signature · 1 line
2.25.1
#22 lore raw

PATCH v2 6/14 net/i40e/base: fix PHY type identifiers for 2.5G and 5G adapters

In reply to Robin Zhang

Unlike other supported adapters, 2.5G and 5G use different PHY type identifiers for reading/writing PHY settings and for reading link status. This commit intruduces separate PHY identifiers for these two operation types.

Fixes 988ed63c7441 ("net/i40e/base: add support for Carlsville device")
---
 drivers/net/i40e/base/i40e_adminq_cmd.h | 6 ++++--
 drivers/net/i40e/base/i40e_common.c     | 4 ++--
 drivers/net/i40e/base/i40e_type.h       | 8 ++------
 3 files changed, 8 insertions(+), 10 deletions(-)
drivers/net/i40e/base/i40e_adminq_cmd.h +4 -2
index a73a08aae6..1aafe1de38 100644
@@ -1947,8 +1947,10 @@ enum i40e_aq_phy_type {
 	I40E_PHY_TYPE_25GBASE_LR		= 0x22,
 	I40E_PHY_TYPE_25GBASE_AOC		= 0x23,
 	I40E_PHY_TYPE_25GBASE_ACC		= 0x24,
-	I40E_PHY_TYPE_2_5GBASE_T		= 0x30,
-	I40E_PHY_TYPE_5GBASE_T			= 0x31,
+	I40E_PHY_TYPE_2_5GBASE_T		= 0x26,
+	I40E_PHY_TYPE_5GBASE_T			= 0x27,
+	I40E_PHY_TYPE_2_5GBASE_T_LINK_STATUS	= 0x30,
+	I40E_PHY_TYPE_5GBASE_T_LINK_STATUS	= 0x31,
 	I40E_PHY_TYPE_MAX,
 	I40E_PHY_TYPE_NOT_SUPPORTED_HIGH_TEMP	= 0xFD,
 	I40E_PHY_TYPE_EMPTY			= 0xFE,
drivers/net/i40e/base/i40e_common.c +2 -2
index 32642f3e2b..ceedec68bf 100644
@@ -1280,8 +1280,8 @@ STATIC enum i40e_media_type i40e_get_media_type(struct i40e_hw *hw)
 		break;
 	case I40E_PHY_TYPE_100BASE_TX:
 	case I40E_PHY_TYPE_1000BASE_T:
-	case I40E_PHY_TYPE_2_5GBASE_T:
-	case I40E_PHY_TYPE_5GBASE_T:
+	case I40E_PHY_TYPE_2_5GBASE_T_LINK_STATUS:
+	case I40E_PHY_TYPE_5GBASE_T_LINK_STATUS:
 	case I40E_PHY_TYPE_10GBASE_T:
 		media = I40E_MEDIA_TYPE_BASET;
 		break;
drivers/net/i40e/base/i40e_type.h +2 -6
index e5a3729183..0323887550 100644
@@ -329,12 +329,8 @@ struct i40e_phy_info {
 					     I40E_PHY_TYPE_OFFSET)
 #define I40E_CAP_PHY_TYPE_25GBASE_ACC BIT_ULL(I40E_PHY_TYPE_25GBASE_ACC + \
 					     I40E_PHY_TYPE_OFFSET)
-/* Offset for 2.5G/5G PHY Types value to bit number conversion */
-#define I40E_PHY_TYPE_OFFSET2 (-10)
-#define I40E_CAP_PHY_TYPE_2_5GBASE_T BIT_ULL(I40E_PHY_TYPE_2_5GBASE_T + \
-					     I40E_PHY_TYPE_OFFSET2)
-#define I40E_CAP_PHY_TYPE_5GBASE_T BIT_ULL(I40E_PHY_TYPE_5GBASE_T + \
-					     I40E_PHY_TYPE_OFFSET2)
+#define I40E_CAP_PHY_TYPE_2_5GBASE_T BIT_ULL(I40E_PHY_TYPE_2_5GBASE_T)
+#define I40E_CAP_PHY_TYPE_5GBASE_T BIT_ULL(I40E_PHY_TYPE_5GBASE_T)
 #define I40E_HW_CAP_MAX_GPIO			30
 #define I40E_HW_CAP_MDIO_PORT_MODE_MDIO		0
 #define I40E_HW_CAP_MDIO_PORT_MODE_I2C		1
Signature · 1 line
2.25.1
#23 lore raw

PATCH v2 7/14 net/i40e/base: fix PF reset failed

In reply to Robin Zhang

PF has to delete all the filters during reset.
If it is fully loaded with filters then it is possible that it will take more than 200 ms to finish the reset resulting in timeout during pf_reset and
PF reset failed, -15 error indication.
Increasing the timeout value for PF reset from 200 to 1000 to give PF more time to finish reset if it is loaded with filters.

Fixes 1e32378f0774 ("i40e/base: increase PF reset max loop limit")
---
 drivers/net/i40e/base/i40e_common.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/i40e/base/i40e_common.c +1 -1
index ceedec68bf..aa424e6010 100644
@@ -1341,7 +1341,7 @@ STATIC enum i40e_status_code i40e_poll_globr(struct i40e_hw *hw,
 	return I40E_ERR_RESET_FAILED;
 }
 
-#define I40E_PF_RESET_WAIT_COUNT	200
+#define I40E_PF_RESET_WAIT_COUNT	1000
 /**
  * i40e_pf_reset - Reset the PF
  * @hw: pointer to the hardware structure
Signature · 1 line
2.25.1
#24 lore raw

PATCH v2 8/14 net/i40e/base: fix update link data for X722

In reply to Robin Zhang

The X722 card has 'Link Type' information elsewhere than the X710. Previously, for all cards, the 'Link Type' information was retrieved by opcode 0x0607 and this value was wrong for all X722 cards. Now this information for X722 only is taken by opcode 0x0600 (function: i40e_aq_get_phy_capabilities) instead of an opcode 0x0607 (function: i40e_aq_get_link_info).
All other parameters read by opcode 0x0607 unchanged.

Fixes e6691b428eb1 ("i40e/base: fix PHY NVM interaction")
Fixes 75c3de654ead ("net/i40e/base: fix long link down notification time")
---
 drivers/net/i40e/base/i40e_common.c | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)
drivers/net/i40e/base/i40e_common.c +10 -4
index aa424e6010..ef061a6b63 100644
@@ -2078,6 +2078,9 @@ enum i40e_status_code i40e_aq_get_link_info(struct i40e_hw *hw,
 	     hw->aq.fw_min_ver < 40)) && hw_link_info->phy_type == 0xE)
 		hw_link_info->phy_type = I40E_PHY_TYPE_10GBASE_SFPP_CU;
 
+	/* 'Get Link Status' response data structure from X722 FW has
+	 * different format and does not contain this information
+	 */
 	if (hw->flags & I40E_HW_FLAG_AQ_PHY_ACCESS_CAPABLE &&
 	    hw->mac.type != I40E_MAC_X722) {
 		__le32 tmp;
@@ -2948,10 +2951,13 @@ enum i40e_status_code i40e_update_link_info(struct i40e_hw *hw)
 		return status;
 
 	/* extra checking needed to ensure link info to user is timely */
-	if ((hw->phy.link_info.link_info & I40E_AQ_MEDIA_AVAILABLE) &&
-	    ((hw->phy.link_info.link_info & I40E_AQ_LINK_UP) ||
-	     !(hw->phy.link_info_old.link_info & I40E_AQ_LINK_UP))) {
-		status = i40e_aq_get_phy_capabilities(hw, false, false,
+	if (((hw->phy.link_info.link_info & I40E_AQ_MEDIA_AVAILABLE) &&
+	     ((hw->phy.link_info.link_info & I40E_AQ_LINK_UP) ||
+	      !(hw->phy.link_info_old.link_info & I40E_AQ_LINK_UP))) ||
+		hw->mac.type == I40E_MAC_X722) {
+		status = i40e_aq_get_phy_capabilities(hw, false,
+						      hw->mac.type ==
+						      I40E_MAC_X722,
 						      &abilities, NULL);
 		if (status)
 			return status;
Signature · 1 line
2.25.1
#25 lore raw

PATCH v2 9/14 net/i40e/base: fix AOC media type reported by ethtool

In reply to Robin Zhang

For Active Optical Cable (AOC) the correct media type is "Fibre", not "Direct Attach Copper".

Fixes d749d4d89969 ("i40e/base: add AOC PHY types")
Fixes aa153cc89ff0 ("net/i40e/base: add new PHY types for 25G AOC and

ACC")
Cc: [email protected]

---
 drivers/net/i40e/base/i40e_common.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/net/i40e/base/i40e_common.c +3 -3
index ef061a6b63..2ca6a13e79 100644
@@ -1276,6 +1276,9 @@ STATIC enum i40e_media_type i40e_get_media_type(struct i40e_hw *hw)
 	case I40E_PHY_TYPE_40GBASE_LR4:
 	case I40E_PHY_TYPE_25GBASE_LR:
 	case I40E_PHY_TYPE_25GBASE_SR:
+	case I40E_PHY_TYPE_10GBASE_AOC:
+	case I40E_PHY_TYPE_25GBASE_AOC:
+	case I40E_PHY_TYPE_40GBASE_AOC:
 		media = I40E_MEDIA_TYPE_FIBER;
 		break;
 	case I40E_PHY_TYPE_100BASE_TX:
@@ -1290,10 +1293,7 @@ STATIC enum i40e_media_type i40e_get_media_type(struct i40e_hw *hw)
 	case I40E_PHY_TYPE_10GBASE_CR1:
 	case I40E_PHY_TYPE_40GBASE_CR4:
 	case I40E_PHY_TYPE_10GBASE_SFPP_CU:
-	case I40E_PHY_TYPE_40GBASE_AOC:
-	case I40E_PHY_TYPE_10GBASE_AOC:
 	case I40E_PHY_TYPE_25GBASE_CR:
-	case I40E_PHY_TYPE_25GBASE_AOC:
 	case I40E_PHY_TYPE_25GBASE_ACC:
 		media = I40E_MEDIA_TYPE_DA;
 		break;
Signature · 1 line
2.25.1
#26 lore raw

PATCH v2 10/14 net/i40e/base: add flags and fields for double vlan processing

In reply to Robin Zhang

Add flags for outer vlan and include set port parameters in Linux compilation.
Add flags, which describe port and switch state for both double vlan functionality and outer vlan processing.

---
 drivers/net/i40e/base/i40e_adminq_cmd.h | 22 ++++++++++++++++++++--
 1 file changed, 20 insertions(+), 2 deletions(-)
drivers/net/i40e/base/i40e_adminq_cmd.h +20 -2
index 1aafe1de38..646cfd0398 100644
@@ -768,6 +768,7 @@ struct i40e_aqc_set_switch_config {
 #define I40E_AQ_SET_SWITCH_CFG_PROMISC		0x0001
 #define I40E_AQ_SET_SWITCH_CFG_L2_FILTER	0x0002
 #define I40E_AQ_SET_SWITCH_CFG_HW_ATR_EVICT	0x0004
+#define I40E_AQ_SET_SWITCH_CFG_OUTER_VLAN	0x0008
 	__le16	valid_flags;
 	/* The ethertype in switch_tag is dropped on ingress and used
 	 * internally by the switch. Set this to zero for the default
@@ -904,7 +905,7 @@ struct i40e_aqc_vsi_properties_data {
 	u8	sec_reserved;
 	/* VLAN section */
 	__le16	pvid; /* VLANS include priority bits */
-	__le16	fcoe_pvid;
+	__le16	outer_vlan;
 	u8	port_vlan_flags;
 #define I40E_AQ_VSI_PVLAN_MODE_SHIFT	0x00
 #define I40E_AQ_VSI_PVLAN_MODE_MASK	(0x03 << \
@@ -920,7 +921,24 @@ struct i40e_aqc_vsi_properties_data {
 #define I40E_AQ_VSI_PVLAN_EMOD_STR_UP	0x08
 #define I40E_AQ_VSI_PVLAN_EMOD_STR	0x10
 #define I40E_AQ_VSI_PVLAN_EMOD_NOTHING	0x18
-	u8	pvlan_reserved[3];
+	u8	outer_vlan_flags;
+#define I40E_AQ_VSI_OVLAN_MODE_SHIFT	0x00
+#define I40E_AQ_VSI_OVLAN_MODE_MASK	(0x03 << \
+					 I40E_AQ_VSI_OVLAN_MODE_SHIFT)
+#define I40E_AQ_VSI_OVLAN_MODE_UNTAGGED	0x01
+#define I40E_AQ_VSI_OVLAN_MODE_TAGGED	0x02
+#define I40E_AQ_VSI_OVLAN_MODE_ALL	0x03
+#define I40E_AQ_VSI_OVLAN_INSERT_PVID	0x04
+#define I40E_AQ_VSI_OVLAN_EMOD_SHIFT	0x03
+#define I40E_AQ_VSI_OVLAN_EMOD_MASK	(0x03 <<\
+					 I40E_AQ_VSI_OVLAN_EMOD_SHIFT)
+#define I40E_AQ_VSI_OVLAN_EMOD_SHOW_ALL	0x00
+#define I40E_AQ_VSI_OVLAN_EMOD_SHOW_UP	0x01
+#define I40E_AQ_VSI_OVLAN_EMOD_HIDE_ALL	0x02
+#define I40E_AQ_VSI_OVLAN_EMOD_NOTHING	0x03
+#define I40E_AQ_VSI_OVLAN_CTRL_ENA	0x04
+
+	u8	pvlan_reserved[2];
 	/* ingress egress up sections */
 	__le32	ingress_table; /* bitmap, 3 bits per up */
 #define I40E_AQ_VSI_UP_TABLE_UP0_SHIFT	0
Signature · 1 line
2.25.1
#27 lore raw

PATCH v2 11/14 net/i40e/base: 10GBASE-ER Optical modules recognition

In reply to Robin Zhang

This change adds a new PHY type for 10GBASE-ER modules.

---
 drivers/net/i40e/base/i40e_adminq_cmd.h | 2 ++
 drivers/net/i40e/base/i40e_common.c     | 1 +
 drivers/net/i40e/base/i40e_type.h       | 1 +
 3 files changed, 4 insertions(+)
drivers/net/i40e/base/i40e_adminq_cmd.h +2 -0
index 646cfd0398..c41dc71cdf 100644
@@ -1945,6 +1945,7 @@ enum i40e_aq_phy_type {
 	I40E_PHY_TYPE_40GBASE_AOC		= 0xD,
 	I40E_PHY_TYPE_UNRECOGNIZED		= 0xE,
 	I40E_PHY_TYPE_UNSUPPORTED		= 0xF,
+	I40E_PHY_TYPE_10GBASE_ER		= 0x10,
 	I40E_PHY_TYPE_100BASE_TX		= 0x11,
 	I40E_PHY_TYPE_1000BASE_T		= 0x12,
 	I40E_PHY_TYPE_10GBASE_T			= 0x13,
@@ -1991,6 +1992,7 @@ enum i40e_aq_phy_type {
 				BIT_ULL(I40E_PHY_TYPE_40GBASE_AOC) | \
 				BIT_ULL(I40E_PHY_TYPE_UNRECOGNIZED) | \
 				BIT_ULL(I40E_PHY_TYPE_UNSUPPORTED) | \
+				BIT_ULL(I40E_PHY_TYPE_10GBASE_ER) | \
 				BIT_ULL(I40E_PHY_TYPE_100BASE_TX) | \
 				BIT_ULL(I40E_PHY_TYPE_1000BASE_T) | \
 				BIT_ULL(I40E_PHY_TYPE_10GBASE_T) | \
drivers/net/i40e/base/i40e_common.c +1 -0
index 2ca6a13e79..e077bf8fd3 100644
@@ -1268,6 +1268,7 @@ STATIC enum i40e_media_type i40e_get_media_type(struct i40e_hw *hw)
 	enum i40e_media_type media;
 
 	switch (hw->phy.link_info.phy_type) {
+	case I40E_PHY_TYPE_10GBASE_ER:
 	case I40E_PHY_TYPE_10GBASE_SR:
 	case I40E_PHY_TYPE_10GBASE_LR:
 	case I40E_PHY_TYPE_1000BASE_SX:
drivers/net/i40e/base/i40e_type.h +1 -0
index 0323887550..86b9eeeb43 100644
@@ -294,6 +294,7 @@ struct i40e_phy_info {
 #define I40E_CAP_PHY_TYPE_10GBASE_CR1_CU BIT_ULL(I40E_PHY_TYPE_10GBASE_CR1_CU)
 #define I40E_CAP_PHY_TYPE_10GBASE_AOC BIT_ULL(I40E_PHY_TYPE_10GBASE_AOC)
 #define I40E_CAP_PHY_TYPE_40GBASE_AOC BIT_ULL(I40E_PHY_TYPE_40GBASE_AOC)
+#define I40E_CAP_PHY_TYPE_10GBASE_ER BIT_ULL(I40E_PHY_TYPE_10GBASE_ER)
 #define I40E_CAP_PHY_TYPE_100BASE_TX BIT_ULL(I40E_PHY_TYPE_100BASE_TX)
 #define I40E_CAP_PHY_TYPE_1000BASE_T BIT_ULL(I40E_PHY_TYPE_1000BASE_T)
 #define I40E_CAP_PHY_TYPE_10GBASE_T BIT_ULL(I40E_PHY_TYPE_10GBASE_T)
Signature · 1 line
2.25.1
#28 lore raw

PATCH v2 12/14 net/i40e/base: fix headers to match functions

In reply to Robin Zhang

Fix several kernel-doc warnings when building with W=1. These changes are only to comments.

Fixes 8db9e2a1b232 ("i40e: base driver")
Fixes 842ea1996335 ("i40e/base: save link module type")
Fixes fd72a2284a89 ("i40e/base: support LED blinking with new PHY")
Fixes 788fc17b2dec ("i40e/base: support proxy config for X722")
---
 drivers/net/i40e/base/i40e_common.c  | 10 +++++-----
 drivers/net/i40e/base/i40e_dcb.c     |  2 +-
 drivers/net/i40e/base/i40e_lan_hmc.c |  2 +-
 drivers/net/i40e/base/i40e_nvm.c     |  2 +-
 4 files changed, 8 insertions(+), 8 deletions(-)
drivers/net/i40e/base/i40e_common.c +5 -5
index e077bf8fd3..3f3896aea4 100644
@@ -2678,7 +2678,7 @@ enum i40e_status_code i40e_aq_set_vsi_vlan_promisc(struct i40e_hw *hw,
 }
 
 /**
- * i40e_get_vsi_params - get VSI configuration info
+ * i40e_aq_get_vsi_params - get VSI configuration info
  * @hw: pointer to the hw struct
  * @vsi_ctx: pointer to a vsi context struct
  * @cmd_details: pointer to command details structure or NULL
@@ -2939,7 +2939,7 @@ enum i40e_status_code i40e_get_link_status(struct i40e_hw *hw, bool *link_up)
 }
 
 /**
- * i40e_updatelink_status - update status of the HW network link
+ * i40e_update_link_info - update status of the HW network link
  * @hw: pointer to the hw struct
  **/
 enum i40e_status_code i40e_update_link_info(struct i40e_hw *hw)
@@ -4831,7 +4831,7 @@ enum i40e_status_code i40e_aq_del_udp_tunnel(struct i40e_hw *hw, u8 index,
 }
 
 /**
- * i40e_aq_get_switch_resource_alloc (0x0204)
+ * i40e_aq_get_switch_resource_alloc - command (0x0204) to get allocations
  * @hw: pointer to the hw struct
  * @num_entries: pointer to u8 to store the number of resource entries returned
  * @buf: pointer to a user supplied buffer.  This buffer must be large enough
@@ -6978,7 +6978,7 @@ u8 i40e_get_phy_address(struct i40e_hw *hw, u8 dev_num)
 }
 
 /**
- * i40e_blink_phy_led
+ * i40e_blink_phy_link_led
  * @hw: pointer to the HW structure
  * @time: time how long led will blinks in secs
  * @interval: gap between LED on and off in msecs
@@ -7825,7 +7825,7 @@ enum i40e_status_code i40e_aq_set_arp_proxy_config(struct i40e_hw *hw,
 }
 
 /**
- * i40e_aq_opc_set_ns_proxy_table_entry
+ * i40e_aq_set_ns_proxy_table_entry
  * @hw: pointer to the HW structure
  * @ns_proxy_table_entry: pointer to NS table entry command struct
  * @cmd_details: pointer to command details
drivers/net/i40e/base/i40e_dcb.c +1 -1
index 27b52bc365..8f9b7e823f 100644
@@ -235,7 +235,7 @@ static void i40e_parse_ieee_app_tlv(struct i40e_lldp_org_tlv *tlv,
 }
 
 /**
- * i40e_parse_ieee_etsrec_tlv
+ * i40e_parse_ieee_tlv
  * @tlv: IEEE 802.1Qaz TLV
  * @dcbcfg: Local store to update ETS REC data
  *
drivers/net/i40e/base/i40e_lan_hmc.c +1 -1
index d3969396f0..d3bd683ff3 100644
@@ -516,7 +516,7 @@ enum i40e_status_code i40e_configure_lan_hmc(struct i40e_hw *hw,
 }
 
 /**
- * i40e_delete_hmc_object - remove hmc objects
+ * i40e_delete_lan_hmc_object - remove hmc objects
  * @hw: pointer to the HW structure
  * @info: pointer to i40e_hmc_delete_obj_info struct
  *
drivers/net/i40e/base/i40e_nvm.c +1 -1
index 561ed21136..67e58cc195 100644
@@ -7,7 +7,7 @@
 #include "i40e_prototype.h"
 
 /**
- * i40e_init_nvm_ops - Initialize NVM function pointers
+ * i40e_init_nvm - Initialize NVM function pointers
  * @hw: pointer to the HW structure
  *
  * Setup the function pointers and the NVM info structure. Should be called
Signature · 1 line
2.25.1
#29 lore raw

PATCH v2 13/14 net/i40e/base: fix potentially uninitialized variables in NVM code

In reply to Robin Zhang

The status of i40e_read_nvm_word is not checked, so variables set from this function could be used uninitialized. In this case, preserve the existing flow that does not block initialization by initializing these values from the start.

The variable checksum from i40e_calc_nvm_checksum is used before return value is checked. Fix this logic.

Fixes 8d6c51fcd24b ("i40e/base: get OEM version")
Fixes 2db70574247b ("net/i40e/base: limit PF/VF specific code to that driver only")
Fixes 8db9e2a1b232 ("i40e: base driver")
Fixes 3ed6c3246f43 ("i40e/base: handle AQ timeout when releasing NVM")
---
 drivers/net/i40e/base/i40e_adminq.c | 6 ++++--
 drivers/net/i40e/base/i40e_nvm.c    | 5 +++--
 2 files changed, 7 insertions(+), 4 deletions(-)
drivers/net/i40e/base/i40e_adminq.c +4 -2
index eafacbdbec..d27ccde29a 100644
@@ -648,8 +648,10 @@ enum i40e_status_code i40e_init_adminq(struct i40e_hw *hw)
 {
 	struct i40e_adminq_info *aq = &hw->aq;
 	enum i40e_status_code ret_code;
-	u16 cfg_ptr, oem_hi, oem_lo;
-	u16 eetrack_lo, eetrack_hi;
+	u16 oem_hi = 0, oem_lo = 0;
+	u16 eetrack_hi = 0;
+	u16 eetrack_lo = 0;
+	u16 cfg_ptr = 0;
 	int retry = 0;
 
 	/* verify input for valid configuration */
drivers/net/i40e/base/i40e_nvm.c +3 -2
index 67e58cc195..f385042601 100644
@@ -755,10 +755,11 @@ enum i40e_status_code i40e_update_nvm_checksum(struct i40e_hw *hw)
 	DEBUGFUNC("i40e_update_nvm_checksum");
 
 	ret_code = i40e_calc_nvm_checksum(hw, &checksum);
-	le_sum = CPU_TO_LE16(checksum);
-	if (ret_code == I40E_SUCCESS)
+	if (ret_code == I40E_SUCCESS) {
+		le_sum = CPU_TO_LE16(checksum);
 		ret_code = i40e_write_nvm_aq(hw, 0x00, I40E_SR_SW_CHECKSUM_WORD,
 					     1, &le_sum, true);
+	}
 
 	return ret_code;
 }
Signature · 1 line
2.25.1
#30 lore raw

PATCH v2 14/14 net/i40e/base: update version in readme

In reply to Robin Zhang

Update base code version in README.

---
 drivers/net/i40e/base/README | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/i40e/base/README +1 -1
index 6af2993116..c84764005b 100644
@@ -6,7 +6,7 @@ Intel® I40E driver
 ==================
 
 This directory contains source code of FreeBSD i40e driver of version
-cid-i40e.2020.08.27.tar.gz released by the team which develops
+cid-i40e.2021.04.29.tar.gz released by the team which develops
 basic drivers for any i40e NIC. The directory of base/ contains the
 original source package.
 This driver is valid for the product(s) listed below
Signature · 1 line
2.25.1
#31 lore raw

v3 cover i40e base code update

In reply to Robin Zhang

update i40e base code.

source code of i40e driver:
cid-i40e.2021.04.29.tar.gz

changelog in i40e share repo:
From 59a080f4fafe ("i40e-shared: Add opcode 0x0406 and 0x0416 to Linux support") To bedcbea1063 ("i40e-shared: Fix potentially uninitialized variables in NVM code")

The following commits are ignored:
cb9139e3bce8 ("i40e-shared: Fix not blinking X722 with x557 PHY via ‘ethtool -p'")
c09d4f9cf390 ("i40e-shared: i40e-shared: Fix build warning -Wformat related to integer size")
ff8a1abc6c17 ("i40e-shared: Fix build warning with __packed") 59a080f4fafe ("i40e-shared: Add opcode 0x0406 and 0x0416 to Linux support")

v2:
- refine commit messages and macro name
v3:
- there has a fix patch contains two issues, split it into two patches

Robin Zhang (15):
net/i40e/base: add new versions of send ASQ command functions net/i40e/base: update X710 FW API version to 1.14 net/i40e/base: add support for Min Rollback Revision for 4 more X722
modules
net/i40e/base: set TSA table values when parsing CEE configuration net/i40e/base: define new Shadow RAM pointers net/i40e/base: fix PHY type identifiers for 2.5G and 5G adapters net/i40e/base: fix PF reset failed
net/i40e/base: fix update link data for X722 net/i40e/base: fix AOC media type reported by ethtool net/i40e/base: add flags and fields for double vlan processing net/i40e/base: 10GBASE-ER Optical modules recognition net/i40e/base: fix headers to match functions net/i40e/base: fix potentially uninitialized variables in NVM code net/i40e/base: fix checksum is used before return value is checked net/i40e/base: update version in readme

 drivers/net/i40e/base/README            |   2 +-
 drivers/net/i40e/base/i40e_adminq.c     |  79 +++++++++--
 drivers/net/i40e/base/i40e_adminq_cmd.h |  48 +++++--
 drivers/net/i40e/base/i40e_common.c     | 176 +++++++++++++++++++-----
 drivers/net/i40e/base/i40e_dcb.c        |  10 +-
 drivers/net/i40e/base/i40e_lan_hmc.c    |   2 +-
 drivers/net/i40e/base/i40e_nvm.c        |   7 +-
 drivers/net/i40e/base/i40e_prototype.h  |  17 +++
 drivers/net/i40e/base/i40e_type.h       |  12 +-
 9 files changed, 288 insertions(+), 65 deletions(-)
Signature · 1 line
2.25.1
#32 lore raw

PATCH v3 1/15 net/i40e/base: add new versions of send ASQ command functions

ASQ send command functions are returning only i40e status codes yet some calling functions also need Admin Queue status that is stored in hw->aq.asq_last_status. Since hw object is stored on a heap it introduces a possibility for
a race condition in access to hw if calling function is not fast enough to read hw->aq.asq_last_status before next send ASQ command is executed.

Added new versions of send ASQ command functions that return Admin Queue status on the stack to avoid race conditions
in access to hw->aq.asq_last_status.
Added new _v2 version of i40e_aq_remove_macvlan and i40e_aq_add_macvlan that is using new _v2 versions of ASQ send command functions and returns the Admin Queue status on the stack.

---
 drivers/net/i40e/base/i40e_adminq.c    |  73 +++++++++++--
 drivers/net/i40e/base/i40e_common.c    | 139 ++++++++++++++++++++++---
 drivers/net/i40e/base/i40e_prototype.h |  17 +++
 3 files changed, 205 insertions(+), 24 deletions(-)
drivers/net/i40e/base/i40e_adminq.c +65 -8
index 0da45f03e4..eafacbdbec 100644
@@ -834,7 +834,7 @@ STATIC bool i40e_asq_done(struct i40e_hw *hw)
 }
 
 /**
- *  i40e_asq_send_command - send command to Admin Queue
+ *  i40e_asq_send_command_exec - send command to Admin Queue
  *  @hw: pointer to the hw struct
  *  @desc: prefilled descriptor describing the command (non DMA mem)
  *  @buff: buffer to use for indirect commands
@@ -844,11 +844,12 @@ STATIC bool i40e_asq_done(struct i40e_hw *hw)
  *  This is the main send command driver routine for the Admin Queue send
  *  queue.  It runs the queue, cleans the queue, etc
  **/
-enum i40e_status_code i40e_asq_send_command(struct i40e_hw *hw,
-				struct i40e_aq_desc *desc,
-				void *buff, /* can be NULL */
-				u16  buff_size,
-				struct i40e_asq_cmd_details *cmd_details)
+STATIC enum i40e_status_code
+i40e_asq_send_command_exec(struct i40e_hw *hw,
+			   struct i40e_aq_desc *desc,
+			   void *buff, /* can be NULL */
+			   u16  buff_size,
+			   struct i40e_asq_cmd_details *cmd_details)
 {
 	enum i40e_status_code status = I40E_SUCCESS;
 	struct i40e_dma_mem *dma_buff = NULL;
@@ -858,8 +859,6 @@ enum i40e_status_code i40e_asq_send_command(struct i40e_hw *hw,
 	u16  retval = 0;
 	u32  val = 0;
 
-	i40e_acquire_spinlock(&hw->aq.asq_spinlock);
-
 	hw->aq.asq_last_status = I40E_AQ_RC_OK;
 
 	if (hw->aq.asq.count == 0) {
@@ -1042,6 +1041,64 @@ enum i40e_status_code i40e_asq_send_command(struct i40e_hw *hw,
 	}
 
 asq_send_command_error:
+	return status;
+}
+
+/**
+ *  i40e_asq_send_command - send command to Admin Queue
+ *  @hw: pointer to the hw struct
+ *  @desc: prefilled descriptor describing the command (non DMA mem)
+ *  @buff: buffer to use for indirect commands
+ *  @buff_size: size of buffer for indirect commands
+ *  @cmd_details: pointer to command details structure
+ *
+ *  Acquires the lock and calls the main send command execution
+ *  routine.
+ **/
+enum i40e_status_code
+i40e_asq_send_command(struct i40e_hw *hw,
+		      struct i40e_aq_desc *desc,
+		      void *buff, /* can be NULL */
+		      u16  buff_size,
+		      struct i40e_asq_cmd_details *cmd_details)
+{
+	enum i40e_status_code status = I40E_SUCCESS;
+
+	i40e_acquire_spinlock(&hw->aq.asq_spinlock);
+	status = i40e_asq_send_command_exec(hw, desc, buff, buff_size,
+					    cmd_details);
+	i40e_release_spinlock(&hw->aq.asq_spinlock);
+	return status;
+}
+
+/**
+ *  i40e_asq_send_command_v2 - send command to Admin Queue
+ *  @hw: pointer to the hw struct
+ *  @desc: prefilled descriptor describing the command (non DMA mem)
+ *  @buff: buffer to use for indirect commands
+ *  @buff_size: size of buffer for indirect commands
+ *  @cmd_details: pointer to command details structure
+ *  @aq_status: pointer to Admin Queue status return value
+ *
+ *  Acquires the lock and calls the main send command execution
+ *  routine. Returns the last Admin Queue status in aq_status
+ *  to avoid race conditions in access to hw->aq.asq_last_status.
+ **/
+enum i40e_status_code
+i40e_asq_send_command_v2(struct i40e_hw *hw,
+			 struct i40e_aq_desc *desc,
+			 void *buff, /* can be NULL */
+			 u16  buff_size,
+			 struct i40e_asq_cmd_details *cmd_details,
+			 enum i40e_admin_queue_err *aq_status)
+{
+	enum i40e_status_code status = I40E_SUCCESS;
+
+	i40e_acquire_spinlock(&hw->aq.asq_spinlock);
+	status = i40e_asq_send_command_exec(hw, desc, buff, buff_size,
+					    cmd_details);
+	if (aq_status)
+		*aq_status = hw->aq.asq_last_status;
 	i40e_release_spinlock(&hw->aq.asq_spinlock);
 	return status;
 }
drivers/net/i40e/base/i40e_common.c +123 -16

187 lines not on this page · raw message

drivers/net/i40e/base/i40e_prototype.h +17 -0
index 124222e476..29c86c7fe8 100644
@@ -38,6 +38,13 @@ enum i40e_status_code i40e_asq_send_command(struct i40e_hw *hw,
 				void *buff, /* can be NULL */
 				u16  buff_size,
 				struct i40e_asq_cmd_details *cmd_details);
+enum i40e_status_code
+i40e_asq_send_command_v2(struct i40e_hw *hw,
+			 struct i40e_aq_desc *desc,
+			 void *buff, /* can be NULL */
+			 u16  buff_size,
+			 struct i40e_asq_cmd_details *cmd_details,
+			 enum i40e_admin_queue_err *aq_status);
 #ifdef VF_DRIVER
 bool i40e_asq_done(struct i40e_hw *hw);
 #endif
@@ -188,9 +195,19 @@ enum i40e_status_code i40e_aq_get_veb_parameters(struct i40e_hw *hw,
 enum i40e_status_code i40e_aq_add_macvlan(struct i40e_hw *hw, u16 vsi_id,
 			struct i40e_aqc_add_macvlan_element_data *mv_list,
 			u16 count, struct i40e_asq_cmd_details *cmd_details);
+enum i40e_status_code
+i40e_aq_add_macvlan_v2(struct i40e_hw *hw, u16 seid,
+		       struct i40e_aqc_add_macvlan_element_data *mv_list,
+		       u16 count, struct i40e_asq_cmd_details *cmd_details,
+		       enum i40e_admin_queue_err *aq_status);
 enum i40e_status_code i40e_aq_remove_macvlan(struct i40e_hw *hw, u16 vsi_id,
 			struct i40e_aqc_remove_macvlan_element_data *mv_list,
 			u16 count, struct i40e_asq_cmd_details *cmd_details);
+enum i40e_status_code
+i40e_aq_remove_macvlan_v2(struct i40e_hw *hw, u16 seid,
+			  struct i40e_aqc_remove_macvlan_element_data *mv_list,
+			  u16 count, struct i40e_asq_cmd_details *cmd_details,
+			  enum i40e_admin_queue_err *aq_status);
 enum i40e_status_code i40e_aq_add_mirrorrule(struct i40e_hw *hw, u16 sw_seid,
 			u16 rule_type, u16 dest_vsi, u16 count, __le16 *mr_list,
 			struct i40e_asq_cmd_details *cmd_details,
Signature · 1 line
2.25.1
#33 lore raw

PATCH v3 2/15 net/i40e/base: update X710 FW API version to 1.14

In reply to Robin Zhang

Update X710 FW increment API version to 1.14

---
 drivers/net/i40e/base/i40e_adminq_cmd.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/i40e/base/i40e_adminq_cmd.h +1 -1
index 2ca41db5d3..b5ac74787b 100644
@@ -13,7 +13,7 @@
 
 #define I40E_FW_API_VERSION_MAJOR	0x0001
 #define I40E_FW_API_VERSION_MINOR_X722	0x000B
-#define I40E_FW_API_VERSION_MINOR_X710	0x000C
+#define I40E_FW_API_VERSION_MINOR_X710	0x000E
 
 #define I40E_FW_MINOR_VERSION(_h) ((_h)->mac.type == I40E_MAC_XL710 ? \
 					I40E_FW_API_VERSION_MINOR_X710 : \
Signature · 1 line
2.25.1
#34 lore raw

PATCH v3 3/15 net/i40e/base: add support for Min Rollback Revision for 4 more X722 modules

In reply to Robin Zhang

This change increments X722 API version and adds new constants related to the extended implementation of Security Version Opt-In.

---
 drivers/net/i40e/base/i40e_adminq_cmd.h | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)
drivers/net/i40e/base/i40e_adminq_cmd.h +10 -6
index b5ac74787b..a73a08aae6 100644
@@ -12,7 +12,7 @@
  */
 
 #define I40E_FW_API_VERSION_MAJOR	0x0001
-#define I40E_FW_API_VERSION_MINOR_X722	0x000B
+#define I40E_FW_API_VERSION_MINOR_X722	0x000C
 #define I40E_FW_API_VERSION_MINOR_X710	0x000E
 
 #define I40E_FW_MINOR_VERSION(_h) ((_h)->mac.type == I40E_MAC_XL710 ? \
@@ -2425,11 +2425,15 @@ struct i40e_aqc_rollback_revision_update {
 	u8	optin_mode; /* bool */
 #define I40E_AQ_RREV_OPTION_MODE			0x01
 	u8	module_selected;
-#define I40E_AQ_RREV_MODULE_PCIE_ANALOG		0
-#define I40E_AQ_RREV_MODULE_PHY_ANALOG		1
-#define I40E_AQ_RREV_MODULE_OPTION_ROM		2
-#define I40E_AQ_RREV_MODULE_EMP_IMAGE		3
-#define I40E_AQ_RREV_MODULE_PE_IMAGE		4
+#define I40E_AQ_RREV_MODULE_PCIE_ANALOG			0
+#define I40E_AQ_RREV_MODULE_PHY_ANALOG			1
+#define I40E_AQ_RREV_MODULE_OPTION_ROM			2
+#define I40E_AQ_RREV_MODULE_EMP_IMAGE			3
+#define I40E_AQ_RREV_MODULE_PE_IMAGE			4
+#define I40E_AQ_RREV_MODULE_PHY_PLL_O_CONFIGURATION	5
+#define I40E_AQ_RREV_MODULE_PHY_0_CONFIGURATION		6
+#define I40E_AQ_RREV_MODULE_PHY_PLL_1_CONFIGURATION	7
+#define I40E_AQ_RREV_MODULE_PHY_1_CONFIGURATION		8
 	u8	reserved1[2];
 	u32	min_rrev;
 	u8	reserved2[8];
Signature · 1 line
2.25.1
#35 lore raw

PATCH v3 4/15 net/i40e/base: set TSA table values when parsing CEE configuration

In reply to Robin Zhang

Driver did not Set TSA table values when parsing CEE configuration obtained from FW.

---
 drivers/net/i40e/base/i40e_dcb.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
drivers/net/i40e/base/i40e_dcb.c +7 -1
index 388af3d64d..27b52bc365 100644
@@ -315,9 +315,15 @@ static void i40e_parse_cee_pgcfg_tlv(struct i40e_cee_feat_tlv *tlv,
 	 *        |pg0|pg1|pg2|pg3|pg4|pg5|pg6|pg7|
 	 *        ---------------------------------
 	 */
-	for (i = 0; i < I40E_MAX_TRAFFIC_CLASS; i++)
+	for (i = 0; i < I40E_MAX_TRAFFIC_CLASS; i++) {
 		etscfg->tcbwtable[i] = buf[offset++];
 
+		if (etscfg->prioritytable[i] == I40E_CEE_PGID_STRICT)
+			dcbcfg->etscfg.tsatable[i] = I40E_IEEE_TSA_STRICT;
+		else
+			dcbcfg->etscfg.tsatable[i] = I40E_IEEE_TSA_ETS;
+	}
+
 	/* Number of TCs supported (1 octet) */
 	etscfg->maxtcs = buf[offset];
 }
Signature · 1 line
2.25.1
#36 lore raw

PATCH v3 5/15 net/i40e/base: define new Shadow RAM pointers

In reply to Robin Zhang

Add definitions for Shadow RAM pointers: 6th FPA module, 5th FPA module in X722 and Preservation Rules Module.

---
 drivers/net/i40e/base/i40e_type.h | 3 +++
 1 file changed, 3 insertions(+)
drivers/net/i40e/base/i40e_type.h +3 -0
index cf41345834..e5a3729183 100644
@@ -1555,6 +1555,9 @@ struct i40e_hw_port_stats {
 #define I40E_SR_FEATURE_CONFIGURATION_PTR	0x49
 #define I40E_SR_CONFIGURATION_METADATA_PTR	0x4D
 #define I40E_SR_IMMEDIATE_VALUES_PTR		0x4E
+#define I40E_SR_PRESERVATION_RULES_PTR		0x70
+#define I40E_X722_SR_5TH_FREE_PROVISION_AREA_PTR	0x71
+#define I40E_SR_6TH_FREE_PROVISION_AREA_PTR	0x71
 
 /* Auxiliary field, mask and shift definition for Shadow RAM and NVM Flash */
 #define I40E_SR_VPD_MODULE_MAX_SIZE		1024
Signature · 1 line
2.25.1
#37 lore raw

PATCH v3 6/15 net/i40e/base: fix PHY type identifiers for 2.5G and 5G adapters

In reply to Robin Zhang

Unlike other supported adapters, 2.5G and 5G use different PHY type identifiers for reading/writing PHY settings and for reading link status. This commit intruduces separate PHY identifiers for these two operation types.

Fixes 988ed63c7441 ("net/i40e/base: add support for Carlsville device")
---
 drivers/net/i40e/base/i40e_adminq_cmd.h | 6 ++++--
 drivers/net/i40e/base/i40e_common.c     | 4 ++--
 drivers/net/i40e/base/i40e_type.h       | 8 ++------
 3 files changed, 8 insertions(+), 10 deletions(-)
drivers/net/i40e/base/i40e_adminq_cmd.h +4 -2
index a73a08aae6..1aafe1de38 100644
@@ -1947,8 +1947,10 @@ enum i40e_aq_phy_type {
 	I40E_PHY_TYPE_25GBASE_LR		= 0x22,
 	I40E_PHY_TYPE_25GBASE_AOC		= 0x23,
 	I40E_PHY_TYPE_25GBASE_ACC		= 0x24,
-	I40E_PHY_TYPE_2_5GBASE_T		= 0x30,
-	I40E_PHY_TYPE_5GBASE_T			= 0x31,
+	I40E_PHY_TYPE_2_5GBASE_T		= 0x26,
+	I40E_PHY_TYPE_5GBASE_T			= 0x27,
+	I40E_PHY_TYPE_2_5GBASE_T_LINK_STATUS	= 0x30,
+	I40E_PHY_TYPE_5GBASE_T_LINK_STATUS	= 0x31,
 	I40E_PHY_TYPE_MAX,
 	I40E_PHY_TYPE_NOT_SUPPORTED_HIGH_TEMP	= 0xFD,
 	I40E_PHY_TYPE_EMPTY			= 0xFE,
drivers/net/i40e/base/i40e_common.c +2 -2
index 32642f3e2b..ceedec68bf 100644
@@ -1280,8 +1280,8 @@ STATIC enum i40e_media_type i40e_get_media_type(struct i40e_hw *hw)
 		break;
 	case I40E_PHY_TYPE_100BASE_TX:
 	case I40E_PHY_TYPE_1000BASE_T:
-	case I40E_PHY_TYPE_2_5GBASE_T:
-	case I40E_PHY_TYPE_5GBASE_T:
+	case I40E_PHY_TYPE_2_5GBASE_T_LINK_STATUS:
+	case I40E_PHY_TYPE_5GBASE_T_LINK_STATUS:
 	case I40E_PHY_TYPE_10GBASE_T:
 		media = I40E_MEDIA_TYPE_BASET;
 		break;
drivers/net/i40e/base/i40e_type.h +2 -6
index e5a3729183..0323887550 100644
@@ -329,12 +329,8 @@ struct i40e_phy_info {
 					     I40E_PHY_TYPE_OFFSET)
 #define I40E_CAP_PHY_TYPE_25GBASE_ACC BIT_ULL(I40E_PHY_TYPE_25GBASE_ACC + \
 					     I40E_PHY_TYPE_OFFSET)
-/* Offset for 2.5G/5G PHY Types value to bit number conversion */
-#define I40E_PHY_TYPE_OFFSET2 (-10)
-#define I40E_CAP_PHY_TYPE_2_5GBASE_T BIT_ULL(I40E_PHY_TYPE_2_5GBASE_T + \
-					     I40E_PHY_TYPE_OFFSET2)
-#define I40E_CAP_PHY_TYPE_5GBASE_T BIT_ULL(I40E_PHY_TYPE_5GBASE_T + \
-					     I40E_PHY_TYPE_OFFSET2)
+#define I40E_CAP_PHY_TYPE_2_5GBASE_T BIT_ULL(I40E_PHY_TYPE_2_5GBASE_T)
+#define I40E_CAP_PHY_TYPE_5GBASE_T BIT_ULL(I40E_PHY_TYPE_5GBASE_T)
 #define I40E_HW_CAP_MAX_GPIO			30
 #define I40E_HW_CAP_MDIO_PORT_MODE_MDIO		0
 #define I40E_HW_CAP_MDIO_PORT_MODE_I2C		1
Signature · 1 line
2.25.1
#38 lore raw

PATCH v3 7/15 net/i40e/base: fix PF reset failed

In reply to Robin Zhang

PF has to delete all the filters during reset.
If it is fully loaded with filters then it is possible that it will take more than 200 ms to finish the reset resulting in timeout during pf_reset and
PF reset failed, -15 error indication.
Increasing the timeout value for PF reset from 200 to 1000 to give PF more time to finish reset if it is loaded with filters.

Fixes 1e32378f0774 ("i40e/base: increase PF reset max loop limit")
---
 drivers/net/i40e/base/i40e_common.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/i40e/base/i40e_common.c +1 -1
index ceedec68bf..aa424e6010 100644
@@ -1341,7 +1341,7 @@ STATIC enum i40e_status_code i40e_poll_globr(struct i40e_hw *hw,
 	return I40E_ERR_RESET_FAILED;
 }
 
-#define I40E_PF_RESET_WAIT_COUNT	200
+#define I40E_PF_RESET_WAIT_COUNT	1000
 /**
  * i40e_pf_reset - Reset the PF
  * @hw: pointer to the hardware structure
Signature · 1 line
2.25.1
#39 lore raw

PATCH v3 8/15 net/i40e/base: fix update link data for X722

In reply to Robin Zhang

The X722 card has 'Link Type' information elsewhere than the X710. Previously, for all cards, the 'Link Type' information was retrieved by opcode 0x0607 and this value was wrong for all X722 cards. Now this information for X722 only is taken by opcode 0x0600 (function: i40e_aq_get_phy_capabilities) instead of an opcode 0x0607 (function: i40e_aq_get_link_info).
All other parameters read by opcode 0x0607 unchanged.

Fixes e6691b428eb1 ("i40e/base: fix PHY NVM interaction")
Fixes 75c3de654ead ("net/i40e/base: fix long link down notification time")
---
 drivers/net/i40e/base/i40e_common.c | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)
drivers/net/i40e/base/i40e_common.c +10 -4
index aa424e6010..ef061a6b63 100644
@@ -2078,6 +2078,9 @@ enum i40e_status_code i40e_aq_get_link_info(struct i40e_hw *hw,
 	     hw->aq.fw_min_ver < 40)) && hw_link_info->phy_type == 0xE)
 		hw_link_info->phy_type = I40E_PHY_TYPE_10GBASE_SFPP_CU;
 
+	/* 'Get Link Status' response data structure from X722 FW has
+	 * different format and does not contain this information
+	 */
 	if (hw->flags & I40E_HW_FLAG_AQ_PHY_ACCESS_CAPABLE &&
 	    hw->mac.type != I40E_MAC_X722) {
 		__le32 tmp;
@@ -2948,10 +2951,13 @@ enum i40e_status_code i40e_update_link_info(struct i40e_hw *hw)
 		return status;
 
 	/* extra checking needed to ensure link info to user is timely */
-	if ((hw->phy.link_info.link_info & I40E_AQ_MEDIA_AVAILABLE) &&
-	    ((hw->phy.link_info.link_info & I40E_AQ_LINK_UP) ||
-	     !(hw->phy.link_info_old.link_info & I40E_AQ_LINK_UP))) {
-		status = i40e_aq_get_phy_capabilities(hw, false, false,
+	if (((hw->phy.link_info.link_info & I40E_AQ_MEDIA_AVAILABLE) &&
+	     ((hw->phy.link_info.link_info & I40E_AQ_LINK_UP) ||
+	      !(hw->phy.link_info_old.link_info & I40E_AQ_LINK_UP))) ||
+		hw->mac.type == I40E_MAC_X722) {
+		status = i40e_aq_get_phy_capabilities(hw, false,
+						      hw->mac.type ==
+						      I40E_MAC_X722,
 						      &abilities, NULL);
 		if (status)
 			return status;
Signature · 1 line
2.25.1
#40 lore raw

PATCH v3 9/15 net/i40e/base: fix AOC media type reported by ethtool

In reply to Robin Zhang

For Active Optical Cable (AOC) the correct media type is "Fibre", not "Direct Attach Copper".

Fixes d749d4d89969 ("i40e/base: add AOC PHY types")
Fixes aa153cc89ff0 ("net/i40e/base: add new PHY types for 25G AOC and

ACC")
Cc: [email protected]

---
 drivers/net/i40e/base/i40e_common.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/net/i40e/base/i40e_common.c +3 -3
index ef061a6b63..2ca6a13e79 100644
@@ -1276,6 +1276,9 @@ STATIC enum i40e_media_type i40e_get_media_type(struct i40e_hw *hw)
 	case I40E_PHY_TYPE_40GBASE_LR4:
 	case I40E_PHY_TYPE_25GBASE_LR:
 	case I40E_PHY_TYPE_25GBASE_SR:
+	case I40E_PHY_TYPE_10GBASE_AOC:
+	case I40E_PHY_TYPE_25GBASE_AOC:
+	case I40E_PHY_TYPE_40GBASE_AOC:
 		media = I40E_MEDIA_TYPE_FIBER;
 		break;
 	case I40E_PHY_TYPE_100BASE_TX:
@@ -1290,10 +1293,7 @@ STATIC enum i40e_media_type i40e_get_media_type(struct i40e_hw *hw)
 	case I40E_PHY_TYPE_10GBASE_CR1:
 	case I40E_PHY_TYPE_40GBASE_CR4:
 	case I40E_PHY_TYPE_10GBASE_SFPP_CU:
-	case I40E_PHY_TYPE_40GBASE_AOC:
-	case I40E_PHY_TYPE_10GBASE_AOC:
 	case I40E_PHY_TYPE_25GBASE_CR:
-	case I40E_PHY_TYPE_25GBASE_AOC:
 	case I40E_PHY_TYPE_25GBASE_ACC:
 		media = I40E_MEDIA_TYPE_DA;
 		break;
Signature · 1 line
2.25.1
#41 lore raw

PATCH v3 10/15 net/i40e/base: add flags and fields for double vlan processing

In reply to Robin Zhang

Add flags for outer vlan and include set port parameters in Linux compilation.
Add flags, which describe port and switch state for both double vlan functionality and outer vlan processing.

---
 drivers/net/i40e/base/i40e_adminq_cmd.h | 22 ++++++++++++++++++++--
 1 file changed, 20 insertions(+), 2 deletions(-)
drivers/net/i40e/base/i40e_adminq_cmd.h +20 -2
index 1aafe1de38..646cfd0398 100644
@@ -768,6 +768,7 @@ struct i40e_aqc_set_switch_config {
 #define I40E_AQ_SET_SWITCH_CFG_PROMISC		0x0001
 #define I40E_AQ_SET_SWITCH_CFG_L2_FILTER	0x0002
 #define I40E_AQ_SET_SWITCH_CFG_HW_ATR_EVICT	0x0004
+#define I40E_AQ_SET_SWITCH_CFG_OUTER_VLAN	0x0008
 	__le16	valid_flags;
 	/* The ethertype in switch_tag is dropped on ingress and used
 	 * internally by the switch. Set this to zero for the default
@@ -904,7 +905,7 @@ struct i40e_aqc_vsi_properties_data {
 	u8	sec_reserved;
 	/* VLAN section */
 	__le16	pvid; /* VLANS include priority bits */
-	__le16	fcoe_pvid;
+	__le16	outer_vlan;
 	u8	port_vlan_flags;
 #define I40E_AQ_VSI_PVLAN_MODE_SHIFT	0x00
 #define I40E_AQ_VSI_PVLAN_MODE_MASK	(0x03 << \
@@ -920,7 +921,24 @@ struct i40e_aqc_vsi_properties_data {
 #define I40E_AQ_VSI_PVLAN_EMOD_STR_UP	0x08
 #define I40E_AQ_VSI_PVLAN_EMOD_STR	0x10
 #define I40E_AQ_VSI_PVLAN_EMOD_NOTHING	0x18
-	u8	pvlan_reserved[3];
+	u8	outer_vlan_flags;
+#define I40E_AQ_VSI_OVLAN_MODE_SHIFT	0x00
+#define I40E_AQ_VSI_OVLAN_MODE_MASK	(0x03 << \
+					 I40E_AQ_VSI_OVLAN_MODE_SHIFT)
+#define I40E_AQ_VSI_OVLAN_MODE_UNTAGGED	0x01
+#define I40E_AQ_VSI_OVLAN_MODE_TAGGED	0x02
+#define I40E_AQ_VSI_OVLAN_MODE_ALL	0x03
+#define I40E_AQ_VSI_OVLAN_INSERT_PVID	0x04
+#define I40E_AQ_VSI_OVLAN_EMOD_SHIFT	0x03
+#define I40E_AQ_VSI_OVLAN_EMOD_MASK	(0x03 <<\
+					 I40E_AQ_VSI_OVLAN_EMOD_SHIFT)
+#define I40E_AQ_VSI_OVLAN_EMOD_SHOW_ALL	0x00
+#define I40E_AQ_VSI_OVLAN_EMOD_SHOW_UP	0x01
+#define I40E_AQ_VSI_OVLAN_EMOD_HIDE_ALL	0x02
+#define I40E_AQ_VSI_OVLAN_EMOD_NOTHING	0x03
+#define I40E_AQ_VSI_OVLAN_CTRL_ENA	0x04
+
+	u8	pvlan_reserved[2];
 	/* ingress egress up sections */
 	__le32	ingress_table; /* bitmap, 3 bits per up */
 #define I40E_AQ_VSI_UP_TABLE_UP0_SHIFT	0
Signature · 1 line
2.25.1
#42 lore raw

PATCH v3 11/15 net/i40e/base: 10GBASE-ER Optical modules recognition

In reply to Robin Zhang

This change adds a new PHY type for 10GBASE-ER modules.

---
 drivers/net/i40e/base/i40e_adminq_cmd.h | 2 ++
 drivers/net/i40e/base/i40e_common.c     | 1 +
 drivers/net/i40e/base/i40e_type.h       | 1 +
 3 files changed, 4 insertions(+)
drivers/net/i40e/base/i40e_adminq_cmd.h +2 -0
index 646cfd0398..c41dc71cdf 100644
@@ -1945,6 +1945,7 @@ enum i40e_aq_phy_type {
 	I40E_PHY_TYPE_40GBASE_AOC		= 0xD,
 	I40E_PHY_TYPE_UNRECOGNIZED		= 0xE,
 	I40E_PHY_TYPE_UNSUPPORTED		= 0xF,
+	I40E_PHY_TYPE_10GBASE_ER		= 0x10,
 	I40E_PHY_TYPE_100BASE_TX		= 0x11,
 	I40E_PHY_TYPE_1000BASE_T		= 0x12,
 	I40E_PHY_TYPE_10GBASE_T			= 0x13,
@@ -1991,6 +1992,7 @@ enum i40e_aq_phy_type {
 				BIT_ULL(I40E_PHY_TYPE_40GBASE_AOC) | \
 				BIT_ULL(I40E_PHY_TYPE_UNRECOGNIZED) | \
 				BIT_ULL(I40E_PHY_TYPE_UNSUPPORTED) | \
+				BIT_ULL(I40E_PHY_TYPE_10GBASE_ER) | \
 				BIT_ULL(I40E_PHY_TYPE_100BASE_TX) | \
 				BIT_ULL(I40E_PHY_TYPE_1000BASE_T) | \
 				BIT_ULL(I40E_PHY_TYPE_10GBASE_T) | \
drivers/net/i40e/base/i40e_common.c +1 -0
index 2ca6a13e79..e077bf8fd3 100644
@@ -1268,6 +1268,7 @@ STATIC enum i40e_media_type i40e_get_media_type(struct i40e_hw *hw)
 	enum i40e_media_type media;
 
 	switch (hw->phy.link_info.phy_type) {
+	case I40E_PHY_TYPE_10GBASE_ER:
 	case I40E_PHY_TYPE_10GBASE_SR:
 	case I40E_PHY_TYPE_10GBASE_LR:
 	case I40E_PHY_TYPE_1000BASE_SX:
drivers/net/i40e/base/i40e_type.h +1 -0
index 0323887550..86b9eeeb43 100644
@@ -294,6 +294,7 @@ struct i40e_phy_info {
 #define I40E_CAP_PHY_TYPE_10GBASE_CR1_CU BIT_ULL(I40E_PHY_TYPE_10GBASE_CR1_CU)
 #define I40E_CAP_PHY_TYPE_10GBASE_AOC BIT_ULL(I40E_PHY_TYPE_10GBASE_AOC)
 #define I40E_CAP_PHY_TYPE_40GBASE_AOC BIT_ULL(I40E_PHY_TYPE_40GBASE_AOC)
+#define I40E_CAP_PHY_TYPE_10GBASE_ER BIT_ULL(I40E_PHY_TYPE_10GBASE_ER)
 #define I40E_CAP_PHY_TYPE_100BASE_TX BIT_ULL(I40E_PHY_TYPE_100BASE_TX)
 #define I40E_CAP_PHY_TYPE_1000BASE_T BIT_ULL(I40E_PHY_TYPE_1000BASE_T)
 #define I40E_CAP_PHY_TYPE_10GBASE_T BIT_ULL(I40E_PHY_TYPE_10GBASE_T)
Signature · 1 line
2.25.1
#43 lore raw

PATCH v3 12/15 net/i40e/base: fix headers to match functions

In reply to Robin Zhang

Fix several kernel-doc warnings when building with W=1. These changes are only to comments.

Fixes 8db9e2a1b232 ("i40e: base driver")
Fixes 842ea1996335 ("i40e/base: save link module type")
Fixes fd72a2284a89 ("i40e/base: support LED blinking with new PHY")
Fixes 788fc17b2dec ("i40e/base: support proxy config for X722")
---
 drivers/net/i40e/base/i40e_common.c  | 10 +++++-----
 drivers/net/i40e/base/i40e_dcb.c     |  2 +-
 drivers/net/i40e/base/i40e_lan_hmc.c |  2 +-
 drivers/net/i40e/base/i40e_nvm.c     |  2 +-
 4 files changed, 8 insertions(+), 8 deletions(-)
drivers/net/i40e/base/i40e_common.c +5 -5
index e077bf8fd3..3f3896aea4 100644
@@ -2678,7 +2678,7 @@ enum i40e_status_code i40e_aq_set_vsi_vlan_promisc(struct i40e_hw *hw,
 }
 
 /**
- * i40e_get_vsi_params - get VSI configuration info
+ * i40e_aq_get_vsi_params - get VSI configuration info
  * @hw: pointer to the hw struct
  * @vsi_ctx: pointer to a vsi context struct
  * @cmd_details: pointer to command details structure or NULL
@@ -2939,7 +2939,7 @@ enum i40e_status_code i40e_get_link_status(struct i40e_hw *hw, bool *link_up)
 }
 
 /**
- * i40e_updatelink_status - update status of the HW network link
+ * i40e_update_link_info - update status of the HW network link
  * @hw: pointer to the hw struct
  **/
 enum i40e_status_code i40e_update_link_info(struct i40e_hw *hw)
@@ -4831,7 +4831,7 @@ enum i40e_status_code i40e_aq_del_udp_tunnel(struct i40e_hw *hw, u8 index,
 }
 
 /**
- * i40e_aq_get_switch_resource_alloc (0x0204)
+ * i40e_aq_get_switch_resource_alloc - command (0x0204) to get allocations
  * @hw: pointer to the hw struct
  * @num_entries: pointer to u8 to store the number of resource entries returned
  * @buf: pointer to a user supplied buffer.  This buffer must be large enough
@@ -6978,7 +6978,7 @@ u8 i40e_get_phy_address(struct i40e_hw *hw, u8 dev_num)
 }
 
 /**
- * i40e_blink_phy_led
+ * i40e_blink_phy_link_led
  * @hw: pointer to the HW structure
  * @time: time how long led will blinks in secs
  * @interval: gap between LED on and off in msecs
@@ -7825,7 +7825,7 @@ enum i40e_status_code i40e_aq_set_arp_proxy_config(struct i40e_hw *hw,
 }
 
 /**
- * i40e_aq_opc_set_ns_proxy_table_entry
+ * i40e_aq_set_ns_proxy_table_entry
  * @hw: pointer to the HW structure
  * @ns_proxy_table_entry: pointer to NS table entry command struct
  * @cmd_details: pointer to command details
drivers/net/i40e/base/i40e_dcb.c +1 -1
index 27b52bc365..8f9b7e823f 100644
@@ -235,7 +235,7 @@ static void i40e_parse_ieee_app_tlv(struct i40e_lldp_org_tlv *tlv,
 }
 
 /**
- * i40e_parse_ieee_etsrec_tlv
+ * i40e_parse_ieee_tlv
  * @tlv: IEEE 802.1Qaz TLV
  * @dcbcfg: Local store to update ETS REC data
  *
drivers/net/i40e/base/i40e_lan_hmc.c +1 -1
index d3969396f0..d3bd683ff3 100644
@@ -516,7 +516,7 @@ enum i40e_status_code i40e_configure_lan_hmc(struct i40e_hw *hw,
 }
 
 /**
- * i40e_delete_hmc_object - remove hmc objects
+ * i40e_delete_lan_hmc_object - remove hmc objects
  * @hw: pointer to the HW structure
  * @info: pointer to i40e_hmc_delete_obj_info struct
  *
drivers/net/i40e/base/i40e_nvm.c +1 -1
index 561ed21136..67e58cc195 100644
@@ -7,7 +7,7 @@
 #include "i40e_prototype.h"
 
 /**
- * i40e_init_nvm_ops - Initialize NVM function pointers
+ * i40e_init_nvm - Initialize NVM function pointers
  * @hw: pointer to the HW structure
  *
  * Setup the function pointers and the NVM info structure. Should be called
Signature · 1 line
2.25.1
#44 lore raw

PATCH v3 13/15 net/i40e/base: fix potentially uninitialized variables in NVM code

In reply to Robin Zhang

The status of i40e_read_nvm_word is not checked, so variables set from this function could be used uninitialized. In this case, preserve the existing flow that does not block initialization by initializing these values from the start.

Fixes 8d6c51fcd24b ("i40e/base: get OEM version")
Fixes 2db70574247b ("net/i40e/base: limit PF/VF specific code to that driver only")
---
 drivers/net/i40e/base/i40e_adminq.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/net/i40e/base/i40e_adminq.c +4 -2
index eafacbdbec..d27ccde29a 100644
@@ -648,8 +648,10 @@ enum i40e_status_code i40e_init_adminq(struct i40e_hw *hw)
 {
 	struct i40e_adminq_info *aq = &hw->aq;
 	enum i40e_status_code ret_code;
-	u16 cfg_ptr, oem_hi, oem_lo;
-	u16 eetrack_lo, eetrack_hi;
+	u16 oem_hi = 0, oem_lo = 0;
+	u16 eetrack_hi = 0;
+	u16 eetrack_lo = 0;
+	u16 cfg_ptr = 0;
 	int retry = 0;
 
 	/* verify input for valid configuration */
Signature · 1 line
2.25.1
#45 lore raw

PATCH v3 14/15 net/i40e/base: fix checksum is used before return value is checked

In reply to Robin Zhang

The variable checksum from i40e_calc_nvm_checksum is used before return value is checked. Fix this logic.

Fixes 8db9e2a1b232 ("i40e: base driver")
Fixes 3ed6c3246f43 ("i40e/base: handle AQ timeout when releasing NVM")
---
 drivers/net/i40e/base/i40e_nvm.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/net/i40e/base/i40e_nvm.c +3 -2
index 67e58cc195..f385042601 100644
@@ -755,10 +755,11 @@ enum i40e_status_code i40e_update_nvm_checksum(struct i40e_hw *hw)
 	DEBUGFUNC("i40e_update_nvm_checksum");
 
 	ret_code = i40e_calc_nvm_checksum(hw, &checksum);
-	le_sum = CPU_TO_LE16(checksum);
-	if (ret_code == I40E_SUCCESS)
+	if (ret_code == I40E_SUCCESS) {
+		le_sum = CPU_TO_LE16(checksum);
 		ret_code = i40e_write_nvm_aq(hw, 0x00, I40E_SR_SW_CHECKSUM_WORD,
 					     1, &le_sum, true);
+	}
 
 	return ret_code;
 }
Signature · 1 line
2.25.1
#46 lore raw

PATCH v3 15/15 net/i40e/base: update version in readme

In reply to Robin Zhang

Update base code version in README.

---
 drivers/net/i40e/base/README | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/i40e/base/README +1 -1
index 6af2993116..c84764005b 100644
@@ -6,7 +6,7 @@ Intel® I40E driver
 ==================
 
 This directory contains source code of FreeBSD i40e driver of version
-cid-i40e.2020.08.27.tar.gz released by the team which develops
+cid-i40e.2021.04.29.tar.gz released by the team which develops
 basic drivers for any i40e NIC. The directory of base/ contains the
 original source package.
 This driver is valid for the product(s) listed below
Signature · 1 line
2.25.1
#47 lore raw

v4 cover i40e base code update

In reply to Robin Zhang

update i40e base code.

source code of i40e driver:
cid-i40e.2021.08.16.tar.gz

changelog in i40e share repo:
From 59a080f4fafe ("i40e-shared: Add opcode 0x0406 and 0x0416 to Linux support") To 2c7aab559654 ("i40e-shared: Add defines related to DDP")

The following commits are ignored:
cb9139e3bce8 ("i40e-shared: Fix not blinking X722 with x557 PHY via ‘ethtool -p'")
c09d4f9cf390 ("i40e-shared: i40e-shared: Fix build warning -Wformat related to integer size")
ff8a1abc6c17 ("i40e-shared: Fix build warning with __packed") 59a080f4fafe ("i40e-shared: Add opcode 0x0406 and 0x0416 to Linux support")

v4:
- update base code to cid-i40e.2021.08.16
v3:
- there has a fix patch contains two issues, split it into two patches v2:
- refine commit messages and macro name

Robin Zhang (18):
net/i40e/base: add new versions of send ASQ command functions net/i40e/base: add support for Min Rollback Revision for 4 more X722
modules
net/i40e/base: set TSA table values when parsing CEE configuration net/i40e/base: define new Shadow RAM pointers net/i40e/base: fix PHY type identifiers for 2.5G and 5G adapters net/i40e/base: fix PF reset failed
net/i40e/base: fix update link data for X722 net/i40e/base: fix AOC media type reported by ethtool net/i40e/base: add flags and fields for double vlan processing net/i40e/base: fix headers to match functions net/i40e/base: fix potentially uninitialized variables in NVM code net/i40e/base: fix checksum is used before return value is checked net/i40e/base: add defs for MAC frequency calculation if no link net/i40e/base: separate kernel allocated rx_bi rings from AF_XDP rings net/i40e/base: Update FVL FW API version to 1.15 net/i40e/base: add defines related to DDP
net/i40e/base: update version in readme
net/i40e: fix redefinition warning

 drivers/net/i40e/base/README            |   2 +-
 drivers/net/i40e/base/i40e_adminq.c     |  79 +++++++++--
 drivers/net/i40e/base/i40e_adminq_cmd.h |  55 ++++++--
 drivers/net/i40e/base/i40e_common.c     | 175 +++++++++++++++++++-----
 drivers/net/i40e/base/i40e_dcb.c        |  10 +-
 drivers/net/i40e/base/i40e_lan_hmc.c    |   2 +-
 drivers/net/i40e/base/i40e_nvm.c        |   7 +-
 drivers/net/i40e/base/i40e_prototype.h  |  17 +++
 drivers/net/i40e/base/i40e_register.h   |  10 ++
 drivers/net/i40e/base/i40e_type.h       |  26 +++-
 drivers/net/i40e/i40e_ethdev.c          |   3 +-
 11 files changed, 318 insertions(+), 68 deletions(-)
Signature · 1 line
2.25.1
#48 lore raw

PATCH v4 1/18 net/i40e/base: add new versions of send ASQ command functions

ASQ send command functions are returning only i40e status codes yet some calling functions also need Admin Queue status that is stored in hw->aq.asq_last_status. Since hw object is stored on a heap it introduces a possibility for
a race condition in access to hw if calling function is not fast enough to read hw->aq.asq_last_status before next send ASQ command is executed.

Added new versions of send ASQ command functions that return Admin Queue status on the stack to avoid race conditions
in access to hw->aq.asq_last_status.
Added new _v2 version of i40e_aq_remove_macvlan and i40e_aq_add_macvlan that is using new _v2 versions of ASQ send command functions and returns the Admin Queue status on the stack.

---
 drivers/net/i40e/base/i40e_adminq.c    |  73 +++++++++++--
 drivers/net/i40e/base/i40e_common.c    | 139 ++++++++++++++++++++++---
 drivers/net/i40e/base/i40e_prototype.h |  17 +++
 3 files changed, 205 insertions(+), 24 deletions(-)
drivers/net/i40e/base/i40e_adminq.c +65 -8
index 0da45f03e4..eafacbdbec 100644
@@ -834,7 +834,7 @@ STATIC bool i40e_asq_done(struct i40e_hw *hw)
 }
 
 /**
- *  i40e_asq_send_command - send command to Admin Queue
+ *  i40e_asq_send_command_exec - send command to Admin Queue
  *  @hw: pointer to the hw struct
  *  @desc: prefilled descriptor describing the command (non DMA mem)
  *  @buff: buffer to use for indirect commands
@@ -844,11 +844,12 @@ STATIC bool i40e_asq_done(struct i40e_hw *hw)
  *  This is the main send command driver routine for the Admin Queue send
  *  queue.  It runs the queue, cleans the queue, etc
  **/
-enum i40e_status_code i40e_asq_send_command(struct i40e_hw *hw,
-				struct i40e_aq_desc *desc,
-				void *buff, /* can be NULL */
-				u16  buff_size,
-				struct i40e_asq_cmd_details *cmd_details)
+STATIC enum i40e_status_code
+i40e_asq_send_command_exec(struct i40e_hw *hw,
+			   struct i40e_aq_desc *desc,
+			   void *buff, /* can be NULL */
+			   u16  buff_size,
+			   struct i40e_asq_cmd_details *cmd_details)
 {
 	enum i40e_status_code status = I40E_SUCCESS;
 	struct i40e_dma_mem *dma_buff = NULL;
@@ -858,8 +859,6 @@ enum i40e_status_code i40e_asq_send_command(struct i40e_hw *hw,
 	u16  retval = 0;
 	u32  val = 0;
 
-	i40e_acquire_spinlock(&hw->aq.asq_spinlock);
-
 	hw->aq.asq_last_status = I40E_AQ_RC_OK;
 
 	if (hw->aq.asq.count == 0) {
@@ -1042,6 +1041,64 @@ enum i40e_status_code i40e_asq_send_command(struct i40e_hw *hw,
 	}
 
 asq_send_command_error:
+	return status;
+}
+
+/**
+ *  i40e_asq_send_command - send command to Admin Queue
+ *  @hw: pointer to the hw struct
+ *  @desc: prefilled descriptor describing the command (non DMA mem)
+ *  @buff: buffer to use for indirect commands
+ *  @buff_size: size of buffer for indirect commands
+ *  @cmd_details: pointer to command details structure
+ *
+ *  Acquires the lock and calls the main send command execution
+ *  routine.
+ **/
+enum i40e_status_code
+i40e_asq_send_command(struct i40e_hw *hw,
+		      struct i40e_aq_desc *desc,
+		      void *buff, /* can be NULL */
+		      u16  buff_size,
+		      struct i40e_asq_cmd_details *cmd_details)
+{
+	enum i40e_status_code status = I40E_SUCCESS;
+
+	i40e_acquire_spinlock(&hw->aq.asq_spinlock);
+	status = i40e_asq_send_command_exec(hw, desc, buff, buff_size,
+					    cmd_details);
+	i40e_release_spinlock(&hw->aq.asq_spinlock);
+	return status;
+}
+
+/**
+ *  i40e_asq_send_command_v2 - send command to Admin Queue
+ *  @hw: pointer to the hw struct
+ *  @desc: prefilled descriptor describing the command (non DMA mem)
+ *  @buff: buffer to use for indirect commands
+ *  @buff_size: size of buffer for indirect commands
+ *  @cmd_details: pointer to command details structure
+ *  @aq_status: pointer to Admin Queue status return value
+ *
+ *  Acquires the lock and calls the main send command execution
+ *  routine. Returns the last Admin Queue status in aq_status
+ *  to avoid race conditions in access to hw->aq.asq_last_status.
+ **/
+enum i40e_status_code
+i40e_asq_send_command_v2(struct i40e_hw *hw,
+			 struct i40e_aq_desc *desc,
+			 void *buff, /* can be NULL */
+			 u16  buff_size,
+			 struct i40e_asq_cmd_details *cmd_details,
+			 enum i40e_admin_queue_err *aq_status)
+{
+	enum i40e_status_code status = I40E_SUCCESS;
+
+	i40e_acquire_spinlock(&hw->aq.asq_spinlock);
+	status = i40e_asq_send_command_exec(hw, desc, buff, buff_size,
+					    cmd_details);
+	if (aq_status)
+		*aq_status = hw->aq.asq_last_status;
 	i40e_release_spinlock(&hw->aq.asq_spinlock);
 	return status;
 }
drivers/net/i40e/base/i40e_common.c +123 -16

187 lines not on this page · raw message

drivers/net/i40e/base/i40e_prototype.h +17 -0
index 124222e476..29c86c7fe8 100644
@@ -38,6 +38,13 @@ enum i40e_status_code i40e_asq_send_command(struct i40e_hw *hw,
 				void *buff, /* can be NULL */
 				u16  buff_size,
 				struct i40e_asq_cmd_details *cmd_details);
+enum i40e_status_code
+i40e_asq_send_command_v2(struct i40e_hw *hw,
+			 struct i40e_aq_desc *desc,
+			 void *buff, /* can be NULL */
+			 u16  buff_size,
+			 struct i40e_asq_cmd_details *cmd_details,
+			 enum i40e_admin_queue_err *aq_status);
 #ifdef VF_DRIVER
 bool i40e_asq_done(struct i40e_hw *hw);
 #endif
@@ -188,9 +195,19 @@ enum i40e_status_code i40e_aq_get_veb_parameters(struct i40e_hw *hw,
 enum i40e_status_code i40e_aq_add_macvlan(struct i40e_hw *hw, u16 vsi_id,
 			struct i40e_aqc_add_macvlan_element_data *mv_list,
 			u16 count, struct i40e_asq_cmd_details *cmd_details);
+enum i40e_status_code
+i40e_aq_add_macvlan_v2(struct i40e_hw *hw, u16 seid,
+		       struct i40e_aqc_add_macvlan_element_data *mv_list,
+		       u16 count, struct i40e_asq_cmd_details *cmd_details,
+		       enum i40e_admin_queue_err *aq_status);
 enum i40e_status_code i40e_aq_remove_macvlan(struct i40e_hw *hw, u16 vsi_id,
 			struct i40e_aqc_remove_macvlan_element_data *mv_list,
 			u16 count, struct i40e_asq_cmd_details *cmd_details);
+enum i40e_status_code
+i40e_aq_remove_macvlan_v2(struct i40e_hw *hw, u16 seid,
+			  struct i40e_aqc_remove_macvlan_element_data *mv_list,
+			  u16 count, struct i40e_asq_cmd_details *cmd_details,
+			  enum i40e_admin_queue_err *aq_status);
 enum i40e_status_code i40e_aq_add_mirrorrule(struct i40e_hw *hw, u16 sw_seid,
 			u16 rule_type, u16 dest_vsi, u16 count, __le16 *mr_list,
 			struct i40e_asq_cmd_details *cmd_details,
Signature · 1 line
2.25.1
#49 lore raw

Re: [dpdk-dev] [PATCH v4 01/18] net/i40e/base: add new versions of send ASQ command functions

Quoted 15 lines · Robin Zhang

ASQ send command functions are returning only i40e status codes yet some calling functions also need Admin Queue status that is stored in hw->aq.asq_last_status. Since hw object is stored on a heap it introduces a possibility for
a race condition in access to hw if calling function is not fast enough to read hw->aq.asq_last_status before next send ASQ command is executed.

Added new versions of send ASQ command functions that return Admin Queue status on the stack to avoid race conditions
in access to hw->aq.asq_last_status.
Added new _v2 version of i40e_aq_remove_macvlan and i40e_aq_add_macvlan that is using new _v2 versions of ASQ send command functions and returns the Admin Queue status on the stack.

Quoted 2 lines

I assume ASQ is "Admin Send Queue" (although datasheet refers to it as ATQ), can you please give the long version of the abbreviations in the commit log in first usage as:
"ASQ (Admin Send Queue) ... "

#50 lore raw

PATCH v4 2/18 net/i40e/base: add support for Min Rollback Revision for 4 more X722 modules

In reply to Robin Zhang

This change increments X722 API version and adds new constants related to the extended implementation of Security Version Opt-In.

---
 drivers/net/i40e/base/i40e_adminq_cmd.h | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)
drivers/net/i40e/base/i40e_adminq_cmd.h +10 -6
index 2ca41db5d3..a96527f31c 100644
@@ -12,7 +12,7 @@
  */
 
 #define I40E_FW_API_VERSION_MAJOR	0x0001
-#define I40E_FW_API_VERSION_MINOR_X722	0x000B
+#define I40E_FW_API_VERSION_MINOR_X722	0x000C
 #define I40E_FW_API_VERSION_MINOR_X710	0x000C
 
 #define I40E_FW_MINOR_VERSION(_h) ((_h)->mac.type == I40E_MAC_XL710 ? \
@@ -2425,11 +2425,15 @@ struct i40e_aqc_rollback_revision_update {
 	u8	optin_mode; /* bool */
 #define I40E_AQ_RREV_OPTION_MODE			0x01
 	u8	module_selected;
-#define I40E_AQ_RREV_MODULE_PCIE_ANALOG		0
-#define I40E_AQ_RREV_MODULE_PHY_ANALOG		1
-#define I40E_AQ_RREV_MODULE_OPTION_ROM		2
-#define I40E_AQ_RREV_MODULE_EMP_IMAGE		3
-#define I40E_AQ_RREV_MODULE_PE_IMAGE		4
+#define I40E_AQ_RREV_MODULE_PCIE_ANALOG			0
+#define I40E_AQ_RREV_MODULE_PHY_ANALOG			1
+#define I40E_AQ_RREV_MODULE_OPTION_ROM			2
+#define I40E_AQ_RREV_MODULE_EMP_IMAGE			3
+#define I40E_AQ_RREV_MODULE_PE_IMAGE			4
+#define I40E_AQ_RREV_MODULE_PHY_PLL_O_CONFIGURATION	5
+#define I40E_AQ_RREV_MODULE_PHY_0_CONFIGURATION		6
+#define I40E_AQ_RREV_MODULE_PHY_PLL_1_CONFIGURATION	7
+#define I40E_AQ_RREV_MODULE_PHY_1_CONFIGURATION		8
 	u8	reserved1[2];
 	u32	min_rrev;
 	u8	reserved2[8];
Signature · 1 line
2.25.1
#51 lore raw

Re: [dpdk-dev] [PATCH v4 02/18] net/i40e/base: add support for Min Rollback Revision for 4 more X722 modules

Quoted 3 lines · Robin Zhang

This change increments X722 API version and adds new constants related to the extended implementation of Security Version Opt-In.

There are new 'I40E_AQ_RREV_MODULE_PHY_*' macros, what is their relation with "Security Version Opt-In"?

Also title mentions "Min Rollback Revision for 4 more X722 modules", is this referred 4 more modules are 'I40E_AQ_RREV_MODULE_PHY_*', is added macros for "Security Version Opt-In" or "Min Rollback Revision"?

And what does "Min Rollback Revision" mean? And why first letters of words are upper case?

Overall can you please add a little more clarification to the commit log?

Quoted 41 lines
---
 drivers/net/i40e/base/i40e_adminq_cmd.h | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)
drivers/net/i40e/base/i40e_adminq_cmd.h +10 -6
index 2ca41db5d3..a96527f31c 100644
@@ -12,7 +12,7 @@
  */
 
 #define I40E_FW_API_VERSION_MAJOR	0x0001
-#define I40E_FW_API_VERSION_MINOR_X722	0x000B
+#define I40E_FW_API_VERSION_MINOR_X722	0x000C
 #define I40E_FW_API_VERSION_MINOR_X710	0x000C
 
 #define I40E_FW_MINOR_VERSION(_h) ((_h)->mac.type == I40E_MAC_XL710 ? \
@@ -2425,11 +2425,15 @@ struct i40e_aqc_rollback_revision_update {
 	u8	optin_mode; /* bool */
 #define I40E_AQ_RREV_OPTION_MODE			0x01
 	u8	module_selected;
-#define I40E_AQ_RREV_MODULE_PCIE_ANALOG		0
-#define I40E_AQ_RREV_MODULE_PHY_ANALOG		1
-#define I40E_AQ_RREV_MODULE_OPTION_ROM		2
-#define I40E_AQ_RREV_MODULE_EMP_IMAGE		3
-#define I40E_AQ_RREV_MODULE_PE_IMAGE		4
+#define I40E_AQ_RREV_MODULE_PCIE_ANALOG			0
+#define I40E_AQ_RREV_MODULE_PHY_ANALOG			1
+#define I40E_AQ_RREV_MODULE_OPTION_ROM			2
+#define I40E_AQ_RREV_MODULE_EMP_IMAGE			3
+#define I40E_AQ_RREV_MODULE_PE_IMAGE			4
+#define I40E_AQ_RREV_MODULE_PHY_PLL_O_CONFIGURATION	5
+#define I40E_AQ_RREV_MODULE_PHY_0_CONFIGURATION		6
+#define I40E_AQ_RREV_MODULE_PHY_PLL_1_CONFIGURATION	7
+#define I40E_AQ_RREV_MODULE_PHY_1_CONFIGURATION		8
 	u8	reserved1[2];
 	u32	min_rrev;
 	u8	reserved2[8];
#52 lore raw

PATCH v4 3/18 net/i40e/base: set TSA table values when parsing CEE configuration

In reply to Robin Zhang

Driver did not Set TSA table values when parsing CEE configuration obtained from FW.

---
 drivers/net/i40e/base/i40e_dcb.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
drivers/net/i40e/base/i40e_dcb.c +7 -1
index 388af3d64d..27b52bc365 100644
@@ -315,9 +315,15 @@ static void i40e_parse_cee_pgcfg_tlv(struct i40e_cee_feat_tlv *tlv,
 	 *        |pg0|pg1|pg2|pg3|pg4|pg5|pg6|pg7|
 	 *        ---------------------------------
 	 */
-	for (i = 0; i < I40E_MAX_TRAFFIC_CLASS; i++)
+	for (i = 0; i < I40E_MAX_TRAFFIC_CLASS; i++) {
 		etscfg->tcbwtable[i] = buf[offset++];
 
+		if (etscfg->prioritytable[i] == I40E_CEE_PGID_STRICT)
+			dcbcfg->etscfg.tsatable[i] = I40E_IEEE_TSA_STRICT;
+		else
+			dcbcfg->etscfg.tsatable[i] = I40E_IEEE_TSA_ETS;
+	}
+
 	/* Number of TCs supported (1 octet) */
 	etscfg->maxtcs = buf[offset];
 }
Signature · 1 line
2.25.1
#53 lore raw

Re: [dpdk-dev] [PATCH v4 03/18] net/i40e/base: set TSA table values when parsing CEE configuration

Quoted 5 lines · Robin Zhang

Driver did not Set TSA table values when parsing CEE configuration obtained from FW.

Can you please long version of the 'TSA' & 'CEE' abbreviations in the commit log?

There are more in other commits and I won't comment on all, please update same on all commits.

#54 lore raw

PATCH v4 4/18 net/i40e/base: define new Shadow RAM pointers

In reply to Robin Zhang

Add definitions for Shadow RAM pointers: 6th FPA module, 5th FPA module in X722 and Preservation Rules Module.

---
 drivers/net/i40e/base/i40e_type.h | 3 +++
 1 file changed, 3 insertions(+)
drivers/net/i40e/base/i40e_type.h +3 -0
index cf41345834..e5a3729183 100644
@@ -1555,6 +1555,9 @@ struct i40e_hw_port_stats {
 #define I40E_SR_FEATURE_CONFIGURATION_PTR	0x49
 #define I40E_SR_CONFIGURATION_METADATA_PTR	0x4D
 #define I40E_SR_IMMEDIATE_VALUES_PTR		0x4E
+#define I40E_SR_PRESERVATION_RULES_PTR		0x70
+#define I40E_X722_SR_5TH_FREE_PROVISION_AREA_PTR	0x71
+#define I40E_SR_6TH_FREE_PROVISION_AREA_PTR	0x71
 
 /* Auxiliary field, mask and shift definition for Shadow RAM and NVM Flash */
 #define I40E_SR_VPD_MODULE_MAX_SIZE		1024
Signature · 1 line
2.25.1
#55 lore raw

Re: [dpdk-dev] [PATCH v4 04/18] net/i40e/base: define new Shadow RAM pointers

Quoted 5 lines · Robin Zhang

Add definitions for Shadow RAM pointers: 6th FPA module, 5th FPA module in X722 and Preservation Rules Module.

Can you please update patch title to use all lowercase except abbreviations, like s/Shadow RAM/shadow RAM/

A brief explanation in the commit log on what is shadow RAM pointer and what does it mean adding new ones?

#56 lore raw

PATCH v4 5/18 net/i40e/base: fix PHY type identifiers for 2.5G and 5G adapters

In reply to Robin Zhang

Unlike other supported adapters, 2.5G and 5G use different PHY type identifiers for reading/writing PHY settings and for reading link status. This commit intruduces separate PHY identifiers for these two operation types.

Fixes 988ed63c7441 ("net/i40e/base: add support for Carlsville device")
---
 drivers/net/i40e/base/i40e_adminq_cmd.h | 6 ++++--
 drivers/net/i40e/base/i40e_common.c     | 4 ++--
 drivers/net/i40e/base/i40e_type.h       | 8 ++------
 3 files changed, 8 insertions(+), 10 deletions(-)
drivers/net/i40e/base/i40e_adminq_cmd.h +4 -2
index a96527f31c..af9dec1d7f 100644
@@ -1947,8 +1947,10 @@ enum i40e_aq_phy_type {
 	I40E_PHY_TYPE_25GBASE_LR		= 0x22,
 	I40E_PHY_TYPE_25GBASE_AOC		= 0x23,
 	I40E_PHY_TYPE_25GBASE_ACC		= 0x24,
-	I40E_PHY_TYPE_2_5GBASE_T		= 0x30,
-	I40E_PHY_TYPE_5GBASE_T			= 0x31,
+	I40E_PHY_TYPE_2_5GBASE_T		= 0x26,
+	I40E_PHY_TYPE_5GBASE_T			= 0x27,
+	I40E_PHY_TYPE_2_5GBASE_T_LINK_STATUS	= 0x30,
+	I40E_PHY_TYPE_5GBASE_T_LINK_STATUS	= 0x31,
 	I40E_PHY_TYPE_MAX,
 	I40E_PHY_TYPE_NOT_SUPPORTED_HIGH_TEMP	= 0xFD,
 	I40E_PHY_TYPE_EMPTY			= 0xFE,
drivers/net/i40e/base/i40e_common.c +2 -2
index 32642f3e2b..ceedec68bf 100644
@@ -1280,8 +1280,8 @@ STATIC enum i40e_media_type i40e_get_media_type(struct i40e_hw *hw)
 		break;
 	case I40E_PHY_TYPE_100BASE_TX:
 	case I40E_PHY_TYPE_1000BASE_T:
-	case I40E_PHY_TYPE_2_5GBASE_T:
-	case I40E_PHY_TYPE_5GBASE_T:
+	case I40E_PHY_TYPE_2_5GBASE_T_LINK_STATUS:
+	case I40E_PHY_TYPE_5GBASE_T_LINK_STATUS:
 	case I40E_PHY_TYPE_10GBASE_T:
 		media = I40E_MEDIA_TYPE_BASET;
 		break;
drivers/net/i40e/base/i40e_type.h +2 -6
index e5a3729183..0323887550 100644
@@ -329,12 +329,8 @@ struct i40e_phy_info {
 					     I40E_PHY_TYPE_OFFSET)
 #define I40E_CAP_PHY_TYPE_25GBASE_ACC BIT_ULL(I40E_PHY_TYPE_25GBASE_ACC + \
 					     I40E_PHY_TYPE_OFFSET)
-/* Offset for 2.5G/5G PHY Types value to bit number conversion */
-#define I40E_PHY_TYPE_OFFSET2 (-10)
-#define I40E_CAP_PHY_TYPE_2_5GBASE_T BIT_ULL(I40E_PHY_TYPE_2_5GBASE_T + \
-					     I40E_PHY_TYPE_OFFSET2)
-#define I40E_CAP_PHY_TYPE_5GBASE_T BIT_ULL(I40E_PHY_TYPE_5GBASE_T + \
-					     I40E_PHY_TYPE_OFFSET2)
+#define I40E_CAP_PHY_TYPE_2_5GBASE_T BIT_ULL(I40E_PHY_TYPE_2_5GBASE_T)
+#define I40E_CAP_PHY_TYPE_5GBASE_T BIT_ULL(I40E_PHY_TYPE_5GBASE_T)
 #define I40E_HW_CAP_MAX_GPIO			30
 #define I40E_HW_CAP_MDIO_PORT_MODE_MDIO		0
 #define I40E_HW_CAP_MDIO_PORT_MODE_I2C		1
Signature · 1 line
2.25.1
#57 lore raw

Re: [dpdk-dev] [dpdk-stable] [PATCH v4 05/18] net/i40e/base: fix PHY type identifiers for 2.5G and 5G adapters

Quoted 3 lines · Robin Zhang

Unlike other supported adapters, 2.5G and 5G use different PHY type identifiers for reading/writing PHY settings and for reading link status. This commit intruduces

s/intruduces/introduces/

Quoted 7 lines

separate PHY identifiers for these two operation types.

Fixes 988ed63c7441 ("net/i40e/base: add support for Carlsville device")
#58 lore raw

PATCH v4 6/18 net/i40e/base: fix PF reset failed

In reply to Robin Zhang

PF has to delete all the filters during reset.
If it is fully loaded with filters then it is possible that it will take more than 200 ms to finish the reset resulting in timeout during pf_reset and
PF reset failed, -15 error indication.
Increasing the timeout value for PF reset from 200 to 1000 to give PF more time to finish reset if it is loaded with filters.

Fixes 1e32378f0774 ("i40e/base: increase PF reset max loop limit")
---
 drivers/net/i40e/base/i40e_common.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/i40e/base/i40e_common.c +1 -1
index ceedec68bf..aa424e6010 100644
@@ -1341,7 +1341,7 @@ STATIC enum i40e_status_code i40e_poll_globr(struct i40e_hw *hw,
 	return I40E_ERR_RESET_FAILED;
 }
 
-#define I40E_PF_RESET_WAIT_COUNT	200
+#define I40E_PF_RESET_WAIT_COUNT	1000
 /**
  * i40e_pf_reset - Reset the PF
  * @hw: pointer to the hardware structure
Signature · 1 line
2.25.1
#59 lore raw

Re: [dpdk-dev] [dpdk-stable] [PATCH v4 06/18] net/i40e/base: fix PF reset failed

Quoted 8 lines · Robin Zhang

PF has to delete all the filters during reset.
If it is fully loaded with filters then it is possible that it will take more than 200 ms to finish the reset resulting in timeout during pf_reset and
PF reset failed, -15 error indication.
Increasing the timeout value for PF reset from 200 to 1000 to give PF more time to finish reset if it is loaded with filters.

Quoted 5 lines
Fixes 1e32378f0774 ("i40e/base: increase PF reset max loop limit")

What do you think updating patch title as:
net/i40e/base: fix PF reset

#60 lore raw

PATCH v4 7/18 net/i40e/base: fix update link data for X722

In reply to Robin Zhang

The X722 card has 'Link Type' information elsewhere than the X710. Previously, for all cards, the 'Link Type' information was retrieved by opcode 0x0607 and this value was wrong for all X722 cards. Now this information for X722 only is taken by opcode 0x0600 (function: i40e_aq_get_phy_capabilities) instead of an opcode 0x0607 (function: i40e_aq_get_link_info).
All other parameters read by opcode 0x0607 unchanged.

Fixes e6691b428eb1 ("i40e/base: fix PHY NVM interaction")
Fixes 75c3de654ead ("net/i40e/base: fix long link down notification time")
---
 drivers/net/i40e/base/i40e_common.c | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)
drivers/net/i40e/base/i40e_common.c +10 -4
index aa424e6010..ef061a6b63 100644
@@ -2078,6 +2078,9 @@ enum i40e_status_code i40e_aq_get_link_info(struct i40e_hw *hw,
 	     hw->aq.fw_min_ver < 40)) && hw_link_info->phy_type == 0xE)
 		hw_link_info->phy_type = I40E_PHY_TYPE_10GBASE_SFPP_CU;
 
+	/* 'Get Link Status' response data structure from X722 FW has
+	 * different format and does not contain this information
+	 */
 	if (hw->flags & I40E_HW_FLAG_AQ_PHY_ACCESS_CAPABLE &&
 	    hw->mac.type != I40E_MAC_X722) {
 		__le32 tmp;
@@ -2948,10 +2951,13 @@ enum i40e_status_code i40e_update_link_info(struct i40e_hw *hw)
 		return status;
 
 	/* extra checking needed to ensure link info to user is timely */
-	if ((hw->phy.link_info.link_info & I40E_AQ_MEDIA_AVAILABLE) &&
-	    ((hw->phy.link_info.link_info & I40E_AQ_LINK_UP) ||
-	     !(hw->phy.link_info_old.link_info & I40E_AQ_LINK_UP))) {
-		status = i40e_aq_get_phy_capabilities(hw, false, false,
+	if (((hw->phy.link_info.link_info & I40E_AQ_MEDIA_AVAILABLE) &&
+	     ((hw->phy.link_info.link_info & I40E_AQ_LINK_UP) ||
+	      !(hw->phy.link_info_old.link_info & I40E_AQ_LINK_UP))) ||
+		hw->mac.type == I40E_MAC_X722) {
+		status = i40e_aq_get_phy_capabilities(hw, false,
+						      hw->mac.type ==
+						      I40E_MAC_X722,
 						      &abilities, NULL);
 		if (status)
 			return status;
Signature · 1 line
2.25.1
#61 lore raw

PATCH v4 8/18 net/i40e/base: fix AOC media type reported by ethtool

In reply to Robin Zhang

For Active Optical Cable (AOC) the correct media type is "Fibre", not "Direct Attach Copper".

Fixes d749d4d89969 ("i40e/base: add AOC PHY types")
Fixes aa153cc89ff0 ("net/i40e/base: add new PHY types for 25G AOC and

ACC")
Cc: [email protected]

---
 drivers/net/i40e/base/i40e_common.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/net/i40e/base/i40e_common.c +3 -3
index ef061a6b63..2ca6a13e79 100644
@@ -1276,6 +1276,9 @@ STATIC enum i40e_media_type i40e_get_media_type(struct i40e_hw *hw)
 	case I40E_PHY_TYPE_40GBASE_LR4:
 	case I40E_PHY_TYPE_25GBASE_LR:
 	case I40E_PHY_TYPE_25GBASE_SR:
+	case I40E_PHY_TYPE_10GBASE_AOC:
+	case I40E_PHY_TYPE_25GBASE_AOC:
+	case I40E_PHY_TYPE_40GBASE_AOC:
 		media = I40E_MEDIA_TYPE_FIBER;
 		break;
 	case I40E_PHY_TYPE_100BASE_TX:
@@ -1290,10 +1293,7 @@ STATIC enum i40e_media_type i40e_get_media_type(struct i40e_hw *hw)
 	case I40E_PHY_TYPE_10GBASE_CR1:
 	case I40E_PHY_TYPE_40GBASE_CR4:
 	case I40E_PHY_TYPE_10GBASE_SFPP_CU:
-	case I40E_PHY_TYPE_40GBASE_AOC:
-	case I40E_PHY_TYPE_10GBASE_AOC:
 	case I40E_PHY_TYPE_25GBASE_CR:
-	case I40E_PHY_TYPE_25GBASE_AOC:
 	case I40E_PHY_TYPE_25GBASE_ACC:
 		media = I40E_MEDIA_TYPE_DA;
 		break;
Signature · 1 line
2.25.1
#62 lore raw

Re: [dpdk-dev] [PATCH v4 08/18] net/i40e/base: fix AOC media type reported by ethtool

Quoted 10 lines · Robin Zhang

For Active Optical Cable (AOC) the correct media type is "Fibre", not "Direct Attach Copper".

Fixes d749d4d89969 ("i40e/base: add AOC PHY types")
Fixes aa153cc89ff0 ("net/i40e/base: add new PHY types for 25G AOC and

ACC")
Cc: [email protected]

I don't think the update in the dpdk is related to the ethtool, can you please update the patch title accordingly?

#63 lore raw

PATCH v4 9/18 net/i40e/base: add flags and fields for double vlan processing

In reply to Robin Zhang

Add flags for outer vlan and include set port parameters in Linux compilation.
Add flags, which describe port and switch state for both double vlan functionality and outer vlan processing.

---
 drivers/net/i40e/base/i40e_adminq_cmd.h | 22 ++++++++++++++++++++--
 1 file changed, 20 insertions(+), 2 deletions(-)
drivers/net/i40e/base/i40e_adminq_cmd.h +20 -2
index af9dec1d7f..372dd71c3f 100644
@@ -768,6 +768,7 @@ struct i40e_aqc_set_switch_config {
 #define I40E_AQ_SET_SWITCH_CFG_PROMISC		0x0001
 #define I40E_AQ_SET_SWITCH_CFG_L2_FILTER	0x0002
 #define I40E_AQ_SET_SWITCH_CFG_HW_ATR_EVICT	0x0004
+#define I40E_AQ_SET_SWITCH_CFG_OUTER_VLAN	0x0008
 	__le16	valid_flags;
 	/* The ethertype in switch_tag is dropped on ingress and used
 	 * internally by the switch. Set this to zero for the default
@@ -904,7 +905,7 @@ struct i40e_aqc_vsi_properties_data {
 	u8	sec_reserved;
 	/* VLAN section */
 	__le16	pvid; /* VLANS include priority bits */
-	__le16	fcoe_pvid;
+	__le16	outer_vlan;
 	u8	port_vlan_flags;
 #define I40E_AQ_VSI_PVLAN_MODE_SHIFT	0x00
 #define I40E_AQ_VSI_PVLAN_MODE_MASK	(0x03 << \
@@ -920,7 +921,24 @@ struct i40e_aqc_vsi_properties_data {
 #define I40E_AQ_VSI_PVLAN_EMOD_STR_UP	0x08
 #define I40E_AQ_VSI_PVLAN_EMOD_STR	0x10
 #define I40E_AQ_VSI_PVLAN_EMOD_NOTHING	0x18
-	u8	pvlan_reserved[3];
+	u8	outer_vlan_flags;
+#define I40E_AQ_VSI_OVLAN_MODE_SHIFT	0x00
+#define I40E_AQ_VSI_OVLAN_MODE_MASK	(0x03 << \
+					 I40E_AQ_VSI_OVLAN_MODE_SHIFT)
+#define I40E_AQ_VSI_OVLAN_MODE_UNTAGGED	0x01
+#define I40E_AQ_VSI_OVLAN_MODE_TAGGED	0x02
+#define I40E_AQ_VSI_OVLAN_MODE_ALL	0x03
+#define I40E_AQ_VSI_OVLAN_INSERT_PVID	0x04
+#define I40E_AQ_VSI_OVLAN_EMOD_SHIFT	0x03
+#define I40E_AQ_VSI_OVLAN_EMOD_MASK	(0x03 <<\
+					 I40E_AQ_VSI_OVLAN_EMOD_SHIFT)
+#define I40E_AQ_VSI_OVLAN_EMOD_SHOW_ALL	0x00
+#define I40E_AQ_VSI_OVLAN_EMOD_SHOW_UP	0x01
+#define I40E_AQ_VSI_OVLAN_EMOD_HIDE_ALL	0x02
+#define I40E_AQ_VSI_OVLAN_EMOD_NOTHING	0x03
+#define I40E_AQ_VSI_OVLAN_CTRL_ENA	0x04
+
+	u8	pvlan_reserved[2];
 	/* ingress egress up sections */
 	__le32	ingress_table; /* bitmap, 3 bits per up */
 #define I40E_AQ_VSI_UP_TABLE_UP0_SHIFT	0
Signature · 1 line
2.25.1
#64 lore raw

Re: [dpdk-dev] [PATCH v4 09/18] net/i40e/base: add flags and fields for double vlan processing

Quoted 2 lines · Robin Zhang

Add flags for outer vlan and include set port parameters in Linux compilation.

Isn't this a shared code drop, why it has changes specific to Linux compilation?

Quoted 5 lines

Add flags, which describe port and switch state for both double vlan functionality and outer vlan processing.

#65 lore raw

PATCH v4 10/18 net/i40e/base: fix headers to match functions

In reply to Robin Zhang

Fix several kernel-doc warnings when building with W=1. These changes are only to comments.

Fixes 8db9e2a1b232 ("i40e: base driver")
Fixes 842ea1996335 ("i40e/base: save link module type")
Fixes fd72a2284a89 ("i40e/base: support LED blinking with new PHY")
Fixes 788fc17b2dec ("i40e/base: support proxy config for X722")
---
 drivers/net/i40e/base/i40e_common.c  | 10 +++++-----
 drivers/net/i40e/base/i40e_dcb.c     |  2 +-
 drivers/net/i40e/base/i40e_lan_hmc.c |  2 +-
 drivers/net/i40e/base/i40e_nvm.c     |  2 +-
 4 files changed, 8 insertions(+), 8 deletions(-)
drivers/net/i40e/base/i40e_common.c +5 -5
index 2ca6a13e79..baa51e1396 100644
@@ -2677,7 +2677,7 @@ enum i40e_status_code i40e_aq_set_vsi_vlan_promisc(struct i40e_hw *hw,
 }
 
 /**
- * i40e_get_vsi_params - get VSI configuration info
+ * i40e_aq_get_vsi_params - get VSI configuration info
  * @hw: pointer to the hw struct
  * @vsi_ctx: pointer to a vsi context struct
  * @cmd_details: pointer to command details structure or NULL
@@ -2938,7 +2938,7 @@ enum i40e_status_code i40e_get_link_status(struct i40e_hw *hw, bool *link_up)
 }
 
 /**
- * i40e_updatelink_status - update status of the HW network link
+ * i40e_update_link_info - update status of the HW network link
  * @hw: pointer to the hw struct
  **/
 enum i40e_status_code i40e_update_link_info(struct i40e_hw *hw)
@@ -4830,7 +4830,7 @@ enum i40e_status_code i40e_aq_del_udp_tunnel(struct i40e_hw *hw, u8 index,
 }
 
 /**
- * i40e_aq_get_switch_resource_alloc (0x0204)
+ * i40e_aq_get_switch_resource_alloc - command (0x0204) to get allocations
  * @hw: pointer to the hw struct
  * @num_entries: pointer to u8 to store the number of resource entries returned
  * @buf: pointer to a user supplied buffer.  This buffer must be large enough
@@ -6977,7 +6977,7 @@ u8 i40e_get_phy_address(struct i40e_hw *hw, u8 dev_num)
 }
 
 /**
- * i40e_blink_phy_led
+ * i40e_blink_phy_link_led
  * @hw: pointer to the HW structure
  * @time: time how long led will blinks in secs
  * @interval: gap between LED on and off in msecs
@@ -7824,7 +7824,7 @@ enum i40e_status_code i40e_aq_set_arp_proxy_config(struct i40e_hw *hw,
 }
 
 /**
- * i40e_aq_opc_set_ns_proxy_table_entry
+ * i40e_aq_set_ns_proxy_table_entry
  * @hw: pointer to the HW structure
  * @ns_proxy_table_entry: pointer to NS table entry command struct
  * @cmd_details: pointer to command details
drivers/net/i40e/base/i40e_dcb.c +1 -1
index 27b52bc365..8f9b7e823f 100644
@@ -235,7 +235,7 @@ static void i40e_parse_ieee_app_tlv(struct i40e_lldp_org_tlv *tlv,
 }
 
 /**
- * i40e_parse_ieee_etsrec_tlv
+ * i40e_parse_ieee_tlv
  * @tlv: IEEE 802.1Qaz TLV
  * @dcbcfg: Local store to update ETS REC data
  *
drivers/net/i40e/base/i40e_lan_hmc.c +1 -1
index d3969396f0..d3bd683ff3 100644
@@ -516,7 +516,7 @@ enum i40e_status_code i40e_configure_lan_hmc(struct i40e_hw *hw,
 }
 
 /**
- * i40e_delete_hmc_object - remove hmc objects
+ * i40e_delete_lan_hmc_object - remove hmc objects
  * @hw: pointer to the HW structure
  * @info: pointer to i40e_hmc_delete_obj_info struct
  *
drivers/net/i40e/base/i40e_nvm.c +1 -1
index 561ed21136..67e58cc195 100644
@@ -7,7 +7,7 @@
 #include "i40e_prototype.h"
 
 /**
- * i40e_init_nvm_ops - Initialize NVM function pointers
+ * i40e_init_nvm - Initialize NVM function pointers
  * @hw: pointer to the HW structure
  *
  * Setup the function pointers and the NVM info structure. Should be called
Signature · 1 line
2.25.1
#66 lore raw

Re: [dpdk-dev] [PATCH v4 10/18] net/i40e/base: fix headers to match functions

Quoted 3 lines · Robin Zhang

Fix several kernel-doc warnings when building with W=1. These changes are only to comments.

Same here, why shared code drop has Linux kernel specific updates?

Quoted 8 lines
Fixes 8db9e2a1b232 ("i40e: base driver")
Fixes 842ea1996335 ("i40e/base: save link module type")
Fixes fd72a2284a89 ("i40e/base: support LED blinking with new PHY")
Fixes 788fc17b2dec ("i40e/base: support proxy config for X722")
#67 lore raw

PATCH v4 11/18 net/i40e/base: fix potentially uninitialized variables in NVM code

In reply to Robin Zhang

The status of i40e_read_nvm_word is not checked, so variables set from this function could be used uninitialized. In this case, preserve the existing flow that does not block initialization by initializing these values from the start.

Fixes 8d6c51fcd24b ("i40e/base: get OEM version")
Fixes 2db70574247b ("net/i40e/base: limit PF/VF specific code to that driver only")
---
 drivers/net/i40e/base/i40e_adminq.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/net/i40e/base/i40e_adminq.c +4 -2
index eafacbdbec..d27ccde29a 100644
@@ -648,8 +648,10 @@ enum i40e_status_code i40e_init_adminq(struct i40e_hw *hw)
 {
 	struct i40e_adminq_info *aq = &hw->aq;
 	enum i40e_status_code ret_code;
-	u16 cfg_ptr, oem_hi, oem_lo;
-	u16 eetrack_lo, eetrack_hi;
+	u16 oem_hi = 0, oem_lo = 0;
+	u16 eetrack_hi = 0;
+	u16 eetrack_lo = 0;
+	u16 cfg_ptr = 0;
 	int retry = 0;
 
 	/* verify input for valid configuration */
Signature · 1 line
2.25.1
#68 lore raw

PATCH v4 12/18 net/i40e/base: fix checksum is used before return value is checked

In reply to Robin Zhang

The variable checksum from i40e_calc_nvm_checksum is used before return value is checked. Fix this logic.

Fixes 8db9e2a1b232 ("i40e: base driver")
Fixes 3ed6c3246f43 ("i40e/base: handle AQ timeout when releasing NVM")
---
 drivers/net/i40e/base/i40e_nvm.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/net/i40e/base/i40e_nvm.c +3 -2
index 67e58cc195..f385042601 100644
@@ -755,10 +755,11 @@ enum i40e_status_code i40e_update_nvm_checksum(struct i40e_hw *hw)
 	DEBUGFUNC("i40e_update_nvm_checksum");
 
 	ret_code = i40e_calc_nvm_checksum(hw, &checksum);
-	le_sum = CPU_TO_LE16(checksum);
-	if (ret_code == I40E_SUCCESS)
+	if (ret_code == I40E_SUCCESS) {
+		le_sum = CPU_TO_LE16(checksum);
 		ret_code = i40e_write_nvm_aq(hw, 0x00, I40E_SR_SW_CHECKSUM_WORD,
 					     1, &le_sum, true);
+	}
 
 	return ret_code;
 }
Signature · 1 line
2.25.1
#69 lore raw

PATCH v4 13/18 net/i40e/base: add defs for MAC frequency calculation if no link

In reply to Robin Zhang

Add macros and structures for MAC frequency calculation in case the link is not present.

---
 drivers/net/i40e/base/i40e_adminq_cmd.h |  9 +++++++++
 drivers/net/i40e/base/i40e_register.h   | 10 ++++++++++
 drivers/net/i40e/base/i40e_type.h       |  8 ++++++++
 3 files changed, 27 insertions(+)
drivers/net/i40e/base/i40e_adminq_cmd.h +9 -0
index 372dd71c3f..d2615705a9 100644
@@ -2035,6 +2035,15 @@ enum i40e_aq_link_speed {
 	I40E_LINK_SPEED_25GB	= (1 << I40E_LINK_SPEED_25GB_SHIFT),
 };
 
+enum i40e_prt_mac_pcs_link_speed {
+	I40E_PRT_MAC_PCS_LINK_SPEED_UNKNOWN = 0,
+	I40E_PRT_MAC_PCS_LINK_SPEED_100MB,
+	I40E_PRT_MAC_PCS_LINK_SPEED_1GB,
+	I40E_PRT_MAC_PCS_LINK_SPEED_10GB,
+	I40E_PRT_MAC_PCS_LINK_SPEED_40GB,
+	I40E_PRT_MAC_PCS_LINK_SPEED_20GB
+};
+
 struct i40e_aqc_module_desc {
 	u8 oui[3];
 	u8 reserved1;
drivers/net/i40e/base/i40e_register.h +10 -0
index ee4f333f9c..75eff845f1 100644
@@ -1411,6 +1411,11 @@
 #define I40E_PRTMAC_PCS_XAUI_SWAP_B_SWAP_RX_LANE1_MASK  I40E_MASK(0x3, I40E_PRTMAC_PCS_XAUI_SWAP_B_SWAP_RX_LANE1_SHIFT)
 #define I40E_PRTMAC_PCS_XAUI_SWAP_B_SWAP_RX_LANE0_SHIFT 14
 #define I40E_PRTMAC_PCS_XAUI_SWAP_B_SWAP_RX_LANE0_MASK  I40E_MASK(0x3, I40E_PRTMAC_PCS_XAUI_SWAP_B_SWAP_RX_LANE0_SHIFT)
+/* _i=0...3 */ /* Reset: GLOBR */
+#define I40E_PRTMAC_PCS_LINK_STATUS1(_i) (0x0008C200 + ((_i) * 4))
+#define I40E_PRTMAC_PCS_LINK_STATUS1_LINK_SPEED_SHIFT 24
+#define I40E_PRTMAC_PCS_LINK_STATUS1_LINK_SPEED_MASK \
+	I40E_MASK(0x7, I40E_PRTMAC_PCS_LINK_STATUS1_LINK_SPEED_SHIFT)
 #define I40E_GL_FWRESETCNT                  0x00083100 /* Reset: POR */
 #define I40E_GL_FWRESETCNT_FWRESETCNT_SHIFT 0
 #define I40E_GL_FWRESETCNT_FWRESETCNT_MASK  I40E_MASK(0xFFFFFFFF, I40E_GL_FWRESETCNT_FWRESETCNT_SHIFT)
@@ -3873,6 +3878,11 @@
 #define I40E_PRTMAC_LINK_DOWN_COUNTER                         0x001E2440 /* Reset: GLOBR */
 #define I40E_PRTMAC_LINK_DOWN_COUNTER_LINK_DOWN_COUNTER_SHIFT 0
 #define I40E_PRTMAC_LINK_DOWN_COUNTER_LINK_DOWN_COUNTER_MASK  I40E_MASK(0xFFFF, I40E_PRTMAC_LINK_DOWN_COUNTER_LINK_DOWN_COUNTER_SHIFT)
+/* _i=0...3 */ /* Reset: GLOBR */
+#define I40E_PRTMAC_LINKSTA(_i) (0x001E2420 + ((_i) * 4))
+#define I40E_PRTMAC_LINKSTA_MAC_LINK_SPEED_SHIFT 27
+#define I40E_PRTMAC_LINKSTA_MAC_LINK_SPEED_MASK \
+	I40E_MASK(0x7, I40E_PRTMAC_LINKSTA_MAC_LINK_SPEED_SHIFT)
 #define I40E_GLNVM_AL_REQ                        0x000B6164 /* Reset: POR */
 #define I40E_GLNVM_AL_REQ_POR_SHIFT              0
 #define I40E_GLNVM_AL_REQ_POR_MASK               I40E_MASK(0x1, I40E_GLNVM_AL_REQ_POR_SHIFT)
drivers/net/i40e/base/i40e_type.h +8 -0
index 0323887550..49e05d89fa 100644
@@ -236,6 +236,14 @@ enum i40e_queue_type {
 	I40E_QUEUE_TYPE_UNKNOWN
 };
 
+enum i40e_prt_mac_link_speed {
+	I40E_PRT_MAC_LINK_SPEED_100MB = 0,
+	I40E_PRT_MAC_LINK_SPEED_1GB,
+	I40E_PRT_MAC_LINK_SPEED_10GB,
+	I40E_PRT_MAC_LINK_SPEED_40GB,
+	I40E_PRT_MAC_LINK_SPEED_20GB
+};
+
 struct i40e_link_status {
 	enum i40e_aq_phy_type phy_type;
 	enum i40e_aq_link_speed link_speed;
Signature · 1 line
2.25.1
#70 lore raw

PATCH v4 14/18 net/i40e/base: separate kernel allocated rx_bi rings from AF_XDP rings

In reply to Robin Zhang

Continuing the path to support MEM_TYPE_XSK_BUFF_POOL, the AF_XDP zero-copy/sk_buff rx_bi rings are now separate. Functions to properly allocate the different rings are added as well.

---
 drivers/net/i40e/base/i40e_type.h | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/net/i40e/base/i40e_type.h +4 -1
index 49e05d89fa..813c1ec00f 100644
@@ -817,7 +817,7 @@ union i40e_32byte_rx_desc {
 		__le64  rsvd2;
 	} read;
 	struct {
-		struct {
+		struct i40e_32b_rx_wb_qw0 {
 			struct {
 				union {
 					__le16 mirroring_status;
@@ -855,6 +855,9 @@ union i40e_32byte_rx_desc {
 			} hi_dword;
 		} qword3;
 	} wb;  /* writeback */
+	struct {
+		u64 qword[4];
+	} raw;
 };
 
 #define I40E_RXD_QW0_MIRROR_STATUS_SHIFT	8
Signature · 1 line
2.25.1
#71 lore raw

Re: [dpdk-dev] [PATCH v4 14/18] net/i40e/base: separate kernel allocated rx_bi rings from AF_XDP rings

Quoted 6 lines · Robin Zhang

Continuing the path to support MEM_TYPE_XSK_BUFF_POOL, the AF_XDP zero-copy/sk_buff rx_bi rings are now separate. Functions to properly allocate the different rings are added as well.

Again, af_xdp concern is very specific to the Linux kernel, should we get this commit in shared code drop for DPDK?

#72 lore raw

PATCH v4 15/18 net/i40e/base: Update FVL FW API version to 1.15

In reply to Robin Zhang

Update FVL FW API version to 1.15

---
 drivers/net/i40e/base/i40e_adminq_cmd.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/i40e/base/i40e_adminq_cmd.h +1 -1
index d2615705a9..def307b59d 100644
@@ -13,7 +13,7 @@
 
 #define I40E_FW_API_VERSION_MAJOR	0x0001
 #define I40E_FW_API_VERSION_MINOR_X722	0x000C
-#define I40E_FW_API_VERSION_MINOR_X710	0x000C
+#define I40E_FW_API_VERSION_MINOR_X710	0x000F
 
 #define I40E_FW_MINOR_VERSION(_h) ((_h)->mac.type == I40E_MAC_XL710 ? \
 					I40E_FW_API_VERSION_MINOR_X710 : \
Signature · 1 line
2.25.1
#73 lore raw

PATCH v4 16/18 net/i40e/base: add defines related to DDP

In reply to Robin Zhang

This patch adds some defines related to DDP Track ID.

---
 drivers/net/i40e/base/i40e_type.h | 2 ++
 1 file changed, 2 insertions(+)
drivers/net/i40e/base/i40e_type.h +2 -0
index 813c1ec00f..f4a3d66759 100644
@@ -1988,6 +1988,8 @@ struct i40e_metadata_segment {
 	struct i40e_ddp_version version;
 #define I40E_DDP_TRACKID_RDONLY		0
 #define I40E_DDP_TRACKID_INVALID	0xFFFFFFFF
+#define I40E_DDP_TRACKID_GRP_MSK	0x00FF0000
+#define I40E_DDP_TRACKID_GRP_COMP_ALL	0xFF
 	u32 track_id;
 	char name[I40E_DDP_NAME_SIZE];
 };
Signature · 1 line
2.25.1
#74 lore raw

PATCH v4 17/18 net/i40e/base: update version in readme

In reply to Robin Zhang

Update base code version in README.

---
 drivers/net/i40e/base/README | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/i40e/base/README +1 -1
index 6af2993116..2e4fa5a921 100644
@@ -6,7 +6,7 @@ Intel® I40E driver
 ==================
 
 This directory contains source code of FreeBSD i40e driver of version
-cid-i40e.2020.08.27.tar.gz released by the team which develops
+cid-i40e.2021.08.16.tar.gz released by the team which develops
 basic drivers for any i40e NIC. The directory of base/ contains the
 original source package.
 This driver is valid for the product(s) listed below
Signature · 1 line
2.25.1
#75 lore raw

PATCH v4 18/18 net/i40e: fix redefinition warning

In reply to Robin Zhang

After update i40e share code, there will be a redefinition compile warning. This patch fix the situation by remove duplicate definition in i40e_ethdev.c

Fixes eef2daf2e199 ("net/i40e: fix link update no wait")
---
 drivers/net/i40e/i40e_ethdev.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/net/i40e/i40e_ethdev.c +1 -2
index 7b230e2ed1..4fc44dc5e2 100644
@@ -2886,7 +2886,6 @@ static __rte_always_inline void
 update_link_reg(struct i40e_hw *hw, struct rte_eth_link *link)
 {
 /* Link status registers and values*/
-#define I40E_PRTMAC_LINKSTA		0x001E2420
 #define I40E_REG_LINK_UP		0x40000080
 #define I40E_PRTMAC_MACC		0x001E24E0
 #define I40E_REG_MACC_25GB		0x00020000
@@ -2899,7 +2898,7 @@ update_link_reg(struct i40e_hw *hw, struct rte_eth_link *link)
 	uint32_t link_speed;
 	uint32_t reg_val;
 
-	reg_val = I40E_READ_REG(hw, I40E_PRTMAC_LINKSTA);
+	reg_val = I40E_READ_REG(hw, I40E_PRTMAC_LINKSTA(0));
 	link_speed = reg_val & I40E_REG_SPEED_MASK;
 	reg_val &= I40E_REG_LINK_UP;
 	link->link_status = (reg_val == I40E_REG_LINK_UP) ? 1 : 0;
Signature · 1 line
2.25.1
#76 lore raw

Re: [dpdk-dev] [PATCH v4 18/18] net/i40e: fix redefinition warning

Quoted 17 lines

-----Original Message-----
From: Zhang, RobinX <[email protected]>
Sent: Monday, September 6, 2021 10:03 AM
To: [email protected]
Cc: Xing, Beilei <[email protected]>; Zhang, Qi Z <[email protected]>; Zhang, Helin <[email protected]>; Wu, Jingjing <[email protected]>; [email protected]; [email protected]; [email protected]; Zhu, Heqing <[email protected]>; Liang, Cunming <[email protected]>; Lu, Wenzhuo <[email protected]>; Zhang, Roy Fan <[email protected]>; Chilikin, Andrey <[email protected]>; [email protected]; Guo, Junfeng <[email protected]>; Yang, SteveX <[email protected]>; Zhang, RobinX <[email protected]>
Subject: [PATCH v4 18/18] net/i40e: fix redefinition warning

Quoted 4 lines

After update i40e share code, there will be a redefinition compile warning. This patch fix the situation by remove duplicate definition in i40e_ethdev.c

Fixes eef2daf2e199 ("net/i40e: fix link update no wait")

Need to cc stable?

Quoted 29 lines
---
 drivers/net/i40e/i40e_ethdev.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/net/i40e/i40e_ethdev.c +1 -2
index 7b230e2ed1..4fc44dc5e2 100644
@@ -2886,7 +2886,6 @@ static __rte_always_inline void
 update_link_reg(struct i40e_hw *hw, struct rte_eth_link *link)  {
 /* Link status registers and values*/
-#define I40E_PRTMAC_LINKSTA		0x001E2420
 #define I40E_REG_LINK_UP		0x40000080
 #define I40E_PRTMAC_MACC		0x001E24E0
 #define I40E_REG_MACC_25GB		0x00020000
@@ -2899,7 +2898,7 @@ update_link_reg(struct i40e_hw *hw, struct
 rte_eth_link *link)
 	uint32_t link_speed;
 	uint32_t reg_val;
 
-	reg_val = I40E_READ_REG(hw, I40E_PRTMAC_LINKSTA);
+	reg_val = I40E_READ_REG(hw, I40E_PRTMAC_LINKSTA(0));
 	link_speed = reg_val & I40E_REG_SPEED_MASK;
 	reg_val &= I40E_REG_LINK_UP;

link->link_status = (reg_val == I40E_REG_LINK_UP) ? 1 : 0;
--
2.25.1

#77 lore raw

Re: [dpdk-dev] [PATCH v4 18/18] net/i40e: fix redefinition warning

Hi, Beilei

Quoted 32 lines

-----Original Message-----
From: Xing, Beilei <[email protected]>
Sent: Monday, September 27, 2021 5:18 PM
To: Zhang, RobinX <[email protected]>; [email protected]
Cc: Zhang, Qi Z <[email protected]>; Zhang, Helin <[email protected]>; Wu, Jingjing <[email protected]>; [email protected]; [email protected]; [email protected]; Zhu, Heqing <[email protected]>; Liang, Cunming <[email protected]>; Lu, Wenzhuo <[email protected]>; Zhang, Roy Fan <[email protected]>; Chilikin, Andrey <[email protected]>; [email protected]; Guo, Junfeng <[email protected]>; Yang, SteveX <[email protected]>
Subject: RE: [PATCH v4 18/18] net/i40e: fix redefinition warning

Quoted 16 lines

-----Original Message-----
From: Zhang, RobinX <[email protected]>
Sent: Monday, September 6, 2021 10:03 AM
To: [email protected]
Cc: Xing, Beilei <[email protected]>; Zhang, Qi Z <[email protected]>; Zhang, Helin <[email protected]>; Wu, Jingjing <[email protected]>; [email protected]; [email protected]; [email protected]; Zhu, Heqing <[email protected]>; Liang, Cunming <[email protected]>; Lu, Wenzhuo <[email protected]>; Zhang, Roy Fan <[email protected]>; Chilikin, Andrey <[email protected]>; [email protected]; Guo, Junfeng <[email protected]>; Yang, SteveX <[email protected]>; Zhang, RobinX <[email protected]>
Subject: [PATCH v4 18/18] net/i40e: fix redefinition warning

Quoted 6 lines
Quoted 5 lines

After update i40e share code, there will be a redefinition compile warning. This patch fix the situation by remove duplicate definition in i40e_ethdev.c

Fixes eef2daf2e199 ("net/i40e: fix link update no wait")

Need to cc stable?

This patch is dependent on share code, so cannot cc stable.

Quoted 30 lines
Quoted 30 lines
---
 drivers/net/i40e/i40e_ethdev.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
(quoted diff) +0 -0

b/drivers/net/i40e/i40e_ethdev.c index 7b230e2ed1..4fc44dc5e2 100644

drivers/net/i40e/i40e_ethdev.c +1 -2
@@ -2886,7 +2886,6 @@ static __rte_always_inline void
 update_link_reg(struct i40e_hw *hw, struct rte_eth_link *link)  {
 /* Link status registers and values*/
-#define I40E_PRTMAC_LINKSTA		0x001E2420
 #define I40E_REG_LINK_UP		0x40000080
 #define I40E_PRTMAC_MACC		0x001E24E0
 #define I40E_REG_MACC_25GB		0x00020000
@@ -2899,7 +2898,7 @@ update_link_reg(struct i40e_hw *hw, struct
 rte_eth_link *link)
 	uint32_t link_speed;
 	uint32_t reg_val;
 
-	reg_val = I40E_READ_REG(hw, I40E_PRTMAC_LINKSTA);
+	reg_val = I40E_READ_REG(hw, I40E_PRTMAC_LINKSTA(0));
 	link_speed = reg_val & I40E_REG_SPEED_MASK;
 	reg_val &= I40E_REG_LINK_UP;

link->link_status = (reg_val == I40E_REG_LINK_UP) ? 1 : 0;
--
2.25.1

#78 lore raw

Re: [dpdk-dev] [PATCH v4 18/18] net/i40e: fix redefinition warning

Hi,

Quoted 34 lines · RobinX

Hi, Beilei

Quoted 32 lines

-----Original Message-----
From: Xing, Beilei <[email protected]>
Sent: Monday, September 27, 2021 5:18 PM
To: Zhang, RobinX <[email protected]>; [email protected]
Cc: Zhang, Qi Z <[email protected]>; Zhang, Helin <[email protected]>; Wu, Jingjing <[email protected]>; [email protected]; [email protected]; [email protected]; Zhu, Heqing <[email protected]>; Liang, Cunming <[email protected]>; Lu, Wenzhuo <[email protected]>; Zhang, Roy Fan <[email protected]>; Chilikin, Andrey <[email protected]>; [email protected]; Guo, Junfeng <[email protected]>; Yang, SteveX <[email protected]>
Subject: RE: [PATCH v4 18/18] net/i40e: fix redefinition warning

Quoted 16 lines

-----Original Message-----
From: Zhang, RobinX <[email protected]>
Sent: Monday, September 6, 2021 10:03 AM
To: [email protected]
Cc: Xing, Beilei <[email protected]>; Zhang, Qi Z <[email protected]>; Zhang, Helin <[email protected]>; Wu, Jingjing <[email protected]>; [email protected]; [email protected]; [email protected]; Zhu, Heqing <[email protected]>; Liang, Cunming <[email protected]>; Lu, Wenzhuo <[email protected]>; Zhang, Roy Fan <[email protected]>; Chilikin, Andrey <[email protected]>; [email protected]; Guo, Junfeng <[email protected]>; Yang, SteveX <[email protected]>; Zhang, RobinX <[email protected]>
Subject: [PATCH v4 18/18] net/i40e: fix redefinition warning

Quoted 9 lines
Quoted 6 lines
Quoted 5 lines

After update i40e share code, there will be a redefinition compile warning. This patch fix the situation by remove duplicate definition in i40e_ethdev.c

Fixes eef2daf2e199 ("net/i40e: fix link update no wait")

Need to cc stable?

This patch is dependent on share code, so cannot cc stable.

I don't think the original definition should be the fixes commit, unless it was incorrect before these patches.

This warning was introduced by the redefining in patch 13/18. It would be better to fix 13/18 to not introduce the warning, rather than introduce a warning and fix it at the end of the series.

Quoted 31 lines
Quoted 30 lines
Quoted 30 lines
---
  drivers/net/i40e/i40e_ethdev.c | 3 +--
  1 file changed, 1 insertion(+), 2 deletions(-)
(quoted diff) +0 -0

b/drivers/net/i40e/i40e_ethdev.c index 7b230e2ed1..4fc44dc5e2 100644

drivers/net/i40e/i40e_ethdev.c +1 -2
@@ -2886,7 +2886,6 @@ static __rte_always_inline void
 update_link_reg(struct i40e_hw *hw, struct rte_eth_link *link)  {
  /* Link status registers and values*/
-#define I40E_PRTMAC_LINKSTA		0x001E2420
  #define I40E_REG_LINK_UP		0x40000080
  #define I40E_PRTMAC_MACC		0x001E24E0
  #define I40E_REG_MACC_25GB		0x00020000
@@ -2899,7 +2898,7 @@ update_link_reg(struct i40e_hw *hw, struct
 rte_eth_link *link)
  	uint32_t link_speed;
  	uint32_t reg_val;
 
-	reg_val = I40E_READ_REG(hw, I40E_PRTMAC_LINKSTA);
+	reg_val = I40E_READ_REG(hw, I40E_PRTMAC_LINKSTA(0));
  	link_speed = reg_val & I40E_REG_SPEED_MASK;
  	reg_val &= I40E_REG_LINK_UP;

link->link_status = (reg_val == I40E_REG_LINK_UP) ? 1 : 0;
--
2.25.1

#79 lore raw

Re: [dpdk-dev] [PATCH v4 18/18] net/i40e: fix redefinition warning

Quoted 65 lines

-----Original Message-----
From: Kevin Traynor <[email protected]>
Sent: Monday, September 27, 2021 6:38 PM
To: Zhang, RobinX <[email protected]>; Xing, Beilei <[email protected]>; [email protected]
Cc: Zhang, Qi Z <[email protected]>; Zhang, Helin <[email protected]>; Wu, Jingjing <[email protected]>; [email protected]; [email protected]; [email protected]; Zhu, Heqing <[email protected]>; Liang, Cunming <[email protected]>; Lu, Wenzhuo <[email protected]>; Zhang, Roy Fan <[email protected]>; Chilikin, Andrey <[email protected]>; [email protected]; Guo, Junfeng <[email protected]>; Yang, SteveX <[email protected]>
Subject: Re: [dpdk-dev] [PATCH v4 18/18] net/i40e: fix redefinition warning

Hi,

Quoted 11 lines · RobinX

Hi, Beilei

Quoted 9 lines

-----Original Message-----
From: Xing, Beilei <[email protected]>
Sent: Monday, September 27, 2021 5:18 PM
To: Zhang, RobinX <[email protected]>; [email protected]
Cc: Zhang, Qi Z <[email protected]>; Zhang, Helin <[email protected]>; Wu, Jingjing <[email protected]>; [email protected]; [email protected]; [email protected]; Zhu, Heqing <[email protected]>; Liang, Cunming <[email protected]>; Lu, Wenzhuo <[email protected]>;

Zhang,

Quoted 23 lines
Quoted 23 lines

Roy Fan <[email protected]>; Chilikin, Andrey <[email protected]>; [email protected]; Guo, Junfeng <[email protected]>; Yang, SteveX <[email protected]>
Subject: RE: [PATCH v4 18/18] net/i40e: fix redefinition warning

Quoted 16 lines

-----Original Message-----
From: Zhang, RobinX <[email protected]>
Sent: Monday, September 6, 2021 10:03 AM
To: [email protected]
Cc: Xing, Beilei <[email protected]>; Zhang, Qi Z <[email protected]>; Zhang, Helin <[email protected]>; Wu, Jingjing <[email protected]>; [email protected]; [email protected]; [email protected]; Zhu, Heqing <[email protected]>; Liang, Cunming <[email protected]>; Lu, Wenzhuo <[email protected]>; Zhang, Roy Fan <[email protected]>; Chilikin, Andrey <[email protected]>; [email protected]; Guo, Junfeng <[email protected]>; Yang, SteveX <[email protected]>; Zhang, RobinX <[email protected]>
Subject: [PATCH v4 18/18] net/i40e: fix redefinition warning

Quoted 9 lines
Quoted 6 lines
Quoted 5 lines

After update i40e share code, there will be a redefinition compile warning. This patch fix the situation by remove duplicate definition in i40e_ethdev.c

Fixes eef2daf2e199 ("net/i40e: fix link update no wait")

Need to cc stable?

This patch is dependent on share code, so cannot cc stable.

Quoted 6 lines

I don't think the original definition should be the fixes commit, unless it was incorrect before these patches.

This warning was introduced by the redefining in patch 13/18. It would be better to fix 13/18 to not introduce the warning, rather than introduce a warning and fix it at the end of the series.

+1

If fix a patch belong to the same set, please squash them into 1.

Quoted 32 lines
Quoted 32 lines
Quoted 31 lines
Quoted 31 lines
---
  drivers/net/i40e/i40e_ethdev.c | 3 +--
  1 file changed, 1 insertion(+), 2 deletions(-)
(quoted diff) +0 -0

b/drivers/net/i40e/i40e_ethdev.c index 7b230e2ed1..4fc44dc5e2 100644

drivers/net/i40e/i40e_ethdev.c +1 -2
@@ -2886,7 +2886,6 @@ static __rte_always_inline void
 update_link_reg(struct i40e_hw *hw, struct rte_eth_link *link)  {
  /* Link status registers and values*/
-#define I40E_PRTMAC_LINKSTA		0x001E2420
  #define I40E_REG_LINK_UP		0x40000080
  #define I40E_PRTMAC_MACC		0x001E24E0
  #define I40E_REG_MACC_25GB		0x00020000
@@ -2899,7 +2898,7 @@ update_link_reg(struct i40e_hw *hw, struct
 rte_eth_link *link)
  	uint32_t link_speed;
  	uint32_t reg_val;
 
-	reg_val = I40E_READ_REG(hw, I40E_PRTMAC_LINKSTA);
+	reg_val = I40E_READ_REG(hw, I40E_PRTMAC_LINKSTA(0));
  	link_speed = reg_val & I40E_REG_SPEED_MASK;
  	reg_val &= I40E_REG_LINK_UP;

link->link_status = (reg_val == I40E_REG_LINK_UP) ? 1 : 0;
--
2.25.1

Acked-by on the v4 series
#80 lore raw
In reply to Robin Zhang
Quoted 76 lines

-----Original Message-----
From: Zhang, RobinX <[email protected]>
Sent: Monday, September 6, 2021 10:03 AM
To: [email protected]
Cc: Xing, Beilei <[email protected]>; Zhang, Qi Z <[email protected]>; Zhang, Helin <[email protected]>; Wu, Jingjing <[email protected]>; [email protected]; [email protected]; [email protected]; Zhu, Heqing <[email protected]>; Liang, Cunming <[email protected]>; Lu, Wenzhuo <[email protected]>; Zhang, Roy Fan <[email protected]>; Chilikin, Andrey <[email protected]>; [email protected]; Guo, Junfeng <[email protected]>; Yang, SteveX <[email protected]>; Zhang, RobinX <[email protected]>
Subject: [PATCH v4 00/18] i40e base code update

update i40e base code.

source code of i40e driver:
cid-i40e.2021.08.16.tar.gz

changelog in i40e share repo:
From 59a080f4fafe ("i40e-shared: Add opcode 0x0406 and 0x0416 to Linux support") To 2c7aab559654 ("i40e-shared: Add defines related to DDP")

The following commits are ignored:
cb9139e3bce8 ("i40e-shared: Fix not blinking X722 with x557 PHY via ‘ethtool -p'")
c09d4f9cf390 ("i40e-shared: i40e-shared: Fix build warning -Wformat related to integer size")
ff8a1abc6c17 ("i40e-shared: Fix build warning with __packed") 59a080f4fafe ("i40e-shared: Add opcode 0x0406 and 0x0416 to Linux
support")

v4:
- update base code to cid-i40e.2021.08.16
v3:
- there has a fix patch contains two issues, split it into two patches v2:
- refine commit messages and macro name

Robin Zhang (18):
net/i40e/base: add new versions of send ASQ command functions net/i40e/base: add support for Min Rollback Revision for 4 more X722
modules
net/i40e/base: set TSA table values when parsing CEE configuration net/i40e/base: define new Shadow RAM pointers net/i40e/base: fix PHY type identifiers for 2.5G and 5G adapters net/i40e/base: fix PF reset failed
net/i40e/base: fix update link data for X722 net/i40e/base: fix AOC media type reported by ethtool net/i40e/base: add flags and fields for double vlan processing net/i40e/base: fix headers to match functions net/i40e/base: fix potentially uninitialized variables in NVM code net/i40e/base: fix checksum is used before return value is checked net/i40e/base: add defs for MAC frequency calculation if no link net/i40e/base: separate kernel allocated rx_bi rings from AF_XDP rings net/i40e/base: Update FVL FW API version to 1.15 net/i40e/base: add defines related to DDP
net/i40e/base: update version in readme
net/i40e: fix redefinition warning

 drivers/net/i40e/base/README            |   2 +-
 drivers/net/i40e/base/i40e_adminq.c     |  79 +++++++++--
 drivers/net/i40e/base/i40e_adminq_cmd.h |  55 ++++++--
 drivers/net/i40e/base/i40e_common.c     | 175 +++++++++++++++++++-----
 drivers/net/i40e/base/i40e_dcb.c        |  10 +-
 drivers/net/i40e/base/i40e_lan_hmc.c    |   2 +-
 drivers/net/i40e/base/i40e_nvm.c        |   7 +-
 drivers/net/i40e/base/i40e_prototype.h  |  17 +++
 drivers/net/i40e/base/i40e_register.h   |  10 ++
 drivers/net/i40e/base/i40e_type.h       |  26 +++-
 drivers/net/i40e/i40e_ethdev.c          |   3 +-
 11 files changed, 318 insertions(+), 68 deletions(-)
Quoted 2 lines

--
2.25.1

Applied
#81 lore raw
Quoted 96 lines

-----Original Message-----
From: Xing, Beilei <[email protected]>
Sent: Monday, September 27, 2021 5:42 PM
To: Zhang, RobinX <[email protected]>; [email protected]
Cc: Zhang, Qi Z <[email protected]>; Zhang, Helin <[email protected]>; Wu, Jingjing <[email protected]>; [email protected]; [email protected]; [email protected]; Zhu, Heqing <[email protected]>; Liang, Cunming <[email protected]>; Lu, Wenzhuo <[email protected]>; Zhang, Roy Fan <[email protected]>; Chilikin, Andrey <[email protected]>; [email protected]; Guo, Junfeng <[email protected]>; Yang, SteveX <[email protected]>
Subject: RE: [PATCH v4 00/18] i40e base code update

Quoted 64 lines

-----Original Message-----
From: Zhang, RobinX <[email protected]>
Sent: Monday, September 6, 2021 10:03 AM
To: [email protected]
Cc: Xing, Beilei <[email protected]>; Zhang, Qi Z <[email protected]>; Zhang, Helin <[email protected]>; Wu, Jingjing <[email protected]>; [email protected]; [email protected]; [email protected]; Zhu, Heqing <[email protected]>; Liang, Cunming <[email protected]>; Lu, Wenzhuo <[email protected]>; Zhang, Roy Fan <[email protected]>; Chilikin, Andrey <[email protected]>; [email protected]; Guo, Junfeng <[email protected]>; Yang, SteveX <[email protected]>; Zhang, RobinX <[email protected]>
Subject: [PATCH v4 00/18] i40e base code update

update i40e base code.

source code of i40e driver:
cid-i40e.2021.08.16.tar.gz

changelog in i40e share repo:
From 59a080f4fafe ("i40e-shared: Add opcode 0x0406 and 0x0416 to Linux support") To 2c7aab559654 ("i40e-shared: Add defines related to DDP")

The following commits are ignored:
cb9139e3bce8 ("i40e-shared: Fix not blinking X722 with x557 PHY via ‘ethtool
-p'")
c09d4f9cf390 ("i40e-shared: i40e-shared: Fix build warning -Wformat related to integer size")
ff8a1abc6c17 ("i40e-shared: Fix build warning with __packed") 59a080f4fafe
("i40e-shared: Add opcode 0x0406 and 0x0416 to Linux support")

v4:
- update base code to cid-i40e.2021.08.16
v3:
- there has a fix patch contains two issues, split it into two patches v2:
- refine commit messages and macro name

Robin Zhang (18):
net/i40e/base: add new versions of send ASQ command functions net/i40e/base: add support for Min Rollback Revision for 4 more X722
modules
net/i40e/base: set TSA table values when parsing CEE configuration net/i40e/base: define new Shadow RAM pointers net/i40e/base: fix PHY type identifiers for 2.5G and 5G adapters net/i40e/base: fix PF reset failed
net/i40e/base: fix update link data for X722 net/i40e/base: fix AOC media type reported by ethtool net/i40e/base: add flags and fields for double vlan processing net/i40e/base: fix headers to match functions net/i40e/base: fix potentially uninitialized variables in NVM code net/i40e/base: fix checksum is used before return value is checked net/i40e/base: add defs for MAC frequency calculation if no link net/i40e/base: separate kernel allocated rx_bi rings from AF_XDP rings net/i40e/base: Update FVL FW API version to 1.15 net/i40e/base: add defines related to DDP
net/i40e/base: update version in readme
net/i40e: fix redefinition warning

Quoted 4 lines
 drivers/net/i40e/base/README            |   2 +-
 drivers/net/i40e/base/i40e_adminq.c     |  79 +++++++++--
 drivers/net/i40e/base/i40e_adminq_cmd.h |  55 ++++++--
 drivers/net/i40e/base/i40e_common.c     | 175

+++++++++++++++++++-----

Quoted 9 lines
 drivers/net/i40e/base/i40e_dcb.c        |  10 +-
 drivers/net/i40e/base/i40e_lan_hmc.c    |   2 +-
 drivers/net/i40e/base/i40e_nvm.c        |   7 +-
 drivers/net/i40e/base/i40e_prototype.h  |  17 +++
 drivers/net/i40e/base/i40e_register.h   |  10 ++
 drivers/net/i40e/base/i40e_type.h       |  26 +++-
 drivers/net/i40e/i40e_ethdev.c          |   3 +-
 11 files changed, 318 insertions(+), 68 deletions(-)
Quoted 4 lines
Quoted 2 lines

--
2.25.1

Applied to dpdk-next-net-intel after squash patch 18/18 into patch 13/18.

Thanks
Qi

Quoted 1 line
#82 lore raw
In reply to Robin Zhang
Quoted 37 lines · Robin Zhang

update i40e base code.

source code of i40e driver:
cid-i40e.2021.08.16.tar.gz

changelog in i40e share repo:
From 59a080f4fafe ("i40e-shared: Add opcode 0x0406 and 0x0416 to Linux support") To 2c7aab559654 ("i40e-shared: Add defines related to DDP")

The following commits are ignored:
cb9139e3bce8 ("i40e-shared: Fix not blinking X722 with x557 PHY via ‘ethtool -p'")
c09d4f9cf390 ("i40e-shared: i40e-shared: Fix build warning -Wformat related to integer size")
ff8a1abc6c17 ("i40e-shared: Fix build warning with __packed") 59a080f4fafe ("i40e-shared: Add opcode 0x0406 and 0x0416 to Linux support")

v4:
- update base code to cid-i40e.2021.08.16
v3:
- there has a fix patch contains two issues, split it into two patches v2:
- refine commit messages and macro name

Robin Zhang (18):
net/i40e/base: add new versions of send ASQ command functions net/i40e/base: add support for Min Rollback Revision for 4 more X722
modules
net/i40e/base: set TSA table values when parsing CEE configuration net/i40e/base: define new Shadow RAM pointers net/i40e/base: fix PHY type identifiers for 2.5G and 5G adapters net/i40e/base: fix PF reset failed
net/i40e/base: fix update link data for X722 net/i40e/base: fix AOC media type reported by ethtool net/i40e/base: add flags and fields for double vlan processing net/i40e/base: fix headers to match functions

Quoted 9 lines

net/i40e/base: fix potentially uninitialized variables in NVM code net/i40e/base: fix checksum is used before return value is checked net/i40e/base: add defs for MAC frequency calculation if no link net/i40e/base: separate kernel allocated rx_bi rings from AF_XDP rings net/i40e/base: Update FVL FW API version to 1.15 net/i40e/base: add defines related to DDP
net/i40e/base: update version in readme
net/i40e: fix redefinition warning

There are various './devtools/check-git-log.sh' warnings, can you please check them. Specially there are many 'Headline too long' warnings.

#83 lore raw

v5 cover i40e base code update

In reply to Robin Zhang

update i40e base code.

source code of i40e driver:
cid-i40e.2021.08.16.tar.gz

changelog in i40e share repo:
From 59a080f4fafe ("i40e-shared: Add opcode 0x0406 and 0x0416 to Linux support") To 2c7aab559654 ("i40e-shared: Add defines related to DDP")

The following commits are ignored:
cb9139e3bce8 ("i40e-shared: Fix not blinking X722 with x557 PHY via ‘ethtool -p'")
c09d4f9cf390 ("i40e-shared: i40e-shared: Fix build warning -Wformat related to integer size")
ff8a1abc6c17 ("i40e-shared: Fix build warning with __packed") 59a080f4fafe ("i40e-shared: Add opcode 0x0406 and 0x0416 to Linux support")

v5:
- refine commit messages
v4:
- update base code to cid-i40e.2021.08.16
v3:
- there has a fix patch contains two issues, split it into two patches v2:
- refine commit messages and macro name

Robin Zhang (17):
net/i40e/base: add v2 version of send ASQ command functions net/i40e/base: add Min SRev for 4 more X722 modules net/i40e/base: set TSA table values when parsing CEE config net/i40e/base: define new shadow RAM pointers net/i40e/base: fix PHY identifiers for 2.5G and 5G adapters net/i40e/base: fix PF reset
net/i40e/base: fix update link data for X722 net/i40e/base: fix AOC media type
net/i40e/base: add flags and fields for double VLAN net/i40e/base: fix headers to match functions net/i40e/base: fix potentially uninitialized variables net/i40e/base: fix checksum is used incorrectly net/i40e/base: add calculation of MAC frequency if no link net/i40e/base: separate kernel allocated Rx bi rings net/i40e/base: update FVL FW API version to 1.15 net/i40e/base: add defines related to DDP net/i40e/base: update version in readme

 drivers/net/i40e/base/README            |   2 +-
 drivers/net/i40e/base/i40e_adminq.c     |  79 +++++++++--
 drivers/net/i40e/base/i40e_adminq_cmd.h |  55 ++++++--
 drivers/net/i40e/base/i40e_common.c     | 175 +++++++++++++++++++-----
 drivers/net/i40e/base/i40e_dcb.c        |  10 +-
 drivers/net/i40e/base/i40e_lan_hmc.c    |   2 +-
 drivers/net/i40e/base/i40e_nvm.c        |   7 +-
 drivers/net/i40e/base/i40e_prototype.h  |  17 +++
 drivers/net/i40e/base/i40e_register.h   |  10 ++
 drivers/net/i40e/base/i40e_type.h       |  26 +++-
 drivers/net/i40e/i40e_ethdev.c          |   3 +-
 11 files changed, 318 insertions(+), 68 deletions(-)
Signature · 1 line
2.25.1
#84 lore raw

PATCH v5 1/17 net/i40e/base: add v2 version of send ASQ command functions

ASQ(Admin Send Queue) send command functions are returning only i40e status codes yet some calling functions also need Admin Queue status that is stored in hw->aq.asq_last_status. Since hw object is stored on a heap it introduces a possibility for a race condition in access to hw if calling function is not fast enough to read hw->aq.asq_last_status before next send ASQ command is executed.

Added new versions of send ASQ command functions that return Admin Queue status on the stack to avoid race conditions in access to hw->aq.asq_last_status.
Added new _v2 version of i40e_aq_remove_macvlan and i40e_aq_add_macvlan that is using new _v2 versions of ASQ send command functions and returns the Admin Queue status on the stack.

---
 drivers/net/i40e/base/i40e_adminq.c    |  73 +++++++++++--
 drivers/net/i40e/base/i40e_common.c    | 139 ++++++++++++++++++++++---
 drivers/net/i40e/base/i40e_prototype.h |  17 +++
 3 files changed, 205 insertions(+), 24 deletions(-)
drivers/net/i40e/base/i40e_adminq.c +65 -8
index 235667d57a..38d3429e5b 100644
@@ -838,7 +838,7 @@ STATIC bool i40e_asq_done(struct i40e_hw *hw)
 }
 
 /**
- *  i40e_asq_send_command - send command to Admin Queue
+ *  i40e_asq_send_command_exec - send command to Admin Queue
  *  @hw: pointer to the hw struct
  *  @desc: prefilled descriptor describing the command (non DMA mem)
  *  @buff: buffer to use for indirect commands
@@ -848,11 +848,12 @@ STATIC bool i40e_asq_done(struct i40e_hw *hw)
  *  This is the main send command driver routine for the Admin Queue send
  *  queue.  It runs the queue, cleans the queue, etc
  **/
-enum i40e_status_code i40e_asq_send_command(struct i40e_hw *hw,
-				struct i40e_aq_desc *desc,
-				void *buff, /* can be NULL */
-				u16  buff_size,
-				struct i40e_asq_cmd_details *cmd_details)
+STATIC enum i40e_status_code
+i40e_asq_send_command_exec(struct i40e_hw *hw,
+			   struct i40e_aq_desc *desc,
+			   void *buff, /* can be NULL */
+			   u16  buff_size,
+			   struct i40e_asq_cmd_details *cmd_details)
 {
 	enum i40e_status_code status = I40E_SUCCESS;
 	struct i40e_dma_mem *dma_buff = NULL;
@@ -862,8 +863,6 @@ enum i40e_status_code i40e_asq_send_command(struct i40e_hw *hw,
 	u16  retval = 0;
 	u32  val = 0;
 
-	i40e_acquire_spinlock(&hw->aq.asq_spinlock);
-
 	hw->aq.asq_last_status = I40E_AQ_RC_OK;
 
 	if (hw->aq.asq.count == 0) {
@@ -1046,6 +1045,64 @@ enum i40e_status_code i40e_asq_send_command(struct i40e_hw *hw,
 	}
 
 asq_send_command_error:
+	return status;
+}
+
+/**
+ *  i40e_asq_send_command - send command to Admin Queue
+ *  @hw: pointer to the hw struct
+ *  @desc: prefilled descriptor describing the command (non DMA mem)
+ *  @buff: buffer to use for indirect commands
+ *  @buff_size: size of buffer for indirect commands
+ *  @cmd_details: pointer to command details structure
+ *
+ *  Acquires the lock and calls the main send command execution
+ *  routine.
+ **/
+enum i40e_status_code
+i40e_asq_send_command(struct i40e_hw *hw,
+		      struct i40e_aq_desc *desc,
+		      void *buff, /* can be NULL */
+		      u16  buff_size,
+		      struct i40e_asq_cmd_details *cmd_details)
+{
+	enum i40e_status_code status = I40E_SUCCESS;
+
+	i40e_acquire_spinlock(&hw->aq.asq_spinlock);
+	status = i40e_asq_send_command_exec(hw, desc, buff, buff_size,
+					    cmd_details);
+	i40e_release_spinlock(&hw->aq.asq_spinlock);
+	return status;
+}
+
+/**
+ *  i40e_asq_send_command_v2 - send command to Admin Queue
+ *  @hw: pointer to the hw struct
+ *  @desc: prefilled descriptor describing the command (non DMA mem)
+ *  @buff: buffer to use for indirect commands
+ *  @buff_size: size of buffer for indirect commands
+ *  @cmd_details: pointer to command details structure
+ *  @aq_status: pointer to Admin Queue status return value
+ *
+ *  Acquires the lock and calls the main send command execution
+ *  routine. Returns the last Admin Queue status in aq_status
+ *  to avoid race conditions in access to hw->aq.asq_last_status.
+ **/
+enum i40e_status_code
+i40e_asq_send_command_v2(struct i40e_hw *hw,
+			 struct i40e_aq_desc *desc,
+			 void *buff, /* can be NULL */
+			 u16  buff_size,
+			 struct i40e_asq_cmd_details *cmd_details,
+			 enum i40e_admin_queue_err *aq_status)
+{
+	enum i40e_status_code status = I40E_SUCCESS;
+
+	i40e_acquire_spinlock(&hw->aq.asq_spinlock);
+	status = i40e_asq_send_command_exec(hw, desc, buff, buff_size,
+					    cmd_details);
+	if (aq_status)
+		*aq_status = hw->aq.asq_last_status;
 	i40e_release_spinlock(&hw->aq.asq_spinlock);
 	return status;
 }
drivers/net/i40e/base/i40e_common.c +123 -16

187 lines not on this page · raw message

drivers/net/i40e/base/i40e_prototype.h +17 -0
index 124222e476..29c86c7fe8 100644
@@ -38,6 +38,13 @@ enum i40e_status_code i40e_asq_send_command(struct i40e_hw *hw,
 				void *buff, /* can be NULL */
 				u16  buff_size,
 				struct i40e_asq_cmd_details *cmd_details);
+enum i40e_status_code
+i40e_asq_send_command_v2(struct i40e_hw *hw,
+			 struct i40e_aq_desc *desc,
+			 void *buff, /* can be NULL */
+			 u16  buff_size,
+			 struct i40e_asq_cmd_details *cmd_details,
+			 enum i40e_admin_queue_err *aq_status);
 #ifdef VF_DRIVER
 bool i40e_asq_done(struct i40e_hw *hw);
 #endif
@@ -188,9 +195,19 @@ enum i40e_status_code i40e_aq_get_veb_parameters(struct i40e_hw *hw,
 enum i40e_status_code i40e_aq_add_macvlan(struct i40e_hw *hw, u16 vsi_id,
 			struct i40e_aqc_add_macvlan_element_data *mv_list,
 			u16 count, struct i40e_asq_cmd_details *cmd_details);
+enum i40e_status_code
+i40e_aq_add_macvlan_v2(struct i40e_hw *hw, u16 seid,
+		       struct i40e_aqc_add_macvlan_element_data *mv_list,
+		       u16 count, struct i40e_asq_cmd_details *cmd_details,
+		       enum i40e_admin_queue_err *aq_status);
 enum i40e_status_code i40e_aq_remove_macvlan(struct i40e_hw *hw, u16 vsi_id,
 			struct i40e_aqc_remove_macvlan_element_data *mv_list,
 			u16 count, struct i40e_asq_cmd_details *cmd_details);
+enum i40e_status_code
+i40e_aq_remove_macvlan_v2(struct i40e_hw *hw, u16 seid,
+			  struct i40e_aqc_remove_macvlan_element_data *mv_list,
+			  u16 count, struct i40e_asq_cmd_details *cmd_details,
+			  enum i40e_admin_queue_err *aq_status);
 enum i40e_status_code i40e_aq_add_mirrorrule(struct i40e_hw *hw, u16 sw_seid,
 			u16 rule_type, u16 dest_vsi, u16 count, __le16 *mr_list,
 			struct i40e_asq_cmd_details *cmd_details,
Signature · 1 line
2.25.1
#85 lore raw

PATCH v5 2/17 net/i40e/base: add Min SRev for 4 more X722 modules

In reply to Robin Zhang

Some customers want to downgrade to an earlier FW security revision, this already implemented by FW so that customers can have more control over the security revisions they can use. FW also implemented a mechanism via NVMupdate to allow the users to accept or not a baseline Min SRev version that will limit the secure version rollback only down to that level.

This commit increments X722 API version and adds new minimal rollback revision that related to the extended implementation of Security Revision Opt-In for 4 more X722 modules.

These definations are not using by DPDK now, the purpose of this commit is sync with latest share code.

---
 drivers/net/i40e/base/i40e_adminq_cmd.h | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)
drivers/net/i40e/base/i40e_adminq_cmd.h +10 -6
index 2ca41db5d3..a96527f31c 100644
@@ -12,7 +12,7 @@
  */
 
 #define I40E_FW_API_VERSION_MAJOR	0x0001
-#define I40E_FW_API_VERSION_MINOR_X722	0x000B
+#define I40E_FW_API_VERSION_MINOR_X722	0x000C
 #define I40E_FW_API_VERSION_MINOR_X710	0x000C
 
 #define I40E_FW_MINOR_VERSION(_h) ((_h)->mac.type == I40E_MAC_XL710 ? \
@@ -2425,11 +2425,15 @@ struct i40e_aqc_rollback_revision_update {
 	u8	optin_mode; /* bool */
 #define I40E_AQ_RREV_OPTION_MODE			0x01
 	u8	module_selected;
-#define I40E_AQ_RREV_MODULE_PCIE_ANALOG		0
-#define I40E_AQ_RREV_MODULE_PHY_ANALOG		1
-#define I40E_AQ_RREV_MODULE_OPTION_ROM		2
-#define I40E_AQ_RREV_MODULE_EMP_IMAGE		3
-#define I40E_AQ_RREV_MODULE_PE_IMAGE		4
+#define I40E_AQ_RREV_MODULE_PCIE_ANALOG			0
+#define I40E_AQ_RREV_MODULE_PHY_ANALOG			1
+#define I40E_AQ_RREV_MODULE_OPTION_ROM			2
+#define I40E_AQ_RREV_MODULE_EMP_IMAGE			3
+#define I40E_AQ_RREV_MODULE_PE_IMAGE			4
+#define I40E_AQ_RREV_MODULE_PHY_PLL_O_CONFIGURATION	5
+#define I40E_AQ_RREV_MODULE_PHY_0_CONFIGURATION		6
+#define I40E_AQ_RREV_MODULE_PHY_PLL_1_CONFIGURATION	7
+#define I40E_AQ_RREV_MODULE_PHY_1_CONFIGURATION		8
 	u8	reserved1[2];
 	u32	min_rrev;
 	u8	reserved2[8];
Signature · 1 line
2.25.1
#86 lore raw

PATCH v5 3/17 net/i40e/base: set TSA table values when parsing CEE config

In reply to Robin Zhang

Driver did not Set TSA(Transmit Selection Algorithm) table values when parsing CEE(Converged Enhanced Ethernet) configuration obtained from FW.

---
 drivers/net/i40e/base/i40e_dcb.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
drivers/net/i40e/base/i40e_dcb.c +7 -1
index 388af3d64d..27b52bc365 100644
@@ -315,9 +315,15 @@ static void i40e_parse_cee_pgcfg_tlv(struct i40e_cee_feat_tlv *tlv,
 	 *        |pg0|pg1|pg2|pg3|pg4|pg5|pg6|pg7|
 	 *        ---------------------------------
 	 */
-	for (i = 0; i < I40E_MAX_TRAFFIC_CLASS; i++)
+	for (i = 0; i < I40E_MAX_TRAFFIC_CLASS; i++) {
 		etscfg->tcbwtable[i] = buf[offset++];
 
+		if (etscfg->prioritytable[i] == I40E_CEE_PGID_STRICT)
+			dcbcfg->etscfg.tsatable[i] = I40E_IEEE_TSA_STRICT;
+		else
+			dcbcfg->etscfg.tsatable[i] = I40E_IEEE_TSA_ETS;
+	}
+
 	/* Number of TCs supported (1 octet) */
 	etscfg->maxtcs = buf[offset];
 }
Signature · 1 line
2.25.1
#87 lore raw

PATCH v5 4/17 net/i40e/base: define new shadow RAM pointers

In reply to Robin Zhang

Add definitions for Shadow RAM pointers: 6th FPA(Free Provisioning Area) module, 5th FPA module in X722 and Preservation Rules module.

These definations are not using by DPDK now, the purpose of this commit is sync with latest share code.

---
 drivers/net/i40e/base/i40e_type.h | 3 +++
 1 file changed, 3 insertions(+)
drivers/net/i40e/base/i40e_type.h +3 -0
index cf41345834..e5a3729183 100644
@@ -1555,6 +1555,9 @@ struct i40e_hw_port_stats {
 #define I40E_SR_FEATURE_CONFIGURATION_PTR	0x49
 #define I40E_SR_CONFIGURATION_METADATA_PTR	0x4D
 #define I40E_SR_IMMEDIATE_VALUES_PTR		0x4E
+#define I40E_SR_PRESERVATION_RULES_PTR		0x70
+#define I40E_X722_SR_5TH_FREE_PROVISION_AREA_PTR	0x71
+#define I40E_SR_6TH_FREE_PROVISION_AREA_PTR	0x71
 
 /* Auxiliary field, mask and shift definition for Shadow RAM and NVM Flash */
 #define I40E_SR_VPD_MODULE_MAX_SIZE		1024
Signature · 1 line
2.25.1
#88 lore raw

PATCH v5 5/17 net/i40e/base: fix PHY identifiers for 2.5G and 5G adapters

In reply to Robin Zhang

Unlike other supported adapters, 2.5G and 5G use different PHY type identifiers for reading/writing PHY settings and for reading link status. This commit introduces separate PHY identifiers for these two operation types.

Fixes 988ed63c7441 ("net/i40e/base: add support for Carlsville device")
---
 drivers/net/i40e/base/i40e_adminq_cmd.h | 6 ++++--
 drivers/net/i40e/base/i40e_common.c     | 4 ++--
 drivers/net/i40e/base/i40e_type.h       | 8 ++------
 3 files changed, 8 insertions(+), 10 deletions(-)
drivers/net/i40e/base/i40e_adminq_cmd.h +4 -2
index a96527f31c..af9dec1d7f 100644
@@ -1947,8 +1947,10 @@ enum i40e_aq_phy_type {
 	I40E_PHY_TYPE_25GBASE_LR		= 0x22,
 	I40E_PHY_TYPE_25GBASE_AOC		= 0x23,
 	I40E_PHY_TYPE_25GBASE_ACC		= 0x24,
-	I40E_PHY_TYPE_2_5GBASE_T		= 0x30,
-	I40E_PHY_TYPE_5GBASE_T			= 0x31,
+	I40E_PHY_TYPE_2_5GBASE_T		= 0x26,
+	I40E_PHY_TYPE_5GBASE_T			= 0x27,
+	I40E_PHY_TYPE_2_5GBASE_T_LINK_STATUS	= 0x30,
+	I40E_PHY_TYPE_5GBASE_T_LINK_STATUS	= 0x31,
 	I40E_PHY_TYPE_MAX,
 	I40E_PHY_TYPE_NOT_SUPPORTED_HIGH_TEMP	= 0xFD,
 	I40E_PHY_TYPE_EMPTY			= 0xFE,
drivers/net/i40e/base/i40e_common.c +2 -2
index 32642f3e2b..ceedec68bf 100644
@@ -1280,8 +1280,8 @@ STATIC enum i40e_media_type i40e_get_media_type(struct i40e_hw *hw)
 		break;
 	case I40E_PHY_TYPE_100BASE_TX:
 	case I40E_PHY_TYPE_1000BASE_T:
-	case I40E_PHY_TYPE_2_5GBASE_T:
-	case I40E_PHY_TYPE_5GBASE_T:
+	case I40E_PHY_TYPE_2_5GBASE_T_LINK_STATUS:
+	case I40E_PHY_TYPE_5GBASE_T_LINK_STATUS:
 	case I40E_PHY_TYPE_10GBASE_T:
 		media = I40E_MEDIA_TYPE_BASET;
 		break;
drivers/net/i40e/base/i40e_type.h +2 -6
index e5a3729183..0323887550 100644
@@ -329,12 +329,8 @@ struct i40e_phy_info {
 					     I40E_PHY_TYPE_OFFSET)
 #define I40E_CAP_PHY_TYPE_25GBASE_ACC BIT_ULL(I40E_PHY_TYPE_25GBASE_ACC + \
 					     I40E_PHY_TYPE_OFFSET)
-/* Offset for 2.5G/5G PHY Types value to bit number conversion */
-#define I40E_PHY_TYPE_OFFSET2 (-10)
-#define I40E_CAP_PHY_TYPE_2_5GBASE_T BIT_ULL(I40E_PHY_TYPE_2_5GBASE_T + \
-					     I40E_PHY_TYPE_OFFSET2)
-#define I40E_CAP_PHY_TYPE_5GBASE_T BIT_ULL(I40E_PHY_TYPE_5GBASE_T + \
-					     I40E_PHY_TYPE_OFFSET2)
+#define I40E_CAP_PHY_TYPE_2_5GBASE_T BIT_ULL(I40E_PHY_TYPE_2_5GBASE_T)
+#define I40E_CAP_PHY_TYPE_5GBASE_T BIT_ULL(I40E_PHY_TYPE_5GBASE_T)
 #define I40E_HW_CAP_MAX_GPIO			30
 #define I40E_HW_CAP_MDIO_PORT_MODE_MDIO		0
 #define I40E_HW_CAP_MDIO_PORT_MODE_I2C		1
Signature · 1 line
2.25.1
#89 lore raw

PATCH v5 6/17 net/i40e/base: fix PF reset

In reply to Robin Zhang

PF has to delete all the filters during reset.
If it is fully loaded with filters then it is possible that it will take more than 200 ms to finish the reset resulting in timeout during pf_reset and PF reset failed, -15 error indication.

Increasing the timeout value for PF reset from 200 to 1000 to give PF more time to finish reset if it is loaded with filters.

Fixes 1e32378f0774 ("i40e/base: increase PF reset max loop limit")
---
 drivers/net/i40e/base/i40e_common.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/i40e/base/i40e_common.c +1 -1
index ceedec68bf..aa424e6010 100644
@@ -1341,7 +1341,7 @@ STATIC enum i40e_status_code i40e_poll_globr(struct i40e_hw *hw,
 	return I40E_ERR_RESET_FAILED;
 }
 
-#define I40E_PF_RESET_WAIT_COUNT	200
+#define I40E_PF_RESET_WAIT_COUNT	1000
 /**
  * i40e_pf_reset - Reset the PF
  * @hw: pointer to the hardware structure
Signature · 1 line
2.25.1
#90 lore raw

PATCH v5 7/17 net/i40e/base: fix update link data for X722

In reply to Robin Zhang

The X722 card has 'Link Type' information elsewhere than the X710. Previously, for all cards, the 'Link Type' information was retrieved by opcode 0x0607 and this value was wrong for all X722 cards. Now this information for X722 only is taken by opcode 0x0600 (function: i40e_aq_get_phy_capabilities) instead of an opcode 0x0607 (function: i40e_aq_get_link_info).
All other parameters read by opcode 0x0607 unchanged.

Fixes e6691b428eb1 ("i40e/base: fix PHY NVM interaction")
Fixes 75c3de654ead ("net/i40e/base: fix long link down notification time")
---
 drivers/net/i40e/base/i40e_common.c | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)
drivers/net/i40e/base/i40e_common.c +10 -4
index aa424e6010..ef061a6b63 100644
@@ -2078,6 +2078,9 @@ enum i40e_status_code i40e_aq_get_link_info(struct i40e_hw *hw,
 	     hw->aq.fw_min_ver < 40)) && hw_link_info->phy_type == 0xE)
 		hw_link_info->phy_type = I40E_PHY_TYPE_10GBASE_SFPP_CU;
 
+	/* 'Get Link Status' response data structure from X722 FW has
+	 * different format and does not contain this information
+	 */
 	if (hw->flags & I40E_HW_FLAG_AQ_PHY_ACCESS_CAPABLE &&
 	    hw->mac.type != I40E_MAC_X722) {
 		__le32 tmp;
@@ -2948,10 +2951,13 @@ enum i40e_status_code i40e_update_link_info(struct i40e_hw *hw)
 		return status;
 
 	/* extra checking needed to ensure link info to user is timely */
-	if ((hw->phy.link_info.link_info & I40E_AQ_MEDIA_AVAILABLE) &&
-	    ((hw->phy.link_info.link_info & I40E_AQ_LINK_UP) ||
-	     !(hw->phy.link_info_old.link_info & I40E_AQ_LINK_UP))) {
-		status = i40e_aq_get_phy_capabilities(hw, false, false,
+	if (((hw->phy.link_info.link_info & I40E_AQ_MEDIA_AVAILABLE) &&
+	     ((hw->phy.link_info.link_info & I40E_AQ_LINK_UP) ||
+	      !(hw->phy.link_info_old.link_info & I40E_AQ_LINK_UP))) ||
+		hw->mac.type == I40E_MAC_X722) {
+		status = i40e_aq_get_phy_capabilities(hw, false,
+						      hw->mac.type ==
+						      I40E_MAC_X722,
 						      &abilities, NULL);
 		if (status)
 			return status;
Signature · 1 line
2.25.1
#91 lore raw

PATCH v5 8/17 net/i40e/base: fix AOC media type

In reply to Robin Zhang

For Active Optical Cable (AOC) the correct media type is "Fibre", not "Direct Attach Copper".

Fixes d749d4d89969 ("i40e/base: add AOC PHY types")
Fixes aa153cc89ff0 ("net/i40e/base: add new PHY types for 25G AOC and ACC")
---
 drivers/net/i40e/base/i40e_common.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/net/i40e/base/i40e_common.c +3 -3
index ef061a6b63..2ca6a13e79 100644
@@ -1276,6 +1276,9 @@ STATIC enum i40e_media_type i40e_get_media_type(struct i40e_hw *hw)
 	case I40E_PHY_TYPE_40GBASE_LR4:
 	case I40E_PHY_TYPE_25GBASE_LR:
 	case I40E_PHY_TYPE_25GBASE_SR:
+	case I40E_PHY_TYPE_10GBASE_AOC:
+	case I40E_PHY_TYPE_25GBASE_AOC:
+	case I40E_PHY_TYPE_40GBASE_AOC:
 		media = I40E_MEDIA_TYPE_FIBER;
 		break;
 	case I40E_PHY_TYPE_100BASE_TX:
@@ -1290,10 +1293,7 @@ STATIC enum i40e_media_type i40e_get_media_type(struct i40e_hw *hw)
 	case I40E_PHY_TYPE_10GBASE_CR1:
 	case I40E_PHY_TYPE_40GBASE_CR4:
 	case I40E_PHY_TYPE_10GBASE_SFPP_CU:
-	case I40E_PHY_TYPE_40GBASE_AOC:
-	case I40E_PHY_TYPE_10GBASE_AOC:
 	case I40E_PHY_TYPE_25GBASE_CR:
-	case I40E_PHY_TYPE_25GBASE_AOC:
 	case I40E_PHY_TYPE_25GBASE_ACC:
 		media = I40E_MEDIA_TYPE_DA;
 		break;
Signature · 1 line
2.25.1
#92 lore raw

PATCH v5 9/17 net/i40e/base: add flags and fields for double VLAN

In reply to Robin Zhang

Add flags for outer VLAN and include set port parameters. Add flags, which describe port and switch state for both double VLAN functionality and outer VLAN processing.

---
 drivers/net/i40e/base/i40e_adminq_cmd.h | 22 ++++++++++++++++++++--
 1 file changed, 20 insertions(+), 2 deletions(-)
drivers/net/i40e/base/i40e_adminq_cmd.h +20 -2
index af9dec1d7f..372dd71c3f 100644
@@ -768,6 +768,7 @@ struct i40e_aqc_set_switch_config {
 #define I40E_AQ_SET_SWITCH_CFG_PROMISC		0x0001
 #define I40E_AQ_SET_SWITCH_CFG_L2_FILTER	0x0002
 #define I40E_AQ_SET_SWITCH_CFG_HW_ATR_EVICT	0x0004
+#define I40E_AQ_SET_SWITCH_CFG_OUTER_VLAN	0x0008
 	__le16	valid_flags;
 	/* The ethertype in switch_tag is dropped on ingress and used
 	 * internally by the switch. Set this to zero for the default
@@ -904,7 +905,7 @@ struct i40e_aqc_vsi_properties_data {
 	u8	sec_reserved;
 	/* VLAN section */
 	__le16	pvid; /* VLANS include priority bits */
-	__le16	fcoe_pvid;
+	__le16	outer_vlan;
 	u8	port_vlan_flags;
 #define I40E_AQ_VSI_PVLAN_MODE_SHIFT	0x00
 #define I40E_AQ_VSI_PVLAN_MODE_MASK	(0x03 << \
@@ -920,7 +921,24 @@ struct i40e_aqc_vsi_properties_data {
 #define I40E_AQ_VSI_PVLAN_EMOD_STR_UP	0x08
 #define I40E_AQ_VSI_PVLAN_EMOD_STR	0x10
 #define I40E_AQ_VSI_PVLAN_EMOD_NOTHING	0x18
-	u8	pvlan_reserved[3];
+	u8	outer_vlan_flags;
+#define I40E_AQ_VSI_OVLAN_MODE_SHIFT	0x00
+#define I40E_AQ_VSI_OVLAN_MODE_MASK	(0x03 << \
+					 I40E_AQ_VSI_OVLAN_MODE_SHIFT)
+#define I40E_AQ_VSI_OVLAN_MODE_UNTAGGED	0x01
+#define I40E_AQ_VSI_OVLAN_MODE_TAGGED	0x02
+#define I40E_AQ_VSI_OVLAN_MODE_ALL	0x03
+#define I40E_AQ_VSI_OVLAN_INSERT_PVID	0x04
+#define I40E_AQ_VSI_OVLAN_EMOD_SHIFT	0x03
+#define I40E_AQ_VSI_OVLAN_EMOD_MASK	(0x03 <<\
+					 I40E_AQ_VSI_OVLAN_EMOD_SHIFT)
+#define I40E_AQ_VSI_OVLAN_EMOD_SHOW_ALL	0x00
+#define I40E_AQ_VSI_OVLAN_EMOD_SHOW_UP	0x01
+#define I40E_AQ_VSI_OVLAN_EMOD_HIDE_ALL	0x02
+#define I40E_AQ_VSI_OVLAN_EMOD_NOTHING	0x03
+#define I40E_AQ_VSI_OVLAN_CTRL_ENA	0x04
+
+	u8	pvlan_reserved[2];
 	/* ingress egress up sections */
 	__le32	ingress_table; /* bitmap, 3 bits per up */
 #define I40E_AQ_VSI_UP_TABLE_UP0_SHIFT	0
Signature · 1 line
2.25.1
#93 lore raw

PATCH v5 10/17 net/i40e/base: fix headers to match functions

In reply to Robin Zhang

Fix several kernel-doc warnings when building with W=1. These changes are only to comments.

Fixes 8db9e2a1b232 ("i40e: base driver")
Fixes 842ea1996335 ("i40e/base: save link module type")
Fixes fd72a2284a89 ("i40e/base: support LED blinking with new PHY")
Fixes 788fc17b2dec ("i40e/base: support proxy config for X722")
---
 drivers/net/i40e/base/i40e_common.c  | 10 +++++-----
 drivers/net/i40e/base/i40e_dcb.c     |  2 +-
 drivers/net/i40e/base/i40e_lan_hmc.c |  2 +-
 drivers/net/i40e/base/i40e_nvm.c     |  2 +-
 4 files changed, 8 insertions(+), 8 deletions(-)
drivers/net/i40e/base/i40e_common.c +5 -5
index 2ca6a13e79..baa51e1396 100644
@@ -2677,7 +2677,7 @@ enum i40e_status_code i40e_aq_set_vsi_vlan_promisc(struct i40e_hw *hw,
 }
 
 /**
- * i40e_get_vsi_params - get VSI configuration info
+ * i40e_aq_get_vsi_params - get VSI configuration info
  * @hw: pointer to the hw struct
  * @vsi_ctx: pointer to a vsi context struct
  * @cmd_details: pointer to command details structure or NULL
@@ -2938,7 +2938,7 @@ enum i40e_status_code i40e_get_link_status(struct i40e_hw *hw, bool *link_up)
 }
 
 /**
- * i40e_updatelink_status - update status of the HW network link
+ * i40e_update_link_info - update status of the HW network link
  * @hw: pointer to the hw struct
  **/
 enum i40e_status_code i40e_update_link_info(struct i40e_hw *hw)
@@ -4830,7 +4830,7 @@ enum i40e_status_code i40e_aq_del_udp_tunnel(struct i40e_hw *hw, u8 index,
 }
 
 /**
- * i40e_aq_get_switch_resource_alloc (0x0204)
+ * i40e_aq_get_switch_resource_alloc - command (0x0204) to get allocations
  * @hw: pointer to the hw struct
  * @num_entries: pointer to u8 to store the number of resource entries returned
  * @buf: pointer to a user supplied buffer.  This buffer must be large enough
@@ -6977,7 +6977,7 @@ u8 i40e_get_phy_address(struct i40e_hw *hw, u8 dev_num)
 }
 
 /**
- * i40e_blink_phy_led
+ * i40e_blink_phy_link_led
  * @hw: pointer to the HW structure
  * @time: time how long led will blinks in secs
  * @interval: gap between LED on and off in msecs
@@ -7824,7 +7824,7 @@ enum i40e_status_code i40e_aq_set_arp_proxy_config(struct i40e_hw *hw,
 }
 
 /**
- * i40e_aq_opc_set_ns_proxy_table_entry
+ * i40e_aq_set_ns_proxy_table_entry
  * @hw: pointer to the HW structure
  * @ns_proxy_table_entry: pointer to NS table entry command struct
  * @cmd_details: pointer to command details
drivers/net/i40e/base/i40e_dcb.c +1 -1
index 27b52bc365..8f9b7e823f 100644
@@ -235,7 +235,7 @@ static void i40e_parse_ieee_app_tlv(struct i40e_lldp_org_tlv *tlv,
 }
 
 /**
- * i40e_parse_ieee_etsrec_tlv
+ * i40e_parse_ieee_tlv
  * @tlv: IEEE 802.1Qaz TLV
  * @dcbcfg: Local store to update ETS REC data
  *
drivers/net/i40e/base/i40e_lan_hmc.c +1 -1
index d3969396f0..d3bd683ff3 100644
@@ -516,7 +516,7 @@ enum i40e_status_code i40e_configure_lan_hmc(struct i40e_hw *hw,
 }
 
 /**
- * i40e_delete_hmc_object - remove hmc objects
+ * i40e_delete_lan_hmc_object - remove hmc objects
  * @hw: pointer to the HW structure
  * @info: pointer to i40e_hmc_delete_obj_info struct
  *
drivers/net/i40e/base/i40e_nvm.c +1 -1
index 561ed21136..67e58cc195 100644
@@ -7,7 +7,7 @@
 #include "i40e_prototype.h"
 
 /**
- * i40e_init_nvm_ops - Initialize NVM function pointers
+ * i40e_init_nvm - Initialize NVM function pointers
  * @hw: pointer to the HW structure
  *
  * Setup the function pointers and the NVM info structure. Should be called
Signature · 1 line
2.25.1
#94 lore raw

PATCH v5 11/17 net/i40e/base: fix potentially uninitialized variables

In reply to Robin Zhang

The status of i40e_read_nvm_word is not checked, so variables set from this function could be used uninitialized. In this case, preserve the existing flow that does not block initialization by initializing these values from the start.

Fixes 8d6c51fcd24b ("i40e/base: get OEM version")
Fixes 2db70574247b ("net/i40e/base: limit PF/VF specific code to that driver only")
---
 drivers/net/i40e/base/i40e_adminq.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/net/i40e/base/i40e_adminq.c +4 -2
index 38d3429e5b..27c82d9b44 100644
@@ -652,8 +652,10 @@ enum i40e_status_code i40e_init_adminq(struct i40e_hw *hw)
 {
 	struct i40e_adminq_info *aq = &hw->aq;
 	enum i40e_status_code ret_code;
-	u16 cfg_ptr, oem_hi, oem_lo;
-	u16 eetrack_lo, eetrack_hi;
+	u16 oem_hi = 0, oem_lo = 0;
+	u16 eetrack_hi = 0;
+	u16 eetrack_lo = 0;
+	u16 cfg_ptr = 0;
 	int retry = 0;
 
 	/* verify input for valid configuration */
Signature · 1 line
2.25.1
#95 lore raw

PATCH v5 12/17 net/i40e/base: fix checksum is used incorrectly

In reply to Robin Zhang

The variable checksum from i40e_calc_nvm_checksum is used before return value is checked. Fix this logic.

Fixes 8db9e2a1b232 ("i40e: base driver")
Fixes 3ed6c3246f43 ("i40e/base: handle AQ timeout when releasing NVM")
---
 drivers/net/i40e/base/i40e_nvm.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/net/i40e/base/i40e_nvm.c +3 -2
index 67e58cc195..f385042601 100644
@@ -755,10 +755,11 @@ enum i40e_status_code i40e_update_nvm_checksum(struct i40e_hw *hw)
 	DEBUGFUNC("i40e_update_nvm_checksum");
 
 	ret_code = i40e_calc_nvm_checksum(hw, &checksum);
-	le_sum = CPU_TO_LE16(checksum);
-	if (ret_code == I40E_SUCCESS)
+	if (ret_code == I40E_SUCCESS) {
+		le_sum = CPU_TO_LE16(checksum);
 		ret_code = i40e_write_nvm_aq(hw, 0x00, I40E_SR_SW_CHECKSUM_WORD,
 					     1, &le_sum, true);
+	}
 
 	return ret_code;
 }
Signature · 1 line
2.25.1
#96 lore raw

PATCH v5 13/17 net/i40e/base: add calculation of MAC frequency if no link

In reply to Robin Zhang

Add macros and structures for MAC frequency calculation in case the link is not present.

Remove duplicate definition in i40e_ethdev.c

---
 drivers/net/i40e/base/i40e_adminq_cmd.h |  9 +++++++++
 drivers/net/i40e/base/i40e_register.h   | 10 ++++++++++
 drivers/net/i40e/base/i40e_type.h       |  8 ++++++++
 drivers/net/i40e/i40e_ethdev.c          |  3 +--
 4 files changed, 28 insertions(+), 2 deletions(-)
drivers/net/i40e/base/i40e_adminq_cmd.h +9 -0
index 372dd71c3f..d2615705a9 100644
@@ -2035,6 +2035,15 @@ enum i40e_aq_link_speed {
 	I40E_LINK_SPEED_25GB	= (1 << I40E_LINK_SPEED_25GB_SHIFT),
 };
 
+enum i40e_prt_mac_pcs_link_speed {
+	I40E_PRT_MAC_PCS_LINK_SPEED_UNKNOWN = 0,
+	I40E_PRT_MAC_PCS_LINK_SPEED_100MB,
+	I40E_PRT_MAC_PCS_LINK_SPEED_1GB,
+	I40E_PRT_MAC_PCS_LINK_SPEED_10GB,
+	I40E_PRT_MAC_PCS_LINK_SPEED_40GB,
+	I40E_PRT_MAC_PCS_LINK_SPEED_20GB
+};
+
 struct i40e_aqc_module_desc {
 	u8 oui[3];
 	u8 reserved1;
drivers/net/i40e/base/i40e_register.h +10 -0
index ee4f333f9c..75eff845f1 100644
@@ -1411,6 +1411,11 @@
 #define I40E_PRTMAC_PCS_XAUI_SWAP_B_SWAP_RX_LANE1_MASK  I40E_MASK(0x3, I40E_PRTMAC_PCS_XAUI_SWAP_B_SWAP_RX_LANE1_SHIFT)
 #define I40E_PRTMAC_PCS_XAUI_SWAP_B_SWAP_RX_LANE0_SHIFT 14
 #define I40E_PRTMAC_PCS_XAUI_SWAP_B_SWAP_RX_LANE0_MASK  I40E_MASK(0x3, I40E_PRTMAC_PCS_XAUI_SWAP_B_SWAP_RX_LANE0_SHIFT)
+/* _i=0...3 */ /* Reset: GLOBR */
+#define I40E_PRTMAC_PCS_LINK_STATUS1(_i) (0x0008C200 + ((_i) * 4))
+#define I40E_PRTMAC_PCS_LINK_STATUS1_LINK_SPEED_SHIFT 24
+#define I40E_PRTMAC_PCS_LINK_STATUS1_LINK_SPEED_MASK \
+	I40E_MASK(0x7, I40E_PRTMAC_PCS_LINK_STATUS1_LINK_SPEED_SHIFT)
 #define I40E_GL_FWRESETCNT                  0x00083100 /* Reset: POR */
 #define I40E_GL_FWRESETCNT_FWRESETCNT_SHIFT 0
 #define I40E_GL_FWRESETCNT_FWRESETCNT_MASK  I40E_MASK(0xFFFFFFFF, I40E_GL_FWRESETCNT_FWRESETCNT_SHIFT)
@@ -3873,6 +3878,11 @@
 #define I40E_PRTMAC_LINK_DOWN_COUNTER                         0x001E2440 /* Reset: GLOBR */
 #define I40E_PRTMAC_LINK_DOWN_COUNTER_LINK_DOWN_COUNTER_SHIFT 0
 #define I40E_PRTMAC_LINK_DOWN_COUNTER_LINK_DOWN_COUNTER_MASK  I40E_MASK(0xFFFF, I40E_PRTMAC_LINK_DOWN_COUNTER_LINK_DOWN_COUNTER_SHIFT)
+/* _i=0...3 */ /* Reset: GLOBR */
+#define I40E_PRTMAC_LINKSTA(_i) (0x001E2420 + ((_i) * 4))
+#define I40E_PRTMAC_LINKSTA_MAC_LINK_SPEED_SHIFT 27
+#define I40E_PRTMAC_LINKSTA_MAC_LINK_SPEED_MASK \
+	I40E_MASK(0x7, I40E_PRTMAC_LINKSTA_MAC_LINK_SPEED_SHIFT)
 #define I40E_GLNVM_AL_REQ                        0x000B6164 /* Reset: POR */
 #define I40E_GLNVM_AL_REQ_POR_SHIFT              0
 #define I40E_GLNVM_AL_REQ_POR_MASK               I40E_MASK(0x1, I40E_GLNVM_AL_REQ_POR_SHIFT)
drivers/net/i40e/base/i40e_type.h +8 -0
index 0323887550..49e05d89fa 100644
@@ -236,6 +236,14 @@ enum i40e_queue_type {
 	I40E_QUEUE_TYPE_UNKNOWN
 };
 
+enum i40e_prt_mac_link_speed {
+	I40E_PRT_MAC_LINK_SPEED_100MB = 0,
+	I40E_PRT_MAC_LINK_SPEED_1GB,
+	I40E_PRT_MAC_LINK_SPEED_10GB,
+	I40E_PRT_MAC_LINK_SPEED_40GB,
+	I40E_PRT_MAC_LINK_SPEED_20GB
+};
+
 struct i40e_link_status {
 	enum i40e_aq_phy_type phy_type;
 	enum i40e_aq_link_speed link_speed;
drivers/net/i40e/i40e_ethdev.c +1 -2
index 6f1765117a..b00f9cd396 100644
@@ -2855,7 +2855,6 @@ static __rte_always_inline void
 update_link_reg(struct i40e_hw *hw, struct rte_eth_link *link)
 {
 /* Link status registers and values*/
-#define I40E_PRTMAC_LINKSTA		0x001E2420
 #define I40E_REG_LINK_UP		0x40000080
 #define I40E_PRTMAC_MACC		0x001E24E0
 #define I40E_REG_MACC_25GB		0x00020000
@@ -2868,7 +2867,7 @@ update_link_reg(struct i40e_hw *hw, struct rte_eth_link *link)
 	uint32_t link_speed;
 	uint32_t reg_val;
 
-	reg_val = I40E_READ_REG(hw, I40E_PRTMAC_LINKSTA);
+	reg_val = I40E_READ_REG(hw, I40E_PRTMAC_LINKSTA(0));
 	link_speed = reg_val & I40E_REG_SPEED_MASK;
 	reg_val &= I40E_REG_LINK_UP;
 	link->link_status = (reg_val == I40E_REG_LINK_UP) ? 1 : 0;
Signature · 1 line
2.25.1
#97 lore raw

PATCH v5 14/17 net/i40e/base: separate kernel allocated Rx bi rings

In reply to Robin Zhang

Continuing the path to support MEM_TYPE_XSK_BUFF_POOL, the AF_XDP zero-copy/sk_buff rx_bi rings are now separate. Functions to properly allocate the different rings are added as well.

The purpose of this commit is sync with latest share code.

---
 drivers/net/i40e/base/i40e_type.h | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/net/i40e/base/i40e_type.h +4 -1
index 49e05d89fa..813c1ec00f 100644
@@ -817,7 +817,7 @@ union i40e_32byte_rx_desc {
 		__le64  rsvd2;
 	} read;
 	struct {
-		struct {
+		struct i40e_32b_rx_wb_qw0 {
 			struct {
 				union {
 					__le16 mirroring_status;
@@ -855,6 +855,9 @@ union i40e_32byte_rx_desc {
 			} hi_dword;
 		} qword3;
 	} wb;  /* writeback */
+	struct {
+		u64 qword[4];
+	} raw;
 };
 
 #define I40E_RXD_QW0_MIRROR_STATUS_SHIFT	8
Signature · 1 line
2.25.1
#98 lore raw

PATCH v5 15/17 net/i40e/base: update FVL FW API version to 1.15

In reply to Robin Zhang

Update FVL FW API version to 1.15

---
 drivers/net/i40e/base/i40e_adminq_cmd.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/i40e/base/i40e_adminq_cmd.h +1 -1
index d2615705a9..def307b59d 100644
@@ -13,7 +13,7 @@
 
 #define I40E_FW_API_VERSION_MAJOR	0x0001
 #define I40E_FW_API_VERSION_MINOR_X722	0x000C
-#define I40E_FW_API_VERSION_MINOR_X710	0x000C
+#define I40E_FW_API_VERSION_MINOR_X710	0x000F
 
 #define I40E_FW_MINOR_VERSION(_h) ((_h)->mac.type == I40E_MAC_XL710 ? \
 					I40E_FW_API_VERSION_MINOR_X710 : \
Signature · 1 line
2.25.1
#99 lore raw

PATCH v5 16/17 net/i40e/base: add defines related to DDP

In reply to Robin Zhang

This patch adds some defines related to DDP Track ID.

---
 drivers/net/i40e/base/i40e_type.h | 2 ++
 1 file changed, 2 insertions(+)
drivers/net/i40e/base/i40e_type.h +2 -0
index 813c1ec00f..f4a3d66759 100644
@@ -1988,6 +1988,8 @@ struct i40e_metadata_segment {
 	struct i40e_ddp_version version;
 #define I40E_DDP_TRACKID_RDONLY		0
 #define I40E_DDP_TRACKID_INVALID	0xFFFFFFFF
+#define I40E_DDP_TRACKID_GRP_MSK	0x00FF0000
+#define I40E_DDP_TRACKID_GRP_COMP_ALL	0xFF
 	u32 track_id;
 	char name[I40E_DDP_NAME_SIZE];
 };
Signature · 1 line
2.25.1
#100 lore raw

PATCH v5 17/17 net/i40e/base: update version in readme

In reply to Robin Zhang

Update base code version in README.

---
 drivers/net/i40e/base/README | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/i40e/base/README +1 -1
index 6af2993116..2e4fa5a921 100644
@@ -6,7 +6,7 @@ Intel® I40E driver
 ==================
 
 This directory contains source code of FreeBSD i40e driver of version
-cid-i40e.2020.08.27.tar.gz released by the team which develops
+cid-i40e.2021.08.16.tar.gz released by the team which develops
 basic drivers for any i40e NIC. The directory of base/ contains the
 original source package.
 This driver is valid for the product(s) listed below
Signature · 1 line
2.25.1
#101 lore raw

v6 cover i40e base code update

In reply to Robin Zhang

update i40e base code.

source code of i40e driver:
cid-i40e.2021.08.16.tar.gz

changelog in i40e share repo:
From 59a080f4fafe ("i40e-shared: Add opcode 0x0406 and 0x0416 to Linux support") To 2c7aab559654 ("i40e-shared: Add defines related to DDP")

The following commits are ignored:
cb9139e3bce8 ("i40e-shared: Fix not blinking X722 with x557 PHY via ‘ethtool -p'")
c09d4f9cf390 ("i40e-shared: i40e-shared: Fix build warning -Wformat related to integer size")
ff8a1abc6c17 ("i40e-shared: Fix build warning with __packed") 59a080f4fafe ("i40e-shared: Add opcode 0x0406 and 0x0416 to Linux support")

v6:
- fix some typos
v5:
- refine commit messages
v4:
- update base code to cid-i40e.2021.08.16
v3:
- there has a fix patch contains two issues, split it into two patches v2:
- refine commit messages and macro name

Robin Zhang (17):
net/i40e/base: add v2 version of send ASQ command functions net/i40e/base: add Min SRev for 4 more X722 modules net/i40e/base: set TSA table values when parsing CEE config net/i40e/base: define new shadow RAM pointers net/i40e/base: fix PHY identifiers for 2.5G and 5G adapters net/i40e/base: fix PF reset
net/i40e/base: fix update link data for X722 net/i40e/base: fix AOC media type
net/i40e/base: add flags and fields for double VLAN net/i40e/base: fix headers to match functions net/i40e/base: fix potentially uninitialized variables net/i40e/base: fix checksum is used incorrectly net/i40e/base: add calculation of MAC frequency if no link net/i40e/base: separate kernel allocated Rx bi rings net/i40e/base: update FVL FW API version to 1.15 net/i40e/base: add defines related to DDP net/i40e/base: update version in readme

 drivers/net/i40e/base/README            |   2 +-
 drivers/net/i40e/base/i40e_adminq.c     |  79 +++++++++--
 drivers/net/i40e/base/i40e_adminq_cmd.h |  55 ++++++--
 drivers/net/i40e/base/i40e_common.c     | 175 +++++++++++++++++++-----
 drivers/net/i40e/base/i40e_dcb.c        |  10 +-
 drivers/net/i40e/base/i40e_lan_hmc.c    |   2 +-
 drivers/net/i40e/base/i40e_nvm.c        |   7 +-
 drivers/net/i40e/base/i40e_prototype.h  |  17 +++
 drivers/net/i40e/base/i40e_register.h   |  10 ++
 drivers/net/i40e/base/i40e_type.h       |  26 +++-
 drivers/net/i40e/i40e_ethdev.c          |   3 +-
 11 files changed, 318 insertions(+), 68 deletions(-)
Signature · 1 line
2.25.1
#102 lore raw

PATCH v6 1/17 net/i40e/base: add v2 version of send ASQ command functions

ASQ(Admin Send Queue) send command functions are returning only i40e status codes yet some calling functions also need Admin Queue status that is stored in hw->aq.asq_last_status. Since hw object is stored on a heap it introduces a possibility for a race condition in access to hw if calling function is not fast enough to read hw->aq.asq_last_status before next send ASQ command is executed.

Added new versions of send ASQ command functions that return Admin Queue status on the stack to avoid race conditions in access to hw->aq.asq_last_status.
Added new _v2 version of i40e_aq_remove_macvlan and i40e_aq_add_macvlan that is using new _v2 versions of ASQ send command functions and returns the Admin Queue status on the stack.

---
 drivers/net/i40e/base/i40e_adminq.c    |  73 +++++++++++--
 drivers/net/i40e/base/i40e_common.c    | 139 ++++++++++++++++++++++---
 drivers/net/i40e/base/i40e_prototype.h |  17 +++
 3 files changed, 205 insertions(+), 24 deletions(-)
drivers/net/i40e/base/i40e_adminq.c +65 -8
index 235667d57a..38d3429e5b 100644
@@ -838,7 +838,7 @@ STATIC bool i40e_asq_done(struct i40e_hw *hw)
 }
 
 /**
- *  i40e_asq_send_command - send command to Admin Queue
+ *  i40e_asq_send_command_exec - send command to Admin Queue
  *  @hw: pointer to the hw struct
  *  @desc: prefilled descriptor describing the command (non DMA mem)
  *  @buff: buffer to use for indirect commands
@@ -848,11 +848,12 @@ STATIC bool i40e_asq_done(struct i40e_hw *hw)
  *  This is the main send command driver routine for the Admin Queue send
  *  queue.  It runs the queue, cleans the queue, etc
  **/
-enum i40e_status_code i40e_asq_send_command(struct i40e_hw *hw,
-				struct i40e_aq_desc *desc,
-				void *buff, /* can be NULL */
-				u16  buff_size,
-				struct i40e_asq_cmd_details *cmd_details)
+STATIC enum i40e_status_code
+i40e_asq_send_command_exec(struct i40e_hw *hw,
+			   struct i40e_aq_desc *desc,
+			   void *buff, /* can be NULL */
+			   u16  buff_size,
+			   struct i40e_asq_cmd_details *cmd_details)
 {
 	enum i40e_status_code status = I40E_SUCCESS;
 	struct i40e_dma_mem *dma_buff = NULL;
@@ -862,8 +863,6 @@ enum i40e_status_code i40e_asq_send_command(struct i40e_hw *hw,
 	u16  retval = 0;
 	u32  val = 0;
 
-	i40e_acquire_spinlock(&hw->aq.asq_spinlock);
-
 	hw->aq.asq_last_status = I40E_AQ_RC_OK;
 
 	if (hw->aq.asq.count == 0) {
@@ -1046,6 +1045,64 @@ enum i40e_status_code i40e_asq_send_command(struct i40e_hw *hw,
 	}
 
 asq_send_command_error:
+	return status;
+}
+
+/**
+ *  i40e_asq_send_command - send command to Admin Queue
+ *  @hw: pointer to the hw struct
+ *  @desc: prefilled descriptor describing the command (non DMA mem)
+ *  @buff: buffer to use for indirect commands
+ *  @buff_size: size of buffer for indirect commands
+ *  @cmd_details: pointer to command details structure
+ *
+ *  Acquires the lock and calls the main send command execution
+ *  routine.
+ **/
+enum i40e_status_code
+i40e_asq_send_command(struct i40e_hw *hw,
+		      struct i40e_aq_desc *desc,
+		      void *buff, /* can be NULL */
+		      u16  buff_size,
+		      struct i40e_asq_cmd_details *cmd_details)
+{
+	enum i40e_status_code status = I40E_SUCCESS;
+
+	i40e_acquire_spinlock(&hw->aq.asq_spinlock);
+	status = i40e_asq_send_command_exec(hw, desc, buff, buff_size,
+					    cmd_details);
+	i40e_release_spinlock(&hw->aq.asq_spinlock);
+	return status;
+}
+
+/**
+ *  i40e_asq_send_command_v2 - send command to Admin Queue
+ *  @hw: pointer to the hw struct
+ *  @desc: prefilled descriptor describing the command (non DMA mem)
+ *  @buff: buffer to use for indirect commands
+ *  @buff_size: size of buffer for indirect commands
+ *  @cmd_details: pointer to command details structure
+ *  @aq_status: pointer to Admin Queue status return value
+ *
+ *  Acquires the lock and calls the main send command execution
+ *  routine. Returns the last Admin Queue status in aq_status
+ *  to avoid race conditions in access to hw->aq.asq_last_status.
+ **/
+enum i40e_status_code
+i40e_asq_send_command_v2(struct i40e_hw *hw,
+			 struct i40e_aq_desc *desc,
+			 void *buff, /* can be NULL */
+			 u16  buff_size,
+			 struct i40e_asq_cmd_details *cmd_details,
+			 enum i40e_admin_queue_err *aq_status)
+{
+	enum i40e_status_code status = I40E_SUCCESS;
+
+	i40e_acquire_spinlock(&hw->aq.asq_spinlock);
+	status = i40e_asq_send_command_exec(hw, desc, buff, buff_size,
+					    cmd_details);
+	if (aq_status)
+		*aq_status = hw->aq.asq_last_status;
 	i40e_release_spinlock(&hw->aq.asq_spinlock);
 	return status;
 }
drivers/net/i40e/base/i40e_common.c +123 -16

187 lines not on this page · raw message

drivers/net/i40e/base/i40e_prototype.h +17 -0
index 124222e476..29c86c7fe8 100644
@@ -38,6 +38,13 @@ enum i40e_status_code i40e_asq_send_command(struct i40e_hw *hw,
 				void *buff, /* can be NULL */
 				u16  buff_size,
 				struct i40e_asq_cmd_details *cmd_details);
+enum i40e_status_code
+i40e_asq_send_command_v2(struct i40e_hw *hw,
+			 struct i40e_aq_desc *desc,
+			 void *buff, /* can be NULL */
+			 u16  buff_size,
+			 struct i40e_asq_cmd_details *cmd_details,
+			 enum i40e_admin_queue_err *aq_status);
 #ifdef VF_DRIVER
 bool i40e_asq_done(struct i40e_hw *hw);
 #endif
@@ -188,9 +195,19 @@ enum i40e_status_code i40e_aq_get_veb_parameters(struct i40e_hw *hw,
 enum i40e_status_code i40e_aq_add_macvlan(struct i40e_hw *hw, u16 vsi_id,
 			struct i40e_aqc_add_macvlan_element_data *mv_list,
 			u16 count, struct i40e_asq_cmd_details *cmd_details);
+enum i40e_status_code
+i40e_aq_add_macvlan_v2(struct i40e_hw *hw, u16 seid,
+		       struct i40e_aqc_add_macvlan_element_data *mv_list,
+		       u16 count, struct i40e_asq_cmd_details *cmd_details,
+		       enum i40e_admin_queue_err *aq_status);
 enum i40e_status_code i40e_aq_remove_macvlan(struct i40e_hw *hw, u16 vsi_id,
 			struct i40e_aqc_remove_macvlan_element_data *mv_list,
 			u16 count, struct i40e_asq_cmd_details *cmd_details);
+enum i40e_status_code
+i40e_aq_remove_macvlan_v2(struct i40e_hw *hw, u16 seid,
+			  struct i40e_aqc_remove_macvlan_element_data *mv_list,
+			  u16 count, struct i40e_asq_cmd_details *cmd_details,
+			  enum i40e_admin_queue_err *aq_status);
 enum i40e_status_code i40e_aq_add_mirrorrule(struct i40e_hw *hw, u16 sw_seid,
 			u16 rule_type, u16 dest_vsi, u16 count, __le16 *mr_list,
 			struct i40e_asq_cmd_details *cmd_details,
Signature · 1 line
2.25.1
#103 lore raw

PATCH v6 2/17 net/i40e/base: add Min SRev for 4 more X722 modules

In reply to Robin Zhang

Some customers want to downgrade to an earlier FW security revision, this already implemented by FW so that customers can have more control over the security revisions they can use. FW also implemented a mechanism via NVMupdate to allow the users to accept or not a baseline Min SRev version that will limit the secure version rollback only down to that level.

This commit increments X722 API version and adds new minimal rollback revision that related to the extended implementation of Security Revision Opt-In for 4 more X722 modules.

These definitions are not using by DPDK now, the purpose of this commit is sync with latest share code.

---
 drivers/net/i40e/base/i40e_adminq_cmd.h | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)
drivers/net/i40e/base/i40e_adminq_cmd.h +10 -6
index 2ca41db5d3..a96527f31c 100644
@@ -12,7 +12,7 @@
  */
 
 #define I40E_FW_API_VERSION_MAJOR	0x0001
-#define I40E_FW_API_VERSION_MINOR_X722	0x000B
+#define I40E_FW_API_VERSION_MINOR_X722	0x000C
 #define I40E_FW_API_VERSION_MINOR_X710	0x000C
 
 #define I40E_FW_MINOR_VERSION(_h) ((_h)->mac.type == I40E_MAC_XL710 ? \
@@ -2425,11 +2425,15 @@ struct i40e_aqc_rollback_revision_update {
 	u8	optin_mode; /* bool */
 #define I40E_AQ_RREV_OPTION_MODE			0x01
 	u8	module_selected;
-#define I40E_AQ_RREV_MODULE_PCIE_ANALOG		0
-#define I40E_AQ_RREV_MODULE_PHY_ANALOG		1
-#define I40E_AQ_RREV_MODULE_OPTION_ROM		2
-#define I40E_AQ_RREV_MODULE_EMP_IMAGE		3
-#define I40E_AQ_RREV_MODULE_PE_IMAGE		4
+#define I40E_AQ_RREV_MODULE_PCIE_ANALOG			0
+#define I40E_AQ_RREV_MODULE_PHY_ANALOG			1
+#define I40E_AQ_RREV_MODULE_OPTION_ROM			2
+#define I40E_AQ_RREV_MODULE_EMP_IMAGE			3
+#define I40E_AQ_RREV_MODULE_PE_IMAGE			4
+#define I40E_AQ_RREV_MODULE_PHY_PLL_O_CONFIGURATION	5
+#define I40E_AQ_RREV_MODULE_PHY_0_CONFIGURATION		6
+#define I40E_AQ_RREV_MODULE_PHY_PLL_1_CONFIGURATION	7
+#define I40E_AQ_RREV_MODULE_PHY_1_CONFIGURATION		8
 	u8	reserved1[2];
 	u32	min_rrev;
 	u8	reserved2[8];
Signature · 1 line
2.25.1
#104 lore raw

PATCH v6 3/17 net/i40e/base: set TSA table values when parsing CEE config

In reply to Robin Zhang

Driver did not Set TSA(Transmit Selection Algorithm) table values when parsing CEE(Converged Enhanced Ethernet) configuration obtained from FW.

---
 drivers/net/i40e/base/i40e_dcb.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
drivers/net/i40e/base/i40e_dcb.c +7 -1
index 388af3d64d..27b52bc365 100644
@@ -315,9 +315,15 @@ static void i40e_parse_cee_pgcfg_tlv(struct i40e_cee_feat_tlv *tlv,
 	 *        |pg0|pg1|pg2|pg3|pg4|pg5|pg6|pg7|
 	 *        ---------------------------------
 	 */
-	for (i = 0; i < I40E_MAX_TRAFFIC_CLASS; i++)
+	for (i = 0; i < I40E_MAX_TRAFFIC_CLASS; i++) {
 		etscfg->tcbwtable[i] = buf[offset++];
 
+		if (etscfg->prioritytable[i] == I40E_CEE_PGID_STRICT)
+			dcbcfg->etscfg.tsatable[i] = I40E_IEEE_TSA_STRICT;
+		else
+			dcbcfg->etscfg.tsatable[i] = I40E_IEEE_TSA_ETS;
+	}
+
 	/* Number of TCs supported (1 octet) */
 	etscfg->maxtcs = buf[offset];
 }
Signature · 1 line
2.25.1
#105 lore raw

PATCH v6 4/17 net/i40e/base: define new shadow RAM pointers

In reply to Robin Zhang

Add definitions for Shadow RAM pointers: 6th FPA(Free Provisioning Area) module, 5th FPA module in X722 and Preservation Rules module.

These definitions are not using by DPDK now, the purpose of this commit is sync with latest share code.

---
 drivers/net/i40e/base/i40e_type.h | 3 +++
 1 file changed, 3 insertions(+)
drivers/net/i40e/base/i40e_type.h +3 -0
index cf41345834..e5a3729183 100644
@@ -1555,6 +1555,9 @@ struct i40e_hw_port_stats {
 #define I40E_SR_FEATURE_CONFIGURATION_PTR	0x49
 #define I40E_SR_CONFIGURATION_METADATA_PTR	0x4D
 #define I40E_SR_IMMEDIATE_VALUES_PTR		0x4E
+#define I40E_SR_PRESERVATION_RULES_PTR		0x70
+#define I40E_X722_SR_5TH_FREE_PROVISION_AREA_PTR	0x71
+#define I40E_SR_6TH_FREE_PROVISION_AREA_PTR	0x71
 
 /* Auxiliary field, mask and shift definition for Shadow RAM and NVM Flash */
 #define I40E_SR_VPD_MODULE_MAX_SIZE		1024
Signature · 1 line
2.25.1
#106 lore raw

PATCH v6 5/17 net/i40e/base: fix PHY identifiers for 2.5G and 5G adapters

In reply to Robin Zhang

Unlike other supported adapters, 2.5G and 5G use different PHY type identifiers for reading/writing PHY settings and for reading link status. This commit introduces separate PHY identifiers for these two operation types.

Fixes 988ed63c7441 ("net/i40e/base: add support for Carlsville device")
---
 drivers/net/i40e/base/i40e_adminq_cmd.h | 6 ++++--
 drivers/net/i40e/base/i40e_common.c     | 4 ++--
 drivers/net/i40e/base/i40e_type.h       | 8 ++------
 3 files changed, 8 insertions(+), 10 deletions(-)
drivers/net/i40e/base/i40e_adminq_cmd.h +4 -2
index a96527f31c..af9dec1d7f 100644
@@ -1947,8 +1947,10 @@ enum i40e_aq_phy_type {
 	I40E_PHY_TYPE_25GBASE_LR		= 0x22,
 	I40E_PHY_TYPE_25GBASE_AOC		= 0x23,
 	I40E_PHY_TYPE_25GBASE_ACC		= 0x24,
-	I40E_PHY_TYPE_2_5GBASE_T		= 0x30,
-	I40E_PHY_TYPE_5GBASE_T			= 0x31,
+	I40E_PHY_TYPE_2_5GBASE_T		= 0x26,
+	I40E_PHY_TYPE_5GBASE_T			= 0x27,
+	I40E_PHY_TYPE_2_5GBASE_T_LINK_STATUS	= 0x30,
+	I40E_PHY_TYPE_5GBASE_T_LINK_STATUS	= 0x31,
 	I40E_PHY_TYPE_MAX,
 	I40E_PHY_TYPE_NOT_SUPPORTED_HIGH_TEMP	= 0xFD,
 	I40E_PHY_TYPE_EMPTY			= 0xFE,
drivers/net/i40e/base/i40e_common.c +2 -2
index 32642f3e2b..ceedec68bf 100644
@@ -1280,8 +1280,8 @@ STATIC enum i40e_media_type i40e_get_media_type(struct i40e_hw *hw)
 		break;
 	case I40E_PHY_TYPE_100BASE_TX:
 	case I40E_PHY_TYPE_1000BASE_T:
-	case I40E_PHY_TYPE_2_5GBASE_T:
-	case I40E_PHY_TYPE_5GBASE_T:
+	case I40E_PHY_TYPE_2_5GBASE_T_LINK_STATUS:
+	case I40E_PHY_TYPE_5GBASE_T_LINK_STATUS:
 	case I40E_PHY_TYPE_10GBASE_T:
 		media = I40E_MEDIA_TYPE_BASET;
 		break;
drivers/net/i40e/base/i40e_type.h +2 -6
index e5a3729183..0323887550 100644
@@ -329,12 +329,8 @@ struct i40e_phy_info {
 					     I40E_PHY_TYPE_OFFSET)
 #define I40E_CAP_PHY_TYPE_25GBASE_ACC BIT_ULL(I40E_PHY_TYPE_25GBASE_ACC + \
 					     I40E_PHY_TYPE_OFFSET)
-/* Offset for 2.5G/5G PHY Types value to bit number conversion */
-#define I40E_PHY_TYPE_OFFSET2 (-10)
-#define I40E_CAP_PHY_TYPE_2_5GBASE_T BIT_ULL(I40E_PHY_TYPE_2_5GBASE_T + \
-					     I40E_PHY_TYPE_OFFSET2)
-#define I40E_CAP_PHY_TYPE_5GBASE_T BIT_ULL(I40E_PHY_TYPE_5GBASE_T + \
-					     I40E_PHY_TYPE_OFFSET2)
+#define I40E_CAP_PHY_TYPE_2_5GBASE_T BIT_ULL(I40E_PHY_TYPE_2_5GBASE_T)
+#define I40E_CAP_PHY_TYPE_5GBASE_T BIT_ULL(I40E_PHY_TYPE_5GBASE_T)
 #define I40E_HW_CAP_MAX_GPIO			30
 #define I40E_HW_CAP_MDIO_PORT_MODE_MDIO		0
 #define I40E_HW_CAP_MDIO_PORT_MODE_I2C		1
Signature · 1 line
2.25.1
#107 lore raw

PATCH v6 6/17 net/i40e/base: fix PF reset

In reply to Robin Zhang

PF has to delete all the filters during reset.
If it is fully loaded with filters then it is possible that it will take more than 200 ms to finish the reset resulting in timeout during pf_reset and PF reset failed, -15 error indication.

Increasing the timeout value for PF reset from 200 to 1000 to give PF more time to finish reset if it is loaded with filters.

Fixes 1e32378f0774 ("i40e/base: increase PF reset max loop limit")
---
 drivers/net/i40e/base/i40e_common.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/i40e/base/i40e_common.c +1 -1
index ceedec68bf..aa424e6010 100644
@@ -1341,7 +1341,7 @@ STATIC enum i40e_status_code i40e_poll_globr(struct i40e_hw *hw,
 	return I40E_ERR_RESET_FAILED;
 }
 
-#define I40E_PF_RESET_WAIT_COUNT	200
+#define I40E_PF_RESET_WAIT_COUNT	1000
 /**
  * i40e_pf_reset - Reset the PF
  * @hw: pointer to the hardware structure
Signature · 1 line
2.25.1
#108 lore raw

PATCH v6 7/17 net/i40e/base: fix update link data for X722

In reply to Robin Zhang

The X722 card has 'Link Type' information elsewhere than the X710. Previously, for all cards, the 'Link Type' information was retrieved by opcode 0x0607 and this value was wrong for all X722 cards. Now this information for X722 only is taken by opcode 0x0600 (function: i40e_aq_get_phy_capabilities) instead of an opcode 0x0607 (function: i40e_aq_get_link_info).
All other parameters read by opcode 0x0607 unchanged.

Fixes e6691b428eb1 ("i40e/base: fix PHY NVM interaction")
Fixes 75c3de654ead ("net/i40e/base: fix long link down notification time")
---
 drivers/net/i40e/base/i40e_common.c | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)
drivers/net/i40e/base/i40e_common.c +10 -4
index aa424e6010..ef061a6b63 100644
@@ -2078,6 +2078,9 @@ enum i40e_status_code i40e_aq_get_link_info(struct i40e_hw *hw,
 	     hw->aq.fw_min_ver < 40)) && hw_link_info->phy_type == 0xE)
 		hw_link_info->phy_type = I40E_PHY_TYPE_10GBASE_SFPP_CU;
 
+	/* 'Get Link Status' response data structure from X722 FW has
+	 * different format and does not contain this information
+	 */
 	if (hw->flags & I40E_HW_FLAG_AQ_PHY_ACCESS_CAPABLE &&
 	    hw->mac.type != I40E_MAC_X722) {
 		__le32 tmp;
@@ -2948,10 +2951,13 @@ enum i40e_status_code i40e_update_link_info(struct i40e_hw *hw)
 		return status;
 
 	/* extra checking needed to ensure link info to user is timely */
-	if ((hw->phy.link_info.link_info & I40E_AQ_MEDIA_AVAILABLE) &&
-	    ((hw->phy.link_info.link_info & I40E_AQ_LINK_UP) ||
-	     !(hw->phy.link_info_old.link_info & I40E_AQ_LINK_UP))) {
-		status = i40e_aq_get_phy_capabilities(hw, false, false,
+	if (((hw->phy.link_info.link_info & I40E_AQ_MEDIA_AVAILABLE) &&
+	     ((hw->phy.link_info.link_info & I40E_AQ_LINK_UP) ||
+	      !(hw->phy.link_info_old.link_info & I40E_AQ_LINK_UP))) ||
+		hw->mac.type == I40E_MAC_X722) {
+		status = i40e_aq_get_phy_capabilities(hw, false,
+						      hw->mac.type ==
+						      I40E_MAC_X722,
 						      &abilities, NULL);
 		if (status)
 			return status;
Signature · 1 line
2.25.1
#109 lore raw

PATCH v6 8/17 net/i40e/base: fix AOC media type

In reply to Robin Zhang

For Active Optical Cable (AOC) the correct media type is "Fibre", not "Direct Attach Copper".

Fixes d749d4d89969 ("i40e/base: add AOC PHY types")
Fixes aa153cc89ff0 ("net/i40e/base: add new PHY types for 25G AOC and ACC")
---
 drivers/net/i40e/base/i40e_common.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/net/i40e/base/i40e_common.c +3 -3
index ef061a6b63..2ca6a13e79 100644
@@ -1276,6 +1276,9 @@ STATIC enum i40e_media_type i40e_get_media_type(struct i40e_hw *hw)
 	case I40E_PHY_TYPE_40GBASE_LR4:
 	case I40E_PHY_TYPE_25GBASE_LR:
 	case I40E_PHY_TYPE_25GBASE_SR:
+	case I40E_PHY_TYPE_10GBASE_AOC:
+	case I40E_PHY_TYPE_25GBASE_AOC:
+	case I40E_PHY_TYPE_40GBASE_AOC:
 		media = I40E_MEDIA_TYPE_FIBER;
 		break;
 	case I40E_PHY_TYPE_100BASE_TX:
@@ -1290,10 +1293,7 @@ STATIC enum i40e_media_type i40e_get_media_type(struct i40e_hw *hw)
 	case I40E_PHY_TYPE_10GBASE_CR1:
 	case I40E_PHY_TYPE_40GBASE_CR4:
 	case I40E_PHY_TYPE_10GBASE_SFPP_CU:
-	case I40E_PHY_TYPE_40GBASE_AOC:
-	case I40E_PHY_TYPE_10GBASE_AOC:
 	case I40E_PHY_TYPE_25GBASE_CR:
-	case I40E_PHY_TYPE_25GBASE_AOC:
 	case I40E_PHY_TYPE_25GBASE_ACC:
 		media = I40E_MEDIA_TYPE_DA;
 		break;
Signature · 1 line
2.25.1
#110 lore raw

PATCH v6 9/17 net/i40e/base: add flags and fields for double VLAN

In reply to Robin Zhang

Add flags for outer VLAN and include set port parameters. Add flags, which describe port and switch state for both double VLAN functionality and outer VLAN processing.

---
 drivers/net/i40e/base/i40e_adminq_cmd.h | 22 ++++++++++++++++++++--
 1 file changed, 20 insertions(+), 2 deletions(-)
drivers/net/i40e/base/i40e_adminq_cmd.h +20 -2
index af9dec1d7f..372dd71c3f 100644
@@ -768,6 +768,7 @@ struct i40e_aqc_set_switch_config {
 #define I40E_AQ_SET_SWITCH_CFG_PROMISC		0x0001
 #define I40E_AQ_SET_SWITCH_CFG_L2_FILTER	0x0002
 #define I40E_AQ_SET_SWITCH_CFG_HW_ATR_EVICT	0x0004
+#define I40E_AQ_SET_SWITCH_CFG_OUTER_VLAN	0x0008
 	__le16	valid_flags;
 	/* The ethertype in switch_tag is dropped on ingress and used
 	 * internally by the switch. Set this to zero for the default
@@ -904,7 +905,7 @@ struct i40e_aqc_vsi_properties_data {
 	u8	sec_reserved;
 	/* VLAN section */
 	__le16	pvid; /* VLANS include priority bits */
-	__le16	fcoe_pvid;
+	__le16	outer_vlan;
 	u8	port_vlan_flags;
 #define I40E_AQ_VSI_PVLAN_MODE_SHIFT	0x00
 #define I40E_AQ_VSI_PVLAN_MODE_MASK	(0x03 << \
@@ -920,7 +921,24 @@ struct i40e_aqc_vsi_properties_data {
 #define I40E_AQ_VSI_PVLAN_EMOD_STR_UP	0x08
 #define I40E_AQ_VSI_PVLAN_EMOD_STR	0x10
 #define I40E_AQ_VSI_PVLAN_EMOD_NOTHING	0x18
-	u8	pvlan_reserved[3];
+	u8	outer_vlan_flags;
+#define I40E_AQ_VSI_OVLAN_MODE_SHIFT	0x00
+#define I40E_AQ_VSI_OVLAN_MODE_MASK	(0x03 << \
+					 I40E_AQ_VSI_OVLAN_MODE_SHIFT)
+#define I40E_AQ_VSI_OVLAN_MODE_UNTAGGED	0x01
+#define I40E_AQ_VSI_OVLAN_MODE_TAGGED	0x02
+#define I40E_AQ_VSI_OVLAN_MODE_ALL	0x03
+#define I40E_AQ_VSI_OVLAN_INSERT_PVID	0x04
+#define I40E_AQ_VSI_OVLAN_EMOD_SHIFT	0x03
+#define I40E_AQ_VSI_OVLAN_EMOD_MASK	(0x03 <<\
+					 I40E_AQ_VSI_OVLAN_EMOD_SHIFT)
+#define I40E_AQ_VSI_OVLAN_EMOD_SHOW_ALL	0x00
+#define I40E_AQ_VSI_OVLAN_EMOD_SHOW_UP	0x01
+#define I40E_AQ_VSI_OVLAN_EMOD_HIDE_ALL	0x02
+#define I40E_AQ_VSI_OVLAN_EMOD_NOTHING	0x03
+#define I40E_AQ_VSI_OVLAN_CTRL_ENA	0x04
+
+	u8	pvlan_reserved[2];
 	/* ingress egress up sections */
 	__le32	ingress_table; /* bitmap, 3 bits per up */
 #define I40E_AQ_VSI_UP_TABLE_UP0_SHIFT	0
Signature · 1 line
2.25.1
#111 lore raw

PATCH v6 10/17 net/i40e/base: fix headers to match functions

In reply to Robin Zhang

Fix several kernel-doc warnings when building with W=1. These changes are only to comments.

Fixes 8db9e2a1b232 ("i40e: base driver")
Fixes 842ea1996335 ("i40e/base: save link module type")
Fixes fd72a2284a89 ("i40e/base: support LED blinking with new PHY")
Fixes 788fc17b2dec ("i40e/base: support proxy config for X722")
---
 drivers/net/i40e/base/i40e_common.c  | 10 +++++-----
 drivers/net/i40e/base/i40e_dcb.c     |  2 +-
 drivers/net/i40e/base/i40e_lan_hmc.c |  2 +-
 drivers/net/i40e/base/i40e_nvm.c     |  2 +-
 4 files changed, 8 insertions(+), 8 deletions(-)
drivers/net/i40e/base/i40e_common.c +5 -5
index 2ca6a13e79..baa51e1396 100644
@@ -2677,7 +2677,7 @@ enum i40e_status_code i40e_aq_set_vsi_vlan_promisc(struct i40e_hw *hw,
 }
 
 /**
- * i40e_get_vsi_params - get VSI configuration info
+ * i40e_aq_get_vsi_params - get VSI configuration info
  * @hw: pointer to the hw struct
  * @vsi_ctx: pointer to a vsi context struct
  * @cmd_details: pointer to command details structure or NULL
@@ -2938,7 +2938,7 @@ enum i40e_status_code i40e_get_link_status(struct i40e_hw *hw, bool *link_up)
 }
 
 /**
- * i40e_updatelink_status - update status of the HW network link
+ * i40e_update_link_info - update status of the HW network link
  * @hw: pointer to the hw struct
  **/
 enum i40e_status_code i40e_update_link_info(struct i40e_hw *hw)
@@ -4830,7 +4830,7 @@ enum i40e_status_code i40e_aq_del_udp_tunnel(struct i40e_hw *hw, u8 index,
 }
 
 /**
- * i40e_aq_get_switch_resource_alloc (0x0204)
+ * i40e_aq_get_switch_resource_alloc - command (0x0204) to get allocations
  * @hw: pointer to the hw struct
  * @num_entries: pointer to u8 to store the number of resource entries returned
  * @buf: pointer to a user supplied buffer.  This buffer must be large enough
@@ -6977,7 +6977,7 @@ u8 i40e_get_phy_address(struct i40e_hw *hw, u8 dev_num)
 }
 
 /**
- * i40e_blink_phy_led
+ * i40e_blink_phy_link_led
  * @hw: pointer to the HW structure
  * @time: time how long led will blinks in secs
  * @interval: gap between LED on and off in msecs
@@ -7824,7 +7824,7 @@ enum i40e_status_code i40e_aq_set_arp_proxy_config(struct i40e_hw *hw,
 }
 
 /**
- * i40e_aq_opc_set_ns_proxy_table_entry
+ * i40e_aq_set_ns_proxy_table_entry
  * @hw: pointer to the HW structure
  * @ns_proxy_table_entry: pointer to NS table entry command struct
  * @cmd_details: pointer to command details
drivers/net/i40e/base/i40e_dcb.c +1 -1
index 27b52bc365..8f9b7e823f 100644
@@ -235,7 +235,7 @@ static void i40e_parse_ieee_app_tlv(struct i40e_lldp_org_tlv *tlv,
 }
 
 /**
- * i40e_parse_ieee_etsrec_tlv
+ * i40e_parse_ieee_tlv
  * @tlv: IEEE 802.1Qaz TLV
  * @dcbcfg: Local store to update ETS REC data
  *
drivers/net/i40e/base/i40e_lan_hmc.c +1 -1
index d3969396f0..d3bd683ff3 100644
@@ -516,7 +516,7 @@ enum i40e_status_code i40e_configure_lan_hmc(struct i40e_hw *hw,
 }
 
 /**
- * i40e_delete_hmc_object - remove hmc objects
+ * i40e_delete_lan_hmc_object - remove hmc objects
  * @hw: pointer to the HW structure
  * @info: pointer to i40e_hmc_delete_obj_info struct
  *
drivers/net/i40e/base/i40e_nvm.c +1 -1
index 561ed21136..67e58cc195 100644
@@ -7,7 +7,7 @@
 #include "i40e_prototype.h"
 
 /**
- * i40e_init_nvm_ops - Initialize NVM function pointers
+ * i40e_init_nvm - Initialize NVM function pointers
  * @hw: pointer to the HW structure
  *
  * Setup the function pointers and the NVM info structure. Should be called
Signature · 1 line
2.25.1
#112 lore raw

Re: [dpdk-dev] [PATCH v6 10/17] net/i40e/base: fix headers to match functions

Quoted 15 lines

-----Original Message-----
From: Zhang, RobinX <[email protected]>
Sent: Saturday, October 9, 2021 9:40 AM
To: [email protected]
Cc: Xing, Beilei <[email protected]>; Zhang, Qi Z <[email protected]>; Zhang, Helin <[email protected]>; Wu, Jingjing <[email protected]>; [email protected]; [email protected]; [email protected]; Liang, Cunming <[email protected]>; Lu, Wenzhuo <[email protected]>; Guo, Junfeng <[email protected]>; Yang, SteveX <[email protected]>; Zhang, RobinX <[email protected]>; [email protected]; Brandeburg, Jesse <[email protected]>
Subject: [PATCH v6 10/17] net/i40e/base: fix headers to match functions

fix headers to match functions

Quoted 2 lines

Fix several kernel-doc warnings when building with W=1. These changes are only to comments.

"Fix mismatched function name in comments"

This is an obvious fix, no need to involve unrelated background.

Quoted 111 lines
Fixes 8db9e2a1b232 ("i40e: base driver")
Fixes 842ea1996335 ("i40e/base: save link module type")
Fixes fd72a2284a89 ("i40e/base: support LED blinking with new PHY")
Fixes 788fc17b2dec ("i40e/base: support proxy config for X722")
---
 drivers/net/i40e/base/i40e_common.c  | 10 +++++-----
 drivers/net/i40e/base/i40e_dcb.c     |  2 +-
 drivers/net/i40e/base/i40e_lan_hmc.c |  2 +-
 drivers/net/i40e/base/i40e_nvm.c     |  2 +-
 4 files changed, 8 insertions(+), 8 deletions(-)
drivers/net/i40e/base/i40e_common.c +2 -1
index 2ca6a13e79..baa51e1396 100644
@@ -2677,7 +2677,7 @@ enum i40e_status_code
 i40e_aq_set_vsi_vlan_promisc(struct i40e_hw *hw,  }
 
 /**
- * i40e_get_vsi_params - get VSI configuration info
+ * i40e_aq_get_vsi_params - get VSI configuration info
  * @hw: pointer to the hw struct
  * @vsi_ctx: pointer to a vsi context struct
  * @cmd_details: pointer to command details structure or NULL @@ -2938,7
+2938,7 @@ enum i40e_status_code i40e_get_link_status(struct i40e_hw

*hw, bool *link_up) }

/**
- * i40e_updatelink_status - update status of the HW network link
+ * i40e_update_link_info - update status of the HW network link
* @hw: pointer to the hw struct
**/
enum i40e_status_code i40e_update_link_info(struct i40e_hw *hw) @@
-4830,7 +4830,7 @@ enum i40e_status_code i40e_aq_del_udp_tunnel(struct i40e_hw *hw, u8 index, }

/**
- * i40e_aq_get_switch_resource_alloc (0x0204)
+ * i40e_aq_get_switch_resource_alloc - command (0x0204) to get
+ allocations
* @hw: pointer to the hw struct
* @num_entries: pointer to u8 to store the number of resource entries
returned
* @buf: pointer to a user supplied buffer. This buffer must be large enough

drivers/net/i40e/base/i40e_common.c +1 -1
@@ -6977,7 +6977,7 @@ u8 i40e_get_phy_address(struct i40e_hw *hw, u8
 dev_num)  }
 
 /**
- * i40e_blink_phy_led
+ * i40e_blink_phy_link_led
  * @hw: pointer to the HW structure
  * @time: time how long led will blinks in secs
  * @interval: gap between LED on and off in msecs @@ -7824,7 +7824,7

@@ enum i40e_status_code i40e_aq_set_arp_proxy_config(struct i40e_hw *hw, }

/**
- * i40e_aq_opc_set_ns_proxy_table_entry
+ * i40e_aq_set_ns_proxy_table_entry
* @hw: pointer to the HW structure
* @ns_proxy_table_entry: pointer to NS table entry command struct
* @cmd_details: pointer to command details diff --git
a/drivers/net/i40e/base/i40e_dcb.c b/drivers/net/i40e/base/i40e_dcb.c index 27b52bc365..8f9b7e823f 100644

drivers/net/i40e/base/i40e_dcb.c +1 -1
@@ -235,7 +235,7 @@ static void i40e_parse_ieee_app_tlv(struct
 i40e_lldp_org_tlv *tlv,  }
 
 /**
- * i40e_parse_ieee_etsrec_tlv
+ * i40e_parse_ieee_tlv
  * @tlv: IEEE 802.1Qaz TLV
  * @dcbcfg: Local store to update ETS REC data
  *
drivers/net/i40e/base/i40e_lan_hmc.c +1 -1
index d3969396f0..d3bd683ff3 100644
@@ -516,7 +516,7 @@ enum i40e_status_code
 i40e_configure_lan_hmc(struct i40e_hw *hw,  }
 
 /**
- * i40e_delete_hmc_object - remove hmc objects
+ * i40e_delete_lan_hmc_object - remove hmc objects
  * @hw: pointer to the HW structure
  * @info: pointer to i40e_hmc_delete_obj_info struct
  *
drivers/net/i40e/base/i40e_nvm.c +1 -2
index 561ed21136..67e58cc195 100644
@@ -7,7 +7,7 @@
 #include "i40e_prototype.h"
 
 /**
- * i40e_init_nvm_ops - Initialize NVM function pointers
+ * i40e_init_nvm - Initialize NVM function pointers
  * @hw: pointer to the HW structure
  *
  * Setup the function pointers and the NVM info structure. Should be called
--

2.25.1

#113 lore raw

PATCH v6 11/17 net/i40e/base: fix potentially uninitialized variables

In reply to Robin Zhang

The status of i40e_read_nvm_word is not checked, so variables set from this function could be used uninitialized. In this case, preserve the existing flow that does not block initialization by initializing these values from the start.

Fixes 8d6c51fcd24b ("i40e/base: get OEM version")
Fixes 2db70574247b ("net/i40e/base: limit PF/VF specific code to that driver only")
---
 drivers/net/i40e/base/i40e_adminq.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/net/i40e/base/i40e_adminq.c +4 -2
index 38d3429e5b..27c82d9b44 100644
@@ -652,8 +652,10 @@ enum i40e_status_code i40e_init_adminq(struct i40e_hw *hw)
 {
 	struct i40e_adminq_info *aq = &hw->aq;
 	enum i40e_status_code ret_code;
-	u16 cfg_ptr, oem_hi, oem_lo;
-	u16 eetrack_lo, eetrack_hi;
+	u16 oem_hi = 0, oem_lo = 0;
+	u16 eetrack_hi = 0;
+	u16 eetrack_lo = 0;
+	u16 cfg_ptr = 0;
 	int retry = 0;
 
 	/* verify input for valid configuration */
Signature · 1 line
2.25.1
#114 lore raw

PATCH v6 12/17 net/i40e/base: fix checksum is used incorrectly

In reply to Robin Zhang

The variable checksum from i40e_calc_nvm_checksum is used before return value is checked. Fix this logic.

Fixes 8db9e2a1b232 ("i40e: base driver")
Fixes 3ed6c3246f43 ("i40e/base: handle AQ timeout when releasing NVM")
---
 drivers/net/i40e/base/i40e_nvm.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/net/i40e/base/i40e_nvm.c +3 -2
index 67e58cc195..f385042601 100644
@@ -755,10 +755,11 @@ enum i40e_status_code i40e_update_nvm_checksum(struct i40e_hw *hw)
 	DEBUGFUNC("i40e_update_nvm_checksum");
 
 	ret_code = i40e_calc_nvm_checksum(hw, &checksum);
-	le_sum = CPU_TO_LE16(checksum);
-	if (ret_code == I40E_SUCCESS)
+	if (ret_code == I40E_SUCCESS) {
+		le_sum = CPU_TO_LE16(checksum);
 		ret_code = i40e_write_nvm_aq(hw, 0x00, I40E_SR_SW_CHECKSUM_WORD,
 					     1, &le_sum, true);
+	}
 
 	return ret_code;
 }
Signature · 1 line
2.25.1
#115 lore raw

PATCH v6 13/17 net/i40e/base: add calculation of MAC frequency if no link

In reply to Robin Zhang

Add macros and structures for MAC frequency calculation in case the link is not present.

Remove duplicate definition in i40e_ethdev.c

---
 drivers/net/i40e/base/i40e_adminq_cmd.h |  9 +++++++++
 drivers/net/i40e/base/i40e_register.h   | 10 ++++++++++
 drivers/net/i40e/base/i40e_type.h       |  8 ++++++++
 drivers/net/i40e/i40e_ethdev.c          |  3 +--
 4 files changed, 28 insertions(+), 2 deletions(-)
drivers/net/i40e/base/i40e_adminq_cmd.h +9 -0
index 372dd71c3f..d2615705a9 100644
@@ -2035,6 +2035,15 @@ enum i40e_aq_link_speed {
 	I40E_LINK_SPEED_25GB	= (1 << I40E_LINK_SPEED_25GB_SHIFT),
 };
 
+enum i40e_prt_mac_pcs_link_speed {
+	I40E_PRT_MAC_PCS_LINK_SPEED_UNKNOWN = 0,
+	I40E_PRT_MAC_PCS_LINK_SPEED_100MB,
+	I40E_PRT_MAC_PCS_LINK_SPEED_1GB,
+	I40E_PRT_MAC_PCS_LINK_SPEED_10GB,
+	I40E_PRT_MAC_PCS_LINK_SPEED_40GB,
+	I40E_PRT_MAC_PCS_LINK_SPEED_20GB
+};
+
 struct i40e_aqc_module_desc {
 	u8 oui[3];
 	u8 reserved1;
drivers/net/i40e/base/i40e_register.h +10 -0
index ee4f333f9c..75eff845f1 100644
@@ -1411,6 +1411,11 @@
 #define I40E_PRTMAC_PCS_XAUI_SWAP_B_SWAP_RX_LANE1_MASK  I40E_MASK(0x3, I40E_PRTMAC_PCS_XAUI_SWAP_B_SWAP_RX_LANE1_SHIFT)
 #define I40E_PRTMAC_PCS_XAUI_SWAP_B_SWAP_RX_LANE0_SHIFT 14
 #define I40E_PRTMAC_PCS_XAUI_SWAP_B_SWAP_RX_LANE0_MASK  I40E_MASK(0x3, I40E_PRTMAC_PCS_XAUI_SWAP_B_SWAP_RX_LANE0_SHIFT)
+/* _i=0...3 */ /* Reset: GLOBR */
+#define I40E_PRTMAC_PCS_LINK_STATUS1(_i) (0x0008C200 + ((_i) * 4))
+#define I40E_PRTMAC_PCS_LINK_STATUS1_LINK_SPEED_SHIFT 24
+#define I40E_PRTMAC_PCS_LINK_STATUS1_LINK_SPEED_MASK \
+	I40E_MASK(0x7, I40E_PRTMAC_PCS_LINK_STATUS1_LINK_SPEED_SHIFT)
 #define I40E_GL_FWRESETCNT                  0x00083100 /* Reset: POR */
 #define I40E_GL_FWRESETCNT_FWRESETCNT_SHIFT 0
 #define I40E_GL_FWRESETCNT_FWRESETCNT_MASK  I40E_MASK(0xFFFFFFFF, I40E_GL_FWRESETCNT_FWRESETCNT_SHIFT)
@@ -3873,6 +3878,11 @@
 #define I40E_PRTMAC_LINK_DOWN_COUNTER                         0x001E2440 /* Reset: GLOBR */
 #define I40E_PRTMAC_LINK_DOWN_COUNTER_LINK_DOWN_COUNTER_SHIFT 0
 #define I40E_PRTMAC_LINK_DOWN_COUNTER_LINK_DOWN_COUNTER_MASK  I40E_MASK(0xFFFF, I40E_PRTMAC_LINK_DOWN_COUNTER_LINK_DOWN_COUNTER_SHIFT)
+/* _i=0...3 */ /* Reset: GLOBR */
+#define I40E_PRTMAC_LINKSTA(_i) (0x001E2420 + ((_i) * 4))
+#define I40E_PRTMAC_LINKSTA_MAC_LINK_SPEED_SHIFT 27
+#define I40E_PRTMAC_LINKSTA_MAC_LINK_SPEED_MASK \
+	I40E_MASK(0x7, I40E_PRTMAC_LINKSTA_MAC_LINK_SPEED_SHIFT)
 #define I40E_GLNVM_AL_REQ                        0x000B6164 /* Reset: POR */
 #define I40E_GLNVM_AL_REQ_POR_SHIFT              0
 #define I40E_GLNVM_AL_REQ_POR_MASK               I40E_MASK(0x1, I40E_GLNVM_AL_REQ_POR_SHIFT)
drivers/net/i40e/base/i40e_type.h +8 -0
index 0323887550..49e05d89fa 100644
@@ -236,6 +236,14 @@ enum i40e_queue_type {
 	I40E_QUEUE_TYPE_UNKNOWN
 };
 
+enum i40e_prt_mac_link_speed {
+	I40E_PRT_MAC_LINK_SPEED_100MB = 0,
+	I40E_PRT_MAC_LINK_SPEED_1GB,
+	I40E_PRT_MAC_LINK_SPEED_10GB,
+	I40E_PRT_MAC_LINK_SPEED_40GB,
+	I40E_PRT_MAC_LINK_SPEED_20GB
+};
+
 struct i40e_link_status {
 	enum i40e_aq_phy_type phy_type;
 	enum i40e_aq_link_speed link_speed;
drivers/net/i40e/i40e_ethdev.c +1 -2
index 6f1765117a..b00f9cd396 100644
@@ -2855,7 +2855,6 @@ static __rte_always_inline void
 update_link_reg(struct i40e_hw *hw, struct rte_eth_link *link)
 {
 /* Link status registers and values*/
-#define I40E_PRTMAC_LINKSTA		0x001E2420
 #define I40E_REG_LINK_UP		0x40000080
 #define I40E_PRTMAC_MACC		0x001E24E0
 #define I40E_REG_MACC_25GB		0x00020000
@@ -2868,7 +2867,7 @@ update_link_reg(struct i40e_hw *hw, struct rte_eth_link *link)
 	uint32_t link_speed;
 	uint32_t reg_val;
 
-	reg_val = I40E_READ_REG(hw, I40E_PRTMAC_LINKSTA);
+	reg_val = I40E_READ_REG(hw, I40E_PRTMAC_LINKSTA(0));
 	link_speed = reg_val & I40E_REG_SPEED_MASK;
 	reg_val &= I40E_REG_LINK_UP;
 	link->link_status = (reg_val == I40E_REG_LINK_UP) ? 1 : 0;
Signature · 1 line
2.25.1
#116 lore raw

PATCH v6 14/17 net/i40e/base: separate kernel allocated Rx bi rings

In reply to Robin Zhang

Continuing the path to support MEM_TYPE_XSK_BUFF_POOL, the AF_XDP zero-copy/sk_buff rx_bi rings are now separate. Functions to properly allocate the different rings are added as well.

The purpose of this commit is sync with latest share code.

---
 drivers/net/i40e/base/i40e_type.h | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/net/i40e/base/i40e_type.h +4 -1
index 49e05d89fa..813c1ec00f 100644
@@ -817,7 +817,7 @@ union i40e_32byte_rx_desc {
 		__le64  rsvd2;
 	} read;
 	struct {
-		struct {
+		struct i40e_32b_rx_wb_qw0 {
 			struct {
 				union {
 					__le16 mirroring_status;
@@ -855,6 +855,9 @@ union i40e_32byte_rx_desc {
 			} hi_dword;
 		} qword3;
 	} wb;  /* writeback */
+	struct {
+		u64 qword[4];
+	} raw;
 };
 
 #define I40E_RXD_QW0_MIRROR_STATUS_SHIFT	8
Signature · 1 line
2.25.1
#117 lore raw

Re: [dpdk-dev] [PATCH v6 14/17] net/i40e/base: separate kernel allocated Rx bi rings

Quoted 14 lines

-----Original Message-----
From: Zhang, RobinX <[email protected]>
Sent: Saturday, October 9, 2021 9:40 AM
To: [email protected]
Cc: Xing, Beilei <[email protected]>; Zhang, Qi Z <[email protected]>; Zhang, Helin <[email protected]>; Wu, Jingjing <[email protected]>; [email protected]; [email protected]; [email protected]; Liang, Cunming <[email protected]>; Lu, Wenzhuo <[email protected]>; Guo, Junfeng <[email protected]>; Yang, SteveX <[email protected]>; Zhang, RobinX <[email protected]>; Björn Töpel <[email protected]>
Subject: [PATCH v6 14/17] net/i40e/base: separate kernel allocated Rx bi rings

The title is still misleading

Changed to

" add raw format for 32 bytes Rx description"

Quoted 6 lines

Continuing the path to support MEM_TYPE_XSK_BUFF_POOL, the AF_XDP zero-copy/sk_buff rx_bi rings are now separate. Functions to properly allocate the different rings are added as well.

The purpose of this commit is sync with latest share code.

Changed to

"Add raw format for i40e_32byte_rx_desc, right now this only be used by kernel driver, the commit is just to sync with kernel driver"

Quoted 33 lines
---
 drivers/net/i40e/base/i40e_type.h | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/net/i40e/base/i40e_type.h +4 -2
index 49e05d89fa..813c1ec00f 100644
@@ -817,7 +817,7 @@ union i40e_32byte_rx_desc {
 		__le64  rsvd2;
 	} read;
 	struct {
-		struct {
+		struct i40e_32b_rx_wb_qw0 {
 			struct {
 				union {
 					__le16 mirroring_status;
@@ -855,6 +855,9 @@ union i40e_32byte_rx_desc {
 			} hi_dword;
 		} qword3;
 	} wb;  /* writeback */
+	struct {
+		u64 qword[4];
+	} raw;
 };
 
 #define I40E_RXD_QW0_MIRROR_STATUS_SHIFT	8
--

2.25.1

#118 lore raw

PATCH v6 15/17 net/i40e/base: update FVL FW API version to 1.15

In reply to Robin Zhang

Update FVL FW API version to 1.15

---
 drivers/net/i40e/base/i40e_adminq_cmd.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/i40e/base/i40e_adminq_cmd.h +1 -1
index d2615705a9..def307b59d 100644
@@ -13,7 +13,7 @@
 
 #define I40E_FW_API_VERSION_MAJOR	0x0001
 #define I40E_FW_API_VERSION_MINOR_X722	0x000C
-#define I40E_FW_API_VERSION_MINOR_X710	0x000C
+#define I40E_FW_API_VERSION_MINOR_X710	0x000F
 
 #define I40E_FW_MINOR_VERSION(_h) ((_h)->mac.type == I40E_MAC_XL710 ? \
 					I40E_FW_API_VERSION_MINOR_X710 : \
Signature · 1 line
2.25.1
#119 lore raw

PATCH v6 16/17 net/i40e/base: add defines related to DDP

In reply to Robin Zhang

This patch adds some defines related to DDP Track ID.

---
 drivers/net/i40e/base/i40e_type.h | 2 ++
 1 file changed, 2 insertions(+)
drivers/net/i40e/base/i40e_type.h +2 -0
index 813c1ec00f..f4a3d66759 100644
@@ -1988,6 +1988,8 @@ struct i40e_metadata_segment {
 	struct i40e_ddp_version version;
 #define I40E_DDP_TRACKID_RDONLY		0
 #define I40E_DDP_TRACKID_INVALID	0xFFFFFFFF
+#define I40E_DDP_TRACKID_GRP_MSK	0x00FF0000
+#define I40E_DDP_TRACKID_GRP_COMP_ALL	0xFF
 	u32 track_id;
 	char name[I40E_DDP_NAME_SIZE];
 };
Signature · 1 line
2.25.1
#120 lore raw

PATCH v6 17/17 net/i40e/base: update version in readme

In reply to Robin Zhang

Update base code version in README.

---
 drivers/net/i40e/base/README | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/i40e/base/README +1 -1
index 6af2993116..2e4fa5a921 100644
@@ -6,7 +6,7 @@ Intel® I40E driver
 ==================
 
 This directory contains source code of FreeBSD i40e driver of version
-cid-i40e.2020.08.27.tar.gz released by the team which develops
+cid-i40e.2021.08.16.tar.gz released by the team which develops
 basic drivers for any i40e NIC. The directory of base/ contains the
 original source package.
 This driver is valid for the product(s) listed below
Signature · 1 line
2.25.1
Applied
#121 lore raw
In reply to Robin Zhang
Quoted 75 lines

-----Original Message-----
From: Zhang, RobinX <[email protected]>
Sent: Saturday, October 9, 2021 9:40 AM
To: [email protected]
Cc: Xing, Beilei <[email protected]>; Zhang, Qi Z <[email protected]>; Zhang, Helin <[email protected]>; Wu, Jingjing <[email protected]>; [email protected]; [email protected]; [email protected]; Liang, Cunming <[email protected]>; Lu, Wenzhuo <[email protected]>; Guo, Junfeng <[email protected]>; Yang, SteveX <[email protected]>; Zhang, RobinX <[email protected]>
Subject: [PATCH v6 00/17] i40e base code update

update i40e base code.

source code of i40e driver:
cid-i40e.2021.08.16.tar.gz

changelog in i40e share repo:
From 59a080f4fafe ("i40e-shared: Add opcode 0x0406 and 0x0416 to Linux support") To 2c7aab559654 ("i40e-shared: Add defines related to DDP")

The following commits are ignored:
cb9139e3bce8 ("i40e-shared: Fix not blinking X722 with x557 PHY via ‘ethtool -p'")
c09d4f9cf390 ("i40e-shared: i40e-shared: Fix build warning -Wformat related to integer size")
ff8a1abc6c17 ("i40e-shared: Fix build warning with __packed") 59a080f4fafe ("i40e-shared: Add opcode 0x0406 and 0x0416 to Linux
support")

v6:
- fix some typos
v5:
- refine commit messages
v4:
- update base code to cid-i40e.2021.08.16
v3:
- there has a fix patch contains two issues, split it into two patches v2:
- refine commit messages and macro name

Robin Zhang (17):
net/i40e/base: add v2 version of send ASQ command functions net/i40e/base: add Min SRev for 4 more X722 modules net/i40e/base: set TSA table values when parsing CEE config net/i40e/base: define new shadow RAM pointers net/i40e/base: fix PHY identifiers for 2.5G and 5G adapters net/i40e/base: fix PF reset
net/i40e/base: fix update link data for X722 net/i40e/base: fix AOC media type
net/i40e/base: add flags and fields for double VLAN net/i40e/base: fix headers to match functions net/i40e/base: fix potentially uninitialized variables net/i40e/base: fix checksum is used incorrectly net/i40e/base: add calculation of MAC frequency if no link net/i40e/base: separate kernel allocated Rx bi rings net/i40e/base: update FVL FW API version to 1.15 net/i40e/base: add defines related to DDP net/i40e/base: update version in readme

 drivers/net/i40e/base/README            |   2 +-
 drivers/net/i40e/base/i40e_adminq.c     |  79 +++++++++--
 drivers/net/i40e/base/i40e_adminq_cmd.h |  55 ++++++--
 drivers/net/i40e/base/i40e_common.c     | 175 +++++++++++++++++++-----
 drivers/net/i40e/base/i40e_dcb.c        |  10 +-
 drivers/net/i40e/base/i40e_lan_hmc.c    |   2 +-
 drivers/net/i40e/base/i40e_nvm.c        |   7 +-
 drivers/net/i40e/base/i40e_prototype.h  |  17 +++
 drivers/net/i40e/base/i40e_register.h   |  10 ++
 drivers/net/i40e/base/i40e_type.h       |  26 +++-
 drivers/net/i40e/i40e_ethdev.c          |   3 +-
 11 files changed, 318 insertions(+), 68 deletions(-)
Quoted 2 lines

--
2.25.1

Applied to dpdk-next-net-intel.

Commit log are refined base on the previous suggestion.

Thanks
Qi