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 D3B59454EF; Tue, 25 Jun 2024 13:23:32 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id CA54242F9D; Tue, 25 Jun 2024 13:18:14 +0200 (CEST) Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.19]) by mails.dpdk.org (Postfix) with ESMTP id 1F83B42DA3 for ; Tue, 25 Jun 2024 13:16:55 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1719314216; x=1750850216; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=IWiRunv3TEavtBfrjbJm4SJ4RkVAcwQhQVZByXaslm4=; b=JG6Bx/bM5cTtkdt8F46BFeWrmWM+R3wULZ9d7jIA5m7l/m7NbwxdVF2v Fngz+1B70g0BqR/TaFBQFSxb1mgicqlho1/F9IBKerJLTPnBQ8IY4H6o5 UYbISiHqByhJ747/2Z2s0wJDFiyBnlmYNz+/IqPvKxJ9Ke5kONV+OLssy AbHyE9TAH0CZr1Cf4r51rOr06iy5/0FKQX9Dk7XAKQp/gM0EoGrugtLXp W1bFY/ZjKihtRZI1NVVjB5Ih0ofXkIUgjn+VQe4JSEGmY/uiypSbpiyyP +UZwBlwbdeK2nU9vWQL45Ta7/dE3kQKJXh6d7nx2jgZo8pF5cwM8mriVi Q==; X-CSE-ConnectionGUID: Z+MDnYCeQqeGh9F3VA1rDA== X-CSE-MsgGUID: zE5EvbSCRW6NT4mxiKWJNg== X-IronPort-AV: E=McAfee;i="6700,10204,11113"; a="16080337" X-IronPort-AV: E=Sophos;i="6.08,263,1712646000"; d="scan'208";a="16080337" 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:16:49 -0700 X-CSE-ConnectionGUID: y/NnnpwVTc6fn8X0CGvE9g== X-CSE-MsgGUID: viBzFRySRf2tUi4Ddmo5Pw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,263,1712646000"; d="scan'208";a="43719392" Received: from unknown (HELO silpixa00401119.ir.intel.com) ([10.55.129.167]) by orviesa009.jf.intel.com with ESMTP; 25 Jun 2024 04:16:49 -0700 From: Anatoly Burakov To: dev@dpdk.org Cc: Pabitra Dalai , bruce.richardson@intel.com, ian.stokes@intel.com Subject: [PATCH v3 068/129] net/ice/base: add defines for loopback mode Date: Tue, 25 Jun 2024 12:13:13 +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: 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 3ef20fe39f..3306ef9b44 100644 --- a/drivers/net/ice/base/ice_common.c +++ b/drivers/net/ice/base/ice_common.c @@ -1055,6 +1055,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; @@ -3228,6 +3230,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