From: Yaacov Hazan <yaacovh@mellanox.com>
To: dev@dpdk.org
Cc: Raslsn Darawsheh <rdarawsheh@asaltech.com>
Subject: [dpdk-dev] [PATCH] net:bonding: fix free_queues function when no queues exist
Date: Thu, 22 Oct 2015 15:55:16 +0300 [thread overview]
Message-ID: <1445518516-15630-1-git-send-email-yaacovh@mellanox.com> (raw)
From: Raslsn Darawsheh <rdarawsheh@asaltech.com>
In case of creating bond device without add any slaves and
quit from testpmd, application crashed since rx/tx queues
are NULL.
add checking of this paramters before trying to free.
Signed-off-by: Raslsn Darawsheh <rdarawsheh@asaltech.com>
Signed-off-by: Yaacov Hazan <yaacovh@mellanox.com>
---
drivers/net/bonding/rte_eth_bond_pmd.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c
index 5cc6372..40b63d7 100644
--- a/drivers/net/bonding/rte_eth_bond_pmd.c
+++ b/drivers/net/bonding/rte_eth_bond_pmd.c
@@ -1518,12 +1518,18 @@ bond_ethdev_free_queues(struct rte_eth_dev *dev)
uint8_t i;
for (i = 0; i < dev->data->nb_rx_queues; i++) {
+ if (dev->data->rx_queues[i] == NULL)
+ continue;
+
rte_free(dev->data->rx_queues[i]);
dev->data->rx_queues[i] = NULL;
}
dev->data->nb_rx_queues = 0;
for (i = 0; i < dev->data->nb_tx_queues; i++) {
+ if (dev->data->tx_queues[i] == NULL)
+ continue;
+
rte_free(dev->data->tx_queues[i]);
dev->data->tx_queues[i] = NULL;
}
--
1.9.1
next reply other threads:[~2015-10-22 12:55 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-22 12:55 Yaacov Hazan [this message]
2015-10-26 7:07 ` [dpdk-dev] [PATCH v2] " Yaacov Hazan
2015-10-29 16:25 ` Declan Doherty
2015-11-04 22:47 ` Thomas Monjalon
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=1445518516-15630-1-git-send-email-yaacovh@mellanox.com \
--to=yaacovh@mellanox.com \
--cc=dev@dpdk.org \
--cc=rdarawsheh@asaltech.com \
/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).