patches for DPDK stable branches
 help / color / mirror / Atom feed
* [PATCH 1/2] net/virtio: propagate return value of called function
@ 2023-03-22 10:23 Boleslav Stankevich
  2023-03-22 10:23 ` [PATCH 2/2] net/virtio: fix device init to return negative errno Boleslav Stankevich
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Boleslav Stankevich @ 2023-03-22 10:23 UTC (permalink / raw)
  To: dev
  Cc: Boleslav Stankevich, stable, Andrew Rybchenko, Maxime Coquelin,
	Chenbo Xia, David Marchand, Hyong Youb Kim, Harman Kalra

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


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2023-06-01 20:01 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-22 10:23 [PATCH 1/2] net/virtio: propagate return value of called function Boleslav Stankevich
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

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).