DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH v1 01/15] net/ixgbe/base: remove minsrevs code from DPDK
@ 2024-08-29  9:00 Anatoly Burakov
  2024-08-29  9:00 ` [PATCH v1 02/15] net/ixgbe/base: add missing ACI definitions Anatoly Burakov
                   ` (14 more replies)
  0 siblings, 15 replies; 17+ messages in thread
From: Anatoly Burakov @ 2024-08-29  9:00 UTC (permalink / raw)
  To: dev

Commit add44414762c ("net/ixgbe/base: add E610 NVM-related operations") has
added code to read minimum security revision from NVM. This code was not
meant to be included in DPDK, and was only meant for other drivers derived
from shared base code, but was present due to the way shared driver code
snapshot was generated. Remove this code from DPDK driver.

Fixes: add44414762c ("net/ixgbe/base: add E610 NVM-related operations")

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
---
 drivers/net/ixgbe/base/ixgbe_e610.c | 54 -----------------------------
 drivers/net/ixgbe/base/ixgbe_e610.h |  1 -
 2 files changed, 55 deletions(-)

diff --git a/drivers/net/ixgbe/base/ixgbe_e610.c b/drivers/net/ixgbe/base/ixgbe_e610.c
index ac71980630..3e2be07731 100644
--- a/drivers/net/ixgbe/base/ixgbe_e610.c
+++ b/drivers/net/ixgbe/base/ixgbe_e610.c
@@ -2488,60 +2488,6 @@ static s32 ixgbe_read_nvm_sr_copy(struct ixgbe_hw *hw,
 	return ixgbe_read_nvm_module(hw, bank, hdr_len + offset, data);
 }
 
-/**
- * ixgbe_get_nvm_minsrevs - Get the minsrevs values from flash
- * @hw: pointer to the HW struct
- * @minsrevs: structure to store NVM and OROM minsrev values
- *
- * Read the Minimum Security Revision TLV and extract
- * the revision values from the flash image
- * into a readable structure for processing.
- *
- * Return: the exit code of the operation.
- */
-s32 ixgbe_get_nvm_minsrevs(struct ixgbe_hw *hw,
-			   struct ixgbe_minsrev_info *minsrevs)
-{
-	struct ixgbe_aci_cmd_nvm_minsrev data;
-	s32 status;
-	u16 valid;
-
-	status = ixgbe_acquire_nvm(hw, IXGBE_RES_READ);
-	if (status)
-		return status;
-
-	status = ixgbe_aci_read_nvm(hw, IXGBE_ACI_NVM_MINSREV_MOD_ID,
-				    0, sizeof(data), &data,
-				    true, false);
-
-	ixgbe_release_nvm(hw);
-
-	if (status)
-		return status;
-
-	valid = IXGBE_LE16_TO_CPU(data.validity);
-
-	/* Extract NVM minimum security revision */
-	if (valid & IXGBE_ACI_NVM_MINSREV_NVM_VALID) {
-		u16 minsrev_l = IXGBE_LE16_TO_CPU(data.nvm_minsrev_l);
-		u16 minsrev_h = IXGBE_LE16_TO_CPU(data.nvm_minsrev_h);
-
-		minsrevs->nvm = minsrev_h << 16 | minsrev_l;
-		minsrevs->nvm_valid = true;
-	}
-
-	/* Extract the OROM minimum security revision */
-	if (valid & IXGBE_ACI_NVM_MINSREV_OROM_VALID) {
-		u16 minsrev_l = IXGBE_LE16_TO_CPU(data.orom_minsrev_l);
-		u16 minsrev_h = IXGBE_LE16_TO_CPU(data.orom_minsrev_h);
-
-		minsrevs->orom = minsrev_h << 16 | minsrev_l;
-		minsrevs->orom_valid = true;
-	}
-
-	return IXGBE_SUCCESS;
-}
-
 /**
  * ixgbe_get_nvm_srev - Read the security revision from the NVM CSS header
  * @hw: pointer to the HW struct
diff --git a/drivers/net/ixgbe/base/ixgbe_e610.h b/drivers/net/ixgbe/base/ixgbe_e610.h
index 33c683d1c1..4babee821e 100644
--- a/drivers/net/ixgbe/base/ixgbe_e610.h
+++ b/drivers/net/ixgbe/base/ixgbe_e610.h
@@ -85,7 +85,6 @@ s32 ixgbe_aci_read_nvm(struct ixgbe_hw *hw, u16 module_typeid, u32 offset,
 s32 ixgbe_nvm_validate_checksum(struct ixgbe_hw *hw);
 s32 ixgbe_nvm_recalculate_checksum(struct ixgbe_hw *hw);
 
-s32 ixgbe_get_nvm_minsrevs(struct ixgbe_hw *hw, struct ixgbe_minsrev_info *minsrevs);
 s32 ixgbe_get_inactive_nvm_ver(struct ixgbe_hw *hw, struct ixgbe_nvm_info *nvm);
 s32 ixgbe_get_active_nvm_ver(struct ixgbe_hw *hw, struct ixgbe_nvm_info *nvm);
 s32 ixgbe_init_nvm(struct ixgbe_hw *hw);
-- 
2.43.5


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

* [PATCH v1 02/15] net/ixgbe/base: add missing ACI definitions
  2024-08-29  9:00 [PATCH v1 01/15] net/ixgbe/base: remove minsrevs code from DPDK Anatoly Burakov
@ 2024-08-29  9:00 ` Anatoly Burakov
  2024-09-03 10:32   ` Bruce Richardson
  2024-08-29  9:00 ` [PATCH v1 03/15] net/ixgbe/base: add missing E610 definitions Anatoly Burakov
                   ` (13 subsequent siblings)
  14 siblings, 1 reply; 17+ messages in thread
From: Anatoly Burakov @ 2024-08-29  9:00 UTC (permalink / raw)
  To: dev, Jedrzej Jagielski, Stefan Wegrzyn, Piotr Kwapulinski

When adding Admin Command Interface and E610 device support, some ACI
capabilities definition code was missed due to the way shared driver code
snapshot was generated. Add missing code paths.

Fixes: 25b48e569f2f ("net/ixgbe/base: add E610 Admin Command Interface")
Fixes: 7c3bfffda43d ("net/ixgbe/base: detect E610 device capabilities")

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
---
 drivers/net/ixgbe/base/ixgbe_e610.c      | 49 ++++++++++++++++++++++++
 drivers/net/ixgbe/base/ixgbe_type_e610.h |  4 ++
 2 files changed, 53 insertions(+)

diff --git a/drivers/net/ixgbe/base/ixgbe_e610.c b/drivers/net/ixgbe/base/ixgbe_e610.c
index 3e2be07731..1f3a4532da 100644
--- a/drivers/net/ixgbe/base/ixgbe_e610.c
+++ b/drivers/net/ixgbe/base/ixgbe_e610.c
@@ -671,6 +671,9 @@ ixgbe_parse_common_caps(struct ixgbe_hw *hw, struct ixgbe_hw_common_caps *caps,
 	case IXGBE_ACI_CAPS_VALID_FUNCTIONS:
 		caps->valid_functions = number;
 		break;
+	case IXGBE_ACI_CAPS_SRIOV:
+		caps->sr_iov_1_1 = (number == 1);
+		break;
 	case IXGBE_ACI_CAPS_VMDQ:
 		caps->vmdq = (number == 1);
 		break;
@@ -833,6 +836,25 @@ ixgbe_parse_valid_functions_cap(struct ixgbe_hw *hw,
 	hw->logical_pf_id = ixgbe_func_id_to_logical_id(number, hw->pf_id);
 }
 
+/**
+ * ixgbe_parse_vf_dev_caps - Parse IXGBE_ACI_CAPS_VF device caps
+ * @hw: pointer to the HW struct
+ * @dev_p: pointer to device capabilities structure
+ * @cap: capability element to parse
+ *
+ * Parse IXGBE_ACI_CAPS_VF for device capabilities.
+ */
+static void ixgbe_parse_vf_dev_caps(struct ixgbe_hw *hw,
+				    struct ixgbe_hw_dev_caps *dev_p,
+				    struct ixgbe_aci_cmd_list_caps_elem *cap)
+{
+	u32 number = IXGBE_LE32_TO_CPU(cap->number);
+
+	UNREFERENCED_1PARAMETER(hw);
+
+	dev_p->num_vfs_exposed = number;
+}
+
 /**
  * ixgbe_parse_vsi_dev_caps - Parse IXGBE_ACI_CAPS_VSI device caps
  * @hw: pointer to the HW struct
@@ -944,6 +966,9 @@ static void ixgbe_parse_dev_caps(struct ixgbe_hw *hw,
 			ixgbe_parse_valid_functions_cap(hw, dev_p,
 							&cap_resp[i]);
 			break;
+		case IXGBE_ACI_CAPS_VF:
+			ixgbe_parse_vf_dev_caps(hw, dev_p, &cap_resp[i]);
+			break;
 		case IXGBE_ACI_CAPS_VSI:
 			ixgbe_parse_vsi_dev_caps(hw, dev_p, &cap_resp[i]);
 			break;
@@ -962,6 +987,27 @@ static void ixgbe_parse_dev_caps(struct ixgbe_hw *hw,
 
 }
 
+/**
+ * ixgbe_parse_vf_func_caps - Parse IXGBE_ACI_CAPS_VF function caps
+ * @hw: pointer to the HW struct
+ * @func_p: pointer to function capabilities structure
+ * @cap: pointer to the capability element to parse
+ *
+ * Extract function capabilities for IXGBE_ACI_CAPS_VF.
+ */
+static void ixgbe_parse_vf_func_caps(struct ixgbe_hw *hw,
+				     struct ixgbe_hw_func_caps *func_p,
+				     struct ixgbe_aci_cmd_list_caps_elem *cap)
+{
+	u32 logical_id = IXGBE_LE32_TO_CPU(cap->logical_id);
+	u32 number = IXGBE_LE32_TO_CPU(cap->number);
+
+	UNREFERENCED_1PARAMETER(hw);
+
+	func_p->num_allocd_vfs = number;
+	func_p->vf_base_id = logical_id;
+}
+
 /**
  * ixgbe_get_num_per_func - determine number of resources per PF
  * @hw: pointer to the HW structure
@@ -1073,6 +1119,9 @@ static void ixgbe_parse_func_caps(struct ixgbe_hw *hw,
 					&cap_resp[i], "func caps");
 
 		switch (cap) {
+		case IXGBE_ACI_CAPS_VF:
+			ixgbe_parse_vf_func_caps(hw, func_p, &cap_resp[i]);
+			break;
 		case IXGBE_ACI_CAPS_VSI:
 			ixgbe_parse_vsi_func_caps(hw, func_p, &cap_resp[i]);
 			break;
diff --git a/drivers/net/ixgbe/base/ixgbe_type_e610.h b/drivers/net/ixgbe/base/ixgbe_type_e610.h
index 9e72053e2a..dcb874e42e 100644
--- a/drivers/net/ixgbe/base/ixgbe_type_e610.h
+++ b/drivers/net/ixgbe/base/ixgbe_type_e610.h
@@ -672,6 +672,8 @@ struct ixgbe_aci_cmd_list_caps_elem {
 	__le16 cap;
 #define IXGBE_ACI_CAPS_VALID_FUNCTIONS			0x0005
 #define IXGBE_ACI_MAX_VALID_FUNCTIONS			0x8
+#define IXGBE_ACI_CAPS_SRIOV				0x0012
+#define IXGBE_ACI_CAPS_VF				0x0013
 #define IXGBE_ACI_CAPS_VMDQ				0x0014
 #define IXGBE_ACI_CAPS_VSI				0x0017
 #define IXGBE_ACI_CAPS_DCB				0x0018
@@ -1954,6 +1956,8 @@ struct ixgbe_hw_common_caps {
 #define IXGBE_MAX_SUPPORTED_GPIO_SDP	8
 	u8 led[IXGBE_MAX_SUPPORTED_GPIO_LED];
 	u8 sdp[IXGBE_MAX_SUPPORTED_GPIO_SDP];
+	/* SR-IOV virtualization */
+	u8 sr_iov_1_1;			/* SR-IOV enabled */
 	/* VMDQ */
 	u8 vmdq;			/* VMDQ supported */
 
