The hairpin queue is the one that start from normal rxq,
and will be less than nr_queues where nr_queues is the
sum of normal and hairpin.
Fixes:
bf3688f1e816 ("app/flow-perf: add insertion rate calculation")
Signed-off-by: Wisam Jaddo <wisamm@mellanox.com>
Reviewed-by: Asaf Penso <asafp@mellanox.com>
static uint32_t nb_lcores;
static uint32_t flows_count;
static uint32_t iterations_number;
static uint32_t nb_lcores;
static uint32_t flows_count;
static uint32_t iterations_number;
-static uint32_t hairpinq;
+static uint32_t hairpin_queues_num; /* total hairpin q number - default: 0 */
static uint32_t nb_lcores;
#define MAX_PKT_BURST 32
static uint32_t nb_lcores;
#define MAX_PKT_BURST 32
flow_items = 0;
flow_actions = 0;
flow_attrs = 0;
flow_items = 0;
flow_actions = 0;
flow_attrs = 0;
+ hairpin_queues_num = 0;
argvopt = argv;
printf(":: Flow -> ");
argvopt = argv;
printf(":: Flow -> ");
"hairpin-rss") == 0) {
n = atoi(optarg);
if (n > 0)
"hairpin-rss") == 0) {
n = atoi(optarg);
if (n > 0)
+ hairpin_queues_num = n;
else
rte_exit(EXIT_SUCCESS,
"Hairpin queues should be > 0\n");
else
rte_exit(EXIT_SUCCESS,
"Hairpin queues should be > 0\n");
"hairpin-queue") == 0) {
n = atoi(optarg);
if (n > 0)
"hairpin-queue") == 0) {
n = atoi(optarg);
if (n > 0)
+ hairpin_queues_num = n;
else
rte_exit(EXIT_SUCCESS,
"Hairpin queues should be > 0\n");
else
rte_exit(EXIT_SUCCESS,
"Hairpin queues should be > 0\n");
for (i = 0; i < flows_count; i++) {
flow = generate_flow(port_id, flow_group,
flow_attrs, flow_items, flow_actions,
for (i = 0; i < flows_count; i++) {
flow = generate_flow(port_id, flow_group,
flow_attrs, flow_items, flow_actions,
- JUMP_ACTION_TABLE, i, hairpinq, &error);
+ JUMP_ACTION_TABLE, i,
+ hairpin_queues_num, &error);
if (force_quit)
i = flows_count;
if (force_quit)
i = flows_count;
{
int ret;
uint16_t std_queue;
{
int ret;
uint16_t std_queue;
+ uint16_t hairpin_queue;
uint16_t port_id;
uint16_t nr_ports;
uint16_t nr_queues;
uint16_t port_id;
uint16_t nr_ports;
uint16_t nr_queues;
struct rte_eth_dev_info dev_info;
nr_queues = RXQ_NUM;
struct rte_eth_dev_info dev_info;
nr_queues = RXQ_NUM;
- if (hairpinq != 0)
- nr_queues = RXQ_NUM + hairpinq;
+ if (hairpin_queues_num != 0)
+ nr_queues = RXQ_NUM + hairpin_queues_num;
nr_ports = rte_eth_dev_count_avail();
if (nr_ports == 0)
nr_ports = rte_eth_dev_count_avail();
if (nr_ports == 0)
":: promiscuous mode enable failed: err=%s, port=%u\n",
rte_strerror(-ret), port_id);
":: promiscuous mode enable failed: err=%s, port=%u\n",
rte_strerror(-ret), port_id);
- if (hairpinq != 0) {
- for (hairpin_q = RXQ_NUM, std_queue = 0;
- std_queue < nr_queues;
- hairpin_q++, std_queue++) {
+ if (hairpin_queues_num != 0) {
+ /*
+ * Configure peer which represents hairpin Tx.
+ * Hairpin queue numbers start after standard queues
+ * (RXQ_NUM and TXQ_NUM).
+ */
+ for (hairpin_queue = RXQ_NUM, std_queue = 0;
+ hairpin_queue < nr_queues;
+ hairpin_queue++, std_queue++) {
hairpin_conf.peers[0].port = port_id;
hairpin_conf.peers[0].queue =
std_queue + TXQ_NUM;
ret = rte_eth_rx_hairpin_queue_setup(
hairpin_conf.peers[0].port = port_id;
hairpin_conf.peers[0].queue =
std_queue + TXQ_NUM;
ret = rte_eth_rx_hairpin_queue_setup(
+ port_id, hairpin_queue,
NR_RXD, &hairpin_conf);
if (ret != 0)
rte_exit(EXIT_FAILURE,
NR_RXD, &hairpin_conf);
if (ret != 0)
rte_exit(EXIT_FAILURE,
- for (hairpin_q = TXQ_NUM, std_queue = 0;
- std_queue < nr_queues;
- hairpin_q++, std_queue++) {
+ for (hairpin_queue = TXQ_NUM, std_queue = 0;
+ hairpin_queue < nr_queues;
+ hairpin_queue++, std_queue++) {
hairpin_conf.peers[0].port = port_id;
hairpin_conf.peers[0].queue =
std_queue + RXQ_NUM;
ret = rte_eth_tx_hairpin_queue_setup(
hairpin_conf.peers[0].port = port_id;
hairpin_conf.peers[0].queue =
std_queue + RXQ_NUM;
ret = rte_eth_tx_hairpin_queue_setup(
+ port_id, hairpin_queue,
NR_TXD, &hairpin_conf);
if (ret != 0)
rte_exit(EXIT_FAILURE,
NR_TXD, &hairpin_conf);
if (ret != 0)
rte_exit(EXIT_FAILURE,