All of lore.kernel.org
 help / color / mirror / Atom feed
* [Intel-wired-lan] [next PATCH S8 01/12] i40e: fix shifts of signed values
@ 2019-07-23 10:01 Alice Michael
  2019-07-23 10:01 ` [Intel-wired-lan] [next PATCH S8 02/12] i40e: Add drop mode parameter to set mac config Alice Michael
                   ` (11 more replies)
  0 siblings, 12 replies; 28+ messages in thread
From: Alice Michael @ 2019-07-23 10:01 UTC (permalink / raw)
  To: intel-wired-lan

From: Beilei Xing <beilei.xing@intel.com>

This patch fixes following error reported by cppcheck:
(error) Shifting signed 32-bit value by 31 bits is undefined behaviour

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
---
 .../net/ethernet/intel/i40e/i40e_register.h   | 24 +++++++++----------
 1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/drivers/net/ethernet/intel/i40e/i40e_register.h b/drivers/net/ethernet/intel/i40e/i40e_register.h
index 52e3680c57f8..330ac19a5dae 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_register.h
+++ b/drivers/net/ethernet/intel/i40e/i40e_register.h
@@ -58,7 +58,7 @@
 #define I40E_PF_ARQLEN_ARQCRIT_SHIFT 30
 #define I40E_PF_ARQLEN_ARQCRIT_MASK I40E_MASK(0x1, I40E_PF_ARQLEN_ARQCRIT_SHIFT)
 #define I40E_PF_ARQLEN_ARQENABLE_SHIFT 31
-#define I40E_PF_ARQLEN_ARQENABLE_MASK I40E_MASK(0x1, I40E_PF_ARQLEN_ARQENABLE_SHIFT)
+#define I40E_PF_ARQLEN_ARQENABLE_MASK I40E_MASK(0x1u, I40E_PF_ARQLEN_ARQENABLE_SHIFT)
 #define I40E_PF_ARQT 0x00080480 /* Reset: EMPR */
 #define I40E_PF_ARQT_ARQT_SHIFT 0
 #define I40E_PF_ARQT_ARQT_MASK I40E_MASK(0x3FF, I40E_PF_ARQT_ARQT_SHIFT)
@@ -81,7 +81,7 @@
 #define I40E_PF_ATQLEN_ATQCRIT_SHIFT 30
 #define I40E_PF_ATQLEN_ATQCRIT_MASK I40E_MASK(0x1, I40E_PF_ATQLEN_ATQCRIT_SHIFT)
 #define I40E_PF_ATQLEN_ATQENABLE_SHIFT 31
-#define I40E_PF_ATQLEN_ATQENABLE_MASK I40E_MASK(0x1, I40E_PF_ATQLEN_ATQENABLE_SHIFT)
+#define I40E_PF_ATQLEN_ATQENABLE_MASK I40E_MASK(0x1u, I40E_PF_ATQLEN_ATQENABLE_SHIFT)
 #define I40E_PF_ATQT 0x00080400 /* Reset: EMPR */
 #define I40E_PF_ATQT_ATQT_SHIFT 0
 #define I40E_PF_ATQT_ATQT_MASK I40E_MASK(0x3FF, I40E_PF_ATQT_ATQT_SHIFT)
@@ -108,7 +108,7 @@
 #define I40E_VF_ARQLEN_ARQCRIT_SHIFT 30
 #define I40E_VF_ARQLEN_ARQCRIT_MASK I40E_MASK(0x1, I40E_VF_ARQLEN_ARQCRIT_SHIFT)
 #define I40E_VF_ARQLEN_ARQENABLE_SHIFT 31
-#define I40E_VF_ARQLEN_ARQENABLE_MASK I40E_MASK(0x1, I40E_VF_ARQLEN_ARQENABLE_SHIFT)
+#define I40E_VF_ARQLEN_ARQENABLE_MASK I40E_MASK(0x1u, I40E_VF_ARQLEN_ARQENABLE_SHIFT)
 #define I40E_VF_ARQT(_VF) (0x00082C00 + ((_VF) * 4)) /* _i=0...127 */ /* Reset: EMPR */
 #define I40E_VF_ARQT_MAX_INDEX 127
 #define I40E_VF_ARQT_ARQT_SHIFT 0
@@ -136,7 +136,7 @@
 #define I40E_VF_ATQLEN_ATQCRIT_SHIFT 30
 #define I40E_VF_ATQLEN_ATQCRIT_MASK I40E_MASK(0x1, I40E_VF_ATQLEN_ATQCRIT_SHIFT)
 #define I40E_VF_ATQLEN_ATQENABLE_SHIFT 31
-#define I40E_VF_ATQLEN_ATQENABLE_MASK I40E_MASK(0x1, I40E_VF_ATQLEN_ATQENABLE_SHIFT)
+#define I40E_VF_ATQLEN_ATQENABLE_MASK I40E_MASK(0x1u, I40E_VF_ATQLEN_ATQENABLE_SHIFT)
 #define I40E_VF_ATQT(_VF) (0x00082800 + ((_VF) * 4)) /* _i=0...127 */ /* Reset: EMPR */
 #define I40E_VF_ATQT_MAX_INDEX 127
 #define I40E_VF_ATQT_ATQT_SHIFT 0
@@ -259,7 +259,7 @@
 #define I40E_PRTDCB_RETSTCC_UPINTC_MODE_SHIFT 30
 #define I40E_PRTDCB_RETSTCC_UPINTC_MODE_MASK I40E_MASK(0x1, I40E_PRTDCB_RETSTCC_UPINTC_MODE_SHIFT)
 #define I40E_PRTDCB_RETSTCC_ETSTC_SHIFT 31
-#define I40E_PRTDCB_RETSTCC_ETSTC_MASK I40E_MASK(0x1, I40E_PRTDCB_RETSTCC_ETSTC_SHIFT)
+#define I40E_PRTDCB_RETSTCC_ETSTC_MASK I40E_MASK(0x1u, I40E_PRTDCB_RETSTCC_ETSTC_SHIFT)
 #define I40E_PRTDCB_RPPMC 0x001223A0 /* Reset: CORER */
 #define I40E_PRTDCB_RPPMC_LANRPPM_SHIFT 0
 #define I40E_PRTDCB_RPPMC_LANRPPM_MASK I40E_MASK(0xFF, I40E_PRTDCB_RPPMC_LANRPPM_SHIFT)
@@ -503,7 +503,7 @@
 #define I40E_GLGEN_MSCA_MDICMD_SHIFT 30
 #define I40E_GLGEN_MSCA_MDICMD_MASK I40E_MASK(0x1, I40E_GLGEN_MSCA_MDICMD_SHIFT)
 #define I40E_GLGEN_MSCA_MDIINPROGEN_SHIFT 31
-#define I40E_GLGEN_MSCA_MDIINPROGEN_MASK I40E_MASK(0x1, I40E_GLGEN_MSCA_MDIINPROGEN_SHIFT)
+#define I40E_GLGEN_MSCA_MDIINPROGEN_MASK I40E_MASK(0x1u, I40E_GLGEN_MSCA_MDIINPROGEN_SHIFT)
 #define I40E_GLGEN_MSRWD(_i) (0x0008819C + ((_i) * 4)) /* _i=0...3 */ /* Reset: POR */
 #define I40E_GLGEN_MSRWD_MAX_INDEX 3
 #define I40E_GLGEN_MSRWD_MDIWRDATA_SHIFT 0
@@ -1242,14 +1242,14 @@
 #define I40E_GLLAN_TXPRE_QDIS_SET_QDIS_SHIFT 30
 #define I40E_GLLAN_TXPRE_QDIS_SET_QDIS_MASK I40E_MASK(0x1, I40E_GLLAN_TXPRE_QDIS_SET_QDIS_SHIFT)
 #define I40E_GLLAN_TXPRE_QDIS_CLEAR_QDIS_SHIFT 31
-#define I40E_GLLAN_TXPRE_QDIS_CLEAR_QDIS_MASK I40E_MASK(0x1, I40E_GLLAN_TXPRE_QDIS_CLEAR_QDIS_SHIFT)
+#define I40E_GLLAN_TXPRE_QDIS_CLEAR_QDIS_MASK I40E_MASK(0x1u, I40E_GLLAN_TXPRE_QDIS_CLEAR_QDIS_SHIFT)
 #define I40E_PFLAN_QALLOC 0x001C0400 /* Reset: CORER */
 #define I40E_PFLAN_QALLOC_FIRSTQ_SHIFT 0
 #define I40E_PFLAN_QALLOC_FIRSTQ_MASK I40E_MASK(0x7FF, I40E_PFLAN_QALLOC_FIRSTQ_SHIFT)
 #define I40E_PFLAN_QALLOC_LASTQ_SHIFT 16
 #define I40E_PFLAN_QALLOC_LASTQ_MASK I40E_MASK(0x7FF, I40E_PFLAN_QALLOC_LASTQ_SHIFT)
 #define I40E_PFLAN_QALLOC_VALID_SHIFT 31
-#define I40E_PFLAN_QALLOC_VALID_MASK I40E_MASK(0x1, I40E_PFLAN_QALLOC_VALID_SHIFT)
+#define I40E_PFLAN_QALLOC_VALID_MASK I40E_MASK(0x1u, I40E_PFLAN_QALLOC_VALID_SHIFT)
 #define I40E_QRX_ENA(_Q) (0x00120000 + ((_Q) * 4)) /* _i=0...1535 */ /* Reset: PFR */
 #define I40E_QRX_ENA_MAX_INDEX 1535
 #define I40E_QRX_ENA_QENA_REQ_SHIFT 0
@@ -1658,7 +1658,7 @@
 #define I40E_GLNVM_SRCTL_START_SHIFT 30
 #define I40E_GLNVM_SRCTL_START_MASK I40E_MASK(0x1, I40E_GLNVM_SRCTL_START_SHIFT)
 #define I40E_GLNVM_SRCTL_DONE_SHIFT 31
-#define I40E_GLNVM_SRCTL_DONE_MASK I40E_MASK(0x1, I40E_GLNVM_SRCTL_DONE_SHIFT)
+#define I40E_GLNVM_SRCTL_DONE_MASK I40E_MASK(0x1u, I40E_GLNVM_SRCTL_DONE_SHIFT)
 #define I40E_GLNVM_SRDATA 0x000B6114 /* Reset: POR */
 #define I40E_GLNVM_SRDATA_WRDATA_SHIFT 0
 #define I40E_GLNVM_SRDATA_WRDATA_MASK I40E_MASK(0xFFFF, I40E_GLNVM_SRDATA_WRDATA_SHIFT)
@@ -3025,7 +3025,7 @@
 #define I40E_PF_VT_PFALLOC_LASTVF_SHIFT 8
 #define I40E_PF_VT_PFALLOC_LASTVF_MASK I40E_MASK(0xFF, I40E_PF_VT_PFALLOC_LASTVF_SHIFT)
 #define I40E_PF_VT_PFALLOC_VALID_SHIFT 31
-#define I40E_PF_VT_PFALLOC_VALID_MASK I40E_MASK(0x1, I40E_PF_VT_PFALLOC_VALID_SHIFT)
+#define I40E_PF_VT_PFALLOC_VALID_MASK I40E_MASK(0x1u, I40E_PF_VT_PFALLOC_VALID_SHIFT)
 #define I40E_VP_MDET_RX(_VF) (0x0012A000 + ((_VF) * 4)) /* _i=0...127 */ /* Reset: CORER */
 #define I40E_VP_MDET_RX_MAX_INDEX 127
 #define I40E_VP_MDET_RX_VALID_SHIFT 0
@@ -3161,7 +3161,7 @@
 #define I40E_VF_ARQLEN1_ARQCRIT_SHIFT 30
 #define I40E_VF_ARQLEN1_ARQCRIT_MASK I40E_MASK(0x1, I40E_VF_ARQLEN1_ARQCRIT_SHIFT)
 #define I40E_VF_ARQLEN1_ARQENABLE_SHIFT 31
-#define I40E_VF_ARQLEN1_ARQENABLE_MASK I40E_MASK(0x1, I40E_VF_ARQLEN1_ARQENABLE_SHIFT)
+#define I40E_VF_ARQLEN1_ARQENABLE_MASK I40E_MASK(0x1u, I40E_VF_ARQLEN1_ARQENABLE_SHIFT)
 #define I40E_VF_ARQT1 0x00007000 /* Reset: EMPR */
 #define I40E_VF_ARQT1_ARQT_SHIFT 0
 #define I40E_VF_ARQT1_ARQT_MASK I40E_MASK(0x3FF, I40E_VF_ARQT1_ARQT_SHIFT)
