Skip to content

Commit 87e2509

Browse files
vipinamdferruhy
authored andcommitted
app/testpmd: move offload update
Moving the offload flag update from end to start of the loop, helps to reduce L1 or L2 cache evictions and amortize shuffle. This helps to improve RX packet in mac-swap processing. Test Result: * Platform: AMD EPYC 9554 @3.1GHz, no boost * Test scenarios: TEST-PMD 64B IO vs MAC-SWAP * NIC: broadcom P2100: loopback 2*100Gbps <mode : Mpps Ingress: Mpps Egress> ------------------------------------------------ - MAC-SWAP original: 45.75 : 43.8 - MAC-SWAP register mod: 45.73 : 44.83 - MAC-SWAP register+ofl modified: 46.36 : 44.79 Signed-off-by: Vipin Varghese <[email protected]> Acked-by: Ferruh Yigit <[email protected]>
1 parent cd36a14 commit 87e2509

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

app/test-pmd/macswap_sse.h

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,19 +45,22 @@ do_macswap(struct rte_mbuf *pkts[], uint16_t nb,
4545
mb[0] = pkts[i++];
4646
eth_hdr[0] = rte_pktmbuf_mtod(mb[0], struct rte_ether_hdr *);
4747
addr0 = _mm_loadu_si128((__m128i *)eth_hdr[0]);
48+
mbuf_field_set(mb[0], ol_flags);
4849

4950
mb[1] = pkts[i++];
5051
eth_hdr[1] = rte_pktmbuf_mtod(mb[1], struct rte_ether_hdr *);
5152
addr1 = _mm_loadu_si128((__m128i *)eth_hdr[1]);
52-
53+
mbuf_field_set(mb[1], ol_flags);
5354

5455
mb[2] = pkts[i++];
5556
eth_hdr[2] = rte_pktmbuf_mtod(mb[2], struct rte_ether_hdr *);
5657
addr2 = _mm_loadu_si128((__m128i *)eth_hdr[2]);
58+
mbuf_field_set(mb[2], ol_flags);
5759

5860
mb[3] = pkts[i++];
5961
eth_hdr[3] = rte_pktmbuf_mtod(mb[3], struct rte_ether_hdr *);
6062
addr3 = _mm_loadu_si128((__m128i *)eth_hdr[3]);
63+
mbuf_field_set(mb[3], ol_flags);
6164

6265
addr0 = _mm_shuffle_epi8(addr0, shfl_msk);
6366
addr1 = _mm_shuffle_epi8(addr1, shfl_msk);
@@ -69,10 +72,6 @@ do_macswap(struct rte_mbuf *pkts[], uint16_t nb,
6972
_mm_storeu_si128((__m128i *)eth_hdr[2], addr2);
7073
_mm_storeu_si128((__m128i *)eth_hdr[3], addr3);
7174

72-
mbuf_field_set(mb[0], ol_flags);
73-
mbuf_field_set(mb[1], ol_flags);
74-
mbuf_field_set(mb[2], ol_flags);
75-
mbuf_field_set(mb[3], ol_flags);
7675
r -= 4;
7776
}
7877

@@ -84,10 +83,10 @@ do_macswap(struct rte_mbuf *pkts[], uint16_t nb,
8483

8584
/* Swap dest and src mac addresses. */
8685
addr0 = _mm_loadu_si128((__m128i *)eth_hdr[0]);
86+
mbuf_field_set(mb[0], ol_flags);
87+
8788
addr0 = _mm_shuffle_epi8(addr0, shfl_msk);
8889
_mm_storeu_si128((__m128i *)eth_hdr[0], addr0);
89-
90-
mbuf_field_set(mb[0], ol_flags);
9190
}
9291
}
9392

0 commit comments

Comments
 (0)