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 CE40CA00C3; Mon, 15 Aug 2022 01:09:02 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5DBAF42CAF; Mon, 15 Aug 2022 01:04:48 +0200 (CEST) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by mails.dpdk.org (Postfix) with ESMTP id F1A8342BDD for ; Mon, 15 Aug 2022 01:04:45 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1660518286; x=1692054286; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=63QjjJp3aPhowNaSeqFUbK+HZzcdKi9Ubi24irMnHew=; b=GXXOIkSN+ouUnOVpnKSw2J+iEWQZcuFM75U7l6402JmzHHjCE1YinwIZ 7y872S+I3WYUgteUAbcNwW1BXqa4a8QQ2mOm8/Br475vqmabKco1kyCPo J5/0cNJx8of+8yxBz41bBSx1QN+BAHKW5RZ2PmcvDSaFZ0V2vTJ00e65Q jG5yqOG83bqS2h2+5KcosGwC+gFswWL5HqoP+tvOE9Vm3G5TimF8PrBv6 Ax1PIGwRcZahOsAR+e6Z5q+KZPFRflo3EOCXfkzhWzelCI4HiM4GcDW1R 4der7Luh/LdOOl1QXV2FZzNGKTGNZ7dKgmnyJ1/iZsJOcAPba+7jHscE8 A==; X-IronPort-AV: E=McAfee;i="6400,9594,10439"; a="293128809" X-IronPort-AV: E=Sophos;i="5.93,237,1654585200"; d="scan'208";a="293128809" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Aug 2022 16:04:45 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.93,237,1654585200"; d="scan'208";a="934296935" Received: from dpdk-qzhan15-test02.sh.intel.com ([10.67.115.4]) by fmsmga005.fm.intel.com with ESMTP; 14 Aug 2022 16:04:44 -0700 From: Qi Zhang To: qiming.yang@intel.com Cc: dev@dpdk.org, Qi Zhang , Anatolii Gerasymenko Subject: [PATCH 62/70] net/ice/base: add function to parse DCBX config Date: Mon, 15 Aug 2022 03:12:58 -0400 Message-Id: <20220815071306.2910599-63-qi.z.zhang@intel.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20220815071306.2910599-1-qi.z.zhang@intel.com> References: <20220815071306.2910599-1-qi.z.zhang@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 LLDP MIB Change Event (opcode 0x0A01) already contains MIB, which has been changed. Add ice_dcb_process_lldp_set_mib_change() function, which will set local/remote DCBX config from LLDP MIB Change Event's buffer. This function will be used in a base driver handler for LLDP MIB Chang Event. Signed-off-by: Anatolii Gerasymenko Signed-off-by: Qi Zhang --- drivers/net/ice/base/ice_dcb.c | 37 ++++++++++++++++++++++++++++++++++ drivers/net/ice/base/ice_dcb.h | 2 ++ 2 files changed, 39 insertions(+) diff --git a/drivers/net/ice/base/ice_dcb.c b/drivers/net/ice/base/ice_dcb.c index d511a5f5ec..30494e868e 100644 --- a/drivers/net/ice/base/ice_dcb.c +++ b/drivers/net/ice/base/ice_dcb.c @@ -970,6 +970,43 @@ enum ice_status ice_get_dcb_cfg(struct ice_port_info *pi) return ret; } +/** + * ice_get_dcb_cfg_from_mib_change + * @pi: port information structure + * @event: pointer to the admin queue receive event + * + * Set DCB configuration from received MIB Change event + */ +void ice_get_dcb_cfg_from_mib_change(struct ice_port_info *pi, + struct ice_rq_event_info *event) +{ + struct ice_dcbx_cfg *dcbx_cfg = &pi->qos_cfg.local_dcbx_cfg; + struct ice_aqc_lldp_get_mib *mib; + u8 change_type, dcbx_mode; + + mib = (struct ice_aqc_lldp_get_mib *)&event->desc.params.raw; + + change_type = mib->type & ICE_AQ_LLDP_MIB_TYPE_M; + if (change_type == ICE_AQ_LLDP_MIB_REMOTE) + dcbx_cfg = &pi->qos_cfg.remote_dcbx_cfg; + + dcbx_mode = ((mib->type & ICE_AQ_LLDP_DCBX_M) >> + ICE_AQ_LLDP_DCBX_S); + + switch (dcbx_mode) { + case ICE_AQ_LLDP_DCBX_IEEE: + dcbx_cfg->dcbx_mode = ICE_DCBX_MODE_IEEE; + ice_lldp_to_dcb_cfg(event->msg_buf, dcbx_cfg); + break; + + case ICE_AQ_LLDP_DCBX_CEE: + pi->qos_cfg.desired_dcbx_cfg = pi->qos_cfg.local_dcbx_cfg; + ice_cee_to_dcb_cfg((struct ice_aqc_get_cee_dcb_cfg_resp *) + event->msg_buf, pi); + break; + } +} + /** * ice_init_dcb * @hw: pointer to the HW struct diff --git a/drivers/net/ice/base/ice_dcb.h b/drivers/net/ice/base/ice_dcb.h index 24c8da2dc8..7e1e4d0297 100644 --- a/drivers/net/ice/base/ice_dcb.h +++ b/drivers/net/ice/base/ice_dcb.h @@ -205,6 +205,8 @@ ice_aq_get_dcb_cfg(struct ice_hw *hw, u8 mib_type, u8 bridgetype, struct ice_dcbx_cfg *dcbcfg); enum ice_status ice_get_dcb_cfg(struct ice_port_info *pi); enum ice_status ice_set_dcb_cfg(struct ice_port_info *pi); +void ice_get_dcb_cfg_from_mib_change(struct ice_port_info *pi, + struct ice_rq_event_info *event); enum ice_status ice_init_dcb(struct ice_hw *hw, bool enable_mib_change); void ice_dcb_cfg_to_lldp(u8 *lldpmib, u16 *miblen, struct ice_dcbx_cfg *dcbcfg); enum ice_status -- 2.31.1