From: Boleslav Stankevich <boleslav.stankevich@oktetlabs.ru>
To: dev@dpdk.org
Cc: Boleslav Stankevich <boleslav.stankevich@oktetlabs.ru>,
stable@dpdk.org, Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>,
Maxime Coquelin <maxime.coquelin@redhat.com>,
Chenbo Xia <chenbo.xia@intel.com>,
David Marchand <david.marchand@redhat.com>,
Hyong Youb Kim <hyonkim@cisco.com>,
Harman Kalra <hkalra@marvell.com>
Subject: [PATCH 1/2] net/virtio: propagate return value of called function
Date: Wed, 22 Mar 2023 13:23:24 +0300 [thread overview]
Message-ID: <20230322102325.1739053-1-boleslav.stankevich@oktetlabs.ru> (raw)
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 <boleslav.stankevich@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
---
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) {
--
2.30.2
next reply other threads:[~2023-03-22 10:23 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-22 10:23 Boleslav Stankevich [this message]
2023-03-22 10:23 ` [PATCH 2/2] net/virtio: fix device init to return negative errno Boleslav Stankevich
2023-05-11 8:20 ` Xia, Chenbo
2023-06-01 20:01 ` Maxime Coquelin
2023-03-28 3:14 ` [PATCH 1/2] net/virtio: propagate return value of called function Xia, Chenbo
2023-03-30 7:13 ` Andrew Rybchenko
2023-05-11 8:19 ` Xia, Chenbo
2023-06-01 20:01 ` Maxime Coquelin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230322102325.1739053-1-boleslav.stankevich@oktetlabs.ru \
--to=boleslav.stankevich@oktetlabs.ru \
--cc=andrew.rybchenko@oktetlabs.ru \
--cc=chenbo.xia@intel.com \
--cc=david.marchand@redhat.com \
--cc=dev@dpdk.org \
--cc=hkalra@marvell.com \
--cc=hyonkim@cisco.com \
--cc=maxime.coquelin@redhat.com \
--cc=stable@dpdk.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).