@@ -3184,7 +3184,7 @@
 #define I40E_VF_ATQLEN1_ATQCRIT_SHIFT 30
 #define I40E_VF_ATQLEN1_ATQCRIT_MASK I40E_MASK(0x1, I40E_VF_ATQLEN1_ATQCRIT_SHIFT)
 #define I40E_VF_ATQLEN1_ATQENABLE_SHIFT 31
-#define I40E_VF_ATQLEN1_ATQENABLE_MASK I40E_MASK(0x1, I40E_VF_ATQLEN1_ATQENABLE_SHIFT)
+#define I40E_VF_ATQLEN1_ATQENABLE_MASK I40E_MASK(0x1u, I40E_VF_ATQLEN1_ATQENABLE_SHIFT)
 #define I40E_VF_ATQT1 0x00008400 /* Reset: EMPR */
 #define I40E_VF_ATQT1_ATQT_SHIFT 0
 #define I40E_VF_ATQT1_ATQT_MASK I40E_MASK(0x3FF, I40E_VF_ATQT1_ATQT_SHIFT)
-- 
2.21.0


^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [Intel-wired-lan] [next PATCH S8 02/12] i40e: Add drop mode parameter to set mac config
  2019-07-23 10:01 [Intel-wired-lan] [next PATCH S8 01/12] i40e: fix shifts of signed values Alice Michael
@ 2019-07-23 10:01 ` Alice Michael
  2019-07-26 21:44   ` Bowers, AndrewX
  2019-07-23 10:01 ` [Intel-wired-lan] [next PATCH S8 03/12] i40e: check_recovery_mode had wrong if statement Alice Michael
                   ` (10 subsequent siblings)
  11 siblings, 1 reply; 28+ messages in thread
From: Alice Michael @ 2019-07-23 10:01 UTC (permalink / raw)
  To: intel-wired-lan

From: Sylwia Wnuczko <sylwia.wnuczko@intel.com>

This patch adds "drop mode" parameter to set mac config AQ command.
This bit controls the behavior when a no-drop packet is blocking a TC
queue.
0 ? The PF driver is notified.
1 ? The blocking packet is dropped and then the PF driver is notified.

Signed-off-by: Sylwia Wnuczko <sylwia.wnuczko@intel.com>
---
 drivers/net/ethernet/intel/i40e/i40e_adminq.c |  4 ++-
 .../net/ethernet/intel/i40e/i40e_adminq_cmd.h | 29 ++++++++++---------
 drivers/net/ethernet/intel/i40e/i40e_type.h   |  1 +
 3 files changed, 19 insertions(+), 15 deletions(-)

