aboutsummaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorKonstantin Ananyev <konstantin.ananyev@intel.com>2018-02-08 15:44:20 +0000
committerKonstantin Ananyev <konstantin.ananyev@intel.com>2018-02-08 15:50:38 +0000
commit5b873e3b8c8cbb175fa014b0c28944892ce6c3b3 (patch)
treebdea44f11d9805aa3d80847cea98cbb600ddc38c /examples
parent5c795f7bd17608d441d4e2c7f862ad9d45685b93 (diff)
at DPDK queue setup take into account device descriptor limits.
Change-Id: Idf7c65a8499f41d2cd53342f91f2b87e902faf58 Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Diffstat (limited to 'examples')
-rw-r--r--examples/l4fwd/port.h10
1 files changed, 7 insertions, 3 deletions
diff --git a/examples/l4fwd/port.h b/examples/l4fwd/port.h
index a451f7b..b727b1b 100644
--- a/examples/l4fwd/port.h
+++ b/examples/l4fwd/port.h
@@ -207,6 +207,7 @@ queue_init(struct netbe_port *uprt, struct rte_mempool *mp)
{
int32_t socket, rc;
uint16_t q;
+ uint32_t nb_rxd, nb_txd;
struct rte_eth_dev_info dev_info;
rte_eth_dev_info_get(uprt->id, &dev_info);
@@ -215,7 +216,10 @@ queue_init(struct netbe_port *uprt, struct rte_mempool *mp)
dev_info.default_rxconf.rx_drop_en = 1;
- dev_info.default_txconf.tx_free_thresh = TX_RING_SIZE / 2;
+ nb_rxd = RTE_MIN(RX_RING_SIZE, dev_info.rx_desc_lim.nb_max);
+ nb_txd = RTE_MIN(TX_RING_SIZE, dev_info.tx_desc_lim.nb_max);
+
+ dev_info.default_txconf.tx_free_thresh = nb_txd / 2;
if (uprt->tx_offload != 0) {
RTE_LOG(ERR, USER1, "%s(%u): enabling full featured TX;\n",
__func__, uprt->id);
@@ -223,7 +227,7 @@ queue_init(struct netbe_port *uprt, struct rte_mempool *mp)
}
for (q = 0; q < uprt->nb_lcore; q++) {
- rc = rte_eth_rx_queue_setup(uprt->id, q, RX_RING_SIZE,
+ rc = rte_eth_rx_queue_setup(uprt->id, q, nb_rxd,
socket, &dev_info.default_rxconf, mp);
if (rc < 0) {
RTE_LOG(ERR, USER1,
@@ -234,7 +238,7 @@ queue_init(struct netbe_port *uprt, struct rte_mempool *mp)
}
for (q = 0; q < uprt->nb_lcore; q++) {
- rc = rte_eth_tx_queue_setup(uprt->id, q, TX_RING_SIZE,
+ rc = rte_eth_tx_queue_setup(uprt->id, q, nb_txd,
socket, &dev_info.default_txconf);
if (rc < 0) {
RTE_LOG(ERR, USER1,