From patchwork Wed Mar 22 10:23:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Boleslav Stankevich X-Patchwork-Id: 125421 X-Patchwork-Delegate: maxime.coquelin@redhat.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 A545742803; Wed, 22 Mar 2023 11:23:38 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7BD9D40E09; Wed, 22 Mar 2023 11:23:38 +0100 (CET) Received: from shelob.oktetlabs.ru (shelob.oktetlabs.ru [91.220.146.113]) by mails.dpdk.org (Postfix) with ESMTP id C4D7440A84; Wed, 22 Mar 2023 11:23:36 +0100 (CET) Received: from finrod.oktetlabs.ru (finrod.oktetlabs.ru [192.168.38.32]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by shelob.oktetlabs.ru (Postfix) with ESMTPS id EF4545A; Wed, 22 Mar 2023 13:23:34 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 shelob.oktetlabs.ru EF4545A Authentication-Results: shelob.oktetlabs.ru/EF4545A; dkim=none; dkim-atps=neutral From: Boleslav Stankevich To: dev@dpdk.org Cc: Boleslav Stankevich , stable@dpdk.org, Andrew Rybchenko , Maxime Coquelin , Chenbo Xia , David Marchand , Hyong Youb Kim , Harman Kalra Subject: [PATCH 1/2] net/virtio: propagate return value of called function Date: Wed, 22 Mar 2023 13:23:24 +0300 Message-Id: <20230322102325.1739053-1-boleslav.stankevich@oktetlabs.ru> X-Mailer: git-send-email 2.30.2 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 rte_intr_vec_list_alloc() may fail because of different reasons which are indicated by different negative errno values. Fixes: d61138d4f0e2 ("drivers: remove direct access to interrupt handle") Cc: stable@dpdk.org Signed-off-by: Boleslav Stankevich Signed-off-by: Andrew Rybchenko Reviewed-by: Chenbo Xia --- drivers/net/virtio/virtio_ethdev.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c index ae84d313be..5c8b7b95e9 100644 --- a/drivers/net/virtio/virtio_ethdev.c +++ b/drivers/net/virtio/virtio_ethdev.c @@ -1390,6 +1390,7 @@ static int virtio_configure_intr(struct rte_eth_dev *dev) { struct virtio_hw *hw = dev->data->dev_private; + int ret; if (!rte_intr_cap_multiple(dev->intr_handle)) { PMD_INIT_LOG(ERR, "Multiple intr vector not supported"); @@ -1401,11 +1402,12 @@ virtio_configure_intr(struct rte_eth_dev *dev) return -1; } - if (rte_intr_vec_list_alloc(dev->intr_handle, "intr_vec", - hw->max_queue_pairs)) { + ret = rte_intr_vec_list_alloc(dev->intr_handle, "intr_vec", + hw->max_queue_pairs); + if (ret < 0) { PMD_INIT_LOG(ERR, "Failed to allocate %u rxq vectors", hw->max_queue_pairs); - return -ENOMEM; + return ret; } if (dev->data->dev_flags & RTE_ETH_DEV_INTR_LSC) {