-- 
2.43.5


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

* [PATCH v1 03/15] net/ixgbe/base: add missing E610 definitions
  2024-08-29  9:00 [PATCH v1 01/15] net/ixgbe/base: remove minsrevs code from DPDK Anatoly Burakov
  2024-08-29  9:00 ` [PATCH v1 02/15] net/ixgbe/base: add missing ACI definitions Anatoly Burakov
@ 2024-08-29  9:00 ` Anatoly Burakov
  2024-08-29  9:00 ` [PATCH v1 04/15] net/ixgbe/base: add missing legacy mailbox API Anatoly Burakov
                   ` (12 subsequent siblings)
  14 siblings, 0 replies; 17+ messages in thread
From: Anatoly Burakov @ 2024-08-29  9:00 UTC (permalink / raw)
  To: dev, Piotr Kwapulinski, Jedrzej Jagielski, Carolyn Wyborny

When adding support for E610 bringup, some definitions and code paths were
accidentally omitted due to the way the shared driver snapshot was created.
Add missing definitions and code paths.

Fixes: 316637762a5f ("net/ixgbe/base: enable E610 device")

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
---
 drivers/net/ixgbe/base/ixgbe_api.c       | 5 +++++
 drivers/net/ixgbe/base/ixgbe_type.h      | 2 ++
 drivers/net/ixgbe/base/ixgbe_type_e610.h | 3 +++
 3 files changed, 10 insertions(+)

diff --git a/drivers/net/ixgbe/base/ixgbe_api.c b/drivers/net/ixgbe/base/ixgbe_api.c
index c8f9a6d9f1..b4920867bc 100644
--- a/drivers/net/ixgbe/base/ixgbe_api.c
+++ b/drivers/net/ixgbe/base/ixgbe_api.c
@@ -87,6 +87,7 @@ s32 ixgbe_init_shared_code(struct ixgbe_hw *hw)
 	case ixgbe_mac_X550_vf:
 	case ixgbe_mac_X550EM_x_vf:
 	case ixgbe_mac_X550EM_a_vf:
+	case ixgbe_mac_E610_vf:
 		status = ixgbe_init_ops_vf(hw);
 		break;
 	case ixgbe_mac_E610:
@@ -219,6 +220,10 @@ s32 ixgbe_set_mac_type(struct ixgbe_hw *hw)
 		hw->mac.type = ixgbe_mac_E610;
 		hw->mvals = ixgbe_mvals_X550EM_a;
 		break;
