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 00E67A0C55; Tue, 10 Aug 2021 04:49:43 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 27F73411B5; Tue, 10 Aug 2021 04:48:59 +0200 (CEST) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by mails.dpdk.org (Postfix) with ESMTP id 8FEC441197 for ; Tue, 10 Aug 2021 04:48:57 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10070"; a="214808446" X-IronPort-AV: E=Sophos;i="5.84,309,1620716400"; d="scan'208";a="214808446" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Aug 2021 19:48:57 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.84,309,1620716400"; d="scan'208";a="483823627" Received: from dpdk51.sh.intel.com ([10.67.111.142]) by fmsmga008.fm.intel.com with ESMTP; 09 Aug 2021 19:48:55 -0700 From: Qi Zhang To: qiming.yang@intel.com Cc: junfeng.guo@intel.com, dev@dpdk.org, Qi Zhang , Tony Nguyen Date: Tue, 10 Aug 2021 10:51:22 +0800 Message-Id: <20210810025140.1698163-11-qi.z.zhang@intel.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210810025140.1698163-1-qi.z.zhang@intel.com> References: <20210810025140.1698163-1-qi.z.zhang@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH 10/28] net/ice/base: clarify comments on checking PFC mode 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 Sender: "dev" Rework the comment around checking PFC mode to make it clear why we are checking the mode after sending the command. Signed-off-by: Tony Nguyen Signed-off-by: Qi Zhang --- drivers/net/ice/base/ice_dcb.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/net/ice/base/ice_dcb.c b/drivers/net/ice/base/ice_dcb.c index 9c9675f6ef..cb6c5ba182 100644 --- a/drivers/net/ice/base/ice_dcb.c +++ b/drivers/net/ice/base/ice_dcb.c @@ -764,11 +764,10 @@ ice_aq_set_pfc_mode(struct ice_hw *hw, u8 pfc_mode, struct ice_sq_cd *cd) if (status) return status; - /* The spec isn't clear about whether the FW will return an error code - * if the PFC mode requested by the driver was not set. The spec just - * says that the FW will write the PFC mode set back into cmd->pfc_mode, - * so after the AQ has been executed, check if cmd->pfc_mode is what was - * requested. + /* FW will write the PFC mode set back into cmd->pfc_mode, but if DCB is + * disabled, FW will write back 0 to cmd->pfc_mode. After the AQ has + * been executed, check if cmd->pfc_mode is what was requested. If not, + * return an error. */ if (cmd->pfc_mode != pfc_mode) return ICE_ERR_NOT_SUPPORTED; -- 2.26.2