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 69A7742BF0 for ; Mon, 5 Jun 2023 17:03:52 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6376440A7F; Mon, 5 Jun 2023 17:03:52 +0200 (CEST) Received: from mail-qt1-f196.google.com (mail-qt1-f196.google.com [209.85.160.196]) by mails.dpdk.org (Postfix) with ESMTP id 35B9E406B8; Fri, 2 Jun 2023 18:45:06 +0200 (CEST) Received: by mail-qt1-f196.google.com with SMTP id d75a77b69052e-3f767eec104so21385811cf.1; Fri, 02 Jun 2023 09:45:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1685724305; x=1688316305; 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=SN2MqSk3czVTymU9LhdAw01Z5lnuKQqN3xVZnnUxAkQ=; b=OrqHOaODi0r0TFrWUYIWNvWl9h+clhAdzQ+ZGt7bUcy3+SFNQciT8tY7wWm47+yeOx YdDBI0OJCNfv0Qm2eLduh3z1zf1uSw/4u2uhvmyo4Elfp2zMO9WUXBRcH1pwEGpaoTrE LEnuWGuCajEty0+MqEly1vRZp2DbjirhXIYMA57i9tKjLs5NDDOAmqXuhH5TCzOmtUFl vZEJL4UD1tYN1mrhDZrcY527VHtAOS83YqClUdMUlmRvpePpKkdiS/JQJjd7GP1aJb7i jC9yczayrPulEkr6O6H1n7Pa241Gy5EnES3GnOzIW07RWRgpVtpahZNz3N2auginf6Ld 0LgQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685724305; x=1688316305; 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=SN2MqSk3czVTymU9LhdAw01Z5lnuKQqN3xVZnnUxAkQ=; b=BUUbNCt0fO9bIbk+d/Bh331hQtdsmI0j4pm349DZNHciRsut3vk/c/AN5djy7zemAT zNSv1Iff7vzOECeWj2xJOZSwzXNWDSe6f16k7FprQQal6zvAgOCYWNUY4bNWH3+BwU48 xEMnYdoUR6JLdQyfZikOcWYk8tJJVjgnAQVlkSPqOQ2AlgCsLALBHOOQc7DT/9h5vx8E UGEGXhWCdI+Er41di6n4sdodpTra22N0HS9lhuwq3KIMeN0icQbsHbtru6+nsAkcGnVv MHmPgCYt2Tuzo9EaoRXc1YuAXxSs+wnfrU1528uPniTY1abIOvm+Ub1bFs9Xh+zOONi/ FfMw== X-Gm-Message-State: AC+VfDyk0wmHPxgMMWqfor5T5ZrYASi6sb31jSGICAG7DIw1mDhI0Ahc v/wGRBwGbUdySlLDhrFFxgVkmmNL1sLsXa8c1rc= X-Google-Smtp-Source: ACHHUZ5C89EpxhFgXJrpcoi2rh/1IqGGikzL2A8LtJ6kgKGhE4GByygO6+Q4NMD0XNB4wXhgtMUQTg== X-Received: by 2002:a05:622a:50e:b0:3f6:bc91:941 with SMTP id l14-20020a05622a050e00b003f6bc910941mr15631872qtx.22.1685724305470; Fri, 02 Jun 2023 09:45:05 -0700 (PDT) Received: from localhost ([2001:19f0:5:3fd8:5400:3ff:fe7e:6d40]) by smtp.gmail.com with ESMTPSA id q13-20020ac8734d000000b003f517e1fed2sm982914qtp.15.2023.06.02.09.45.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Jun 2023 09:45:05 -0700 (PDT) From: Kaijun Zeng To: dev@dpdk.org Cc: Ferruh Yigit , Kaijun Zeng , stable@dpdk.org, Jochen Behrens , Bruce Richardson Subject: [PATCH v2] net/vmxnet3: fix return code in initializing Date: Fri, 2 Jun 2023 12:44:38 -0400 Message-Id: <20230602164438.45939-1-corezeng@gmail.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230528143734.145326-1-user@sklga> References: <20230528143734.145326-1-user@sklga> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Mailman-Approved-At: Mon, 05 Jun 2023 17:03:50 +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 Fixes: dfaff37fc46d ("vmxnet3: import new vmxnet3 poll mode driver implementation") Cc: stable@dpdk.org Signed-off-by: Kaijun Zeng --- drivers/net/vmxnet3/vmxnet3_rxtx.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/drivers/net/vmxnet3/vmxnet3_rxtx.c b/drivers/net/vmxnet3/vmxnet3_rxtx.c index 73ec1e4727..e615d40d09 100644 --- a/drivers/net/vmxnet3/vmxnet3_rxtx.c +++ b/drivers/net/vmxnet3/vmxnet3_rxtx.c @@ -1311,7 +1311,17 @@ 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: Zero descriptor requirement in Rx queue: %d," + "buffers ring: %d\n", + i, j); + return -EINVAL; + } + /* Return the errno */ + if (ret < 0) { PMD_INIT_LOG(ERR, "ERROR: Posting Rxq: %d buffers ring: %d", i, j); -- 2.30.2