net/ice: fix DCF init for E830 devices

Message ID 20240719134427.10512-1-ian.stokes@intel.com (mailing list archive)
State Accepted, archived
Headers
Series net/ice: fix DCF init for E830 devices |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK
ci/loongarch-compilation success Compilation OK
ci/loongarch-unit-testing success Unit Testing PASS
ci/intel-Testing success Testing PASS
ci/intel-Functional success Functional PASS
ci/github-robot: build success github build: passed
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-marvell-Functional success Functional Testing PASS
ci/iol-abi-testing success Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-unit-arm64-testing success Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-broadcom-Functional success Functional Testing PASS
ci/iol-unit-amd64-testing success Testing PASS
ci/iol-compile-amd64-testing pending Testing pending
ci/iol-compile-arm64-testing success Testing PASS
ci/iol-sample-apps-testing success Testing PASS

Commit Message

Ian Stokes July 19, 2024, 1:44 p.m. UTC
From: Bruce Richardson <bruce.richardson@intel.com>

E830 introduces a new version of Get Link Status Data
which increases the size of struct ice_aqc_get_link_status_data
from 32 bytes to 56. When initializing DCF, attempt to get
link status data using both formats of the command, by overriding
the mac type to E830 on failure with the default setting.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Signed-off-by: Ian Stokes <ian.stokes@intel.com>
---
 drivers/net/ice/ice_dcf_parent.c | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)
  

Comments

Bruce Richardson July 22, 2024, 11:41 a.m. UTC | #1
On Fri, Jul 19, 2024 at 02:44:27PM +0100, Ian Stokes wrote:
> From: Bruce Richardson <bruce.richardson@intel.com>
> 
> E830 introduces a new version of Get Link Status Data
> which increases the size of struct ice_aqc_get_link_status_data
> from 32 bytes to 56. When initializing DCF, attempt to get
> link status data using both formats of the command, by overriding
> the mac type to E830 on failure with the default setting.
> 
> Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
> Signed-off-by: Ian Stokes <ian.stokes@intel.com>
> ---
>  drivers/net/ice/ice_dcf_parent.c | 15 +++++++++++++--
>  1 file changed, 13 insertions(+), 2 deletions(-)
> 
Patch applied to dpdk-next-net-intel

/Bruce
  

Patch

diff --git a/drivers/net/ice/ice_dcf_parent.c b/drivers/net/ice/ice_dcf_parent.c
index 4e4a63fdd0..f92bd5e726 100644
--- a/drivers/net/ice/ice_dcf_parent.c
+++ b/drivers/net/ice/ice_dcf_parent.c
@@ -346,8 +346,19 @@  ice_dcf_init_parent_hw(struct ice_hw *hw)
 
 	/* Initialize port_info struct with link information */
 	status = ice_aq_get_link_info(hw->port_info, true, NULL, NULL);
-	if (status)
-		goto err_unroll_alloc;
+	if (status) {
+		enum ice_mac_type type = hw->mac_type;
+
+		/* DCF uses ICE_MAC_GENERIC which can be talking to either
+		 * E810 or E830. Retry with E830 mac type to ensure correct
+		 * data length is used for IAVF communication with PF.
+		 */
+		hw->mac_type = ICE_MAC_E830;
+		status = ice_aq_get_link_info(hw->port_info, true, NULL, NULL);
+		hw->mac_type = type;
+		if (status)
+			goto err_unroll_alloc;
+	}
 
 	status = ice_init_fltr_mgmt_struct(hw);
 	if (status)