+	case IXGBE_DEV_ID_E610_VF:
+		hw->mac.type = ixgbe_mac_E610_vf;
+		hw->mvals = ixgbe_mvals_X550EM_a;
+		break;
 	default:
 		ret_val = IXGBE_ERR_DEVICE_NOT_SUPPORTED;
 		ERROR_REPORT2(IXGBE_ERROR_UNSUPPORTED,
diff --git a/drivers/net/ixgbe/base/ixgbe_type.h b/drivers/net/ixgbe/base/ixgbe_type.h
index d86049426e..f6d5052c65 100644
--- a/drivers/net/ixgbe/base/ixgbe_type.h
+++ b/drivers/net/ixgbe/base/ixgbe_type.h
@@ -130,6 +130,7 @@
 #define IXGBE_DEV_ID_E610_10G_T			0x57B0
 #define IXGBE_DEV_ID_E610_2_5G_T		0x57B1
 #define IXGBE_DEV_ID_E610_SGMII			0x57B2
+#define IXGBE_DEV_ID_E610_VF			0x57AD
 
 #define IXGBE_CAT(r, m) IXGBE_##r##m
 
@@ -3676,6 +3677,7 @@ enum ixgbe_mac_type {
 	ixgbe_mac_X550EM_x_vf,
 	ixgbe_mac_X550EM_a_vf,
 	ixgbe_mac_E610,
+	ixgbe_mac_E610_vf,
 	ixgbe_num_macs
 };
 
diff --git a/drivers/net/ixgbe/base/ixgbe_type_e610.h b/drivers/net/ixgbe/base/ixgbe_type_e610.h
index dcb874e42e..ab57852f19 100644
--- a/drivers/net/ixgbe/base/ixgbe_type_e610.h
+++ b/drivers/net/ixgbe/base/ixgbe_type_e610.h
@@ -2080,6 +2080,8 @@ struct ixgbe_orom_civd_info {
 /* Function specific capabilities */
 struct ixgbe_hw_func_caps {
 	struct ixgbe_hw_common_caps common_cap;
+	u32 num_allocd_vfs;		/* Number of allocated VFs */
+	u32 vf_base_id;			/* Logical ID of the first VF */
 	u32 guar_num_vsi;
 	struct ixgbe_ts_func_info ts_func_info;
 	bool no_drop_policy_ena;
@@ -2088,6 +2090,7 @@ struct ixgbe_hw_func_caps {
 /* Device wide capabilities */
 struct ixgbe_hw_dev_caps {
 	struct ixgbe_hw_common_caps common_cap;
+	u32 num_vfs_exposed;		/* Total number of VFs exposed */
 	u32 num_vsi_allocd_to_host;	/* Excluding EMP VSI */
 	u32 num_flow_director_fltr;	/* Number of FD filters available */
 	struct ixgbe_ts_dev_info ts_dev_info;
-- 
2.43.5


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

* [PATCH v1 04/15] net/ixgbe/base: add missing legacy mailbox API
  2024-08-29  9:00 [PATCH v1 01/15] net/ixgbe/base: remove minsrevs code from DPDK Anatoly Burakov
  2024-08-29  9:00 ` [PATCH v1 02/15] net/ixgbe/base: add missing ACI definitions Anatoly Burakov
  2024-08-29  9:00 ` [PATCH v1 03/15] net/ixgbe/base: add missing E610 definitions Anatoly Burakov
@ 2024-08-29  9:00 ` Anatoly Burakov
  2024-08-29  9:00 ` [PATCH v1 05/15] net/ixgbe/base: add E610 VF HV macro Anatoly Burakov
                   ` (11 subsequent siblings)
  14 siblings, 0 replies; 17+ messages in thread
From: Anatoly Burakov @ 2024-08-29  9:00 UTC (permalink / raw)
  To: dev, Jakub Chylkowski, Alice Michael, Piotr Pietruszewski

When the new mailbox API was introduced, the legacy mailbox API was also
provided, but was missing from the patches due to the way the patches were
generated. This patch adds the missing legacy mailbox API to the driver.

Fixes: 6d243d2caf2c ("net/ixgbe/base: introduce new mailbox API")

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
---
 drivers/net/ixgbe/base/ixgbe_mbx.c | 44 ++++++++++++++++++++++++++++++
 drivers/net/ixgbe/base/ixgbe_mbx.h |  1 +
 2 files changed, 45 insertions(+)

diff --git a/drivers/net/ixgbe/base/ixgbe_mbx.c b/drivers/net/ixgbe/base/ixgbe_mbx.c
index 444a0d339d..23659266d0 100644
--- a/drivers/net/ixgbe/base/ixgbe_mbx.c
+++ b/drivers/net/ixgbe/base/ixgbe_mbx.c
@@ -169,6 +169,26 @@ s32 ixgbe_check_for_rst(struct ixgbe_hw *hw, u16 mbx_id)
 	return ret_val;
 }
 
+/**
+ * ixgbe_clear_mbx - Clear Mailbox Memory
+ * @hw: pointer to the HW structure
+ * @mbx_id: id of mailbox to write
+ *
+ * Set VFMBMEM of given VF to 0x0.
+ **/
+s32 ixgbe_clear_mbx(struct ixgbe_hw *hw, u16 mbx_id)
+{
+	struct ixgbe_mbx_info *mbx = &hw->mbx;
+	s32 ret_val = IXGBE_ERR_CONFIG;
+
+	DEBUGFUNC("ixgbe_clear_mbx");
+
+	if (mbx->ops[mbx_id].clear)
+		ret_val = mbx->ops[mbx_id].clear(hw, mbx_id);
+
+	return ret_val;
+}
+
 /**
  * ixgbe_poll_for_msg - Wait for message notification
  * @hw: pointer to the HW structure
@@ -628,6 +648,7 @@ void ixgbe_init_mbx_params_vf(struct ixgbe_hw *hw)
 	mbx->ops[0].check_for_msg = ixgbe_check_for_msg_vf;
 	mbx->ops[0].check_for_ack = ixgbe_check_for_ack_vf;
 	mbx->ops[0].check_for_rst = ixgbe_check_for_rst_vf;
+	mbx->ops[0].clear = NULL;
 
 	mbx->stats.msgs_tx = 0;
 	mbx->stats.msgs_rx = 0;
@@ -1024,6 +1045,27 @@ STATIC s32 ixgbe_read_mbx_pf(struct ixgbe_hw *hw, u32 *msg, u16 size,
 	return IXGBE_SUCCESS;
 }
 
+/**
+ * ixgbe_clear_mbx_pf - Clear Mailbox Memory
+ * @hw: pointer to the HW structure
+ * @vf_id: the VF index
+ *
+ * Set VFMBMEM of given VF to 0x0.
+ **/
+STATIC s32 ixgbe_clear_mbx_pf(struct ixgbe_hw *hw, u16 vf_id)
+{
+	u16 mbx_size = hw->mbx.size;
+	u16 i;
+
+	if (vf_id > 63)
+		return IXGBE_ERR_PARAM;
+
+	for (i = 0; i < mbx_size; ++i)
+		IXGBE_WRITE_REG_ARRAY(hw, IXGBE_PFMBMEM(vf_id), i, 0x0);
+
+	return IXGBE_SUCCESS;
+}
+
 /**
  * ixgbe_init_mbx_params_pf_id - set initial values for pf mailbox
  * @hw: pointer to the HW structure
@@ -1042,6 +1084,7 @@ void ixgbe_init_mbx_params_pf_id(struct ixgbe_hw *hw, u16 vf_id)
 	mbx->ops[vf_id].check_for_msg = ixgbe_check_for_msg_pf;
 	mbx->ops[vf_id].check_for_ack = ixgbe_check_for_ack_pf;
 	mbx->ops[vf_id].check_for_rst = ixgbe_check_for_rst_pf;
+	mbx->ops[vf_id].clear = ixgbe_clear_mbx_pf;
 }
 
 /**
@@ -1119,6 +1162,7 @@ void ixgbe_upgrade_mbx_params_pf(struct ixgbe_hw *hw, u16 vf_id)
 	mbx->ops[vf_id].check_for_msg = ixgbe_check_for_msg_pf;
 	mbx->ops[vf_id].check_for_ack = ixgbe_check_for_ack_pf;
 	mbx->ops[vf_id].check_for_rst = ixgbe_check_for_rst_pf;
+	mbx->ops[vf_id].clear = ixgbe_clear_mbx_pf;
 
 	mbx->stats.msgs_tx = 0;
 	mbx->stats.msgs_rx = 0;
diff --git a/drivers/net/ixgbe/base/ixgbe_mbx.h b/drivers/net/ixgbe/base/ixgbe_mbx.h
index 56ab435286..434f7c6a69 100644
--- a/drivers/net/ixgbe/base/ixgbe_mbx.h
+++ b/drivers/net/ixgbe/base/ixgbe_mbx.h
@@ -168,6 +168,7 @@ s32 ixgbe_write_mbx(struct ixgbe_hw *hw, u32 *msg, u16 size, u16 mbx_id);
 s32 ixgbe_check_for_msg(struct ixgbe_hw *hw, u16 mbx_id);
 s32 ixgbe_check_for_ack(struct ixgbe_hw *hw, u16 mbx_id);
 s32 ixgbe_check_for_rst(struct ixgbe_hw *hw, u16 mbx_id);
+s32 ixgbe_clear_mbx(struct ixgbe_hw *hw, u16 vf_number);
 void ixgbe_init_mbx_params_vf(struct ixgbe_hw *hw);
 void ixgbe_upgrade_mbx_params_vf(struct ixgbe_hw *hw);
 void ixgbe_init_mbx_params_pf(struct ixgbe_hw *hw);
-- 
2.43.5


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

* [PATCH v1 05/15] net/ixgbe/base: add E610 VF HV macro
  2024-08-29  9:00 [PATCH v1 01/15] net/ixgbe/base: remove minsrevs code from DPDK Anatoly Burakov
                   ` (2 preceding siblings ...)
  2024-08-29  9:00 ` [PATCH v1 04/15] net/ixgbe/base: add missing legacy mailbox API Anatoly Burakov
@ 2024-08-29  9:00 ` Anatoly Burakov
  2024-08-29  9:00 ` [PATCH v1 06/15] net/ixgbe/base: fix unchecked return value Anatoly Burakov
                   ` (10 subsequent siblings)
  14 siblings, 0 replies; 17+ messages in thread
From: Anatoly Burakov @ 2024-08-29  9:00 UTC (permalink / raw)
  To: dev

From: Jedrzej Jagielski <jedrzej.jagielski@intel.com>

At this point there is no macro specific for E610 VF HV.
Add it to ixgbe_type.h

Signed-off-by: Jedrzej Jagielski <jedrzej.jagielski@intel.com>
Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
---
 drivers/net/ixgbe/base/ixgbe_type.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/ixgbe/base/ixgbe_type.h b/drivers/net/ixgbe/base/ixgbe_type.h
index f6d5052c65..cc49eace91 100644
--- a/drivers/net/ixgbe/base/ixgbe_type.h
+++ b/drivers/net/ixgbe/base/ixgbe_type.h
@@ -131,6 +131,7 @@
 #define IXGBE_DEV_ID_E610_2_5G_T		0x57B1
 #define IXGBE_DEV_ID_E610_SGMII			0x57B2
 #define IXGBE_DEV_ID_E610_VF			0x57AD
+#define IXGBE_SUBDEV_ID_E610_VF_HV		0x0001
 
 #define IXGBE_CAT(r, m) IXGBE_##r##m
 
-- 
2.43.5


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

* [PATCH v1 06/15] net/ixgbe/base: fix unchecked return value
  2024-08-29  9:00 [PATCH v1 01/15] net/ixgbe/base: remove minsrevs code from DPDK Anatoly Burakov
                   ` (3 preceding siblings ...)
  2024-08-29  9:00 ` [PATCH v1 05/15] net/ixgbe/base: add E610 VF HV macro Anatoly Burakov
@ 2024-08-29  9:00 ` Anatoly Burakov
  2024-08-29  9:00 ` [PATCH v1 07/15] net/ixgbe/base: fix media type handling for E610 Anatoly Burakov
                   ` (9 subsequent siblings)
  14 siblings, 0 replies; 17+ messages in thread
From: Anatoly Burakov @ 2024-08-29  9:00 UTC (permalink / raw)
  To: dev

From: Barbara Skobiej <barbara.skobiej@intel.com>

There was unchecked return value in the ixgbe_stop_mac_link_on_d3_82599
function. Added checking of return value from the called function
ixgbe_read_eeprom.

Signed-off-by: Barbara Skobiej <barbara.skobiej@intel.com>
Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
---
 drivers/net/ixgbe/base/ixgbe_82599.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ixgbe/base/ixgbe_82599.c b/drivers/net/ixgbe/base/ixgbe_82599.c
index c4ad906f0f..3110477700 100644
--- a/drivers/net/ixgbe/base/ixgbe_82599.c
+++ b/drivers/net/ixgbe/base/ixgbe_82599.c
@@ -556,13 +556,15 @@ enum ixgbe_media_type ixgbe_get_media_type_82599(struct ixgbe_hw *hw)
  **/
 void ixgbe_stop_mac_link_on_d3_82599(struct ixgbe_hw *hw)
 {
-	u32 autoc2_reg;
 	u16 ee_ctrl_2 = 0;
+	u32 autoc2_reg;
+	u32 status;
 
 	DEBUGFUNC("ixgbe_stop_mac_link_on_d3_82599");
-	ixgbe_read_eeprom(hw, IXGBE_EEPROM_CTRL_2, &ee_ctrl_2);
+	status = ixgbe_read_eeprom(hw, IXGBE_EEPROM_CTRL_2, &ee_ctrl_2);
 
-	if (!ixgbe_mng_present(hw) && !hw->wol_enabled &&
+	if (status == IXGBE_SUCCESS &&
+	    !ixgbe_mng_present(hw) && !hw->wol_enabled &&
 	    ee_ctrl_2 & IXGBE_EEPROM_CCD_BIT) {
 		autoc2_reg = IXGBE_READ_REG(hw, IXGBE_AUTOC2);
 		autoc2_reg |= IXGBE_AUTOC2_LINK_DISABLE_ON_D3_MASK;
-- 
2.43.5


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

* [PATCH v1 07/15] net/ixgbe/base: fix media type handling for E610
  2024-08-29  9:00 [PATCH v1 01/15] net/ixgbe/base: remove minsrevs code from DPDK Anatoly Burakov
                   ` (4 preceding siblings ...)
  2024-08-29  9:00 ` [PATCH v1 06/15] net/ixgbe/base: fix unchecked return value Anatoly Burakov
@ 2024-08-29  9:00 ` Anatoly Burakov
  2024-08-29  9:00 ` [PATCH v1 08/15] net/ixgbe/base: fix speed autonegotiation on E610 Anatoly Burakov
                   ` (8 subsequent siblings)
  14 siblings, 0 replies; 17+ messages in thread
From: Anatoly Burakov @ 2024-08-29  9:00 UTC (permalink / raw)
  To: dev

From: Krzysztof Galazka <krzysztof.galazka@intel.com>

Media type information should not be updated by ixgbe_aci_get_link_info
function because it will be incorrectly set as unknown when link is down.
Do it only in ixgbe_get_media_type_E610.

Signed-off-by: Krzysztof Galazka <krzysztof.galazka@intel.com>
Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
---
 drivers/net/ixgbe/base/ixgbe_e610.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/drivers/net/ixgbe/base/ixgbe_e610.c b/drivers/net/ixgbe/base/ixgbe_e610.c
index 1f3a4532da..b9b1ba32c3 100644
--- a/drivers/net/ixgbe/base/ixgbe_e610.c
+++ b/drivers/net/ixgbe/base/ixgbe_e610.c
@@ -1683,7 +1683,6 @@ s32 ixgbe_aci_get_link_info(struct ixgbe_hw *hw, bool ena_lse,
 	struct ixgbe_aci_cmd_get_link_status *resp;
 	struct ixgbe_link_status *li_old, *li;
 	struct ixgbe_fc_info *hw_fc_info;
-	enum ixgbe_media_type *hw_media_type;
 	struct ixgbe_aci_desc desc;
 	bool tx_pause, rx_pause;
 	u8 cmd_flags;
@@ -1693,7 +1692,6 @@ s32 ixgbe_aci_get_link_info(struct ixgbe_hw *hw, bool ena_lse,
 		return IXGBE_ERR_PARAM;
 
 	li_old = &hw->link.link_info_old;
-	hw_media_type = &hw->phy.media_type;
 	li = &hw->link.link_info;
 	hw_fc_info = &hw->fc;
 
@@ -1714,7 +1712,6 @@ s32 ixgbe_aci_get_link_info(struct ixgbe_hw *hw, bool ena_lse,
 	li->link_speed = IXGBE_LE16_TO_CPU(link_data.link_speed);
 	li->phy_type_low = IXGBE_LE64_TO_CPU(link_data.phy_type_low);
 	li->phy_type_high = IXGBE_LE64_TO_CPU(link_data.phy_type_high);
-	*hw_media_type = ixgbe_get_media_type_from_phy_type(hw);
 	li->link_info = link_data.link_info;
 	li->link_cfg_err = link_data.link_cfg_err;
 	li->an_info = link_data.an_info;
@@ -3664,10 +3661,11 @@ enum ixgbe_media_type ixgbe_get_media_type_E610(struct ixgbe_hw *hw)
 			}
 		}
 
-		/* Based on search above try to discover media type */
-		hw->phy.media_type = ixgbe_get_media_type_from_phy_type(hw);
 	}
 
+	/* Based on link status or search above try to discover media type */
+	hw->phy.media_type = ixgbe_get_media_type_from_phy_type(hw);
+
 	return hw->phy.media_type;
 }
 
-- 
2.43.5


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

* [PATCH v1 08/15] net/ixgbe/base: fix speed autonegotiation on E610
  2024-08-29  9:00 [PATCH v1 01/15] net/ixgbe/base: remove minsrevs code from DPDK Anatoly Burakov
                   ` (5 preceding siblings ...)
  2024-08-29  9:00 ` [PATCH v1 07/15] net/ixgbe/base: fix media type handling for E610 Anatoly Burakov
@ 2024-08-29  9:00 ` Anatoly Burakov
  2024-08-29  9:00 ` [PATCH v1 09/15] net/ixgbe/base: FW API version update Anatoly Burakov
                   ` (7 subsequent siblings)
  14 siblings, 0 replies; 17+ messages in thread
From: Anatoly Burakov @ 2024-08-29  9:00 UTC (permalink / raw)
  To: dev

From: Krzysztof Galazka <krzysztof.galazka@intel.com>

When user changed advertised speed settings and link was already up
driver asked FW only for active PHY configuration. This prevented it from
adding speeds, which are supported but was earlier disabled by user. Get
all speeds supported by HW to allow user enabling any of them.

Signed-off-by: Krzysztof Galazka <krzysztof.galazka@intel.com>
Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
---
 drivers/net/ixgbe/base/ixgbe_e610.c | 16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ixgbe/base/ixgbe_e610.c b/drivers/net/ixgbe/base/ixgbe_e610.c
index b9b1ba32c3..6eaf377f4a 100644
--- a/drivers/net/ixgbe/base/ixgbe_e610.c
+++ b/drivers/net/ixgbe/base/ixgbe_e610.c
@@ -4342,7 +4342,8 @@ s32 ixgbe_setup_phy_link_E610(struct ixgbe_hw *hw)
 {
 	struct ixgbe_aci_cmd_get_phy_caps_data pcaps;
 	struct ixgbe_aci_cmd_set_phy_cfg_data pcfg;
-	u8 rmode = IXGBE_ACI_REPORT_ACTIVE_CFG;
+	u8 rmode = IXGBE_ACI_REPORT_TOPO_CAP_MEDIA;
+	u64 sup_phy_type_low, sup_phy_type_high;
 	s32 rc;
 
 	rc = ixgbe_aci_get_link_info(hw, false, NULL);
@@ -4359,6 +4360,15 @@ s32 ixgbe_setup_phy_link_E610(struct ixgbe_hw *hw)
 		goto err;
 	}
 
+	sup_phy_type_low = pcaps.phy_type_low;
+	sup_phy_type_high = pcaps.phy_type_high;
+
+	/* Get Active configuration to avoid unintended changes */
+	rc = ixgbe_aci_get_phy_caps(hw, false, IXGBE_ACI_REPORT_ACTIVE_CFG,
+				    &pcaps);
+	if (rc) {
+		goto err;
+	}
 	ixgbe_copy_phy_caps_to_cfg(&pcaps, &pcfg);
 
 	/* Set default PHY types for a given speed */
@@ -4406,8 +4416,8 @@ s32 ixgbe_setup_phy_link_E610(struct ixgbe_hw *hw)
 	}
 
 	/* Mask the set values to avoid requesting unsupported link types */
-	pcfg.phy_type_low &= pcaps.phy_type_low;
-	pcfg.phy_type_high &= pcaps.phy_type_high;
+	pcfg.phy_type_low &= sup_phy_type_low;
+	pcfg.phy_type_high &= sup_phy_type_high;
 
 	if (pcfg.phy_type_high != pcaps.phy_type_high ||
 	    pcfg.phy_type_low != pcaps.phy_type_low ||
-- 
2.43.5


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

* [PATCH v1 09/15] net/ixgbe/base: FW API version update
  2024-08-29  9:00 [PATCH v1 01/15] net/ixgbe/base: remove minsrevs code from DPDK Anatoly Burakov
                   ` (6 preceding siblings ...)
  2024-08-29  9:00 ` [PATCH v1 08/15] net/ixgbe/base: fix speed autonegotiation on E610 Anatoly Burakov
@ 2024-08-29  9:00 ` Anatoly Burakov
  2024-08-29  9:00 ` [PATCH v1 10/15] net/ixgbe/base: handle 5G link speed for E610 Anatoly Burakov
                   ` (6 subsequent siblings)
  14 siblings, 0 replies; 17+ messages in thread
From: Anatoly Burakov @ 2024-08-29  9:00 UTC (permalink / raw)
  To: dev

From: Pawel Malinowski <pawel.malinowski@intel.com>

Update FW API version to 1.7.

Signed-off-by: Pawel Malinowski <pawel.malinowski@intel.com>
Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
---
 drivers/net/ixgbe/base/ixgbe_type_e610.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ixgbe/base/ixgbe_type_e610.h b/drivers/net/ixgbe/base/ixgbe_type_e610.h
index ab57852f19..bad332c6b8 100644
--- a/drivers/net/ixgbe/base/ixgbe_type_e610.h
+++ b/drivers/net/ixgbe/base/ixgbe_type_e610.h
@@ -351,7 +351,7 @@
  */
 #define IXGBE_FW_API_VER_BRANCH		0x00
 #define IXGBE_FW_API_VER_MAJOR		0x01
-#define IXGBE_FW_API_VER_MINOR		0x05
+#define IXGBE_FW_API_VER_MINOR		0x07
 #define IXGBE_FW_API_VER_DIFF_ALLOWED	0x02
 
 #define IXGBE_ACI_DESC_SIZE		32
-- 
2.43.5


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

* [PATCH v1 10/15] net/ixgbe/base: handle 5G link speed for E610
  2024-08-29  9:00 [PATCH v1 01/15] net/ixgbe/base: remove minsrevs code from DPDK Anatoly Burakov
                   ` (7 preceding siblings ...)
  2024-08-29  9:00 ` [PATCH v1 09/15] net/ixgbe/base: FW API version update Anatoly Burakov
@ 2024-08-29  9:00 ` Anatoly Burakov
  2024-08-29  9:00 ` [PATCH v1 11/15] net/ixgbe/base: remove FW API version check Anatoly Burakov
                   ` (5 subsequent siblings)
  14 siblings, 0 replies; 17+ messages in thread
From: Anatoly Burakov @ 2024-08-29  9:00 UTC (permalink / raw)
  To: dev

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

When detecting the 5G link speed take into account the E610 VF MAC type in
ixgbe_check_mac_link_vf().

Signed-off-by: Piotr Kwapulinski <piotr.kwapulinski@intel.com>
Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
---
 drivers/net/ixgbe/base/ixgbe_vf.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ixgbe/base/ixgbe_vf.c b/drivers/net/ixgbe/base/ixgbe_vf.c
index 0d5b29ba50..37556a9300 100644
--- a/drivers/net/ixgbe/base/ixgbe_vf.c
+++ b/drivers/net/ixgbe/base/ixgbe_vf.c
@@ -628,7 +628,8 @@ s32 ixgbe_check_mac_link_vf(struct ixgbe_hw *hw, ixgbe_link_speed *speed,
 		break;
 	case IXGBE_LINKS_SPEED_100_82599:
 		*speed = IXGBE_LINK_SPEED_100_FULL;
-		if (hw->mac.type == ixgbe_mac_X550_vf) {
+		if (hw->mac.type == ixgbe_mac_X550_vf ||
+		    hw->mac.type == ixgbe_mac_E610_vf) {
 			if (links_reg & IXGBE_LINKS_SPEED_NON_STD)
 				*speed = IXGBE_LINK_SPEED_5GB_FULL;
 		}
-- 
2.43.5


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

* [PATCH v1 11/15] net/ixgbe/base: remove FW API version check
  2024-08-29  9:00 [PATCH v1 01/15] net/ixgbe/base: remove minsrevs code from DPDK Anatoly Burakov
                   ` (8 preceding siblings ...)
  2024-08-29  9:00 ` [PATCH v1 10/15] net/ixgbe/base: handle 5G link speed for E610 Anatoly Burakov
@ 2024-08-29  9:00 ` Anatoly Burakov
  2024-08-29  9:00 ` [PATCH v1 12/15] net/ixgbe/base: disable thermal sensor ops for E610 Anatoly Burakov
                   ` (4 subsequent siblings)
  14 siblings, 0 replies; 17+ messages in thread
From: Anatoly Burakov @ 2024-08-29  9:00 UTC (permalink / raw)
  To: dev

From: Krzysztof Galazka <krzysztof.galazka@intel.com>

Only certain variants of drivers rely on FW API version check in shared
code. Other drivers implement their own logic due to differences in
requirements. DPDK does not require the FW API check.

Signed-off-by: Krzysztof Galazka <krzysztof.galazka@intel.com>
Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
---
 drivers/net/ixgbe/base/ixgbe_e610.c | 31 +----------------------------
 1 file changed, 1 insertion(+), 30 deletions(-)

diff --git a/drivers/net/ixgbe/base/ixgbe_e610.c b/drivers/net/ixgbe/base/ixgbe_e610.c
index 6eaf377f4a..7ea495db97 100644
--- a/drivers/net/ixgbe/base/ixgbe_e610.c
+++ b/drivers/net/ixgbe/base/ixgbe_e610.c
@@ -3541,32 +3541,7 @@ s32 ixgbe_reset_hw_E610(struct ixgbe_hw *hw)
 reset_hw_out:
 	return status;
 }
-/**
- * ixgbe_fw_ver_check - Check the reported FW API version
- * @hw: pointer to the hardware structure
- *
- * Checks if the driver should load on a given FW API version.
- *
- * Return: 'true' if the driver should attempt to load. 'false' otherwise.
- */
-static bool ixgbe_fw_ver_check(struct ixgbe_hw *hw)
-{
-	if (hw->api_maj_ver > IXGBE_FW_API_VER_MAJOR) {
-		ERROR_REPORT1(IXGBE_ERROR_UNSUPPORTED, "The driver for the device stopped because the NVM image is newer than expected. You must install the most recent version of the network driver.\n");
-		return false;
-	} else if (hw->api_maj_ver == IXGBE_FW_API_VER_MAJOR) {
-		if (hw->api_min_ver >
-		    (IXGBE_FW_API_VER_MINOR + IXGBE_FW_API_VER_DIFF_ALLOWED)) {
-			ERROR_REPORT1(IXGBE_ERROR_CAUTION, "The driver for the device detected a newer version of the NVM image than expected. Please install the most recent version of the network driver.\n");
-		} else if ((hw->api_min_ver + IXGBE_FW_API_VER_DIFF_ALLOWED) <
-			   IXGBE_FW_API_VER_MINOR) {
-			ERROR_REPORT1(IXGBE_ERROR_CAUTION, "The driver for the device detected an older version of the NVM image than expected. Please update the NVM image.\n");
-		}
-	} else {
-		ERROR_REPORT1(IXGBE_ERROR_CAUTION, "The driver for the device detected an older version of the NVM image than expected. Please update the NVM image.\n");
-	}
-	return true;
-}
+
 /**
  * ixgbe_start_hw_E610 - Prepare hardware for Tx/Rx
  * @hw: pointer to hardware structure
@@ -3584,10 +3559,6 @@ s32 ixgbe_start_hw_E610(struct ixgbe_hw *hw)
 	if (ret_val)
 		goto out;
 
-	if (!ixgbe_fw_ver_check(hw)) {
-		ret_val = IXGBE_ERR_FW_API_VER;
-		goto out;
-	}
 	ret_val = ixgbe_start_hw_generic(hw);
 	if (ret_val != IXGBE_SUCCESS)
 		goto out;
-- 
2.43.5


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

* [PATCH v1 12/15] net/ixgbe/base: disable thermal sensor ops for E610
  2024-08-29  9:00 [PATCH v1 01/15] net/ixgbe/base: remove minsrevs code from DPDK Anatoly Burakov
                   ` (9 preceding siblings ...)
  2024-08-29  9:00 ` [PATCH v1 11/15] net/ixgbe/base: remove FW API version check Anatoly Burakov
@ 2024-08-29  9:00 ` Anatoly Burakov
  2024-08-29  9:00 ` [PATCH v1 13/15] net/ixgbe/base: fix mailbox ACK handling Anatoly Burakov
                   ` (3 subsequent siblings)
  14 siblings, 0 replies; 17+ messages in thread
From: Anatoly Burakov @ 2024-08-29  9:00 UTC (permalink / raw)
  To: dev; +Cc: RemigiuszX Konca

From: Andrzej Wilczynski <andrzejx.wilczynski@intel.com>

According to data sheet, E610 doesn't expose current reading from thermal
sensors. Currently, E610 sensor ops are the same as for X540, which will
include the unsupported op. This patch disables those ops for E610 to avoid
attempts to read those sensors.

Signed-off-by: Andrzej Wilczynski <andrzejx.wilczynski@intel.com>
Co-authored-by: RemigiuszX Konca <remigiusz.konca@intel.com>
Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
---
 drivers/net/ixgbe/base/ixgbe_e610.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/ixgbe/base/ixgbe_e610.c b/drivers/net/ixgbe/base/ixgbe_e610.c
index 7ea495db97..ab02b11d6a 100644
--- a/drivers/net/ixgbe/base/ixgbe_e610.c
+++ b/drivers/net/ixgbe/base/ixgbe_e610.c
@@ -3431,6 +3431,8 @@ s32 ixgbe_init_ops_E610(struct ixgbe_hw *hw)
 	mac->ops.get_fw_tsam_mode = ixgbe_get_fw_tsam_mode_E610;
 	mac->ops.get_fw_version = ixgbe_aci_get_fw_ver;
 	mac->ops.get_nvm_version = ixgbe_get_active_nvm_ver;
+	mac->ops.get_thermal_sensor_data = NULL;
+	mac->ops.init_thermal_sensor_thresh = NULL;
 
 	/* PHY */
 	phy->ops.init = ixgbe_init_phy_ops_E610;
-- 
2.43.5


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

* [PATCH v1 13/15] net/ixgbe/base: fix mailbox ACK handling
  2024-08-29  9:00 [PATCH v1 01/15] net/ixgbe/base: remove minsrevs code from DPDK Anatoly Burakov
                   ` (10 preceding siblings ...)
  2024-08-29  9:00 ` [PATCH v1 12/15] net/ixgbe/base: disable thermal sensor ops for E610 Anatoly Burakov
@ 2024-08-29  9:00 ` Anatoly Burakov
  2024-08-29  9:00 ` [PATCH v1 14/15] net/ixgbe/base: correct NVM access type for EEPROM writes on E610 Anatoly Burakov
                   ` (2 subsequent siblings)
  14 siblings, 0 replies; 17+ messages in thread
From: Anatoly Burakov @ 2024-08-29  9:00 UTC (permalink / raw)
  To: dev

From: NorbertX Ciosek <norbertx.ciosek@intel.com>

Check if CTS bit is set in the mailbox message before waiting for ACK.
Otherwise ACK will never be received causing the function to timeout. Add
a note for ixgbe_write_mbx that it should be called while holding a lock.

Signed-off-by: NorbertX Ciosek <norbertx.ciosek@intel.com>
Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
---
 drivers/net/ixgbe/base/ixgbe_mbx.c | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ixgbe/base/ixgbe_mbx.c b/drivers/net/ixgbe/base/ixgbe_mbx.c
index 23659266d0..fb8ea8ca68 100644
--- a/drivers/net/ixgbe/base/ixgbe_mbx.c
+++ b/drivers/net/ixgbe/base/ixgbe_mbx.c
@@ -82,6 +82,9 @@ s32 ixgbe_poll_mbx(struct ixgbe_hw *hw, u32 *msg, u16 size, u16 mbx_id)
  *
  * returns SUCCESS if it successfully copied message into the buffer and
  * received an ACK to that message within specified period
+ *
+ * Note that the caller to this function must lock before calling, since
+ * multiple threads can destroy each other messages.
  **/
 s32 ixgbe_write_mbx(struct ixgbe_hw *hw, u32 *msg, u16 size, u16 mbx_id)
 {
@@ -836,6 +839,11 @@ STATIC s32 ixgbe_obtain_mbx_lock_pf(struct ixgbe_hw *hw, u16 vf_id)
 	while (countdown--) {
 		/* Reserve mailbox for PF use */
 		pf_mailbox = IXGBE_READ_REG(hw, IXGBE_PFMAILBOX(vf_id));
+
+		/* Check if other thread holds the PF lock already */
+		if (pf_mailbox & IXGBE_PFMAILBOX_PFU)
+			goto retry;
+
 		pf_mailbox |= IXGBE_PFMAILBOX_PFU;
 		IXGBE_WRITE_REG(hw, IXGBE_PFMAILBOX(vf_id), pf_mailbox);
 
@@ -846,6 +854,7 @@ STATIC s32 ixgbe_obtain_mbx_lock_pf(struct ixgbe_hw *hw, u16 vf_id)
 			break;
 		}
 
+	retry:
 		/* Wait a bit before trying again */
 		usec_delay(mbx->usec_delay);
 	}
@@ -948,13 +957,14 @@ STATIC s32 ixgbe_write_mbx_pf(struct ixgbe_hw *hw, u32 *msg, u16 size,
 	for (i = 0; i < size; i++)
 		IXGBE_WRITE_REG_ARRAY(hw, IXGBE_PFMBMEM(vf_id), i, msg[i]);
 
-	/* Interrupt VF to tell it a message has been sent */
+	/* interrupt VF to tell it a message has been sent */
 	pf_mailbox = IXGBE_READ_REG(hw, IXGBE_PFMAILBOX(vf_id));
 	pf_mailbox |= IXGBE_PFMAILBOX_STS;
 	IXGBE_WRITE_REG(hw, IXGBE_PFMAILBOX(vf_id), pf_mailbox);
 
 	/* if msg sent wait until we receive an ack */
-	ixgbe_poll_for_ack(hw, vf_id);
+	if (msg[0] & IXGBE_VT_MSGTYPE_CTS)
+		ixgbe_poll_for_ack(hw, vf_id);
 
 	/* update stats */
 	hw->mbx.stats.msgs_tx++;
-- 
2.43.5


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

* [PATCH v1 14/15] net/ixgbe/base: correct NVM access type for EEPROM writes on E610
  2024-08-29  9:00 [PATCH v1 01/15] net/ixgbe/base: remove minsrevs code from DPDK Anatoly Burakov
                   ` (11 preceding siblings ...)
  2024-08-29  9:00 ` [PATCH v1 13/15] net/ixgbe/base: fix mailbox ACK handling Anatoly Burakov
@ 2024-08-29  9:00 ` Anatoly Burakov
  2024-08-29  9:00 ` [PATCH v1 15/15] net/ixgbe: add PCI IDs for new device variants Anatoly Burakov
  2024-09-03 14:08 ` [PATCH v1 01/15] net/ixgbe/base: remove minsrevs code from DPDK Bruce Richardson
  14 siblings, 0 replies; 17+ messages in thread
From: Anatoly Burakov @ 2024-08-29  9:00 UTC (permalink / raw)
  To: dev

From: Przemyslaw Gierszynski <przemyslaw.gierszynski@intel.com>

NVM acquire function was incorrectly invoked with a read-only access type
when intending to perform a write operation to the EEPROM. This commit
corrects the access type used during the acquisition of the NVM. The
change ensures that the NVM is acquired with write access before
attempting to write to the EEPROM, aligning with the intended operation.

Signed-off-by: Przemyslaw Gierszynski <przemyslaw.gierszynski@intel.com>
Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
---
 drivers/net/ixgbe/base/ixgbe_e610.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ixgbe/base/ixgbe_e610.c b/drivers/net/ixgbe/base/ixgbe_e610.c
index ab02b11d6a..b0d55a2411 100644
--- a/drivers/net/ixgbe/base/ixgbe_e610.c
+++ b/drivers/net/ixgbe/base/ixgbe_e610.c
@@ -2314,7 +2314,7 @@ s32 ixgbe_nvm_recalculate_checksum(struct ixgbe_hw *hw)
 	struct ixgbe_aci_desc desc;
 	s32 status;
 
-	status = ixgbe_acquire_nvm(hw, IXGBE_RES_READ);
+	status = ixgbe_acquire_nvm(hw, IXGBE_RES_WRITE);
 	if (status)
 		return status;
 
-- 
2.43.5


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

* [PATCH v1 15/15] net/ixgbe: add PCI IDs for new device variants
  2024-08-29  9:00 [PATCH v1 01/15] net/ixgbe/base: remove minsrevs code from DPDK Anatoly Burakov
                   ` (12 preceding siblings ...)
  2024-08-29  9:00 ` [PATCH v1 14/15] net/ixgbe/base: correct NVM access type for EEPROM writes on E610 Anatoly Burakov
@ 2024-08-29  9:00 ` Anatoly Burakov
  2024-09-03 14:08 ` [PATCH v1 01/15] net/ixgbe/base: remove minsrevs code from DPDK Bruce Richardson
  14 siblings, 0 replies; 17+ messages in thread
From: Anatoly Burakov @ 2024-08-29  9:00 UTC (permalink / raw)
  To: dev, Jedrzej Jagielski, Carolyn Wyborny, Piotr Kwapulinski

Include different variants of E610 in the PCI ID table to ensure they are
able to be initialized by DPDK driver.

Fixes: 316637762a5f ("net/ixgbe/base: enable E610 device")

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
---
 drivers/net/ixgbe/ixgbe_ethdev.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
index d88d4065f1..e4263ef50b 100644
--- a/drivers/net/ixgbe/ixgbe_ethdev.c
+++ b/drivers/net/ixgbe/ixgbe_ethdev.c
@@ -449,6 +449,11 @@ static const struct rte_pci_id pci_id_ixgbe_map[] = {
 	{ RTE_PCI_DEVICE(IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_X550EM_X_KX4) },
 	{ RTE_PCI_DEVICE(IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_X550EM_X_KR) },
 	{ RTE_PCI_DEVICE(IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_X550EM_X_XFI) },
+	{ RTE_PCI_DEVICE(IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_E610_10G_T) },
+	{ RTE_PCI_DEVICE(IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_E610_2_5G_T) },
+	{ RTE_PCI_DEVICE(IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_E610_BACKPLANE) },
+	{ RTE_PCI_DEVICE(IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_E610_SFP) },
+	{ RTE_PCI_DEVICE(IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_E610_SGMII) },
 #ifdef RTE_LIBRTE_IXGBE_BYPASS
 	{ RTE_PCI_DEVICE(IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82599_BYPASS) },
 #endif
-- 
2.43.5


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

* Re: [PATCH v1 02/15] net/ixgbe/base: add missing ACI definitions
  2024-08-29  9:00 ` [PATCH v1 02/15] net/ixgbe/base: add missing ACI definitions Anatoly Burakov
@ 2024-09-03 10:32   ` Bruce Richardson
  0 siblings, 0 replies; 17+ messages in thread
From: Bruce Richardson @ 2024-09-03 10:32 UTC (permalink / raw)
  To: Anatoly Burakov; +Cc: dev

On Thu, Aug 29, 2024 at 10:00:07AM +0100, Anatoly Burakov wrote:
> When adding Admin Command Interface and E610 device support, some ACI
> capabilities definition code was missed due to the way shared driver code
> snapshot was generated. Add missing code paths.
> 
> Fixes: 25b48e569f2f ("net/ixgbe/base: add E610 Admin Command Interface")
> Fixes: 7c3bfffda43d ("net/ixgbe/base: detect E610 device capabilities")
> 
> Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
> ---
>  drivers/net/ixgbe/base/ixgbe_e610.c      | 49 ++++++++++++++++++++++++
>  drivers/net/ixgbe/base/ixgbe_type_e610.h |  4 ++
>  2 files changed, 53 insertions(+)
> 
Patch-by-patch builds are failing here. I believe patch 3 is needed before
patch 2 in the series. Assuming no other issues, I'll just reorder these on
apply to fix.

/Bruce


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

* Re: [PATCH v1 01/15] net/ixgbe/base: remove minsrevs code from DPDK
  2024-08-29  9:00 [PATCH v1 01/15] net/ixgbe/base: remove minsrevs code from DPDK Anatoly Burakov
                   ` (13 preceding siblings ...)
  2024-08-29  9:00 ` [PATCH v1 15/15] net/ixgbe: add PCI IDs for new device variants Anatoly Burakov
@ 2024-09-03 14:08 ` Bruce Richardson
  14 siblings, 0 replies; 17+ messages in thread
From: Bruce Richardson @ 2024-09-03 14:08 UTC (permalink / raw)
  To: Anatoly Burakov; +Cc: dev

On Thu, Aug 29, 2024 at 10:00:06AM +0100, Anatoly Burakov wrote:
> Commit add44414762c ("net/ixgbe/base: add E610 NVM-related operations") has
> added code to read minimum security revision from NVM. This code was not
> meant to be included in DPDK, and was only meant for other drivers derived
> from shared base code, but was present due to the way shared driver code
> snapshot was generated. Remove this code from DPDK driver.
> 
> Fixes: add44414762c ("net/ixgbe/base: add E610 NVM-related operations")
> 
> Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
> ---
Series-acked-by: Bruce Richardson <bruce.richardson@intel.com>

Applied to dpdk-next-net-intel with following adjustments:

* reordered patches 2 & 3 to ensure patch-by-patch compile
* added fixes tags (and cc-stable) to a number of patches
* added one missing author email to .mailmap, and corrected another.

Thanks,
/Bruce

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

end of thread, other threads:[~2024-09-03 14:11 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-08-29  9:00 [PATCH v1 01/15] net/ixgbe/base: remove minsrevs code from DPDK Anatoly Burakov
2024-08-29  9:00 ` [PATCH v1 02/15] net/ixgbe/base: add missing ACI definitions Anatoly Burakov
2024-09-03 10:32   ` Bruce Richardson
2024-08-29  9:00 ` [PATCH v1 03/15] net/ixgbe/base: add missing E610 definitions Anatoly Burakov
2024-08-29  9:00 ` [PATCH v1 04/15] net/ixgbe/base: add missing legacy mailbox API Anatoly Burakov
2024-08-29  9:00 ` [PATCH v1 05/15] net/ixgbe/base: add E610 VF HV macro Anatoly Burakov
2024-08-29  9:00 ` [PATCH v1 06/15] net/ixgbe/base: fix unchecked return value Anatoly Burakov
2024-08-29  9:00 ` [PATCH v1 07/15] net/ixgbe/base: fix media type handling for E610 Anatoly Burakov
2024-08-29  9:00 ` [PATCH v1 08/15] net/ixgbe/base: fix speed autonegotiation on E610 Anatoly Burakov
2024-08-29  9:00 ` [PATCH v1 09/15] net/ixgbe/base: FW API version update Anatoly Burakov
2024-08-29  9:00 ` [PATCH v1 10/15] net/ixgbe/base: handle 5G link speed for E610 Anatoly Burakov
2024-08-29  9:00 ` [PATCH v1 11/15] net/ixgbe/base: remove FW API version check Anatoly Burakov
2024-08-29  9:00 ` [PATCH v1 12/15] net/ixgbe/base: disable thermal sensor ops for E610 Anatoly Burakov
2024-08-29  9:00 ` [PATCH v1 13/15] net/ixgbe/base: fix mailbox ACK handling Anatoly Burakov
2024-08-29  9:00 ` [PATCH v1 14/15] net/ixgbe/base: correct NVM access type for EEPROM writes on E610 Anatoly Burakov
2024-08-29  9:00 ` [PATCH v1 15/15] net/ixgbe: add PCI IDs for new device variants Anatoly Burakov
2024-09-03 14:08 ` [PATCH v1 01/15] net/ixgbe/base: remove minsrevs code from DPDK Bruce Richardson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).