aboutsummaryrefslogtreecommitdiffstats
path: root/examples/load_balancer
diff options
context:
space:
mode:
Diffstat (limited to 'examples/load_balancer')
-rw-r--r--examples/load_balancer/Makefile2
-rw-r--r--examples/load_balancer/config.c1
-rw-r--r--examples/load_balancer/init.c14
-rw-r--r--examples/load_balancer/main.c1
-rw-r--r--examples/load_balancer/main.h8
-rw-r--r--examples/load_balancer/runtime.c1
6 files changed, 22 insertions, 5 deletions
diff --git a/examples/load_balancer/Makefile b/examples/load_balancer/Makefile
index 2c5fd9b0..f656e51c 100644
--- a/examples/load_balancer/Makefile
+++ b/examples/load_balancer/Makefile
@@ -33,7 +33,7 @@ ifeq ($(RTE_SDK),)
$(error "Please define RTE_SDK environment variable")
endif
-# Default target, can be overriden by command line or environment
+# Default target, can be overridden by command line or environment
RTE_TARGET ?= x86_64-native-linuxapp-gcc
include $(RTE_SDK)/mk/rte.vars.mk
diff --git a/examples/load_balancer/config.c b/examples/load_balancer/config.c
index 07f92a1a..50325095 100644
--- a/examples/load_balancer/config.c
+++ b/examples/load_balancer/config.c
@@ -49,7 +49,6 @@
#include <rte_memcpy.h>
#include <rte_memzone.h>
#include <rte_eal.h>
-#include <rte_per_lcore.h>
#include <rte_launch.h>
#include <rte_atomic.h>
#include <rte_cycles.h>
diff --git a/examples/load_balancer/init.c b/examples/load_balancer/init.c
index abd05a31..717232e6 100644
--- a/examples/load_balancer/init.c
+++ b/examples/load_balancer/init.c
@@ -49,7 +49,6 @@
#include <rte_memcpy.h>
#include <rte_memzone.h>
#include <rte_eal.h>
-#include <rte_per_lcore.h>
#include <rte_launch.h>
#include <rte_atomic.h>
#include <rte_cycles.h>
@@ -430,6 +429,8 @@ app_init_nics(void)
/* Init NIC ports and queues, then start the ports */
for (port = 0; port < APP_MAX_NIC_PORTS; port ++) {
struct rte_mempool *pool;
+ uint16_t nic_rx_ring_size;
+ uint16_t nic_tx_ring_size;
n_rx_queues = app_get_nic_rx_queues_per_port(port);
n_tx_queues = app.nic_tx_port_mask[port];
@@ -450,6 +451,17 @@ app_init_nics(void)
}
rte_eth_promiscuous_enable(port);
+ nic_rx_ring_size = app.nic_rx_ring_size;
+ nic_tx_ring_size = app.nic_tx_ring_size;
+ ret = rte_eth_dev_adjust_nb_rx_tx_desc(
+ port, &nic_rx_ring_size, &nic_tx_ring_size);
+ if (ret < 0) {
+ rte_panic("Cannot adjust number of descriptors for port %u (%d)\n",
+ (unsigned) port, ret);
+ }
+ app.nic_rx_ring_size = nic_rx_ring_size;
+ app.nic_tx_ring_size = nic_tx_ring_size;
+
/* Init RX queues */
for (queue = 0; queue < APP_MAX_RX_QUEUES_PER_NIC_PORT; queue ++) {
if (app.nic_rx_queue_mask[port][queue] == 0) {
diff --git a/examples/load_balancer/main.c b/examples/load_balancer/main.c
index c97bf6fa..65ceea4a 100644
--- a/examples/load_balancer/main.c
+++ b/examples/load_balancer/main.c
@@ -50,7 +50,6 @@
#include <rte_memcpy.h>
#include <rte_memzone.h>
#include <rte_eal.h>
-#include <rte_per_lcore.h>
#include <rte_launch.h>
#include <rte_atomic.h>
#include <rte_cycles.h>
diff --git a/examples/load_balancer/main.h b/examples/load_balancer/main.h
index d98468a7..dc407555 100644
--- a/examples/load_balancer/main.h
+++ b/examples/load_balancer/main.h
@@ -56,7 +56,11 @@
#endif
#ifndef APP_MAX_IO_LCORES
+#if (APP_MAX_LCORES > 16)
#define APP_MAX_IO_LCORES 16
+#else
+#define APP_MAX_IO_LCORES APP_MAX_LCORES
+#endif
#endif
#if (APP_MAX_IO_LCORES > APP_MAX_LCORES)
#error "APP_MAX_IO_LCORES is too big"
@@ -74,7 +78,11 @@
#endif
#ifndef APP_MAX_WORKER_LCORES
+#if (APP_MAX_LCORES > 16)
#define APP_MAX_WORKER_LCORES 16
+#else
+#define APP_MAX_WORKER_LCORES APP_MAX_LCORES
+#endif
#endif
#if (APP_MAX_WORKER_LCORES > APP_MAX_LCORES)
#error "APP_MAX_WORKER_LCORES is too big"
diff --git a/examples/load_balancer/runtime.c b/examples/load_balancer/runtime.c
index 7f918aa4..e54b7851 100644
--- a/examples/load_balancer/runtime.c
+++ b/examples/load_balancer/runtime.c
@@ -49,7 +49,6 @@
#include <rte_memcpy.h>
#include <rte_memzone.h>
#include <rte_eal.h>
-#include <rte_per_lcore.h>
#include <rte_launch.h>
#include <rte_atomic.h>
#include <rte_cycles.h>