On 14 Jul 2022, at 19:51, Emma Finn wrote:
> This commit adds support for the AVX512 implementation of the
> ipv4_set_addrs action as well as an AVX512 implementation of
> updating the checksums.
>
> Signed-off-by: Emma Finn <[email protected]>
<SNIP>
> +static inline uint16_t ALWAYS_INLINE
> +avx512_get_delta(__m256i old_header, __m256i new_header)
> +{
> + __m256i v_zeros = _mm256_setzero_si256();
> + uint16_t delta;
All changes look good, however you missed a previous comment in all delta
functions:
> These two should be reversed and an extra cr/lf.
>
> + uint16_t delta;
> +
> + /* Set the v_zeros register to all zero's. */
> + __m256i v_zeros = _mm256_setzero_si256();
Looking at the functions again, I guess you can simple change it to:
$ git diff
diff --git a/lib/odp-execute-avx512.c b/lib/odp-execute-avx512.c
index 2e0bc32a9..8f405fa9f 100644
--- a/lib/odp-execute-avx512.c
+++ b/lib/odp-execute-avx512.c
@@ -299,7 +299,6 @@ static inline uint16_t ALWAYS_INLINE
avx512_get_delta(__m256i old_header, __m256i new_header)
{
__m256i v_zeros = _mm256_setzero_si256();
- uint16_t delta;
/* These two shuffle masks, v_swap16a and v_swap16b, are to shuffle the
* old and new header to add padding after each 16-bit value for the
@@ -338,9 +337,7 @@ avx512_get_delta(__m256i old_header, __m256i new_header)
v_delta = _mm256_hadd_epi16(v_delta, v_zeros);
/* Extract delta value. */
- delta = _mm256_extract_epi16(v_delta, 0);
-
- return delta;
+ return _mm256_extract_epi16(v_delta, 0);
}
/* This function will calculate the csum delta for the IPv4 addresses in the
@@ -350,7 +347,6 @@ static inline uint16_t ALWAYS_INLINE
avx512_ipv4_addr_csum_delta(__m256i old_header, __m256i new_header)
{
__m256i v_zeros = _mm256_setzero_si256();
- uint16_t delta;
/* Set the v_ones register to all one's. */
__m256i v_ones = _mm256_cmpeq_epi16(v_zeros, v_zeros);
@@ -365,10 +361,7 @@ avx512_ipv4_addr_csum_delta(__m256i old_header, __m256i
new_header)
old_header =_mm256_andnot_si256(old_header, v_ones);
/* Calculate the delta between the old and new header. */
- delta = avx512_get_delta(old_header, v_blend_new);
-
- return delta;
-
+ return avx512_get_delta(old_header, v_blend_new);
}
/* This function will calculate the csum delta between the new_header and
@@ -379,7 +372,6 @@ static inline uint16_t ALWAYS_INLINE
avx512_ipv4_hdr_csum_delta(__m256i old_header, __m256i new_header)
{
__m256i v_zeros = _mm256_setzero_si256();
- uint16_t delta;
/* Set the v_ones register to all one's. */
__m256i v_ones = _mm256_cmpeq_epi16(v_zeros, v_zeros);
@@ -388,9 +380,7 @@ avx512_ipv4_hdr_csum_delta(__m256i old_header, __m256i
new_header)
old_header =_mm256_andnot_si256(old_header, v_ones);
/* Calculate the delta between the old and new header. */
- delta = avx512_get_delta(old_header, new_header);
-
- return delta;
+ return avx512_get_delta(old_header, new_header);
}
/* This function performs the same operation on each packet in the batch as
//Eelco
_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev