All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ipv6: Correct/silence an endian warning in ip6_multipath_l3_keys
@ 2023-11-17 15:48 Kunwu Chan
  2023-11-17 17:29 ` Eric Dumazet
  0 siblings, 1 reply; 6+ messages in thread
From: Kunwu Chan @ 2023-11-17 15:48 UTC (permalink / raw)
  To: davem, dsahern, edumazet, kuba, pabeni
  Cc: kunwu.chan, netdev, linux-kernel, Kunwu Chan

net/ipv6/route.c:2332:39: warning: incorrect type in assignment (different base types)
net/ipv6/route.c:2332:39:    expected unsigned int [usertype] flow_label
net/ipv6/route.c:2332:39:    got restricted __be32

Signed-off-by: Kunwu Chan <chentao@kylinos.cn>
---
 net/ipv6/route.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index b132feae3393..692c811eb786 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -2329,7 +2329,7 @@ static void ip6_multipath_l3_keys(const struct sk_buff *skb,
 	} else {
 		keys->addrs.v6addrs.src = key_iph->saddr;
 		keys->addrs.v6addrs.dst = key_iph->daddr;
-		keys->tags.flow_label = ip6_flowlabel(key_iph);
+		keys->tags.flow_label = be32_to_cpu(ip6_flowlabel(key_iph));
 		keys->basic.ip_proto = key_iph->nexthdr;
 	}
 }
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] ipv6: Correct/silence an endian warning in ip6_multipath_l3_keys
  2023-11-17 15:48 [PATCH] ipv6: Correct/silence an endian warning in ip6_multipath_l3_keys Kunwu Chan
@ 2023-11-17 17:29 ` Eric Dumazet
  2023-11-19 14:35   ` Kunwu Chan
  2023-11-19 14:39   ` [PATCH v2] " Kunwu Chan
  0 siblings, 2 replies; 6+ messages in thread
From: Eric Dumazet @ 2023-11-17 17:29 UTC (permalink / raw)
  To: Kunwu Chan; +Cc: davem, dsahern, kuba, pabeni, kunwu.chan, netdev, linux-kernel

On Fri, Nov 17, 2023 at 6:06 PM Kunwu Chan <chentao@kylinos.cn> wrote:
>
> net/ipv6/route.c:2332:39: warning: incorrect type in assignment (different base types)
> net/ipv6/route.c:2332:39:    expected unsigned int [usertype] flow_label
> net/ipv6/route.c:2332:39:    got restricted __be32
>
> Signed-off-by: Kunwu Chan <chentao@kylinos.cn>

Same remark, we need a Fixes: tag

> ---
>  net/ipv6/route.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/net/ipv6/route.c b/net/ipv6/route.c
> index b132feae3393..692c811eb786 100644
> --- a/net/ipv6/route.c
> +++ b/net/ipv6/route.c
> @@ -2329,7 +2329,7 @@ static void ip6_multipath_l3_keys(const struct sk_buff *skb,
>         } else {
>                 keys->addrs.v6addrs.src = key_iph->saddr;
>                 keys->addrs.v6addrs.dst = key_iph->daddr;
> -               keys->tags.flow_label = ip6_flowlabel(key_iph);
> +               keys->tags.flow_label = be32_to_cpu(ip6_flowlabel(key_iph));
>                 keys->basic.ip_proto = key_iph->nexthdr;
>         }

This is not consistent with line 2541 doing:

