Skip to contentSkip to conversation

app/flow-perf: export some configuration options

PATCH Applied Wisam Jaddo 2 participants 2 messages Oct 4, 2021 – Oct 25, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 app/flow-perf: export some configuration options

Some options are needed in the runtime many times, so leaving it during compilation is not correct. As a result some options has been exported into command line options to be used at run time.

The options exported are:
--txq=N
--rxq=N
--txd=N
--rxd=N
--mbuf-size=N
--mbuf-cache-size=N
--total-mbuf-count=N

---
 app/test-flow-perf/actions_gen.c |  14 ++---
 app/test-flow-perf/actions_gen.h |   2 +-
 app/test-flow-perf/config.h      |   4 +-
 app/test-flow-perf/flow_gen.c    |   3 +-
 app/test-flow-perf/flow_gen.h    |   1 +
 app/test-flow-perf/main.c        | 102 +++++++++++++++++++++++++------
 doc/guides/tools/flow-perf.rst   |  33 ++++++++--
 7 files changed, 124 insertions(+), 35 deletions(-)
app/test-flow-perf/actions_gen.c +7 -7
index 82cddfc676..7c209f7266 100644
@@ -909,25 +909,25 @@ void
 fill_actions(struct rte_flow_action *actions, uint64_t *flow_actions,
 	uint32_t counter, uint16_t next_table, uint16_t hairpinq,
 	uint64_t encap_data, uint64_t decap_data, uint8_t core_idx,
-	bool unique_data)
+	bool unique_data, uint8_t rx_queues_count)
 {
 	struct additional_para additional_para_data;
 	uint8_t actions_counter = 0;
 	uint16_t hairpin_queues[hairpinq];
-	uint16_t queues[RXQ_NUM];
+	uint16_t queues[rx_queues_count];
 	uint16_t i, j;
 
-	for (i = 0; i < RXQ_NUM; i++)
+	for (i = 0; i < rx_queues_count; i++)
 		queues[i] = i;
 
 	for (i = 0; i < hairpinq; i++)
-		hairpin_queues[i] = i + RXQ_NUM;
+		hairpin_queues[i] = i + rx_queues_count;
 
 	additional_para_data = (struct additional_para){
-		.queue = counter % RXQ_NUM,
+		.queue = counter % rx_queues_count,
 		.next_table = next_table,
 		.queues = queues,
-		.queues_number = RXQ_NUM,
+		.queues_number = rx_queues_count,
 		.counter = counter,
 		.encap_data = encap_data,
 		.decap_data = decap_data,
@@ -938,7 +938,7 @@ fill_actions(struct rte_flow_action *actions, uint64_t *flow_actions,
 	if (hairpinq != 0) {
 		additional_para_data.queues = hairpin_queues;
 		additional_para_data.queues_number = hairpinq;
-		additional_para_data.queue = (counter % hairpinq) + RXQ_NUM;
+		additional_para_data.queue = (counter % hairpinq) + rx_queues_count;
 	}
 
 	static const struct actions_dict {
app/test-flow-perf/actions_gen.h +1 -1
index 6f2f833496..8990686269 100644
@@ -20,6 +20,6 @@
 void fill_actions(struct rte_flow_action *actions, uint64_t *flow_actions,
 	uint32_t counter, uint16_t next_table, uint16_t hairpinq,
 	uint64_t encap_data, uint64_t decap_data, uint8_t core_idx,
-	bool unique_data);
+	bool unique_data, uint8_t rx_queues_count);
 
 #endif /* FLOW_PERF_ACTION_GEN */
app/test-flow-perf/config.h +2 -2
index a14d4e05e1..3d85e0d49a 100644
@@ -8,8 +8,8 @@
 #define GET_RSS_HF() (ETH_RSS_IP)
 
 /* Configuration */
-#define RXQ_NUM 4
-#define TXQ_NUM 4
+#define RXQ_NUM 1
+#define TXQ_NUM 1
 #define TOTAL_MBUF_NUM 32000
 #define MBUF_SIZE 2048
 #define MBUF_CACHE_SIZE 512
app/test-flow-perf/flow_gen.c +2 -1
index 8f87fac5f6..51871dbfdc 100644
@@ -46,6 +46,7 @@ generate_flow(uint16_t port_id,
 	uint64_t encap_data,
 	uint64_t decap_data,
 	uint8_t core_idx,
+	uint8_t rx_queues_count,
 	bool unique_data,
 	struct rte_flow_error *error)
 {
@@ -63,7 +64,7 @@ generate_flow(uint16_t port_id,
 	fill_actions(actions, flow_actions,
 		outer_ip_src, next_table, hairpinq,
 		encap_data, decap_data, core_idx,
-		unique_data);
+		unique_data, rx_queues_count);
 
 	fill_items(items, flow_items, outer_ip_src, core_idx);
 
app/test-flow-perf/flow_gen.h +1 -0
index dc887fceae..1118a9fc14 100644
@@ -35,6 +35,7 @@ generate_flow(uint16_t port_id,
 	uint64_t encap_data,
 	uint64_t decap_data,
 	uint8_t core_idx,
+	uint8_t rx_queues_count,
 	bool unique_data,
 	struct rte_flow_error *error);
 
app/test-flow-perf/main.c +82 -20

212 lines not on this page · raw message

doc/guides/tools/flow-perf.rst +29 -4
index 280bf7e0e0..0855f88689 100644
@@ -100,10 +100,35 @@ The command line options are:
 	Set the number of needed cores to insert/delete rte_flow rules.
 	Default cores count is 1.
 
-*       ``--unique-data``
-        Flag to set using unique data for all actions that support data,
-        Such as header modify and encap actions. Default is using fixed
-        data for any action that support data for all flows.
+*	``--meter-profile-alg``
+	Set the traffic metering algorithm.
+	Example: meter-profile-alg=srtcmp, default algorithm is srtcm_rfc2697
+
+*	``--unique-data``
+	Flag to set using unique data for all actions that support data,
+	Such as header modify and encap actions. Default is using fixed
+	data for any action that support data for all flows.
+
+*	``--rxq=N``
+	Set the count of receive queues, default is 1.
+
+*	``--txq=N``
+	Set the count of send queues, default is 1.
+
+*	``--rxd=N``
+	Set the count of rxd, default is 256.
+
+*	``--txd=N``
+	Set the count of txd, default is 256.
+
+*	``--mbuf-size=N``
+	Set the size of mbuf, default size is 2048.
+
+*	``--mbuf-cache-size=N``
+	Set the size of mbuf cache, default size is 512.
+
+*	``--total-mbuf-count=N``
+	Set the count of total mbuf number, default count is 32000.
 
 Attributes:
 
Signature · 1 line
2.17.1
#1 lore raw

04/10/2021 14:55, Wisam Jaddo:

Quoted 14 lines

Some options are needed in the runtime many times, so leaving it during compilation is not correct. As a result some options has been exported into command line options to be used at run time.

The options exported are:
--txq=N
--rxq=N
--txd=N
--rxd=N
--mbuf-size=N
--mbuf-cache-size=N
--total-mbuf-count=N

Quoted 2 lines

Applied, thanks.