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 96C6745501; Wed, 26 Jun 2024 14:03:32 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A8D2B4344F; Wed, 26 Jun 2024 13:56:36 +0200 (CEST) Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.9]) by mails.dpdk.org (Postfix) with ESMTP id 50F8642E95 for ; Wed, 26 Jun 2024 13:45:01 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1719402301; x=1750938301; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=uGNMLtjVwT6s3Afny+vo1zYj6s30h5h+u4U7Ji5wOmg=; b=By0X49lOzc60zfUJMVd7+yqrfOkwGte0efH1BKJz0iCFNSmnbYwCMAgG tPpVa6TTsAwKV3R6Gl45ox53qhQyKzuk/0Dloj8+VV784sbdv7gw3cU/T FTedDM/oMBTC3QBZI05QuAqQsKJ/991lu0S3GhA8YOEHUpklkeRt3571u KFrhMf/2EWPSNpNWr4ulHmcuJXJ2Ywm2fdLBXt+i03dP5mtZeOObfMFxN 5Uw8vJvG//UyPhg52eWSWwuGheHzD9fAa46QUuJ9LztqPcMzI5kqXKQxg W02eh8exfLA+tHA06JOLxhfnNcYQed1nokVKaWz9lUnLHOKbWMm4IaCs1 w==; X-CSE-ConnectionGUID: YZCqsbMISVGDAVFNFGNZeA== X-CSE-MsgGUID: HSj3t9L+Q9mllsHP7eMjfA== X-IronPort-AV: E=McAfee;i="6700,10204,11114"; a="38979489" X-IronPort-AV: E=Sophos;i="6.08,266,1712646000"; d="scan'208";a="38979489" Received: from orviesa010.jf.intel.com ([10.64.159.150]) by orvoesa101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Jun 2024 04:45:00 -0700 X-CSE-ConnectionGUID: YoRw+jFoTeGhH6rFJnaxig== X-CSE-MsgGUID: x0Loa4btQVaM/eo2FQXgQg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,266,1712646000"; d="scan'208";a="43874169" Received: from unknown (HELO silpixa00401119.ir.intel.com) ([10.55.129.167]) by orviesa010.jf.intel.com with ESMTP; 26 Jun 2024 04:45:00 -0700 From: Anatoly Burakov To: dev@dpdk.org Cc: Paul Greenwalt , ian.stokes@intel.com, bruce.richardson@intel.com Subject: [PATCH v4 072/103] net/ice/base: add Get Link Status Data version 2 Date: Wed, 26 Jun 2024 12:42:00 +0100 Message-ID: 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 7b899f0782..d437ab5be6 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 @@ -704,8 +720,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