From patchwork Thu Jul 22 07:56:20 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Li, Xiaoyun" X-Patchwork-Id: 96193 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 58684A0C4E; Thu, 22 Jul 2021 10:07:06 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C64434014D; Thu, 22 Jul 2021 10:07:05 +0200 (CEST) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by mails.dpdk.org (Postfix) with ESMTP id AB0CB40040; Thu, 22 Jul 2021 10:07:03 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10052"; a="211313688" X-IronPort-AV: E=Sophos;i="5.84,260,1620716400"; d="scan'208";a="211313688" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Jul 2021 01:07:02 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.84,260,1620716400"; d="scan'208";a="470536739" Received: from dpdk-xiaoyunl.sh.intel.com ([10.67.111.165]) by fmsmga008.fm.intel.com with ESMTP; 22 Jul 2021 01:07:01 -0700 From: Xiaoyun Li To: dev@dpdk.org, Jingjing Wu , Beilei Xing Cc: Xiaoyun Li , stable@dpdk.org Date: Thu, 22 Jul 2021 15:56:20 +0800 Message-Id: <20210722075620.472438-1-xiaoyun.li@intel.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH] net/iavf: fix tx thresh check issue 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" Function check_tx_thresh is called with wrong parameter. If the check fails, tx_queue_setup should return error not keep going. iThis patch fixes above issues. Fixes: 69dd4c3d0898 ("net/avf: enable queue and device") Cc: stable@dpdk.org Signed-off-by: Xiaoyun Li Acked-by: Beilei Xing --- drivers/net/iavf/iavf_rxtx.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/iavf/iavf_rxtx.c b/drivers/net/iavf/iavf_rxtx.c index d61b32fcee..e33fe4576b 100644 --- a/drivers/net/iavf/iavf_rxtx.c +++ b/drivers/net/iavf/iavf_rxtx.c @@ -708,7 +708,8 @@ iavf_dev_tx_queue_setup(struct rte_eth_dev *dev, tx_conf->tx_rs_thresh : DEFAULT_TX_RS_THRESH); tx_free_thresh = (uint16_t)((tx_conf->tx_free_thresh) ? tx_conf->tx_free_thresh : DEFAULT_TX_FREE_THRESH); - check_tx_thresh(nb_desc, tx_rs_thresh, tx_rs_thresh); + if (check_tx_thresh(nb_desc, tx_rs_thresh, tx_free_thresh) != 0) + return -EINVAL; /* Free memory if needed. */ if (dev->data->tx_queues[queue_idx]) {