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 070474404F; Wed, 12 Jun 2024 17:17:48 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A058642EEC; Wed, 12 Jun 2024 17:05:46 +0200 (CEST) Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.10]) by mails.dpdk.org (Postfix) with ESMTP id 42FE242ED0 for ; Wed, 12 Jun 2024 17:05:40 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1718204741; x=1749740741; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=S8yaKhuwrQ+KVllT3KDOlWI3kOv7RSwuSzUOpfR2uf4=; b=EHV8/u+oWgOMmy/OgHLVZoT1rLXDR+K65+oPDGmKfj24hwNbu40KveC+ tBvKwGvrBwSEQu091BtMF9UIYLBNIafvMrYJfxG/EWtgiSRigqnvSRX52 XhASSBM15DNqW0usIvlM8fE/PEMpKf9m5K5L/CsCawbl0yq/puBc41PuE i+6ruIjpaoZ/PY/widr7v06NQn/bLqMzGoxYPrdy/+hvNVeDr0ZvBrlIc nSY378xEgCRX1evIRQ8UPMB9si3J4xrUWXQCVilzol+jrhtiQkU5e0wgR ymTfZzSCNEob2JZ2hxDDCSjxPs274hsfEZnumzmN5VYFdOsBh9eH2K48y g==; X-CSE-ConnectionGUID: bTEJLRAJRWqY5gzpQXBlOw== X-CSE-MsgGUID: woxBVqSSQ1ybDh+kfL2dcw== X-IronPort-AV: E=McAfee;i="6700,10204,11101"; a="32459750" X-IronPort-AV: E=Sophos;i="6.08,233,1712646000"; d="scan'208";a="32459750" Received: from orviesa009.jf.intel.com ([10.64.159.149]) by orvoesa102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Jun 2024 08:05:39 -0700 X-CSE-ConnectionGUID: Jx6FN6gHQHypcQBW9MHaGg== X-CSE-MsgGUID: auCElS4cQ06187CMsW8grg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,233,1712646000"; d="scan'208";a="39925606" Received: from silpixa00401119.ir.intel.com ([10.55.129.167]) by orviesa009.jf.intel.com with ESMTP; 12 Jun 2024 08:05:37 -0700 From: Anatoly Burakov To: dev@dpdk.org Cc: Ian Stokes , bruce.richardson@intel.com, Pabitra Dalai Subject: [PATCH v2 086/148] net/ice/base: add defines for loopback mode Date: Wed, 12 Jun 2024 16:01:20 +0100 Message-ID: <8abde0a740f82e0c0197d399dc339c0028bdaa61.1718204529.git.anatoly.burakov@intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: References: <20240430154014.1026-1-ian.stokes@intel.com> 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: Ian Stokes 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 35dafd2190..eb5f82259a 100644 --- a/drivers/net/ice/base/ice_adminq_cmd.h +++ b/drivers/net/ice/base/ice_adminq_cmd.h @@ -265,7 +265,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 efa98ec151..550fc49e8d 100644 --- a/drivers/net/ice/base/ice_common.c +++ b/drivers/net/ice/base/ice_common.c @@ -956,6 +956,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; @@ -3252,6 +3254,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 882359f5e3..dfd7e6511d 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 d9d3e3ee0b..7feb897656 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