hash_keys.tags.flow_label = (__force u32)flowi6_get_flowlabel(fl6);

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] ipv6: Correct/silence an endian warning in ip6_multipath_l3_keys
  2023-11-17 17:29 ` Eric Dumazet
@ 2023-11-19 14:35   ` Kunwu Chan
  2023-11-19 14:39   ` [PATCH v2] " Kunwu Chan
  1 sibling, 0 replies; 6+ messages in thread
From: Kunwu Chan @ 2023-11-19 14:35 UTC (permalink / raw)
  To: Eric Dumazet
  Cc: davem, dsahern, kuba, pabeni, kunwu.chan, netdev, linux-kernel

Hi Eric,
Thank you very much for the suggestion, I have modified and resent the 
patch as suggested.

On 2023/11/18 01:29, Eric Dumazet wrote:
> On Fri, Nov 17, 2023 at 6:06 PM Kunwu Chan <chentao@kylinos.cn> wrote:
>>
>> net/ipv6/route.c:2332:39: warning: incorrect type in assignment (different base types)
>> net/ipv6/route.c:2332:39:    expected unsigned int [usertype] flow_label
>> net/ipv6/route.c:2332:39:    got restricted __be32
>>
>> Signed-off-by: Kunwu Chan <chentao@kylinos.cn>
> 
> Same remark, we need a Fixes: tag
> 
>> ---
>>   net/ipv6/route.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/net/ipv6/route.c b/net/ipv6/route.c
>> index b132feae3393..692c811eb786 100644
>> --- a/net/ipv6/route.c
>> +++ b/net/ipv6/route.c
>> @@ -2329,7 +2329,7 @@ static void ip6_multipath_l3_keys(const struct sk_buff *skb,
>>          } else {
>>                  keys->addrs.v6addrs.src = key_iph->saddr;
>>                  keys->addrs.v6addrs.dst = key_iph->daddr;
>> -               keys->tags.flow_label = ip6_flowlabel(key_iph);
>> +               keys->tags.flow_label = be32_to_cpu(ip6_flowlabel(key_iph));
>>                  keys->basic.ip_proto = key_iph->nexthdr;
>>          }
> 
> This is not consistent with line 2541 doing:
> 
> hash_keys.tags.flow_label = (__force u32)flowi6_get_flowlabel(fl6);

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH v2] ipv6: Correct/silence an endian warning in ip6_multipath_l3_keys
  2023-11-17 17:29 ` Eric Dumazet
  2023-11-19 14:35   ` Kunwu Chan
@ 2023-11-19 14:39   ` Kunwu Chan
  2023-11-21 12:11     ` Paolo Abeni
  1 sibling, 1 reply; 6+ messages in thread
From: Kunwu Chan @ 2023-11-19 14:39 UTC (permalink / raw)
  To: edumazet
  Cc: chentao, davem, dsahern, kuba, kunwu.chan, linux-kernel, netdev, pabeni

net/ipv6/route.c:2332:39: warning: incorrect type in assignment (different base types)
net/ipv6/route.c:2332:39:    expected unsigned int [usertype] flow_label
net/ipv6/route.c:2332:39:    got restricted __be32

Fixes: fa1be7e01ea8 ("ipv6: omit traffic class when calculating flow hash")
Suggested-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: Kunwu Chan <chentao@kylinos.cn>
---
 net/ipv6/route.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index b132feae3393..1fdae8d71339 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -2329,7 +2329,7 @@ static void ip6_multipath_l3_keys(const struct sk_buff *skb,
 	} else {
 		keys->addrs.v6addrs.src = key_iph->saddr;
 		keys->addrs.v6addrs.dst = key_iph->daddr;
-		keys->tags.flow_label = ip6_flowlabel(key_iph);
+		keys->tags.flow_label = (__force u32)ip6_flowlabel(key_iph);
 		keys->basic.ip_proto = key_iph->nexthdr;
 	}
 }
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH v2] ipv6: Correct/silence an endian warning in ip6_multipath_l3_keys
  2023-11-19 14:39   ` [PATCH v2] " Kunwu Chan
@ 2023-11-21 12:11     ` Paolo Abeni
  2023-11-22  7:05       ` Kunwu Chan
  0 siblings, 1 reply; 6+ messages in thread
From: Paolo Abeni @ 2023-11-21 12:11 UTC (permalink / raw)
  To: Kunwu Chan, edumazet
  Cc: davem, dsahern, kuba, kunwu.chan, linux-kernel, netdev

On Sun, 2023-11-19 at 22:39 +0800, Kunwu Chan wrote:
> net/ipv6/route.c:2332:39: warning: incorrect type in assignment (different base types)
> net/ipv6/route.c:2332:39:    expected unsigned int [usertype] flow_label
> net/ipv6/route.c:2332:39:    got restricted __be32
> 
> Fixes: fa1be7e01ea8 ("ipv6: omit traffic class when calculating flow hash")

This does not look like the correct fixes tag, sparse warning is
preexistent. Likely 23aebdacb05dab9efdf22b9e0413491cbd5f128f

Please sent a new revision with the correct tag, thanks

Paolo


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v2] ipv6: Correct/silence an endian warning in ip6_multipath_l3_keys
  2023-11-21 12:11     ` Paolo Abeni
@ 2023-11-22  7:05       ` Kunwu Chan
  0 siblings, 0 replies; 6+ messages in thread
From: Kunwu Chan @ 2023-11-22  7:05 UTC (permalink / raw)
  To: Paolo Abeni, edumazet
  Cc: davem, dsahern, kuba, kunwu.chan, linux-kernel, netdev

Thanks for your reply.

I'll update it in v3,and add send it in a new thread.


Thanks,
Kunwu

On 2023/11/21 20:11, Paolo Abeni wrote:
> This does not look like the correct fixes tag, sparse warning is
> preexistent. Likely 23aebdacb05dab9efdf22b9e0413491cbd5f128f
> 
> Please sent a new revision with the correct tag, thanks

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2023-11-22  7:05 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-17 15:48 [PATCH] ipv6: Correct/silence an endian warning in ip6_multipath_l3_keys Kunwu Chan
2023-11-17 17:29 ` Eric Dumazet
2023-11-19 14:35   ` Kunwu Chan
2023-11-19 14:39   ` [PATCH v2] " Kunwu Chan
2023-11-21 12:11     ` Paolo Abeni
2023-11-22  7:05       ` Kunwu Chan

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.