Skip to content

Commit f35de06

Browse files
net/iavf: 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: 9ab9514 ("net/iavf: enable AVX512 for Tx") Cc: [email protected] Signed-off-by: Bruce Richardson <[email protected]> Acked-by: Ian Stokes <[email protected]>
1 parent ab499a0 commit f35de06

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

drivers/net/iavf/iavf_rxtx_vec_avx512.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1892,6 +1892,7 @@ iavf_tx_free_bufs_avx512(struct iavf_tx_queue *txq)
18921892
uint32_t copied = 0;
18931893
/* n is multiple of 32 */
18941894
while (copied < n) {
1895+
#ifdef RTE_ARCH_64
18951896
const __m512i a = _mm512_loadu_si512(&txep[copied]);
18961897
const __m512i b = _mm512_loadu_si512(&txep[copied + 8]);
18971898
const __m512i c = _mm512_loadu_si512(&txep[copied + 16]);
@@ -1901,6 +1902,12 @@ iavf_tx_free_bufs_avx512(struct iavf_tx_queue *txq)
19011902
_mm512_storeu_si512(&cache_objs[copied + 8], b);
19021903
_mm512_storeu_si512(&cache_objs[copied + 16], c);
19031904
_mm512_storeu_si512(&cache_objs[copied + 24], d);
1905+
#else
1906+
const __m512i a = _mm512_loadu_si512(&txep[copied]);
1907+
const __m512i b = _mm512_loadu_si512(&txep[copied + 16]);
1908+
_mm512_storeu_si512(&cache_objs[copied], a);
1909+
_mm512_storeu_si512(&cache_objs[copied + 16], b);
1910+
#endif
19041911
copied += 32;
19051912
}
19061913
cache->len += n;

0 commit comments

Comments
 (0)