[RFC,v1,4/4] examples/l3fwd: give an example for direct rearm mode

Message ID 20211224164613.32569-5-feifei.wang2@arm.com (mailing list archive)
State Superseded, archived
Delegated to: Ferruh Yigit
Headers
Series Direct re-arming of buffers on receive side |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS

Commit Message

Feifei Wang Dec. 24, 2021, 4:46 p.m. UTC
  This is just to give an example to show how to use API to enable direct
rearm mode for user.

Command (Two flows):
./examples/dpdk-l3fwd -n 4 -l 1 -a 0001:01:00.0 -a 0001:01:00.1
-- -p 0x3 -P --config='(0,0,1),(1,0,1)'

This is one single core case, and by using API, The Rx queue 0 from
port 0 can directly rearm buffers from port 1 Tx queue 0.
And Rx queue 0 from port 1 can directly rearm buffers from port 0 Tx
queue 0.

Suggested-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Signed-off-by: Feifei Wang <feifei.wang2@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
---
 examples/l3fwd/main.c | 3 +++
 1 file changed, 3 insertions(+)
  

Patch

diff --git a/examples/l3fwd/main.c b/examples/l3fwd/main.c
index eb68ffc5aa..e7801b9f04 100644
--- a/examples/l3fwd/main.c
+++ b/examples/l3fwd/main.c
@@ -1439,6 +1439,9 @@  main(int argc, char **argv)
 		}
 	}
 
+	rte_eth_direct_rxrearm_map(0, 0, 1, 0);
+	rte_eth_direct_rxrearm_map(1, 0, 0, 0);
+
 	printf("\n");
 
 	for (lcore_id = 0; lcore_id < RTE_MAX_LCORE; lcore_id++) {