From: Reshma Pattan <reshma.pattan@intel.com>
To: dev@dpdk.org, konstantin.ananyev@intel.com
Cc: Reshma Pattan <reshma.pattan@intel.com>
Subject: [dpdk-dev] [PATCH] examples/l3fwd: fix validation for queue id of config tuple
Date: Fri, 18 Mar 2016 10:35:21 +0000 [thread overview]
Message-ID: <1458297321-25601-1-git-send-email-reshma.pattan@intel.com> (raw)
Added validation for queue id of config parameter tuple.
This validation enforces user to enter queue ids of a port
from 0 and in sequence.
This additional validation on queue ids avoids ixgbe crash caused by null
rxq pointer access inside ixgbe_dev_rx_init.
Reason for null rxq is, L3fwd application allocates memory only for queues passed by user.
But rte_eth_dev_start tries to initialize rx queues in sequence from 0 to nb_rx_queues,
which is not true and coredump while accessing the unallocated queue .
Fixes: Commit af75078f
Signed-off-by: Reshma Pattan <reshma.pattan@intel.com>
---
examples/l3fwd/main.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/examples/l3fwd/main.c b/examples/l3fwd/main.c
index 0e33039..f148d4e 100644
--- a/examples/l3fwd/main.c
+++ b/examples/l3fwd/main.c
@@ -264,8 +264,14 @@ get_port_n_rx_queues(const uint8_t port)
for (i = 0; i < nb_lcore_params; ++i) {
if (lcore_params[i].port_id == port &&
- lcore_params[i].queue_id > queue)
+ lcore_params[i].queue_id > queue &&
+ lcore_params[i].queue_id == queue+1)
queue = lcore_params[i].queue_id;
+ else if (lcore_params[i].port_id == port &&
+ lcore_params[i].queue_id != queue+1)
+ rte_exit(EXIT_FAILURE, "queue ids of the port %d must be"
+ " in sequence and must start with 0",
+ lcore_params[i].port_id);
}
return (uint8_t)(++queue);
}
--
2.5.0
next reply other threads:[~2016-03-18 10:35 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-18 10:35 Reshma Pattan [this message]
2016-03-21 14:12 ` Thomas Monjalon
2016-03-24 23:11 ` [dpdk-dev] [PATCH v2] " Reshma Pattan
2016-03-25 14:14 ` De Lara Guarch, Pablo
2016-03-25 15:13 ` [dpdk-dev] [PATCH v3] " Reshma Pattan
2016-03-25 16:08 ` De Lara Guarch, Pablo
2016-03-25 18:49 ` 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=1458297321-25601-1-git-send-email-reshma.pattan@intel.com \
--to=reshma.pattan@intel.com \
--cc=dev@dpdk.org \
--cc=konstantin.ananyev@intel.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).