From patchwork Fri Sep 15 02:17:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simei Su X-Patchwork-Id: 131447 X-Patchwork-Delegate: qi.z.zhang@intel.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 2AE214259D; Fri, 15 Sep 2023 04:18:05 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A04B740C35; Fri, 15 Sep 2023 04:17:09 +0200 (CEST) Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.88]) by mails.dpdk.org (Postfix) with ESMTP id 12F9940A76 for ; Fri, 15 Sep 2023 04:17:07 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1694744228; x=1726280228; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=K6U4zzIIJ5pfU5YKkw2l5gTE0FwzYV/o33BF0pqN/iQ=; b=Xzzt2t4zztUa8mhG+8pft1WGRqP/kxpAZJZIj/fwXrFie5gp+tcGfshf TaKSygz9bD4MIsMq4D2T32NE1UGvmsETDPCtYaRUhbU7yk8VMpO7HzJTC PMwwkvjM3j3VFU3mZj1e8oqZGlBzesmOi4knFaZqN+hTOhgHgkZ2MFVSj ko3ZTa1MiLkXYJpK5AyEwYuHvmjFjIbDbe1Tl3Jqwwz7SWD0ZmEFhygbi AjjnFIwR+CuU+dsHY2yuI4iDKWu/6tcWbuN2AlwTpz70WpiNg5WeC3L8A wmJHN05HGcfHVmgXeVRRYapsNgwX1XVjqu+NqjdiCJDFifrf3TyVTGP43 g==; X-IronPort-AV: E=McAfee;i="6600,9927,10833"; a="410077979" X-IronPort-AV: E=Sophos;i="6.02,147,1688454000"; d="scan'208";a="410077979" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Sep 2023 19:17:07 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10833"; a="1075622810" X-IronPort-AV: E=Sophos;i="6.02,147,1688454000"; d="scan'208";a="1075622810" Received: from dpdk-simei-icelake.sh.intel.com ([10.67.110.167]) by fmsmga005.fm.intel.com with ESMTP; 14 Sep 2023 19:17:05 -0700 From: Simei Su To: jingjing.wu@intel.com, beilei.xing@intel.com, qi.z.zhang@intel.com Cc: dev@dpdk.org, mingxia.liu@intel.com, wenjing.qiao@intel.com, Simei Su , Pavan Kumar Linga Subject: [PATCH v3 11/17] common/idpf/base: refactor descriptor 'ret val' stripping Date: Fri, 15 Sep 2023 10:17:24 +0800 Message-Id: <20230915021730.2681882-12-simei.su@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230915021730.2681882-1-simei.su@intel.com> References: <20230825101344.1828774-1-simei.su@intel.com> <20230915021730.2681882-1-simei.su@intel.com> MIME-Version: 1.0 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 Conditional check is not necessary to strip and get status bits from the descriptor. Signed-off-by: Pavan Kumar Linga Signed-off-by: Simei Su --- drivers/common/idpf/base/idpf_controlq.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/common/idpf/base/idpf_controlq.c b/drivers/common/idpf/base/idpf_controlq.c index 7b12dfab18..da5c930578 100644 --- a/drivers/common/idpf/base/idpf_controlq.c +++ b/drivers/common/idpf/base/idpf_controlq.c @@ -426,11 +426,8 @@ static int __idpf_ctlq_clean_sq(struct idpf_ctlq_info *cq, u16 *clean_count, if (!force && !(LE16_TO_CPU(desc->flags) & IDPF_CTLQ_FLAG_DD)) break; - desc_err = LE16_TO_CPU(desc->ret_val); - if (desc_err) { - /* strip off FW internal code */ - desc_err &= 0xff; - } + /* strip off FW internal code */ + desc_err = LE16_TO_CPU(desc->ret_val) & 0xff; msg_status[i] = cq->bi.tx_msg[ntc]; if (!msg_status[i])