From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 1EAFB454EF; Tue, 25 Jun 2024 13:26:23 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2C50F432AA; Tue, 25 Jun 2024 13:18:49 +0200 (CEST) Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.19]) by mails.dpdk.org (Postfix) with ESMTP id 389E240696 for ; Tue, 25 Jun 2024 13:17:28 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1719314248; x=1750850248; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=/JrTExGsJF8HHrYE4LEBBDaV4C+5YzJgA/ZXGNogjt4=; b=R+PRdGJ9med7gYCAE0wOaPot/pj58YCf2CX/hixO9OPWiKaKZdtCb8nz jLYvFmykJ+kD8hg9xHlxSSeZdEeylyXToub4p7ENqLrBa8iSmUdIGmmKu Y+8p1kbmP4t2EF/U00uUxiy1/qiP+d+Z5hOLbLCnBQzUAPelt41aW9ejO upbF44EwCmNN87uuz8xt7RjeXcq1nfv7Hv+9uhu4IP195kcGllXFzSnKq OgWU4Y53qhDi/SnX/YUtk847GtD3SHQbS+AnnE3Johsj+n1SV1a1ip+uF q1f5Voj69RYJLeQIGEe5GtnzZST2Tz3SO2tjo9zgKVeB3QQyITG0cubpA Q==; X-CSE-ConnectionGUID: kub0244ITa6YW/AqFHz40Q== X-CSE-MsgGUID: yJUPNVzBSsKlc0kk47jhpQ== X-IronPort-AV: E=McAfee;i="6700,10204,11113"; a="16080461" X-IronPort-AV: E=Sophos;i="6.08,263,1712646000"; d="scan'208";a="16080461" Received: from orviesa009.jf.intel.com ([10.64.159.149]) by fmvoesa113.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Jun 2024 04:17:27 -0700 X-CSE-ConnectionGUID: 32908LTORySvks5z0veaLQ== X-CSE-MsgGUID: 79EP5GPwS0+HgX08lhYlWQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,263,1712646000"; d="scan'208";a="43719577" Received: from unknown (HELO silpixa00401119.ir.intel.com) ([10.55.129.167]) by orviesa009.jf.intel.com with ESMTP; 25 Jun 2024 04:17:27 -0700 From: Anatoly Burakov To: dev@dpdk.org Cc: Paul Greenwalt , bruce.richardson@intel.com, ian.stokes@intel.com Subject: [PATCH v3 093/129] net/ice/base: add Get Link Status Data version 2 Date: Tue, 25 Jun 2024 12:13:38 +0100 Message-ID: <07cca2e53f9c280061072f2dede26d7c00328bfa.1719313663.git.anatoly.burakov@intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org From: Paul Greenwalt 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 51 bytes. Add new link partner fields to ice_aqc_get_link_status_data; PHY type, FEC, and flow control. Add new ICE_GET_LINK_STATUS_DATA_V2 and ICE_GET_LINK_STATUS_DATALEN_V2 to support the new version and data length. Also, moving ice_get_link_status_datalen and ice_get_link_status_datalen to ice_common.c Signed-off-by: Paul Greenwalt Signed-off-by: Anatoly Burakov --- drivers/net/ice/base/ice_adminq_cmd.h | 35 ++++++++++++++++++++++++++- drivers/net/ice/base/ice_common.c | 20 +++++++++++++-- 2 files changed, 52 insertions(+), 3 deletions(-) diff --git a/drivers/net/ice/base/ice_adminq_cmd.h b/drivers/net/ice/base/ice_adminq_cmd.h index ef6284f263..a4b45b9fc5 100644 --- a/drivers/net/ice/base/ice_adminq_cmd.h +++ b/drivers/net/ice/base/ice_adminq_cmd.h @@ -1566,7 +1566,16 @@ struct ice_aqc_get_link_status { __le32 addr_low; }; +enum ice_get_link_status_data_version { + ICE_GET_LINK_STATUS_DATA_V1 = 1, + ICE_GET_LINK_STATUS_DATA_V2 = 2, +}; + +#define ICE_GET_LINK_STATUS_DATALEN_V1 32 +#define ICE_GET_LINK_STATUS_DATALEN_V2 56 + /* Get link status response data structure, also used for Link Status Event */ +#pragma pack(1) struct ice_aqc_get_link_status_data { u8 topo_media_conflict; #define ICE_AQ_LINK_TOPO_CONFLICT BIT(0) @@ -1653,11 +1662,35 @@ struct ice_aqc_get_link_status_data { #define ICE_AQ_LINK_SPEED_100GB BIT(10) #define ICE_AQ_LINK_SPEED_200GB BIT(11) #define ICE_AQ_LINK_SPEED_UNKNOWN BIT(15) - __le32 reserved3; /* Aligns next field to 8-byte boundary */ + __le16 reserved3; /* Aligns next field to 8-byte boundary */ + u8 ext_fec_status; +#define ICE_AQ_LINK_RS_272_FEC_EN BIT(0) /* RS 272 FEC enabled */ + u8 reserved4; __le64 phy_type_low; /* Use values from ICE_PHY_TYPE_LOW_* */ __le64 phy_type_high; /* Use values from ICE_PHY_TYPE_HIGH_* */ + /* Get link status version 2 link partner data */ + __le64 lp_phy_type_low; /* Use values from ICE_PHY_TYPE_LOW_* */ + __le64 lp_phy_type_high; /* Use values from ICE_PHY_TYPE_HIGH_* */ + u8 lp_fec_adv; +#define ICE_AQ_LINK_LP_10G_KR_FEC_CAP BIT(0) +#define ICE_AQ_LINK_LP_25G_KR_FEC_CAP BIT(1) +#define ICE_AQ_LINK_LP_RS_528_FEC_CAP BIT(2) +#define ICE_AQ_LINK_LP_50G_KR_272_FEC_CAP BIT(3) +#define ICE_AQ_LINK_LP_100G_KR_272_FEC_CAP BIT(4) +#define ICE_AQ_LINK_LP_200G_KR_272_FEC_CAP BIT(5) + u8 lp_fec_req; +#define ICE_AQ_LINK_LP_10G_KR_FEC_REQ BIT(0) +#define ICE_AQ_LINK_LP_25G_KR_FEC_REQ BIT(1) +#define ICE_AQ_LINK_LP_RS_528_FEC_REQ BIT(2) +#define ICE_AQ_LINK_LP_KR_272_FEC_REQ BIT(3) + u8 lp_flowcontrol; +#define ICE_AQ_LINK_LP_PAUSE_ADV BIT(0) +#define ICE_AQ_LINK_LP_ASM_DIR_ADV BIT(1) + u8 reserved[5]; }; +#pragma pack() + /* Set event mask command (direct 0x0613) */ struct ice_aqc_set_event_mask { u8 lport_num; diff --git a/drivers/net/ice/base/ice_common.c b/drivers/net/ice/base/ice_common.c index ccf5b341ef..3a91956ff2 100644 --- a/drivers/net/ice/base/ice_common.c +++ b/drivers/net/ice/base/ice_common.c @@ -565,6 +565,22 @@ ice_aq_get_phy_caps(struct ice_port_info *pi, bool qual_mods, u8 report_mode, return status; } +#define ice_get_link_status_data_ver(hw) ((hw)->mac_type == ICE_MAC_E830 ? \ + ICE_GET_LINK_STATUS_DATA_V2 : ICE_GET_LINK_STATUS_DATA_V1) + +/** + * ice_get_link_status_datalen + * @hw: pointer to the HW struct + * + * return Get Link Status datalen + */ +static u16 ice_get_link_status_datalen(struct ice_hw *hw) +{ + return (ice_get_link_status_data_ver(hw) == + ICE_GET_LINK_STATUS_DATA_V1) ? ICE_GET_LINK_STATUS_DATALEN_V1 : + ICE_GET_LINK_STATUS_DATALEN_V2; +} + /** * ice_aq_get_netlist_node_pin * @hw: pointer to the hw struct @@ -701,8 +717,8 @@ ice_aq_get_link_info(struct ice_port_info *pi, bool ena_lse, resp->cmd_flags = CPU_TO_LE16(cmd_flags); resp->lport_num = pi->lport; - status = ice_aq_send_cmd(hw, &desc, &link_data, sizeof(link_data), cd); - + status = ice_aq_send_cmd(hw, &desc, &link_data, + ice_get_link_status_datalen(hw), cd); if (status) return status; -- 2.43.0