Skip to content

Commit 9848a3c

Browse files
common/idpf: fix AVX-512 pointer copy on 32-bit
The size of a pointer on 32-bit is only 4 rather than 8 bytes, so copying 32 pointers only requires half the number of AVX-512 load store operations. Fixes: 5bf87b4 ("net/idpf: add AVX512 data path for single queue model") Cc: [email protected] Signed-off-by: Bruce Richardson <[email protected]> Acked-by: Ian Stokes <[email protected]>
1 parent f35de06 commit 9848a3c

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

drivers/common/idpf/idpf_common_rxtx_avx512.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1043,6 +1043,7 @@ idpf_tx_singleq_free_bufs_avx512(struct idpf_tx_queue *txq)
10431043
uint32_t copied = 0;
10441044
/* n is multiple of 32 */
10451045
while (copied < n) {
1046+
#ifdef RTE_ARCH_64
10461047
const __m512i a = _mm512_loadu_si512(&txep[copied]);
10471048
const __m512i b = _mm512_loadu_si512(&txep[copied + 8]);
10481049
const __m512i c = _mm512_loadu_si512(&txep[copied + 16]);
@@ -1052,6 +1053,12 @@ idpf_tx_singleq_free_bufs_avx512(struct idpf_tx_queue *txq)
10521053
_mm512_storeu_si512(&cache_objs[copied + 8], b);
10531054
_mm512_storeu_si512(&cache_objs[copied + 16], c);
10541055
_mm512_storeu_si512(&cache_objs[copied + 24], d);
1056+
#else
1057+
const __m512i a = _mm512_loadu_si512(&txep[copied]);
1058+
const __m512i b = _mm512_loadu_si512(&txep[copied + 16]);
1059+
_mm512_storeu_si512(&cache_objs[copied], a);
1060+
_mm512_storeu_si512(&cache_objs[copied + 16], b);
1061+
#endif
10551062
copied += 32;
10561063
}
10571064
cache->len += n;

0 commit comments

Comments
 (0)