diff mbox

test: l2fwd: prefetch packet data

Message ID 1467899766-31964-1-git-send-email-matias.elo@nokia.com
State Superseded
Headers show

Commit Message

Elo, Matias (Nokia - FI/Espoo) July 7, 2016, 1:56 p.m. UTC
Prefetch ethernet addresses. This is a no-op on odp-linux but improves
performance significantly on odp-dpdk implementation.

Signed-off-by: Matias Elo <matias.elo@nokia.com>

---
 test/performance/odp_l2fwd.c | 4 ++++
 1 file changed, 4 insertions(+)

-- 
1.9.1

Comments

Maxim Uvarov July 7, 2016, 2:43 p.m. UTC | #1
On 07/07/16 16:56, Matias Elo wrote:
> Prefetch ethernet addresses. This is a no-op on odp-linux but improves

> performance significantly on odp-dpdk implementation.

>

> Signed-off-by: Matias Elo <matias.elo@nokia.com>

> ---

>   test/performance/odp_l2fwd.c | 4 ++++

>   1 file changed, 4 insertions(+)

>

> diff --git a/test/performance/odp_l2fwd.c b/test/performance/odp_l2fwd.c

> index 164f7f5..cd4789f 100644

> --- a/test/performance/odp_l2fwd.c

> +++ b/test/performance/odp_l2fwd.c

> @@ -255,6 +255,10 @@ static inline void fill_eth_addrs(odp_packet_t pkt_tbl[],

>   

>   	for (i = 0; i < num; ++i) {

>   		pkt = pkt_tbl[i];

> +

> +		/* Prefetch ethernet addresses */

> +		odp_packet_prefetch(pkt, 0, 12);

> +

_ODP_ETHHDR_LEN ?


>   		if (odp_packet_has_eth(pkt)) {

>   			eth = (odph_ethhdr_t *)odp_packet_l2_ptr(pkt, NULL);

>
diff mbox

Patch

diff --git a/test/performance/odp_l2fwd.c b/test/performance/odp_l2fwd.c
index 164f7f5..cd4789f 100644
--- a/test/performance/odp_l2fwd.c
+++ b/test/performance/odp_l2fwd.c
@@ -255,6 +255,10 @@  static inline void fill_eth_addrs(odp_packet_t pkt_tbl[],
 
 	for (i = 0; i < num; ++i) {
 		pkt = pkt_tbl[i];
+
+		/* Prefetch ethernet addresses */
+		odp_packet_prefetch(pkt, 0, 12);
+
 		if (odp_packet_has_eth(pkt)) {
 			eth = (odph_ethhdr_t *)odp_packet_l2_ptr(pkt, NULL);