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 3C8D145501; Wed, 26 Jun 2024 14:00:23 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 598EA433E9; Wed, 26 Jun 2024 13:55:56 +0200 (CEST) Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.9]) by mails.dpdk.org (Postfix) with ESMTP id C63CF42E95 for ; Wed, 26 Jun 2024 13:44:20 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1719402261; x=1750938261; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=1IUiUDU12QZsJXlFDXAhaBufcTMdZ9uwiMDc4E04MTk=; b=Brr12iI1EbFSErey7A1qpfaQnBR5zi9DbV8V9LL5vSblk/wbMEdoHxqb 977eANP2udQATruW41PTvYgxhGPaFm5I/afs2OhO1mDV6bs7mKeyGh5tu 3jFPk2OaaNBgV6PKtfeeY5vME9wctuoCdpHZQ2HUyFerKHKSeVRYIY+C4 qQwkJD1/usf2FPV19DqBoqbHNYNmwy5r8hP5o+gFSG3fCCMbfRh0cfM2k q9a8f9EVhtOpu45B4vDxxWcw2o0dSLrDw2WauKzjJlM9TYCRUOMxqxAk2 ppvc9NCBUbpB0MlCTJf2567bcFK3R4umbt17VVv435eadjcWmzyNFCEZL A==; X-CSE-ConnectionGUID: B2AaVpFOSAe37ZnSR647LQ== X-CSE-MsgGUID: 6lzg2tU6TDKCYvWyfYnxTw== X-IronPort-AV: E=McAfee;i="6700,10204,11114"; a="38979429" X-IronPort-AV: E=Sophos;i="6.08,266,1712646000"; d="scan'208";a="38979429" 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:44:20 -0700 X-CSE-ConnectionGUID: PDIv6Wd1QIy6fB7gGxktSA== X-CSE-MsgGUID: MbyzM33iT+WTFLpPdt/sPw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,266,1712646000"; d="scan'208";a="43873937" Received: from unknown (HELO silpixa00401119.ir.intel.com) ([10.55.129.167]) by orviesa010.jf.intel.com with ESMTP; 26 Jun 2024 04:44:19 -0700 From: Anatoly Burakov To: dev@dpdk.org Cc: Pabitra Dalai , ian.stokes@intel.com, bruce.richardson@intel.com Subject: [PATCH v4 048/103] net/ice/base: add defines for loopback mode Date: Wed, 26 Jun 2024 12:41:36 +0100 Message-ID: <12a4cb2c9539a33109f77b3b4615576aa8150ad1.1719401848.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: Pabitra Dalai To reflect updates in the data sheet, add: - loopback mode value into ice_aqc_set_port_params - required defines to support loopback mode - added loopback mode handling in ice_port_info Signed-off-by: Pabitra Dalai Signed-off-by: Ian Stokes --- drivers/net/ice/base/ice_adminq_cmd.h | 7 ++++++- drivers/net/ice/base/ice_common.c | 4 ++++ drivers/net/ice/base/ice_common.h | 3 +++ drivers/net/ice/base/ice_type.h | 1 + 4 files changed, 14 insertions(+), 1 deletion(-) diff --git a/drivers/net/ice/base/ice_adminq_cmd.h b/drivers/net/ice/base/ice_adminq_cmd.h index d828731a5b..c431b82784 100644 --- a/drivers/net/ice/base/ice_adminq_cmd.h +++ b/drivers/net/ice/base/ice_adminq_cmd.h @@ -264,7 +264,12 @@ struct ice_aqc_set_port_params { (0x3F << ICE_AQC_SET_P_PARAMS_LOGI_PORT_ID_S) #define ICE_AQC_SET_P_PARAMS_IS_LOGI_PORT BIT(14) #define ICE_AQC_SET_P_PARAMS_SWID_VALID BIT(15) - u8 reserved[10]; + u8 lb_mode; +#define ICE_AQC_SET_P_PARAMS_LOOPBACK_MODE_VALID BIT(2) +#define ICE_AQC_SET_P_PARAMS_LOOPBACK_MODE_NORMAL 0x00 +#define ICE_AQC_SET_P_PARAMS_LOOPBACK_MODE_NO 0x01 +#define ICE_AQC_SET_P_PARAMS_LOOPBACK_MODE_HIGH 0x02 + u8 reserved[9]; }; /* These resource type defines are used for all switch resource diff --git a/drivers/net/ice/base/ice_common.c b/drivers/net/ice/base/ice_common.c index 079df60cab..bb845700dd 100644 --- a/drivers/net/ice/base/ice_common.c +++ b/drivers/net/ice/base/ice_common.c @@ -1058,6 +1058,8 @@ int ice_init_hw(struct ice_hw *hw) goto err_unroll_cqinit; } + hw->port_info->loopback_mode = ICE_AQC_SET_P_PARAMS_LOOPBACK_MODE_NORMAL; + /* set the back pointer to HW */ hw->port_info->hw = hw; @@ -3231,6 +3233,8 @@ ice_aq_set_port_params(struct ice_port_info *pi, u16 bad_frame_vsi, cmd = &desc.params.set_port_params; ice_fill_dflt_direct_cmd_desc(&desc, ice_aqc_opc_set_port_params); + cmd->lb_mode = pi->loopback_mode | + ICE_AQC_SET_P_PARAMS_LOOPBACK_MODE_VALID; cmd->bad_frame_vsi = CPU_TO_LE16(bad_frame_vsi); if (save_bad_pac) cmd_flags |= ICE_AQC_SET_P_PARAMS_SAVE_BAD_PACKETS; diff --git a/drivers/net/ice/base/ice_common.h b/drivers/net/ice/base/ice_common.h index a57bb4523d..d06742aa77 100644 --- a/drivers/net/ice/base/ice_common.h +++ b/drivers/net/ice/base/ice_common.h @@ -15,6 +15,9 @@ #define ICE_SQ_SEND_DELAY_TIME_MS 10 #define ICE_SQ_SEND_MAX_EXECUTE 3 +#define LOOPBACK_MODE_NO 0 +#define LOOPBACK_MODE_HIGH 2 + enum ice_fw_modes { ICE_FW_MODE_NORMAL, ICE_FW_MODE_DBG, diff --git a/drivers/net/ice/base/ice_type.h b/drivers/net/ice/base/ice_type.h index 2a4e325993..638e812c0f 100644 --- a/drivers/net/ice/base/ice_type.h +++ b/drivers/net/ice/base/ice_type.h @@ -1208,6 +1208,7 @@ struct ice_port_info { u16 sw_id; /* Initial switch ID belongs to port */ u16 pf_vf_num; u8 port_state; + u8 loopback_mode; #define ICE_SCHED_PORT_STATE_INIT 0x0 #define ICE_SCHED_PORT_STATE_READY 0x1 u8 lport; -- 2.43.0