diff --git a/drivers/net/ethernet/intel/i40e/i40e_adminq.c b/drivers/net/ethernet/intel/i40e/i40e_adminq.c
index 814acbe79ffd..72c04881d290 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_adminq.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_adminq.c
@@ -610,8 +610,10 @@ i40e_status i40e_init_adminq(struct i40e_hw *hw)
 
 	if (hw->aq.api_maj_ver > 1 ||
 	    (hw->aq.api_maj_ver == 1 &&
-	     hw->aq.api_min_ver >= 8))
+	     hw->aq.api_min_ver >= 8)) {
 		hw->flags |= I40E_HW_FLAG_FW_LLDP_PERSISTENT;
+		hw->flags |= I40E_HW_FLAG_DROP_MODE;
+	}
 
 	if (hw->aq.api_maj_ver > I40E_FW_API_VERSION_MAJOR) {
 		ret_code = I40E_ERR_FIRMWARE_API_VERSION;
diff --git a/drivers/net/ethernet/intel/i40e/i40e_adminq_cmd.h b/drivers/net/ethernet/intel/i40e/i40e_adminq_cmd.h
index 6536023fa074..4d966d80305f 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_adminq_cmd.h
+++ b/drivers/net/ethernet/intel/i40e/i40e_adminq_cmd.h
@@ -2051,20 +2051,21 @@ I40E_CHECK_CMD_LENGTH(i40e_aq_set_phy_config);
 struct i40e_aq_set_mac_config {
 	__le16	max_frame_size;
 	u8	params;
-#define I40E_AQ_SET_MAC_CONFIG_CRC_EN		0x04
-#define I40E_AQ_SET_MAC_CONFIG_PACING_MASK	0x78
-#define I40E_AQ_SET_MAC_CONFIG_PACING_SHIFT	3
-#define I40E_AQ_SET_MAC_CONFIG_PACING_NONE	0x0
-#define I40E_AQ_SET_MAC_CONFIG_PACING_1B_13TX	0xF
-#define I40E_AQ_SET_MAC_CONFIG_PACING_1DW_9TX	0x9
-#define I40E_AQ_SET_MAC_CONFIG_PACING_1DW_4TX	0x8
-#define I40E_AQ_SET_MAC_CONFIG_PACING_3DW_7TX	0x7
-#define I40E_AQ_SET_MAC_CONFIG_PACING_2DW_3TX	0x6
-#define I40E_AQ_SET_MAC_CONFIG_PACING_1DW_1TX	0x5
-#define I40E_AQ_SET_MAC_CONFIG_PACING_3DW_2TX	0x4
-#define I40E_AQ_SET_MAC_CONFIG_PACING_7DW_3TX	0x3
-#define I40E_AQ_SET_MAC_CONFIG_PACING_4DW_1TX	0x2
-#define I40E_AQ_SET_MAC_CONFIG_PACING_9DW_1TX	0x1
+#define I40E_AQ_SET_MAC_CONFIG_CRC_EN			0x04
+#define I40E_AQ_SET_MAC_CONFIG_PACING_MASK		0x78
+#define I40E_AQ_SET_MAC_CONFIG_PACING_SHIFT		3
+#define I40E_AQ_SET_MAC_CONFIG_PACING_NONE		0x0
+#define I40E_AQ_SET_MAC_CONFIG_PACING_1B_13TX		0xF
+#define I40E_AQ_SET_MAC_CONFIG_PACING_1DW_9TX		0x9
+#define I40E_AQ_SET_MAC_CONFIG_PACING_1DW_4TX		0x8
+#define I40E_AQ_SET_MAC_CONFIG_PACING_3DW_7TX		0x7
+#define I40E_AQ_SET_MAC_CONFIG_PACING_2DW_3TX		0x6
+#define I40E_AQ_SET_MAC_CONFIG_PACING_1DW_1TX		0x5
+#define I40E_AQ_SET_MAC_CONFIG_PACING_3DW_2TX		0x4
+#define I40E_AQ_SET_MAC_CONFIG_PACING_7DW_3TX		0x3
+#define I40E_AQ_SET_MAC_CONFIG_PACING_4DW_1TX		0x2
+#define I40E_AQ_SET_MAC_CONFIG_PACING_9DW_1TX		0x1
+#define I40E_AQ_SET_MAC_CONFIG_DROP_BLOCKING_PACKET_EN	0x80
 	u8	tx_timer_priority; /* bitmap */
 	__le16	tx_timer_value;
 	__le16	fc_refresh_threshold;
diff --git a/drivers/net/ethernet/intel/i40e/i40e_type.h b/drivers/net/ethernet/intel/i40e/i40e_type.h
index 2a6219d66771..06e2499de363 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_type.h
+++ b/drivers/net/ethernet/intel/i40e/i40e_type.h
@@ -624,6 +624,7 @@ struct i40e_hw {
 #define I40E_HW_FLAG_NVM_READ_REQUIRES_LOCK BIT_ULL(3)
 #define I40E_HW_FLAG_FW_LLDP_STOPPABLE      BIT_ULL(4)
 #define I40E_HW_FLAG_FW_LLDP_PERSISTENT     BIT_ULL(5)
+#define I40E_HW_FLAG_DROP_MODE		    BIT_ULL(7)
 	u64 flags;
 
 	/* Used in set switch config AQ command */
-- 
2.21.0


^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [Intel-wired-lan] [next PATCH S8 03/12] i40e: check_recovery_mode had wrong if statement
  2019-07-23 10:01 [Intel-wired-lan] [next PATCH S8 01/12] i40e: fix shifts of signed values Alice Michael
  2019-07-23 10:01 ` [Intel-wired-lan] [next PATCH S8 02/12] i40e: Add drop mode parameter to set mac config Alice Michael
@ 2019-07-23 10:01 ` Alice Michael
  2019-07-26 21:45   ` Bowers, AndrewX
  2019-07-23 10:01 ` [Intel-wired-lan] [next PATCH S8 04/12] i40e: Update FVL FW API version to 1.9 Alice Michael
                   ` (9 subsequent siblings)
  11 siblings, 1 reply; 28+ messages in thread
From: Alice Michael @ 2019-07-23 10:01 UTC (permalink / raw)
  To: intel-wired-lan

From: Adrian Podlawski <adrian.podlawski@intel.com>

Function check_recovery_mode had wrong if statement.
Now we check proper FWS1B register values, which are responsible for
the recovery mode. Recovery mode has 4 values for FVL and 2 for FPK.
That's why we need 6 different flags which are defined in shared code.
Now in if statement we recognize type of mac address
and register value.
Without those changes driver could show wrong state.

Signed-off-by: Adrian Podlawski <adrian.podlawski@intel.com>
---
 drivers/net/ethernet/intel/i40e/i40e_main.c     | 17 ++++++++++++++---
 drivers/net/ethernet/intel/i40e/i40e_register.h |  6 ++++++
 2 files changed, 20 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c
index b807dd6b1417..4551d97771c9 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_main.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
@@ -14578,9 +14578,20 @@ void i40e_set_fec_in_flags(u8 fec_cfg, u32 *flags)
  **/
 static bool i40e_check_recovery_mode(struct i40e_pf *pf)
 {
-	u32 val = rd32(&pf->hw, I40E_GL_FWSTS);
-
-	if (val & I40E_GL_FWSTS_FWS1B_MASK) {
+	u32 val = rd32(&pf->hw, I40E_GL_FWSTS) & I40E_GL_FWSTS_FWS1B_MASK;
+	bool is_recovery_mode = false;
+
+	if (pf->hw.mac.type == I40E_MAC_XL710)
+		is_recovery_mode =
+		val == I40E_XL710_GL_FWSTS_FWS1B_REC_MOD_CORER_MASK ||
+		val == I40E_XL710_GL_FWSTS_FWS1B_REC_MOD_GLOBR_MASK ||
+		val == I40E_XL710_GL_FWSTS_FWS1B_REC_MOD_TRANSITION_MASK ||
+		val == I40E_XL710_GL_FWSTS_FWS1B_REC_MOD_NVM_MASK;
+	if (pf->hw.mac.type == I40E_MAC_X722)
+		is_recovery_mode =
+		val == I40E_X722_GL_FWSTS_FWS1B_REC_MOD_CORER_MASK ||
+		val == I40E_X722_GL_FWSTS_FWS1B_REC_MOD_GLOBR_MASK;
+	if (is_recovery_mode) {
 		dev_notice(&pf->pdev->dev, "Firmware recovery mode detected. Limiting functionality.\n");
 		dev_notice(&pf->pdev->dev, "Refer to the Intel(R) Ethernet Adapters and Devices User Guide for details on firmware recovery mode.\n");
 		set_bit(__I40E_RECOVERY_MODE, pf->state);
diff --git a/drivers/net/ethernet/intel/i40e/i40e_register.h b/drivers/net/ethernet/intel/i40e/i40e_register.h
index 330ac19a5dae..d35d690ca10f 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_register.h
+++ b/drivers/net/ethernet/intel/i40e/i40e_register.h
@@ -363,6 +363,12 @@
 #define I40E_GL_FWSTS_FWRI_MASK I40E_MASK(0x1, I40E_GL_FWSTS_FWRI_SHIFT)
 #define I40E_GL_FWSTS_FWS1B_SHIFT 16
 #define I40E_GL_FWSTS_FWS1B_MASK I40E_MASK(0xFF, I40E_GL_FWSTS_FWS1B_SHIFT)
+#define I40E_XL710_GL_FWSTS_FWS1B_REC_MOD_CORER_MASK I40E_MASK(0x30, I40E_GL_FWSTS_FWS1B_SHIFT)
+#define I40E_XL710_GL_FWSTS_FWS1B_REC_MOD_GLOBR_MASK I40E_MASK(0x31, I40E_GL_FWSTS_FWS1B_SHIFT)
+#define I40E_XL710_GL_FWSTS_FWS1B_REC_MOD_TRANSITION_MASK I40E_MASK(0x32, I40E_GL_FWSTS_FWS1B_SHIFT)
+#define I40E_XL710_GL_FWSTS_FWS1B_REC_MOD_NVM_MASK I40E_MASK(0x33, I40E_GL_FWSTS_FWS1B_SHIFT)
+#define I40E_X722_GL_FWSTS_FWS1B_REC_MOD_CORER_MASK I40E_MASK(0xB, I40E_GL_FWSTS_FWS1B_SHIFT)
+#define I40E_X722_GL_FWSTS_FWS1B_REC_MOD_GLOBR_MASK I40E_MASK(0xC, I40E_GL_FWSTS_FWS1B_SHIFT)
 #define I40E_GLGEN_CLKSTAT 0x000B8184 /* Reset: POR */
 #define I40E_GLGEN_CLKSTAT_CLKMODE_SHIFT 0
 #define I40E_GLGEN_CLKSTAT_CLKMODE_MASK I40E_MASK(0x1, I40E_GLGEN_CLKSTAT_CLKMODE_SHIFT)
-- 
2.21.0


^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [Intel-wired-lan] [next PATCH S8 04/12] i40e: Update FVL FW API version to 1.9
  2019-07-23 10:01 [Intel-wired-lan] [next PATCH S8 01/12] i40e: fix shifts of signed values Alice Michael
  2019-07-23 10:01 ` [Intel-wired-lan] [next PATCH S8 02/12] i40e: Add drop mode parameter to set mac config Alice Michael
  2019-07-23 10:01 ` [Intel-wired-lan] [next PATCH S8 03/12] i40e: check_recovery_mode had wrong if statement Alice Michael
@ 2019-07-23 10:01 ` Alice Michael
  2019-07-26 21:45   ` Bowers, AndrewX
  2019-07-23 10:01 ` [Intel-wired-lan] [next PATCH S8 05/12] i40e: reset veb.tc_stats when resetting veb.stats Alice Michael
                   ` (8 subsequent siblings)
  11 siblings, 1 reply; 28+ messages in thread
From: Alice Michael @ 2019-07-23 10:01 UTC (permalink / raw)
  To: intel-wired-lan

From: Piotr Azarewicz <piotr.azarewicz@intel.com>

Upcoming FVL FW increment API version to 1.9 due to Extend PHY access AQ
command support. SW is ready for that support as well.

Signed-off-by: Piotr Azarewicz <piotr.azarewicz@intel.com>
---
 drivers/net/ethernet/intel/i40e/i40e_adminq_cmd.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/intel/i40e/i40e_adminq_cmd.h b/drivers/net/ethernet/intel/i40e/i40e_adminq_cmd.h
index 4d966d80305f..360f0cb83b2d 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_adminq_cmd.h
+++ b/drivers/net/ethernet/intel/i40e/i40e_adminq_cmd.h
@@ -12,7 +12,7 @@
 
 #define I40E_FW_API_VERSION_MAJOR	0x0001
 #define I40E_FW_API_VERSION_MINOR_X722	0x0008
-#define I40E_FW_API_VERSION_MINOR_X710	0x0008
+#define I40E_FW_API_VERSION_MINOR_X710	0x0009
 
 #define I40E_FW_MINOR_VERSION(_h) ((_h)->mac.type == I40E_MAC_XL710 ? \
 					I40E_FW_API_VERSION_MINOR_X710 : \
-- 
2.21.0


^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [Intel-wired-lan] [next PATCH S8 05/12] i40e: reset veb.tc_stats when resetting veb.stats
  2019-07-23 10:01 [Intel-wired-lan] [next PATCH S8 01/12] i40e: fix shifts of signed values Alice Michael
                   ` (2 preceding siblings ...)
  2019-07-23 10:01 ` [Intel-wired-lan] [next PATCH S8 04/12] i40e: Update FVL FW API version to 1.9 Alice Michael
@ 2019-07-23 10:01 ` Alice Michael
  2019-07-26 21:46   ` Bowers, AndrewX
  2019-07-23 10:01 ` [Intel-wired-lan] [next PATCH S8 06/12] i40e: Update FPK FW API version to 1.9 Alice Michael
                   ` (7 subsequent siblings)
  11 siblings, 1 reply; 28+ messages in thread
From: Alice Michael @ 2019-07-23 10:01 UTC (permalink / raw)
  To: intel-wired-lan

From: Jacob Keller <jacob.e.keller@intel.com>

The stats structure for the VEB switch statistics is reset periodically,
but the tc_stats are not reset at the same time.

Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
---
 drivers/net/ethernet/intel/i40e/i40e_main.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c
index 4551d97771c9..5c280c025085 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_main.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
@@ -534,6 +534,10 @@ void i40e_pf_reset_stats(struct i40e_pf *pf)
 			       sizeof(pf->veb[i]->stats));
 			memset(&pf->veb[i]->stats_offsets, 0,
 			       sizeof(pf->veb[i]->stats_offsets));
+			memset(&pf->veb[i]->tc_stats, 0,
+			       sizeof(pf->veb[i]->tc_stats));
+			memset(&pf->veb[i]->tc_stats_offsets, 0,
+			       sizeof(pf->veb[i]->tc_stats_offsets));
 			pf->veb[i]->stat_offsets_loaded = false;
 		}
 	}
-- 
2.21.0


^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [Intel-wired-lan] [next PATCH S8 06/12] i40e: Update FPK FW API version to 1.9
  2019-07-23 10:01 [Intel-wired-lan] [next PATCH S8 01/12] i40e: fix shifts of signed values Alice Michael
                   ` (3 preceding siblings ...)
  2019-07-23 10:01 ` [Intel-wired-lan] [next PATCH S8 05/12] i40e: reset veb.tc_stats when resetting veb.stats Alice Michael
@ 2019-07-23 10:01 ` Alice Michael
  2019-07-26 21:46   ` Bowers, AndrewX
  2019-07-23 10:01 ` [Intel-wired-lan] [next PATCH S8 07/12] i40e: Fix crash caused by stress setting of VF MAC addresses Alice Michael
                   ` (6 subsequent siblings)
  11 siblings, 1 reply; 28+ messages in thread
From: Alice Michael @ 2019-07-23 10:01 UTC (permalink / raw)
  To: intel-wired-lan

From: Piotr Azarewicz <piotr.azarewicz@intel.com>

Upcoming FPK FW increment API version to 1.9, so we must bump up version
number as well.
FPK will support PHY access AQ command as FVL does.

Signed-off-by: Piotr Azarewicz <piotr.azarewicz@intel.com>
---
 drivers/net/ethernet/intel/i40e/i40e_adminq_cmd.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/intel/i40e/i40e_adminq_cmd.h b/drivers/net/ethernet/intel/i40e/i40e_adminq_cmd.h
index 360f0cb83b2d..21cccec328e3 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_adminq_cmd.h
+++ b/drivers/net/ethernet/intel/i40e/i40e_adminq_cmd.h
@@ -11,7 +11,7 @@
  */
 
 #define I40E_FW_API_VERSION_MAJOR	0x0001
-#define I40E_FW_API_VERSION_MINOR_X722	0x0008
+#define I40E_FW_API_VERSION_MINOR_X722	0x0009
 #define I40E_FW_API_VERSION_MINOR_X710	0x0009
 
 #define I40E_FW_MINOR_VERSION(_h) ((_h)->mac.type == I40E_MAC_XL710 ? \
-- 
2.21.0


^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [Intel-wired-lan] [next PATCH S8 07/12] i40e: Fix crash caused by stress setting of VF MAC addresses
  2019-07-23 10:01 [Intel-wired-lan] [next PATCH S8 01/12] i40e: fix shifts of signed values Alice Michael
                   ` (4 preceding siblings ...)
  2019-07-23 10:01 ` [Intel-wired-lan] [next PATCH S8 06/12] i40e: Update FPK FW API version to 1.9 Alice Michael
@ 2019-07-23 10:01 ` Alice Michael
  2019-07-26 21:47   ` Bowers, AndrewX
  2019-07-23 10:01 ` [Intel-wired-lan] [next PATCH S8 08/12] i40e: Remove function i40e_update_dcb_config() Alice Michael
                   ` (5 subsequent siblings)
  11 siblings, 1 reply; 28+ messages in thread
From: Alice Michael @ 2019-07-23 10:01 UTC (permalink / raw)
  To: intel-wired-lan

From: Slawomir Laba <slawomirx.laba@intel.com>

Add update to the vsi pointer passed to the i40e_set_vf_mac function.
If VF is in reset state the driver waits in i40e_set_vf_mac function
for the reset to be complete, yet after reset the vsi pointer
that was passed into this function is no longer valid.

The patch updates local vsi pointer directly from pf->vsi array,
by using the id stored in vf pointer (lan_vsi_idx).

Without this commit the driver might occasionally invoke general
protection fault in kernel and disable the OS entirely.

Signed-off-by: Slawomir Laba <slawomirx.laba@intel.com>
---
 drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c
index 7bc4e397d56d..eeb37d83efc9 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c
@@ -3970,10 +3970,15 @@ int i40e_ndo_set_vf_mac(struct net_device *netdev, int vf_id, u8 *mac)
 	/* When the VF is resetting wait until it is done.
 	 * It can take up to 200 milliseconds,
 	 * but wait for up to 300 milliseconds to be safe.
+	 * If the VF is indeed in reset, the vsi pointer has
+	 * to show on the newly loaded vsi under pf->vsi[id].
 	 */
 	for (i = 0; i < 15; i++) {
-		if (test_bit(I40E_VF_STATE_INIT, &vf->vf_states))
+		if (test_bit(I40E_VF_STATE_INIT, &vf->vf_states)) {
+			if (i > 0)
+				vsi = pf->vsi[vf->lan_vsi_idx];
 			break;
+		}
 		msleep(20);
 	}
 	if (!test_bit(I40E_VF_STATE_INIT, &vf->vf_states)) {
-- 
2.21.0


^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [Intel-wired-lan] [next PATCH S8 08/12] i40e: Remove function i40e_update_dcb_config()
  2019-07-23 10:01 [Intel-wired-lan] [next PATCH S8 01/12] i40e: fix shifts of signed values Alice Michael
                   ` (5 preceding siblings ...)
  2019-07-23 10:01 ` [Intel-wired-lan] [next PATCH S8 07/12] i40e: Fix crash caused by stress setting of VF MAC addresses Alice Michael
@ 2019-07-23 10:01 ` Alice Michael
  2019-07-26 21:47   ` Bowers, AndrewX
  2019-07-23 10:01 ` [Intel-wired-lan] [next PATCH S8 09/12] i40e: make i40e_set_mac_type() public Alice Michael
                   ` (4 subsequent siblings)
  11 siblings, 1 reply; 28+ messages in thread
From: Alice Michael @ 2019-07-23 10:01 UTC (permalink / raw)
  To: intel-wired-lan

From: Grzegorz Siwik <grzegorz.siwik@intel.com>

This patch removes function i40e_update_dcb_config(). Instead of
i40e_update_dcb_config() we use i40e_init_dcb(), which implements the
correct nvm read.

Signed-off-by: Grzegorz Siwik <grzegorz.siwik@intel.com>
---
 drivers/net/ethernet/intel/i40e/i40e_main.c | 46 +--------------------
 1 file changed, 1 insertion(+), 45 deletions(-)

diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c
index 5c280c025085..8d6b9515b595 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_main.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
@@ -6419,50 +6419,6 @@ static int i40e_resume_port_tx(struct i40e_pf *pf)
 	return ret;
 }
 
-/**
- * i40e_update_dcb_config
- * @hw: pointer to the HW struct
- * @enable_mib_change: enable MIB change event
- *
- * Update DCB configuration from the firmware
- **/
-static enum i40e_status_code
-i40e_update_dcb_config(struct i40e_hw *hw, bool enable_mib_change)
-{
-	struct i40e_lldp_variables lldp_cfg;
-	i40e_status ret;
-
-	if (!hw->func_caps.dcb)
-		return I40E_NOT_SUPPORTED;
-
-	/* Read LLDP NVM area */
-	ret = i40e_read_lldp_cfg(hw, &lldp_cfg);
-	if (ret)
-		return I40E_ERR_NOT_READY;
-
-	/* Get DCBX status */
-	ret = i40e_get_dcbx_status(hw, &hw->dcbx_status);
-	if (ret)
-		return ret;
-
-	/* Check the DCBX Status */
-	if (hw->dcbx_status == I40E_DCBX_STATUS_DONE ||
-	    hw->dcbx_status == I40E_DCBX_STATUS_IN_PROGRESS) {
-		/* Get current DCBX configuration */
-		ret = i40e_get_dcb_config(hw);
-		if (ret)
-			return ret;
-	} else if (hw->dcbx_status == I40E_DCBX_STATUS_DISABLED) {
-		return I40E_ERR_NOT_READY;
-	}
-
-	/* Configure the LLDP MIB change event */
-	if (enable_mib_change)
-		ret = i40e_aq_cfg_lldp_mib_change_event(hw, true, NULL);
-
-	return ret;
-}
-
 /**
  * i40e_init_pf_dcb - Initialize DCB configuration
  * @pf: PF being configured
@@ -6485,7 +6441,7 @@ static int i40e_init_pf_dcb(struct i40e_pf *pf)
 		goto out;
 	}
 
-	err = i40e_update_dcb_config(hw, true);
+	err = i40e_init_dcb(hw, true);
 	if (!err) {
 		/* Device/Function is not DCBX capable */
 		if ((!hw->func_caps.dcb) ||
-- 
2.21.0


^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [Intel-wired-lan] [next PATCH S8 09/12] i40e: make i40e_set_mac_type() public
  2019-07-23 10:01 [Intel-wired-lan] [next PATCH S8 01/12] i40e: fix shifts of signed values Alice Michael
                   ` (6 preceding siblings ...)
  2019-07-23 10:01 ` [Intel-wired-lan] [next PATCH S8 08/12] i40e: Remove function i40e_update_dcb_config() Alice Michael
@ 2019-07-23 10:01 ` Alice Michael
  2019-07-26  6:41   ` Kwapulinski, Piotr
  2019-07-26 21:53   ` Bowers, AndrewX
  2019-07-23 10:01 ` [Intel-wired-lan] [next PATCH S8 10/12] i40e: allow reset in recovery mode Alice Michael
                   ` (3 subsequent siblings)
  11 siblings, 2 replies; 28+ messages in thread
From: Alice Michael @ 2019-07-23 10:01 UTC (permalink / raw)
  To: intel-wired-lan

From: Piotr Kwapulinski <piotr.kwapulinski@intel.com>

Make i40e_set_mac_type() public. i40e driver requires i40e_set_mac_type()
to be public. It is required for recovery mode handling. Without this patch
recovery mode could not be detected in i40e_probe().

Signed-off-by: Piotr Kwapulinski <piotr.kwapulinski@intel.com>
---
 drivers/net/ethernet/intel/i40e/i40e_common.c    | 2 +-
 drivers/net/ethernet/intel/i40e/i40e_prototype.h | 2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/intel/i40e/i40e_common.c b/drivers/net/ethernet/intel/i40e/i40e_common.c
index 7af1b7477140..de996a80013e 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_common.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_common.c
@@ -13,7 +13,7 @@
  * This function sets the mac type of the adapter based on the
  * vendor ID and device ID stored in the hw structure.
  **/
-static i40e_status i40e_set_mac_type(struct i40e_hw *hw)
+i40e_status i40e_set_mac_type(struct i40e_hw *hw)
 {
 	i40e_status status = 0;
 
diff --git a/drivers/net/ethernet/intel/i40e/i40e_prototype.h b/drivers/net/ethernet/intel/i40e/i40e_prototype.h
index eac88bcc6c06..9c810d54df1c 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_prototype.h
+++ b/drivers/net/ethernet/intel/i40e/i40e_prototype.h
@@ -326,6 +326,8 @@ void i40e_nvmupd_check_wait_event(struct i40e_hw *hw, u16 opcode,
 void i40e_nvmupd_clear_wait_state(struct i40e_hw *hw);
 void i40e_set_pci_config_data(struct i40e_hw *hw, u16 link_status);
 
+i40e_status i40e_set_mac_type(struct i40e_hw *hw);
+
 extern struct i40e_rx_ptype_decoded i40e_ptype_lookup[];
 
 static inline struct i40e_rx_ptype_decoded decode_rx_desc_ptype(u8 ptype)
-- 
2.21.0


^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [Intel-wired-lan] [next PATCH S8 10/12] i40e: allow reset in recovery mode
  2019-07-23 10:01 [Intel-wired-lan] [next PATCH S8 01/12] i40e: fix shifts of signed values Alice Michael
                   ` (7 preceding siblings ...)
  2019-07-23 10:01 ` [Intel-wired-lan] [next PATCH S8 09/12] i40e: make i40e_set_mac_type() public Alice Michael
@ 2019-07-23 10:01 ` Alice Michael
  2019-07-26  6:41   ` Kwapulinski, Piotr
  2019-07-26 21:53   ` Bowers, AndrewX
  2019-07-23 10:01 ` [Intel-wired-lan] [next PATCH S8 11/12] i40e: Persistent lldp support Alice Michael
                   ` (2 subsequent siblings)
  11 siblings, 2 replies; 28+ messages in thread
From: Alice Michael @ 2019-07-23 10:01 UTC (permalink / raw)
  To: intel-wired-lan

From: Piotr Kwapulinski <piotr.kwapulinski@intel.com>

Driver waits after issuing a reset. When a reset takes too long a driver
gives up. Implemented by invoking PF reset in a loop. After defined
number of unsuccessful PF reset trials it returns error.
Without this patch PF reset fails when NIC is in recovery mode.

Signed-off-by: Piotr Kwapulinski <piotr.kwapulinski@intel.com>
---
 drivers/net/ethernet/intel/i40e/i40e_main.c | 67 ++++++++++++++++++---
 1 file changed, 60 insertions(+), 7 deletions(-)

diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c
index 8d6b9515b595..fdf43d87e983 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_main.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
@@ -14564,6 +14564,51 @@ static bool i40e_check_recovery_mode(struct i40e_pf *pf)
 	return false;
 }
 
+/**
+ * i40e_pf_loop_reset - perform reset in a loop.
+ * @pf: board private structure
+ *
+ * This function is useful when a NIC is about to enter recovery mode.
+ * When a NIC's internal data structures are corrupted the NIC's
+ * firmware is going to enter recovery mode.
+ * Right after a POR it takes about 7 minutes for firmware to enter
+ * recovery mode. Until that time a NIC is in some kind of intermediate
+ * state. After that time period the NIC almost surely enters
+ * recovery mode. The only way for a driver to detect intermediate
+ * state is to issue a series of pf-resets and check a return value.
+ * If a PF reset returns success then the firmware could be in recovery
+ * mode so the caller of this code needs to check for recovery mode
+ * if this function returns success. There is a little chance that
+ * firmware will hang in intermediate state forever.
+ * Since waiting 7 minutes is quite a lot of time this function waits
+ * 10 seconds and then gives up by returning an error.
+ *
+ * Return 0 on success, negative on failure.
+ **/
+static i40e_status i40e_pf_loop_reset(struct i40e_pf *pf)
+{
+	const unsigned short MAX_CNT = 1000;
+	const unsigned short MSECS = 10;
+	struct i40e_hw *hw = &pf->hw;
+	i40e_status ret;
+	int cnt;
+
+	for (cnt = 0; cnt < MAX_CNT; ++cnt) {
+		ret = i40e_pf_reset(hw);
+		if (!ret)
+			break;
+		msleep(MSECS);
+	}
+
+	if (cnt == MAX_CNT) {
+		dev_info(&pf->pdev->dev, "PF reset failed: %d\n", ret);
+		return ret;
+	}
+
+	pf->pfr_count++;
+	return ret;
+}
+
 /**
  * i40e_init_recovery_mode - initialize subsystems needed in recovery mode
  * @pf: board private structure
@@ -14792,14 +14837,22 @@ static int i40e_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 
 	/* Reset here to make sure all is clean and to define PF 'n' */
 	i40e_clear_hw(hw);
-	if (!i40e_check_recovery_mode(pf)) {
-		err = i40e_pf_reset(hw);
-		if (err) {
-			dev_info(&pdev->dev, "Initial pf_reset failed: %d\n", err);
-			goto err_pf_reset;
-		}
-		pf->pfr_count++;
+
+	err = i40e_set_mac_type(hw);
+	if (err) {
+		dev_warn(&pdev->dev, "unidentified MAC or BLANK NVM: %d\n",
+			 err);
+		goto err_pf_reset;
 	}
+
+	err = i40e_pf_loop_reset(pf);
+	if (err) {
+		dev_info(&pdev->dev, "Initial pf_reset failed: %d\n", err);
+		goto err_pf_reset;
+	}
+
+	i40e_check_recovery_mode(pf);
+
 	hw->aq.num_arq_entries = I40E_AQ_LEN;
 	hw->aq.num_asq_entries = I40E_AQ_LEN;
 	hw->aq.arq_buf_size = I40E_MAX_AQ_BUF_SIZE;
-- 
2.21.0


^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [Intel-wired-lan] [next PATCH S8 11/12] i40e: Persistent lldp support
  2019-07-23 10:01 [Intel-wired-lan] [next PATCH S8 01/12] i40e: fix shifts of signed values Alice Michael
                   ` (8 preceding siblings ...)
  2019-07-23 10:01 ` [Intel-wired-lan] [next PATCH S8 10/12] i40e: allow reset in recovery mode Alice Michael
@ 2019-07-23 10:01 ` Alice Michael
  2019-07-26 21:53   ` Bowers, AndrewX
  2019-07-23 10:01 ` [Intel-wired-lan] [next PATCH S8 12/12] i40e: fix retrying in i40e_aq_get_phy_capabilities Alice Michael
  2019-07-26 21:56 ` [Intel-wired-lan] [next PATCH S8 01/12] i40e: fix shifts of signed values Bowers, AndrewX
  11 siblings, 1 reply; 28+ messages in thread
From: Alice Michael @ 2019-07-23 10:01 UTC (permalink / raw)
  To: intel-wired-lan

From: Sylwia Wnuczko <sylwia.wnuczko@intel.com>

This patch adds a function to read nvm module data and uses it to
read current lldp agent configuration from nvm api version 1.8.

Title: i40e-shared: Persistent lldp support
Change-type: FeatureImplementation

Signed-off-by: Sylwia Wnuczko <sylwia.wnuczko@intel.com>
---
 drivers/net/ethernet/intel/i40e/i40e_dcb.c    |  18 +++-
 drivers/net/ethernet/intel/i40e/i40e_dcb.h    |   2 +
 drivers/net/ethernet/intel/i40e/i40e_nvm.c    | 101 ++++++++++++++++++
 .../net/ethernet/intel/i40e/i40e_prototype.h  |   6 ++
 drivers/net/ethernet/intel/i40e/i40e_type.h   |   1 +
 5 files changed, 127 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/intel/i40e/i40e_dcb.c b/drivers/net/ethernet/intel/i40e/i40e_dcb.c
index 292eeb3def10..200a1cb3b536 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_dcb.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_dcb.c
@@ -877,7 +877,23 @@ i40e_status i40e_init_dcb(struct i40e_hw *hw, bool enable_mib_change)
 		return I40E_NOT_SUPPORTED;
 
 	/* Read LLDP NVM area */
-	ret = i40e_read_lldp_cfg(hw, &lldp_cfg);
+	if (hw->flags & I40E_HW_FLAG_FW_LLDP_PERSISTENT) {
+		u8 offset = 0;
+
+		if (hw->mac.type == I40E_MAC_XL710)
+			offset = I40E_LLDP_CURRENT_STATUS_XL710_OFFSET;
+		else if (hw->mac.type == I40E_MAC_X722)
+			offset = I40E_LLDP_CURRENT_STATUS_X722_OFFSET;
+		else
+			return I40E_NOT_SUPPORTED;
+
+		ret = i40e_read_nvm_module_data(hw,
+						I40E_SR_EMP_SR_SETTINGS_PTR,
+						offset, 1,
+						&lldp_cfg.adminstatus);
+	} else {
+		ret = i40e_read_lldp_cfg(hw, &lldp_cfg);
+	}
 	if (ret)
 		return I40E_ERR_NOT_READY;
 
diff --git a/drivers/net/ethernet/intel/i40e/i40e_dcb.h b/drivers/net/ethernet/intel/i40e/i40e_dcb.h
index ddb48ae7cce4..2a80c5daa376 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_dcb.h
+++ b/drivers/net/ethernet/intel/i40e/i40e_dcb.h
@@ -30,6 +30,8 @@
 #define I40E_CEE_SUBTYPE_APP_PRI	4
 
 #define I40E_CEE_MAX_FEAT_TYPE		3
+#define I40E_LLDP_CURRENT_STATUS_XL710_OFFSET	0x2B
+#define I40E_LLDP_CURRENT_STATUS_X722_OFFSET	0x31
 /* Defines for LLDP TLV header */
 #define I40E_LLDP_TLV_LEN_SHIFT		0
 #define I40E_LLDP_TLV_LEN_MASK		(0x01FF << I40E_LLDP_TLV_LEN_SHIFT)
diff --git a/drivers/net/ethernet/intel/i40e/i40e_nvm.c b/drivers/net/ethernet/intel/i40e/i40e_nvm.c
index a60ab9d48065..28ea53d910ad 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_nvm.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_nvm.c
@@ -321,6 +321,77 @@ i40e_status i40e_read_nvm_word(struct i40e_hw *hw, u16 offset,
 	return ret_code;
 }
 
+/**
+ * i40e_read_nvm_module_data - Reads NVM Buffer to specified memory location
+ * @hw: pointer to the HW structure
+ * @module_ptr: Pointer to module in words with respect to NVM beginning
+ * @offset: offset in words from module start
+ * @words_data_size: Words to read from NVM
+ * @data_ptr: Pointer to memory location where resulting buffer will be stored
+ **/
+i40e_status i40e_read_nvm_module_data(struct i40e_hw *hw,
+						u8 module_ptr, u16 offset,
+						u16 words_data_size,
+						u16 *data_ptr)
+{
+	i40e_status status;
+	u16 ptr_value = 0;
+	u32 flat_offset;
+
+	if (module_ptr != 0) {
+		status = i40e_read_nvm_word(hw, module_ptr, &ptr_value);
+		if (status) {
+			i40e_debug(hw, I40E_DEBUG_ALL,
+				   "Reading nvm word failed.Error code: %d.\n",
+				   status);
+			return I40E_ERR_NVM;
+		}
+	}
+#define I40E_NVM_INVALID_PTR_VAL 0x7FFF
+#define I40E_NVM_INVALID_VAL 0xFFFF
+
+	/* Pointer not initialized */
+	if (ptr_value == I40E_NVM_INVALID_PTR_VAL ||
+	    ptr_value == I40E_NVM_INVALID_VAL)
+		return I40E_ERR_BAD_PTR;
+
+	/* Check whether the module is in SR mapped area or outside */
+	if (ptr_value & I40E_PTR_TYPE) {
+		/* Pointer points outside of the Shared RAM mapped area */
+		ptr_value &= ~I40E_PTR_TYPE;
+
+		/* PtrValue in 4kB units, need to convert to words */
+		ptr_value /= 2;
+		flat_offset = ((u32)ptr_value * 0x1000) + (u32)offset;
+		status = i40e_acquire_nvm(hw, I40E_RESOURCE_READ);
+		if (!status) {
+			status = i40e_aq_read_nvm(hw, 0, 2 * flat_offset,
+						  2 * words_data_size,
+						  data_ptr, true, NULL);
+			i40e_release_nvm(hw);
+			if (status) {
+				i40e_debug(hw, I40E_DEBUG_ALL,
+					   "Reading nvm aq failed.Error code: %d.\n",
+					   status);
+				return I40E_ERR_NVM;
+			}
+		} else {
+			return I40E_ERR_NVM;
+		}
+	} else {
+		/* Read from the Shadow RAM */
+		status = i40e_read_nvm_buffer(hw, ptr_value + offset,
+					      &words_data_size, data_ptr);
+		if (status) {
+			i40e_debug(hw, I40E_DEBUG_ALL,
+				   "Reading nvm buffer failed.Error code: %d.\n",
+				   status);
+		}
+	}
+
+	return status;
+}
+
 /**
  * i40e_read_nvm_buffer_srctl - Reads Shadow RAM buffer via SRCTL register
  * @hw: pointer to the HW structure
@@ -429,6 +500,36 @@ static i40e_status __i40e_read_nvm_buffer(struct i40e_hw *hw,
 	return i40e_read_nvm_buffer_srctl(hw, offset, words, data);
 }
 
+/**
+ * i40e_read_nvm_buffer - Reads Shadow RAM buffer and acquire lock if necessary
+ * @hw: pointer to the HW structure
+ * @offset: offset of the Shadow RAM word to read (0x000000 - 0x001FFF).
+ * @words: (in) number of words to read; (out) number of words actually read
+ * @data: words read from the Shadow RAM
+ *
+ * Reads 16 bit words (data buffer) from the SR using the i40e_read_nvm_srrd()
+ * method. The buffer read is preceded by the NVM ownership take
+ * and followed by the release.
+ **/
+i40e_status i40e_read_nvm_buffer(struct i40e_hw *hw, u16 offset,
+					   u16 *words, u16 *data)
+{
+	i40e_status ret_code = 0;
+
+	if (hw->flags & I40E_HW_FLAG_AQ_SRCTL_ACCESS_ENABLE) {
+		ret_code = i40e_acquire_nvm(hw, I40E_RESOURCE_READ);
+		if (!ret_code) {
+			ret_code = i40e_read_nvm_buffer_aq(hw, offset, words,
+							 data);
+			i40e_release_nvm(hw);
+		}
+	} else {
+		ret_code = i40e_read_nvm_buffer_srctl(hw, offset, words, data);
+	}
+
+	return ret_code;
+}
+
 /**
  * i40e_write_nvm_aq - Writes Shadow RAM.
  * @hw: pointer to the HW structure.
diff --git a/drivers/net/ethernet/intel/i40e/i40e_prototype.h b/drivers/net/ethernet/intel/i40e/i40e_prototype.h
index 9c810d54df1c..33945fb2dd2d 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_prototype.h
+++ b/drivers/net/ethernet/intel/i40e/i40e_prototype.h
@@ -315,6 +315,12 @@ i40e_status i40e_acquire_nvm(struct i40e_hw *hw,
 void i40e_release_nvm(struct i40e_hw *hw);
 i40e_status i40e_read_nvm_word(struct i40e_hw *hw, u16 offset,
 					 u16 *data);
+i40e_status i40e_read_nvm_module_data(struct i40e_hw *hw,
+						u8 module_ptr, u16 offset,
+						u16 words_data_size,
+						u16 *data_ptr);
+i40e_status i40e_read_nvm_buffer(struct i40e_hw *hw, u16 offset,
+					   u16 *words, u16 *data);
 i40e_status i40e_update_nvm_checksum(struct i40e_hw *hw);
 i40e_status i40e_validate_nvm_checksum(struct i40e_hw *hw,
 						 u16 *checksum);
diff --git a/drivers/net/ethernet/intel/i40e/i40e_type.h b/drivers/net/ethernet/intel/i40e/i40e_type.h
index 06e2499de363..0f4994bd089a 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_type.h
+++ b/drivers/net/ethernet/intel/i40e/i40e_type.h
@@ -1318,6 +1318,7 @@ struct i40e_hw_port_stats {
 #define I40E_SR_VPD_PTR				0x2F
 #define I40E_SR_PCIE_ALT_AUTO_LOAD_PTR		0x3E
 #define I40E_SR_SW_CHECKSUM_WORD		0x3F
+#define I40E_SR_EMP_SR_SETTINGS_PTR		0x48
 
 /* Auxiliary field, mask and shift definition for Shadow RAM and NVM Flash */
 #define I40E_SR_VPD_MODULE_MAX_SIZE		1024
-- 
2.21.0


^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [Intel-wired-lan] [next PATCH S8 12/12] i40e: fix retrying in i40e_aq_get_phy_capabilities
  2019-07-23 10:01 [Intel-wired-lan] [next PATCH S8 01/12] i40e: fix shifts of signed values Alice Michael
                   ` (9 preceding siblings ...)
  2019-07-23 10:01 ` [Intel-wired-lan] [next PATCH S8 11/12] i40e: Persistent lldp support Alice Michael
@ 2019-07-23 10:01 ` Alice Michael
  2019-07-26 21:54   ` Bowers, AndrewX
  2019-07-26 21:56 ` [Intel-wired-lan] [next PATCH S8 01/12] i40e: fix shifts of signed values Bowers, AndrewX
  11 siblings, 1 reply; 28+ messages in thread
From: Alice Michael @ 2019-07-23 10:01 UTC (permalink / raw)
  To: intel-wired-lan

From: Marcin Formela <marcin.formela@intel.com>

Fixed a bug where driver was breaking out of the loop and
reporting an error without retrying first.

Signed-off-by: Marcin Formela <marcin.formela@intel.com>
---
 drivers/net/ethernet/intel/i40e/i40e_common.c | 17 ++++++++++-------
 1 file changed, 10 insertions(+), 7 deletions(-)

diff --git a/drivers/net/ethernet/intel/i40e/i40e_common.c b/drivers/net/ethernet/intel/i40e/i40e_common.c
index de996a80013e..46e649c09f72 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_common.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_common.c
@@ -1577,19 +1577,22 @@ i40e_status i40e_aq_get_phy_capabilities(struct i40e_hw *hw,
 		status = i40e_asq_send_command(hw, &desc, abilities,
 					       abilities_size, cmd_details);
 
-		if (status)
-			break;
-
-		if (hw->aq.asq_last_status == I40E_AQ_RC_EIO) {
+		switch (hw->aq.asq_last_status) {
+		case I40E_AQ_RC_EIO:
 			status = I40E_ERR_UNKNOWN_PHY;
 			break;
-		} else if (hw->aq.asq_last_status == I40E_AQ_RC_EAGAIN) {
+		case I40E_AQ_RC_EAGAIN:
 			usleep_range(1000, 2000);
 			total_delay++;
 			status = I40E_ERR_TIMEOUT;
+			break;
+		/* also covers I40E_AQ_RC_OK */
+		default:
+			break;
 		}
-	} while ((hw->aq.asq_last_status != I40E_AQ_RC_OK) &&
-		 (total_delay < max_delay));
+
+	} while ((hw->aq.asq_last_status == I40E_AQ_RC_EAGAIN) &&
+		(total_delay < max_delay));
 
 	if (status)
 		return status;
-- 
2.21.0


^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [Intel-wired-lan] [next PATCH S8 09/12] i40e: make i40e_set_mac_type() public
  2019-07-23 10:01 ` [Intel-wired-lan] [next PATCH S8 09/12] i40e: make i40e_set_mac_type() public Alice Michael
@ 2019-07-26  6:41   ` Kwapulinski, Piotr
  2019-07-26 21:53   ` Bowers, AndrewX
  1 sibling, 0 replies; 28+ messages in thread
From: Kwapulinski, Piotr @ 2019-07-26  6:41 UTC (permalink / raw)
  To: intel-wired-lan

ACK

-----Original Message-----
From: Michael, Alice 
Sent: Tuesday, July 23, 2019 12:02 PM
To: Michael, Alice <alice.michael@intel.com>; intel-wired-lan at lists.osuosl.org
Cc: Kwapulinski, Piotr <piotr.kwapulinski@intel.com>
Subject: [next PATCH S8 09/12] i40e: make i40e_set_mac_type() public

From: Piotr Kwapulinski <piotr.kwapulinski@intel.com>

Make i40e_set_mac_type() public. i40e driver requires i40e_set_mac_type() to be public. It is required for recovery mode handling. Without this patch recovery mode could not be detected in i40e_probe().

Signed-off-by: Piotr Kwapulinski <piotr.kwapulinski@intel.com>
---
 drivers/net/ethernet/intel/i40e/i40e_common.c    | 2 +-
 drivers/net/ethernet/intel/i40e/i40e_prototype.h | 2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/intel/i40e/i40e_common.c b/drivers/net/ethernet/intel/i40e/i40e_common.c
index 7af1b7477140..de996a80013e 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_common.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_common.c
@@ -13,7 +13,7 @@
  * This function sets the mac type of the adapter based on the
  * vendor ID and device ID stored in the hw structure.
  **/
-static i40e_status i40e_set_mac_type(struct i40e_hw *hw)
+i40e_status i40e_set_mac_type(struct i40e_hw *hw)
 {
 	i40e_status status = 0;
 
diff --git a/drivers/net/ethernet/intel/i40e/i40e_prototype.h b/drivers/net/ethernet/intel/i40e/i40e_prototype.h
index eac88bcc6c06..9c810d54df1c 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_prototype.h
+++ b/drivers/net/ethernet/intel/i40e/i40e_prototype.h
@@ -326,6 +326,8 @@ void i40e_nvmupd_check_wait_event(struct i40e_hw *hw, u16 opcode,  void i40e_nvmupd_clear_wait_state(struct i40e_hw *hw);  void i40e_set_pci_config_data(struct i40e_hw *hw, u16 link_status);
 
+i40e_status i40e_set_mac_type(struct i40e_hw *hw);
+
 extern struct i40e_rx_ptype_decoded i40e_ptype_lookup[];
 
 static inline struct i40e_rx_ptype_decoded decode_rx_desc_ptype(u8 ptype)
--
2.21.0

--------------------------------------------------------------------

Intel Technology Poland sp. z o.o.
ul. Slowackiego 173 | 80-298 Gdansk | Sad Rejonowy Gdansk Polnoc | VII Wydzial Gospodarczy Krajowego Rejestru Sadowego - KRS 101882 | NIP 957-07-52-316 | Kapital zakladowy 200.000 PLN.

Ta wiadomosc wraz z zalacznikami jest przeznaczona dla okreslonego adresata i moze zawierac informacje poufne. W razie przypadkowego otrzymania tej wiadomosci, prosimy o powiadomienie nadawcy oraz trwale jej usuniecie; jakiekolwiek
przegladanie lub rozpowszechnianie jest zabronione.
This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). If you are not the intended recipient, please contact the sender and delete all copies; any review or distribution by
others is strictly prohibited.


^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [Intel-wired-lan] [next PATCH S8 10/12] i40e: allow reset in recovery mode
  2019-07-23 10:01 ` [Intel-wired-lan] [next PATCH S8 10/12] i40e: allow reset in recovery mode Alice Michael
@ 2019-07-26  6:41   ` Kwapulinski, Piotr
  2019-07-26 21:53   ` Bowers, AndrewX
  1 sibling, 0 replies; 28+ messages in thread
From: Kwapulinski, Piotr @ 2019-07-26  6:41 UTC (permalink / raw)
  To: intel-wired-lan

ACK

-----Original Message-----
From: Michael, Alice 
Sent: Tuesday, July 23, 2019 12:02 PM
To: Michael, Alice <alice.michael@intel.com>; intel-wired-lan at lists.osuosl.org
Cc: Kwapulinski, Piotr <piotr.kwapulinski@intel.com>
Subject: [next PATCH S8 10/12] i40e: allow reset in recovery mode

From: Piotr Kwapulinski <piotr.kwapulinski@intel.com>

Driver waits after issuing a reset. When a reset takes too long a driver gives up. Implemented by invoking PF reset in a loop. After defined number of unsuccessful PF reset trials it returns error.
Without this patch PF reset fails when NIC is in recovery mode.

Signed-off-by: Piotr Kwapulinski <piotr.kwapulinski@intel.com>
---
 drivers/net/ethernet/intel/i40e/i40e_main.c | 67 ++++++++++++++++++---
 1 file changed, 60 insertions(+), 7 deletions(-)

diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c
index 8d6b9515b595..fdf43d87e983 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_main.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
@@ -14564,6 +14564,51 @@ static bool i40e_check_recovery_mode(struct i40e_pf *pf)
 	return false;
 }
 
+/**
+ * i40e_pf_loop_reset - perform reset in a loop.
+ * @pf: board private structure
+ *
+ * This function is useful when a NIC is about to enter recovery mode.
+ * When a NIC's internal data structures are corrupted the NIC's
+ * firmware is going to enter recovery mode.
+ * Right after a POR it takes about 7 minutes for firmware to enter
+ * recovery mode. Until that time a NIC is in some kind of intermediate
+ * state. After that time period the NIC almost surely enters
+ * recovery mode. The only way for a driver to detect intermediate
+ * state is to issue a series of pf-resets and check a return value.
+ * If a PF reset returns success then the firmware could be in recovery
+ * mode so the caller of this code needs to check for recovery mode
+ * if this function returns success. There is a little chance that
+ * firmware will hang in intermediate state forever.
+ * Since waiting 7 minutes is quite a lot of time this function waits
+ * 10 seconds and then gives up by returning an error.
+ *
+ * Return 0 on success, negative on failure.
+ **/
+static i40e_status i40e_pf_loop_reset(struct i40e_pf *pf) {
+	const unsigned short MAX_CNT = 1000;
+	const unsigned short MSECS = 10;
+	struct i40e_hw *hw = &pf->hw;
+	i40e_status ret;
+	int cnt;
+
+	for (cnt = 0; cnt < MAX_CNT; ++cnt) {
+		ret = i40e_pf_reset(hw);
+		if (!ret)
+			break;
+		msleep(MSECS);
+	}
+
+	if (cnt == MAX_CNT) {
+		dev_info(&pf->pdev->dev, "PF reset failed: %d\n", ret);
+		return ret;
+	}
+
+	pf->pfr_count++;
+	return ret;
+}
+
 /**
  * i40e_init_recovery_mode - initialize subsystems needed in recovery mode
  * @pf: board private structure
@@ -14792,14 +14837,22 @@ static int i40e_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 
 	/* Reset here to make sure all is clean and to define PF 'n' */
 	i40e_clear_hw(hw);
-	if (!i40e_check_recovery_mode(pf)) {
-		err = i40e_pf_reset(hw);
-		if (err) {
-			dev_info(&pdev->dev, "Initial pf_reset failed: %d\n", err);
-			goto err_pf_reset;
-		}
-		pf->pfr_count++;
+
+	err = i40e_set_mac_type(hw);
+	if (err) {
+		dev_warn(&pdev->dev, "unidentified MAC or BLANK NVM: %d\n",
+			 err);
+		goto err_pf_reset;
 	}
+
+	err = i40e_pf_loop_reset(pf);
+	if (err) {
+		dev_info(&pdev->dev, "Initial pf_reset failed: %d\n", err);
+		goto err_pf_reset;
+	}
+
+	i40e_check_recovery_mode(pf);
+
 	hw->aq.num_arq_entries = I40E_AQ_LEN;
 	hw->aq.num_asq_entries = I40E_AQ_LEN;
 	hw->aq.arq_buf_size = I40E_MAX_AQ_BUF_SIZE;
--
2.21.0

--------------------------------------------------------------------

Intel Technology Poland sp. z o.o.
ul. Slowackiego 173 | 80-298 Gdansk | Sad Rejonowy Gdansk Polnoc | VII Wydzial Gospodarczy Krajowego Rejestru Sadowego - KRS 101882 | NIP 957-07-52-316 | Kapital zakladowy 200.000 PLN.

Ta wiadomosc wraz z zalacznikami jest przeznaczona dla okreslonego adresata i moze zawierac informacje poufne. W razie przypadkowego otrzymania tej wiadomosci, prosimy o powiadomienie nadawcy oraz trwale jej usuniecie; jakiekolwiek
przegladanie lub rozpowszechnianie jest zabronione.
This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). If you are not the intended recipient, please contact the sender and delete all copies; any review or distribution by
others is strictly prohibited.


^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [Intel-wired-lan] [next PATCH S8 02/12] i40e: Add drop mode parameter to set mac config
  2019-07-23 10:01 ` [Intel-wired-lan] [next PATCH S8 02/12] i40e: Add drop mode parameter to set mac config Alice Michael
@ 2019-07-26 21:44   ` Bowers, AndrewX
  0 siblings, 0 replies; 28+ messages in thread
From: Bowers, AndrewX @ 2019-07-26 21:44 UTC (permalink / raw)
  To: intel-wired-lan

> -----Original Message-----
> From: Intel-wired-lan [mailto:intel-wired-lan-bounces at osuosl.org] On
> Behalf Of Alice Michael
> Sent: Tuesday, July 23, 2019 3:02 AM
> To: Michael, Alice <alice.michael@intel.com>; intel-wired-
> lan at lists.osuosl.org
> Cc: Wnuczko, Sylwia <sylwia.wnuczko@intel.com>
> Subject: [Intel-wired-lan] [next PATCH S8 02/12] i40e: Add drop mode
> parameter to set mac config
> 
> From: Sylwia Wnuczko <sylwia.wnuczko@intel.com>
> 
> This patch adds "drop mode" parameter to set mac config AQ command.
> This bit controls the behavior when a no-drop packet is blocking a TC queue.
> 0 ? The PF driver is notified.
> 1 ? The blocking packet is dropped and then the PF driver is notified.
> 
> Signed-off-by: Sylwia Wnuczko <sylwia.wnuczko@intel.com>
> ---
>  drivers/net/ethernet/intel/i40e/i40e_adminq.c |  4 ++-
> .../net/ethernet/intel/i40e/i40e_adminq_cmd.h | 29 ++++++++++---------
>  drivers/net/ethernet/intel/i40e/i40e_type.h   |  1 +
>  3 files changed, 19 insertions(+), 15 deletions(-)

Tested-by: Andrew Bowers <andrewx.bowers@intel.com>



^ permalink raw reply	[flat|nested] 28+ messages in thread

* [Intel-wired-lan] [next PATCH S8 03/12] i40e: check_recovery_mode had wrong if statement
  2019-07-23 10:01 ` [Intel-wired-lan] [next PATCH S8 03/12] i40e: check_recovery_mode had wrong if statement Alice Michael
@ 2019-07-26 21:45   ` Bowers, AndrewX
  0 siblings, 0 replies; 28+ messages in thread
From: Bowers, AndrewX @ 2019-07-26 21:45 UTC (permalink / raw)
  To: intel-wired-lan

> -----Original Message-----
> From: Intel-wired-lan [mailto:intel-wired-lan-bounces at osuosl.org] On
> Behalf Of Alice Michael
> Sent: Tuesday, July 23, 2019 3:02 AM
> To: Michael, Alice <alice.michael@intel.com>; intel-wired-
> lan at lists.osuosl.org
> Cc: Podlawski, Adrian <adrian.podlawski@intel.com>
> Subject: [Intel-wired-lan] [next PATCH S8 03/12] i40e: check_recovery_mode
> had wrong if statement
> 
> From: Adrian Podlawski <adrian.podlawski@intel.com>
> 
> Function check_recovery_mode had wrong if statement.
> Now we check proper FWS1B register values, which are responsible for the
> recovery mode. Recovery mode has 4 values for FVL and 2 for FPK.
> That's why we need 6 different flags which are defined in shared code.
> Now in if statement we recognize type of mac address and register value.
> Without those changes driver could show wrong state.
> 
> Signed-off-by: Adrian Podlawski <adrian.podlawski@intel.com>
> ---
>  drivers/net/ethernet/intel/i40e/i40e_main.c     | 17 ++++++++++++++---
>  drivers/net/ethernet/intel/i40e/i40e_register.h |  6 ++++++
>  2 files changed, 20 insertions(+), 3 deletions(-)

Tested-by: Andrew Bowers <andrewx.bowers@intel.com>



^ permalink raw reply	[flat|nested] 28+ messages in thread

* [Intel-wired-lan] [next PATCH S8 04/12] i40e: Update FVL FW API version to 1.9
  2019-07-23 10:01 ` [Intel-wired-lan] [next PATCH S8 04/12] i40e: Update FVL FW API version to 1.9 Alice Michael
@ 2019-07-26 21:45   ` Bowers, AndrewX
  0 siblings, 0 replies; 28+ messages in thread
From: Bowers, AndrewX @ 2019-07-26 21:45 UTC (permalink / raw)
  To: intel-wired-lan

> -----Original Message-----
> From: Intel-wired-lan [mailto:intel-wired-lan-bounces at osuosl.org] On
> Behalf Of Alice Michael
> Sent: Tuesday, July 23, 2019 3:02 AM
> To: Michael, Alice <alice.michael@intel.com>; intel-wired-
> lan at lists.osuosl.org
> Cc: Azarewicz, Piotr <piotr.azarewicz@intel.com>
> Subject: [Intel-wired-lan] [next PATCH S8 04/12] i40e: Update FVL FW API
> version to 1.9
> 
> From: Piotr Azarewicz <piotr.azarewicz@intel.com>
> 
> Upcoming FVL FW increment API version to 1.9 due to Extend PHY access AQ
> command support. SW is ready for that support as well.
> 
> Signed-off-by: Piotr Azarewicz <piotr.azarewicz@intel.com>
> ---
>  drivers/net/ethernet/intel/i40e/i40e_adminq_cmd.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Tested-by: Andrew Bowers <andrewx.bowers@intel.com>



^ permalink raw reply	[flat|nested] 28+ messages in thread

* [Intel-wired-lan] [next PATCH S8 05/12] i40e: reset veb.tc_stats when resetting veb.stats
  2019-07-23 10:01 ` [Intel-wired-lan] [next PATCH S8 05/12] i40e: reset veb.tc_stats when resetting veb.stats Alice Michael
@ 2019-07-26 21:46   ` Bowers, AndrewX
  0 siblings, 0 replies; 28+ messages in thread
From: Bowers, AndrewX @ 2019-07-26 21:46 UTC (permalink / raw)
  To: intel-wired-lan

> -----Original Message-----
> From: Intel-wired-lan [mailto:intel-wired-lan-bounces at osuosl.org] On
> Behalf Of Alice Michael
> Sent: Tuesday, July 23, 2019 3:02 AM
> To: Michael, Alice <alice.michael@intel.com>; intel-wired-
> lan at lists.osuosl.org
> Subject: [Intel-wired-lan] [next PATCH S8 05/12] i40e: reset veb.tc_stats
> when resetting veb.stats
> 
> From: Jacob Keller <jacob.e.keller@intel.com>
> 
> The stats structure for the VEB switch statistics is reset periodically, but the
> tc_stats are not reset at the same time.
> 
> Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
> ---
>  drivers/net/ethernet/intel/i40e/i40e_main.c | 4 ++++
>  1 file changed, 4 insertions(+)

Tested-by: Andrew Bowers <andrewx.bowers@intel.com>



^ permalink raw reply	[flat|nested] 28+ messages in thread

* [Intel-wired-lan] [next PATCH S8 06/12] i40e: Update FPK FW API version to 1.9
  2019-07-23 10:01 ` [Intel-wired-lan] [next PATCH S8 06/12] i40e: Update FPK FW API version to 1.9 Alice Michael
@ 2019-07-26 21:46   ` Bowers, AndrewX
  0 siblings, 0 replies; 28+ messages in thread
From: Bowers, AndrewX @ 2019-07-26 21:46 UTC (permalink / raw)
  To: intel-wired-lan

> -----Original Message-----
> From: Intel-wired-lan [mailto:intel-wired-lan-bounces at osuosl.org] On
> Behalf Of Alice Michael
> Sent: Tuesday, July 23, 2019 3:02 AM
> To: Michael, Alice <alice.michael@intel.com>; intel-wired-
> lan at lists.osuosl.org
> Cc: Azarewicz, Piotr <piotr.azarewicz@intel.com>
> Subject: [Intel-wired-lan] [next PATCH S8 06/12] i40e: Update FPK FW API
> version to 1.9
> 
> From: Piotr Azarewicz <piotr.azarewicz@intel.com>
> 
> Upcoming FPK FW increment API version to 1.9, so we must bump up version
> number as well.
> FPK will support PHY access AQ command as FVL does.
> 
> Signed-off-by: Piotr Azarewicz <piotr.azarewicz@intel.com>
> ---
>  drivers/net/ethernet/intel/i40e/i40e_adminq_cmd.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Tested-by: Andrew Bowers <andrewx.bowers@intel.com>



^ permalink raw reply	[flat|nested] 28+ messages in thread

* [Intel-wired-lan] [next PATCH S8 07/12] i40e: Fix crash caused by stress setting of VF MAC addresses
  2019-07-23 10:01 ` [Intel-wired-lan] [next PATCH S8 07/12] i40e: Fix crash caused by stress setting of VF MAC addresses Alice Michael
@ 2019-07-26 21:47   ` Bowers, AndrewX
  0 siblings, 0 replies; 28+ messages in thread
From: Bowers, AndrewX @ 2019-07-26 21:47 UTC (permalink / raw)
  To: intel-wired-lan

> -----Original Message-----
> From: Intel-wired-lan [mailto:intel-wired-lan-bounces at osuosl.org] On
> Behalf Of Alice Michael
> Sent: Tuesday, July 23, 2019 3:02 AM
> To: Michael, Alice <alice.michael@intel.com>; intel-wired-
> lan at lists.osuosl.org
> Cc: Laba, SlawomirX <slawomirx.laba@intel.com>
> Subject: [Intel-wired-lan] [next PATCH S8 07/12] i40e: Fix crash caused by
> stress setting of VF MAC addresses
> 
> From: Slawomir Laba <slawomirx.laba@intel.com>
> 
> Add update to the vsi pointer passed to the i40e_set_vf_mac function.
> If VF is in reset state the driver waits in i40e_set_vf_mac function for the
> reset to be complete, yet after reset the vsi pointer that was passed into this
> function is no longer valid.
> 
> The patch updates local vsi pointer directly from pf->vsi array, by using the id
> stored in vf pointer (lan_vsi_idx).
> 
> Without this commit the driver might occasionally invoke general protection
> fault in kernel and disable the OS entirely.
> 
> Signed-off-by: Slawomir Laba <slawomirx.laba@intel.com>
> ---
>  drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)

Tested-by: Andrew Bowers <andrewx.bowers@intel.com>



^ permalink raw reply	[flat|nested] 28+ messages in thread

* [Intel-wired-lan] [next PATCH S8 08/12] i40e: Remove function i40e_update_dcb_config()
  2019-07-23 10:01 ` [Intel-wired-lan] [next PATCH S8 08/12] i40e: Remove function i40e_update_dcb_config() Alice Michael
@ 2019-07-26 21:47   ` Bowers, AndrewX
  0 siblings, 0 replies; 28+ messages in thread
From: Bowers, AndrewX @ 2019-07-26 21:47 UTC (permalink / raw)
  To: intel-wired-lan

> -----Original Message-----
> From: Intel-wired-lan [mailto:intel-wired-lan-bounces at osuosl.org] On
> Behalf Of Alice Michael
> Sent: Tuesday, July 23, 2019 3:02 AM
> To: Michael, Alice <alice.michael@intel.com>; intel-wired-
> lan at lists.osuosl.org
> Cc: Siwik, Grzegorz <grzegorz.siwik@intel.com>
> Subject: [Intel-wired-lan] [next PATCH S8 08/12] i40e: Remove function
> i40e_update_dcb_config()
> 
> From: Grzegorz Siwik <grzegorz.siwik@intel.com>
> 
> This patch removes function i40e_update_dcb_config(). Instead of
> i40e_update_dcb_config() we use i40e_init_dcb(), which implements the
> correct nvm read.
> 
> Signed-off-by: Grzegorz Siwik <grzegorz.siwik@intel.com>
> ---
>  drivers/net/ethernet/intel/i40e/i40e_main.c | 46 +--------------------
>  1 file changed, 1 insertion(+), 45 deletions(-)

Tested-by: Andrew Bowers <andrewx.bowers@intel.com>



^ permalink raw reply	[flat|nested] 28+ messages in thread

* [Intel-wired-lan] [next PATCH S8 09/12] i40e: make i40e_set_mac_type() public
  2019-07-23 10:01 ` [Intel-wired-lan] [next PATCH S8 09/12] i40e: make i40e_set_mac_type() public Alice Michael
  2019-07-26  6:41   ` Kwapulinski, Piotr
@ 2019-07-26 21:53   ` Bowers, AndrewX
  1 sibling, 0 replies; 28+ messages in thread
From: Bowers, AndrewX @ 2019-07-26 21:53 UTC (permalink / raw)
  To: intel-wired-lan

> -----Original Message-----
> From: Intel-wired-lan [mailto:intel-wired-lan-bounces at osuosl.org] On
> Behalf Of Alice Michael
> Sent: Tuesday, July 23, 2019 3:02 AM
> To: Michael, Alice <alice.michael@intel.com>; intel-wired-
> lan at lists.osuosl.org
> Cc: Kwapulinski, Piotr <piotr.kwapulinski@intel.com>
> Subject: [Intel-wired-lan] [next PATCH S8 09/12] i40e: make
> i40e_set_mac_type() public
> 
> From: Piotr Kwapulinski <piotr.kwapulinski@intel.com>
> 
> Make i40e_set_mac_type() public. i40e driver requires i40e_set_mac_type()
> to be public. It is required for recovery mode handling. Without this patch
> recovery mode could not be detected in i40e_probe().
> 
> Signed-off-by: Piotr Kwapulinski <piotr.kwapulinski@intel.com>
> ---
>  drivers/net/ethernet/intel/i40e/i40e_common.c    | 2 +-
>  drivers/net/ethernet/intel/i40e/i40e_prototype.h | 2 ++
>  2 files changed, 3 insertions(+), 1 deletion(-)

Tested-by: Andrew Bowers <andrewx.bowers@intel.com>



^ permalink raw reply	[flat|nested] 28+ messages in thread

* [Intel-wired-lan] [next PATCH S8 10/12] i40e: allow reset in recovery mode
  2019-07-23 10:01 ` [Intel-wired-lan] [next PATCH S8 10/12] i40e: allow reset in recovery mode Alice Michael
  2019-07-26  6:41   ` Kwapulinski, Piotr
@ 2019-07-26 21:53   ` Bowers, AndrewX
  1 sibling, 0 replies; 28+ messages in thread
From: Bowers, AndrewX @ 2019-07-26 21:53 UTC (permalink / raw)
  To: intel-wired-lan

> -----Original Message-----
> From: Intel-wired-lan [mailto:intel-wired-lan-bounces at osuosl.org] On
> Behalf Of Alice Michael
> Sent: Tuesday, July 23, 2019 3:02 AM
> To: Michael, Alice <alice.michael@intel.com>; intel-wired-
> lan at lists.osuosl.org
> Cc: Kwapulinski, Piotr <piotr.kwapulinski@intel.com>
> Subject: [Intel-wired-lan] [next PATCH S8 10/12] i40e: allow reset in recovery
> mode
> 
> From: Piotr Kwapulinski <piotr.kwapulinski@intel.com>
> 
> Driver waits after issuing a reset. When a reset takes too long a driver gives
> up. Implemented by invoking PF reset in a loop. After defined number of
> unsuccessful PF reset trials it returns error.
> Without this patch PF reset fails when NIC is in recovery mode.
> 
> Signed-off-by: Piotr Kwapulinski <piotr.kwapulinski@intel.com>
> ---
>  drivers/net/ethernet/intel/i40e/i40e_main.c | 67 ++++++++++++++++++---
>  1 file changed, 60 insertions(+), 7 deletions(-)

Tested-by: Andrew Bowers <andrewx.bowers@intel.com>



^ permalink raw reply	[flat|nested] 28+ messages in thread

* [Intel-wired-lan] [next PATCH S8 11/12] i40e: Persistent lldp support
  2019-07-23 10:01 ` [Intel-wired-lan] [next PATCH S8 11/12] i40e: Persistent lldp support Alice Michael
@ 2019-07-26 21:53   ` Bowers, AndrewX
  0 siblings, 0 replies; 28+ messages in thread
From: Bowers, AndrewX @ 2019-07-26 21:53 UTC (permalink / raw)
  To: intel-wired-lan

> -----Original Message-----
> From: Intel-wired-lan [mailto:intel-wired-lan-bounces at osuosl.org] On
> Behalf Of Alice Michael
> Sent: Tuesday, July 23, 2019 3:02 AM
> To: Michael, Alice <alice.michael@intel.com>; intel-wired-
> lan at lists.osuosl.org
> Cc: Wnuczko, Sylwia <sylwia.wnuczko@intel.com>
> Subject: [Intel-wired-lan] [next PATCH S8 11/12] i40e: Persistent lldp support
> 
> From: Sylwia Wnuczko <sylwia.wnuczko@intel.com>
> 
> This patch adds a function to read nvm module data and uses it to read
> current lldp agent configuration from nvm api version 1.8.
> 
> Title: i40e-shared: Persistent lldp support
> Change-type: FeatureImplementation
> 
> Signed-off-by: Sylwia Wnuczko <sylwia.wnuczko@intel.com>
> ---
>  drivers/net/ethernet/intel/i40e/i40e_dcb.c    |  18 +++-
>  drivers/net/ethernet/intel/i40e/i40e_dcb.h    |   2 +
>  drivers/net/ethernet/intel/i40e/i40e_nvm.c    | 101 ++++++++++++++++++
>  .../net/ethernet/intel/i40e/i40e_prototype.h  |   6 ++
>  drivers/net/ethernet/intel/i40e/i40e_type.h   |   1 +
>  5 files changed, 127 insertions(+), 1 deletion(-)

Tested-by: Andrew Bowers <andrewx.bowers@intel.com>



^ permalink raw reply	[flat|nested] 28+ messages in thread

* [Intel-wired-lan] [next PATCH S8 12/12] i40e: fix retrying in i40e_aq_get_phy_capabilities
  2019-07-23 10:01 ` [Intel-wired-lan] [next PATCH S8 12/12] i40e: fix retrying in i40e_aq_get_phy_capabilities Alice Michael
@ 2019-07-26 21:54   ` Bowers, AndrewX
  0 siblings, 0 replies; 28+ messages in thread
From: Bowers, AndrewX @ 2019-07-26 21:54 UTC (permalink / raw)
  To: intel-wired-lan

> -----Original Message-----
> From: Intel-wired-lan [mailto:intel-wired-lan-bounces at osuosl.org] On
> Behalf Of Alice Michael
> Sent: Tuesday, July 23, 2019 3:02 AM
> To: Michael, Alice <alice.michael@intel.com>; intel-wired-
> lan at lists.osuosl.org
> Cc: Formela, Marcin <marcin.formela@intel.com>
> Subject: [Intel-wired-lan] [next PATCH S8 12/12] i40e: fix retrying in
> i40e_aq_get_phy_capabilities
> 
> From: Marcin Formela <marcin.formela@intel.com>
> 
> Fixed a bug where driver was breaking out of the loop and reporting an error
> without retrying first.
> 
> Signed-off-by: Marcin Formela <marcin.formela@intel.com>
> ---
>  drivers/net/ethernet/intel/i40e/i40e_common.c | 17 ++++++++++-------
>  1 file changed, 10 insertions(+), 7 deletions(-)

Tested-by: Andrew Bowers <andrewx.bowers@intel.com>



^ permalink raw reply	[flat|nested] 28+ messages in thread

* [Intel-wired-lan] [next PATCH S8 01/12] i40e: fix shifts of signed values
  2019-07-23 10:01 [Intel-wired-lan] [next PATCH S8 01/12] i40e: fix shifts of signed values Alice Michael
                   ` (10 preceding siblings ...)
  2019-07-23 10:01 ` [Intel-wired-lan] [next PATCH S8 12/12] i40e: fix retrying in i40e_aq_get_phy_capabilities Alice Michael
@ 2019-07-26 21:56 ` Bowers, AndrewX
  11 siblings, 0 replies; 28+ messages in thread
From: Bowers, AndrewX @ 2019-07-26 21:56 UTC (permalink / raw)
  To: intel-wired-lan

> -----Original Message-----
> From: Intel-wired-lan [mailto:intel-wired-lan-bounces at osuosl.org] On
> Behalf Of Alice Michael
> Sent: Tuesday, July 23, 2019 3:02 AM
> To: Michael, Alice <alice.michael@intel.com>; intel-wired-
> lan at lists.osuosl.org
> Cc: Xing, Beilei <beilei.xing@intel.com>; Yigit, Ferruh
> <ferruh.yigit@intel.com>
> Subject: [Intel-wired-lan] [next PATCH S8 01/12] i40e: fix shifts of signed
> values
> 
> From: Beilei Xing <beilei.xing@intel.com>
> 
> This patch fixes following error reported by cppcheck:
> (error) Shifting signed 32-bit value by 31 bits is undefined behaviour
> 
> Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
> ---
>  .../net/ethernet/intel/i40e/i40e_register.h   | 24 +++++++++----------
>  1 file changed, 12 insertions(+), 12 deletions(-)

Tested-by: Andrew Bowers <andrewx.bowers@intel.com>



^ permalink raw reply	[flat|nested] 28+ messages in thread

* [Intel-wired-lan] [next PATCH S8 09/12] i40e: make i40e_set_mac_type() public
  2019-07-23 10:03 ` [Intel-wired-lan] [next PATCH S8 09/12] i40e: make i40e_set_mac_type() public Alice Michael
@ 2019-07-26  6:42   ` Kwapulinski, Piotr
  0 siblings, 0 replies; 28+ messages in thread
From: Kwapulinski, Piotr @ 2019-07-26  6:42 UTC (permalink / raw)
  To: intel-wired-lan

ACK

-----Original Message-----
From: Michael, Alice 
Sent: Tuesday, July 23, 2019 12:04 PM
To: Michael, Alice <alice.michael@intel.com>; intel-wired-lan at lists.osuosl.org
Cc: Kwapulinski, Piotr <piotr.kwapulinski@intel.com>
Subject: [next PATCH S8 09/12] i40e: make i40e_set_mac_type() public

From: Piotr Kwapulinski <piotr.kwapulinski@intel.com>

Make i40e_set_mac_type() public. i40e driver requires i40e_set_mac_type() to be public. It is required for recovery mode handling. Without this patch recovery mode could not be detected in i40e_probe().

Signed-off-by: Piotr Kwapulinski <piotr.kwapulinski@intel.com>
---
 drivers/net/ethernet/intel/i40e/i40e_common.c    | 2 +-
 drivers/net/ethernet/intel/i40e/i40e_prototype.h | 2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/intel/i40e/i40e_common.c b/drivers/net/ethernet/intel/i40e/i40e_common.c
index 7af1b7477140..de996a80013e 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_common.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_common.c
@@ -13,7 +13,7 @@
  * This function sets the mac type of the adapter based on the
  * vendor ID and device ID stored in the hw structure.
  **/
-static i40e_status i40e_set_mac_type(struct i40e_hw *hw)
+i40e_status i40e_set_mac_type(struct i40e_hw *hw)
 {
 	i40e_status status = 0;
 
diff --git a/drivers/net/ethernet/intel/i40e/i40e_prototype.h b/drivers/net/ethernet/intel/i40e/i40e_prototype.h
index eac88bcc6c06..9c810d54df1c 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_prototype.h
+++ b/drivers/net/ethernet/intel/i40e/i40e_prototype.h
@@ -326,6 +326,8 @@ void i40e_nvmupd_check_wait_event(struct i40e_hw *hw, u16 opcode,  void i40e_nvmupd_clear_wait_state(struct i40e_hw *hw);  void i40e_set_pci_config_data(struct i40e_hw *hw, u16 link_status);
 
+i40e_status i40e_set_mac_type(struct i40e_hw *hw);
+
 extern struct i40e_rx_ptype_decoded i40e_ptype_lookup[];
 
 static inline struct i40e_rx_ptype_decoded decode_rx_desc_ptype(u8 ptype)
--
2.21.0

--------------------------------------------------------------------

Intel Technology Poland sp. z o.o.
ul. Slowackiego 173 | 80-298 Gdansk | Sad Rejonowy Gdansk Polnoc | VII Wydzial Gospodarczy Krajowego Rejestru Sadowego - KRS 101882 | NIP 957-07-52-316 | Kapital zakladowy 200.000 PLN.

Ta wiadomosc wraz z zalacznikami jest przeznaczona dla okreslonego adresata i moze zawierac informacje poufne. W razie przypadkowego otrzymania tej wiadomosci, prosimy o powiadomienie nadawcy oraz trwale jej usuniecie; jakiekolwiek
przegladanie lub rozpowszechnianie jest zabronione.
This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). If you are not the intended recipient, please contact the sender and delete all copies; any review or distribution by
others is strictly prohibited.


^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [Intel-wired-lan] [next PATCH S8 09/12] i40e: make i40e_set_mac_type() public
  2019-07-23 10:03 Alice Michael
@ 2019-07-23 10:03 ` Alice Michael
  2019-07-26  6:42   ` Kwapulinski, Piotr
  0 siblings, 1 reply; 28+ messages in thread
From: Alice Michael @ 2019-07-23 10:03 UTC (permalink / raw)
  To: intel-wired-lan

From: Piotr Kwapulinski <piotr.kwapulinski@intel.com>

Make i40e_set_mac_type() public. i40e driver requires i40e_set_mac_type()
to be public. It is required for recovery mode handling. Without this patch
recovery mode could not be detected in i40e_probe().

Signed-off-by: Piotr Kwapulinski <piotr.kwapulinski@intel.com>
---
 drivers/net/ethernet/intel/i40e/i40e_common.c    | 2 +-
 drivers/net/ethernet/intel/i40e/i40e_prototype.h | 2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/intel/i40e/i40e_common.c b/drivers/net/ethernet/intel/i40e/i40e_common.c
index 7af1b7477140..de996a80013e 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_common.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_common.c
@@ -13,7 +13,7 @@
  * This function sets the mac type of the adapter based on the
  * vendor ID and device ID stored in the hw structure.
  **/
-static i40e_status i40e_set_mac_type(struct i40e_hw *hw)
+i40e_status i40e_set_mac_type(struct i40e_hw *hw)
 {
 	i40e_status status = 0;
 
diff --git a/drivers/net/ethernet/intel/i40e/i40e_prototype.h b/drivers/net/ethernet/intel/i40e/i40e_prototype.h
index eac88bcc6c06..9c810d54df1c 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_prototype.h
+++ b/drivers/net/ethernet/intel/i40e/i40e_prototype.h
@@ -326,6 +326,8 @@ void i40e_nvmupd_check_wait_event(struct i40e_hw *hw, u16 opcode,
 void i40e_nvmupd_clear_wait_state(struct i40e_hw *hw);
 void i40e_set_pci_config_data(struct i40e_hw *hw, u16 link_status);
 
+i40e_status i40e_set_mac_type(struct i40e_hw *hw);
+
 extern struct i40e_rx_ptype_decoded i40e_ptype_lookup[];
 
 static inline struct i40e_rx_ptype_decoded decode_rx_desc_ptype(u8 ptype)
-- 
2.21.0


^ permalink raw reply related	[flat|nested] 28+ messages in thread

end of thread, other threads:[~2019-07-26 21:56 UTC | newest]

Thread overview: 28+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-23 10:01 [Intel-wired-lan] [next PATCH S8 01/12] i40e: fix shifts of signed values Alice Michael
2019-07-23 10:01 ` [Intel-wired-lan] [next PATCH S8 02/12] i40e: Add drop mode parameter to set mac config Alice Michael
2019-07-26 21:44   ` Bowers, AndrewX
2019-07-23 10:01 ` [Intel-wired-lan] [next PATCH S8 03/12] i40e: check_recovery_mode had wrong if statement Alice Michael
2019-07-26 21:45   ` Bowers, AndrewX
2019-07-23 10:01 ` [Intel-wired-lan] [next PATCH S8 04/12] i40e: Update FVL FW API version to 1.9 Alice Michael
2019-07-26 21:45   ` Bowers, AndrewX
2019-07-23 10:01 ` [Intel-wired-lan] [next PATCH S8 05/12] i40e: reset veb.tc_stats when resetting veb.stats Alice Michael
2019-07-26 21:46   ` Bowers, AndrewX
2019-07-23 10:01 ` [Intel-wired-lan] [next PATCH S8 06/12] i40e: Update FPK FW API version to 1.9 Alice Michael
2019-07-26 21:46   ` Bowers, AndrewX
2019-07-23 10:01 ` [Intel-wired-lan] [next PATCH S8 07/12] i40e: Fix crash caused by stress setting of VF MAC addresses Alice Michael
2019-07-26 21:47   ` Bowers, AndrewX
2019-07-23 10:01 ` [Intel-wired-lan] [next PATCH S8 08/12] i40e: Remove function i40e_update_dcb_config() Alice Michael
2019-07-26 21:47   ` Bowers, AndrewX
2019-07-23 10:01 ` [Intel-wired-lan] [next PATCH S8 09/12] i40e: make i40e_set_mac_type() public Alice Michael
2019-07-26  6:41   ` Kwapulinski, Piotr
2019-07-26 21:53   ` Bowers, AndrewX
2019-07-23 10:01 ` [Intel-wired-lan] [next PATCH S8 10/12] i40e: allow reset in recovery mode Alice Michael
2019-07-26  6:41   ` Kwapulinski, Piotr
2019-07-26 21:53   ` Bowers, AndrewX
2019-07-23 10:01 ` [Intel-wired-lan] [next PATCH S8 11/12] i40e: Persistent lldp support Alice Michael
2019-07-26 21:53   ` Bowers, AndrewX
2019-07-23 10:01 ` [Intel-wired-lan] [next PATCH S8 12/12] i40e: fix retrying in i40e_aq_get_phy_capabilities Alice Michael
2019-07-26 21:54   ` Bowers, AndrewX
2019-07-26 21:56 ` [Intel-wired-lan] [next PATCH S8 01/12] i40e: fix shifts of signed values Bowers, AndrewX
2019-07-23 10:03 Alice Michael
2019-07-23 10:03 ` [Intel-wired-lan] [next PATCH S8 09/12] i40e: make i40e_set_mac_type() public Alice Michael
2019-07-26  6:42   ` Kwapulinski, Piotr

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.