From: Andrew Rybchenko <arybchenko@solarflare.com>
To: <dev@dpdk.org>
Cc: Thomas Monjalon <thomas.monjalon@6wind.com>,
Roman Zhukov <Roman.Zhukov@oktetlabs.ru>
Subject: [dpdk-dev] [RFC PATCH 2/2] examples/l3fwd: add check of Rx and Tx descriptors number
Date: Thu, 2 Mar 2017 13:05:35 +0000 [thread overview]
Message-ID: <1488459935-13273-3-git-send-email-arybchenko@solarflare.com> (raw)
In-Reply-To: <1488459935-13273-1-git-send-email-arybchenko@solarflare.com>
From: Roman Zhukov <Roman.Zhukov@oktetlabs.ru>
Signed-off-by: Roman Zhukov <Roman.Zhukov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
examples/l3fwd/main.c | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/examples/l3fwd/main.c b/examples/l3fwd/main.c
index a50d628..8794154 100644
--- a/examples/l3fwd/main.c
+++ b/examples/l3fwd/main.c
@@ -522,9 +522,9 @@ static const struct option lgopts[] = {
* value of 8192
*/
#define NB_MBUF RTE_MAX( \
- (nb_ports*nb_rx_queue*RTE_TEST_RX_DESC_DEFAULT + \
+ (nb_ports*nb_rx_queue*nb_rxd + \
nb_ports*nb_lcores*MAX_PKT_BURST + \
- nb_ports*n_tx_queue*RTE_TEST_TX_DESC_DEFAULT + \
+ nb_ports*n_tx_queue*nb_txd + \
nb_lcores*MEMPOOL_CACHE_SIZE), \
(unsigned)8192)
@@ -918,6 +918,13 @@ main(int argc, char **argv)
"Cannot configure device: err=%d, port=%d\n",
ret, portid);
+ ret = rte_eth_dev_adjust_nb_rx_tx_desc(portid, &nb_rxd,
+ &nb_txd);
+ if (ret < 0)
+ rte_exit(EXIT_FAILURE,
+ "rte_eth_dev_adjust_nb_desc: err=%d, port=%d\n",
+ ret, portid);
+
rte_eth_macaddr_get(portid, &ports_eth_addr[portid]);
print_ethaddr(" Address:", &ports_eth_addr[portid]);
printf(", ");
--
2.9.3
prev parent reply other threads:[~2017-03-02 13:06 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-02 13:05 [dpdk-dev] [RFC PATCH 0/2] Helper function to ajdust Rx/Tx descriptor numbers Andrew Rybchenko
2017-03-02 13:05 ` [dpdk-dev] [RFC PATCH 1/2] ethdev: add function to adjust number of descriptors Andrew Rybchenko
2017-04-24 15:13 ` Thomas Monjalon
2017-04-25 7:39 ` Andrew Rybchenko
2017-05-25 15:57 ` [dpdk-dev] [PATCH " Andrew Rybchenko
2017-05-25 15:57 ` [dpdk-dev] [PATCH 2/2] examples: adjust Rx and Tx descriptors to device limits Andrew Rybchenko
2017-07-08 17:05 ` Stephen Hemminger
2017-07-09 9:40 ` Andrew Rybchenko
2017-05-25 17:40 ` [dpdk-dev] [PATCH 1/2] ethdev: add function to adjust number of descriptors Stephen Hemminger
2017-06-14 10:37 ` Andrew Rybchenko
2017-07-05 23:00 ` Thomas Monjalon
2017-07-08 16:45 ` Thomas Monjalon
2017-03-02 13:05 ` Andrew Rybchenko [this message]
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=1488459935-13273-3-git-send-email-arybchenko@solarflare.com \
--to=arybchenko@solarflare.com \
--cc=Roman.Zhukov@oktetlabs.ru \
--cc=dev@dpdk.org \
--cc=thomas.monjalon@6wind.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).