[dpdk-dev] ip_frag: fix hash key usage

Message ID 1519178599-3661-1-git-send-email-sergey.alekseev@vdomresearch.com (mailing list archive)
State Rejected, archived
Delegated to: Thomas Monjalon
Headers

Checks

Context Check Description
ci/checkpatch warning coding style issues
ci/Intel-compilation success Compilation OK

Commit Message

Sergey Alekseev Feb. 21, 2018, 2:03 a.m. UTC
  ---
 lib/librte_ip_frag/ip_frag_internal.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
  

Comments

Thomas Monjalon March 27, 2018, 10:29 p.m. UTC | #1
Hi,

21/02/2018 03:03, Sergey Alekseev:
> ---
>  lib/librte_ip_frag/ip_frag_internal.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

Please we need an explanation and Signed-off-by.
Could you send a v2?

Do not hesitate to Cc Konstantin (maintainer of this lib) for reviews.
Thanks

> --- a/lib/librte_ip_frag/ip_frag_internal.c
> +++ b/lib/librte_ip_frag/ip_frag_internal.c
> @@ -61,7 +61,7 @@ ipv4_frag_hash(const struct ip_frag_key *key, uint32_t *v1, uint32_t *v2)
>  	uint32_t v;
>  	const uint32_t *p;
>  
> -	p = (const uint32_t *)&key->src_dst;
> +	p = (const uint32_t *) key->src_dst;
>  
>  #ifdef RTE_ARCH_X86
>  	v = rte_hash_crc_4byte(p[0], PRIME_VALUE);
> @@ -82,7 +82,7 @@ ipv6_frag_hash(const struct ip_frag_key *key, uint32_t *v1, uint32_t *v2)
>  	uint32_t v;
>  	const uint32_t *p;
>  
> -	p = (const uint32_t *) &key->src_dst;
> +	p = (const uint32_t *) key->src_dst;
>  
>  #ifdef RTE_ARCH_X86
>  	v = rte_hash_crc_4byte(p[0], PRIME_VALUE);
  

Patch

diff --git a/lib/librte_ip_frag/ip_frag_internal.c b/lib/librte_ip_frag/ip_frag_internal.c
index 7397aa6..2cfa56b 100644
--- a/lib/librte_ip_frag/ip_frag_internal.c
+++ b/lib/librte_ip_frag/ip_frag_internal.c
@@ -61,7 +61,7 @@  ipv4_frag_hash(const struct ip_frag_key *key, uint32_t *v1, uint32_t *v2)
 	uint32_t v;
 	const uint32_t *p;
 
-	p = (const uint32_t *)&key->src_dst;
+	p = (const uint32_t *) key->src_dst;
 
 #ifdef RTE_ARCH_X86
 	v = rte_hash_crc_4byte(p[0], PRIME_VALUE);
@@ -82,7 +82,7 @@  ipv6_frag_hash(const struct ip_frag_key *key, uint32_t *v1, uint32_t *v2)
 	uint32_t v;
 	const uint32_t *p;
 
-	p = (const uint32_t *) &key->src_dst;
+	p = (const uint32_t *) key->src_dst;
 
 #ifdef RTE_ARCH_X86
 	v = rte_hash_crc_4byte(p[0], PRIME_VALUE);