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 5AB2542C54 for ; Wed, 7 Jun 2023 22:52:45 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 56DC542D20; Wed, 7 Jun 2023 22:52:45 +0200 (CEST) Received: from mail-qk1-f193.google.com (mail-qk1-f193.google.com [209.85.222.193]) by mails.dpdk.org (Postfix) with ESMTP id F21DA41611; Wed, 7 Jun 2023 19:57:48 +0200 (CEST) Received: by mail-qk1-f193.google.com with SMTP id af79cd13be357-75d4dd6f012so593325785a.2; Wed, 07 Jun 2023 10:57:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1686160668; x=1688752668; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=3QMBfvpLKXlVx/o30W90vhZ+FV78cwHKkR2N3lO8Y2Y=; b=hP6dKM12iq66dF6zhakkBnnlu7zMOGA8/p3wLEvYePTkW48BjmmL3YNpCDwu8VAiPG RK66JTwmYxs/I4elXXYltgrUBF5wENqts4pLulXiueAkQzHbkyZGmotkAGoPhLU3rz13 RLckctMkcqF9M2Z4bK8q1e8mx7sz8bxUVz0fULSkgtGyW2s8ddhq+d8OcWFvPMpVv2ts Rrmu+s5VpVq2KggEoasK5xYpVybKrQUNPWR+e69OTtcP8zTtq8WwLmDkuH73K5mCipa3 w3TsS2e62jzxEd6OKGT8M6/IDhMtyE/sQ7HrUKpclaZC2D0YnQ2NqFo9H1pQAjc6jvIG RvCg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686160668; x=1688752668; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=3QMBfvpLKXlVx/o30W90vhZ+FV78cwHKkR2N3lO8Y2Y=; b=NGfhe5nRJMCh0Uef0xY8hlCTsDr1QmI8Tbla9ErZAQs2//Y/w+qxy7gtCB2H26LN+8 Gc0NkTqJN0375a2el6RYQ/QF+JQYJvDy92+0j0CT1dww05FjMvb0I1SkzvgLL+KHYpmX 4ize1GYlZEO5pkaSgbMidBZpiOrpx/vCWUluDdNwmaCV51F/id13f/ANVsSF8unpYkXE 6bEOjW5dMGM5xwSr2UZmW+pPYqtY2gxoG2cMkGKzCA2iBpcXCGunL7VTg9gjr/UToZvC zajDmezXJjkAqLJOEes1hhCJNjpYtkw9WPksEgF6X1MRXq/iknu1t4VJSwHr0pdS0G/y Vohw== X-Gm-Message-State: AC+VfDwasysHt0j1o3DfcyIHNagS7RL3FmgtcGg7TuwUlfqJzz60N3F6 TEFW+O+ghaHVMmibIqw2PtNWSs2KN50v+aRAeh8= X-Google-Smtp-Source: ACHHUZ6Xbyq6JsOIUws5lReBy+/Mhh9dOJ1eGNldWyOC+PRgI4EvuUOMVPJjzls/J6gXYNaS+oSteA== X-Received: by 2002:a05:620a:8b0d:b0:75d:ecb2:36a3 with SMTP id qw13-20020a05620a8b0d00b0075decb236a3mr2373701qkn.69.1686160668302; Wed, 07 Jun 2023 10:57:48 -0700 (PDT) Received: from localhost ([2001:19f0:5:3fd8:5400:3ff:fe7e:6d40]) by smtp.gmail.com with ESMTPSA id n13-20020a05620a152d00b0075ebbd60771sm63617qkk.84.2023.06.07.10.57.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Jun 2023 10:57:47 -0700 (PDT) From: Kaijun Zeng To: dev@dpdk.org Cc: Ferruh Yigit , Kaijun Zeng , stable@dpdk.org, Jochen Behrens , Bruce Richardson Subject: [PATCH v3] net/vmxnet3: fix return code in initializing Date: Wed, 7 Jun 2023 13:57:25 -0400 Message-Id: <20230607175725.17488-1-corezeng@gmail.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230602164438.45939-1-corezeng@gmail.com> References: <20230602164438.45939-1-corezeng@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Mailman-Approved-At: Wed, 07 Jun 2023 22:52:43 +0200 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Improve error handling Bugzilla ID: 1239 Fixes: dfaff37fc46d ("vmxnet3: import new vmxnet3 poll mode driver implementation") Cc: stable@dpdk.org Signed-off-by: Kaijun Zeng --- v3: * Improve coding style v2: * Improve error handling --- drivers/net/vmxnet3/vmxnet3_rxtx.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/drivers/net/vmxnet3/vmxnet3_rxtx.c b/drivers/net/vmxnet3/vmxnet3_rxtx.c index a875ffec07..e6e36dca93 100644 --- a/drivers/net/vmxnet3/vmxnet3_rxtx.c +++ b/drivers/net/vmxnet3/vmxnet3_rxtx.c @@ -1311,11 +1311,18 @@ vmxnet3_dev_rxtx_init(struct rte_eth_dev *dev) for (j = 0; j < VMXNET3_RX_CMDRING_SIZE; j++) { /* Passing 0 as alloc_num will allocate full ring */ ret = vmxnet3_post_rx_bufs(rxq, j); - if (ret <= 0) { + + /* Zero number of descriptors in the configuration of the RX queue */ + if (ret == 0) { PMD_INIT_LOG(ERR, - "ERROR: Posting Rxq: %d buffers ring: %d", - i, j); - return -ret; + "Invalid configuration in Rx queue: %d, buffers ring: %d\n", + i, j); + return -EINVAL; + } + /* Return the error number */ + if (ret < 0) { + PMD_INIT_LOG(ERR, "Posting Rxq: %d buffers ring: %d", i, j); + return ret; } /* * Updating device with the index:next2fill to fill the -- 2.30.2