netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net] ipv6: fix checksum annotation in udp6_csum_init
@ 2016-06-11 18:56 Hannes Frederic Sowa
  2016-06-11 19:10 ` Hannes Frederic Sowa
  2016-06-11 19:15 ` [PATCH net v2] " Hannes Frederic Sowa
  0 siblings, 2 replies; 5+ messages in thread
From: Hannes Frederic Sowa @ 2016-06-11 18:56 UTC (permalink / raw)
  To: netdev; +Cc: Tom Herbert

Cc: Tom Herbert <tom@herbertland.com>
Fixes: 4068579e1e098fa ("net: Implmement RFC 6936 (zero RX csums for UDP/IPv6")
Signed-off-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
---
 include/net/ip6_checksum.h | 2 +-
 net/ipv6/ip6_checksum.c    | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/net/ip6_checksum.h b/include/net/ip6_checksum.h
index cca840584c8885..8ee93d1fc56a5b 100644
--- a/include/net/ip6_checksum.h
+++ b/include/net/ip6_checksum.h
@@ -101,5 +101,5 @@ void udp6_set_csum(bool nocheck, struct sk_buff *skb,
 		   const struct in6_addr *saddr,
 		   const struct in6_addr *daddr, int len);
 
-int udp6_csum_init(struct sk_buff *skb, struct udphdr *uh, int proto);
+__sum16 udp6_csum_init(struct sk_buff *skb, struct udphdr *uh, int proto);
 #endif
diff --git a/net/ipv6/ip6_checksum.c b/net/ipv6/ip6_checksum.c
index b2025bf3da4af2..9282326e4a0a56 100644
--- a/net/ipv6/ip6_checksum.c
+++ b/net/ipv6/ip6_checksum.c
@@ -61,7 +61,7 @@ __sum16 csum_ipv6_magic(const struct in6_addr *saddr,
 EXPORT_SYMBOL(csum_ipv6_magic);
 #endif
 
-int udp6_csum_init(struct sk_buff *skb, struct udphdr *uh, int proto)
+__sum16 udp6_csum_init(struct sk_buff *skb, struct udphdr *uh, int proto)
 {
 	int err;
 
-- 
2.5.5

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

* Re: [PATCH net] ipv6: fix checksum annotation in udp6_csum_init
  2016-06-11 18:56 [PATCH net] ipv6: fix checksum annotation in udp6_csum_init Hannes Frederic Sowa
@ 2016-06-11 19:10 ` Hannes Frederic Sowa
  2016-06-11 19:15 ` [PATCH net v2] " Hannes Frederic Sowa
  1 sibling, 0 replies; 5+ messages in thread
From: Hannes Frederic Sowa @ 2016-06-11 19:10 UTC (permalink / raw)
  To: Hannes Frederic Sowa, netdev; +Cc: Tom Herbert

On Sat, Jun 11, 2016, at 20:56, Hannes Frederic Sowa wrote:
> Cc: Tom Herbert <tom@herbertland.com>
> Fixes: 4068579e1e098fa ("net: Implmement RFC 6936 (zero RX csums for
> UDP/IPv6")
> Signed-off-by: Hannes Frederic Sowa <hannes@stressinduktion.org>

Sorry for the noise, I will send a better patch in a minute.

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

* [PATCH net v2] ipv6: fix checksum annotation in udp6_csum_init
  2016-06-11 18:56 [PATCH net] ipv6: fix checksum annotation in udp6_csum_init Hannes Frederic Sowa
  2016-06-11 19:10 ` Hannes Frederic Sowa
@ 2016-06-11 19:15 ` Hannes Frederic Sowa
  2016-06-12  1:07   ` Cong Wang
  2016-06-14 19:28   ` David Miller
  1 sibling, 2 replies; 5+ messages in thread
From: Hannes Frederic Sowa @ 2016-06-11 19:15 UTC (permalink / raw)
  To: netdev; +Cc: Tom Herbert

Cc: Tom Herbert <tom@herbertland.com>
Fixes: 4068579e1e098fa ("net: Implmement RFC 6936 (zero RX csums for UDP/IPv6")
Signed-off-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
---
 net/ipv6/ip6_checksum.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/net/ipv6/ip6_checksum.c b/net/ipv6/ip6_checksum.c
index b2025bf3da4af2..c0cbcb259f5a9a 100644
--- a/net/ipv6/ip6_checksum.c
+++ b/net/ipv6/ip6_checksum.c
@@ -78,9 +78,12 @@ int udp6_csum_init(struct sk_buff *skb, struct udphdr *uh, int proto)
 	 * we accept a checksum of zero here. When we find the socket
 	 * for the UDP packet we'll check if that socket allows zero checksum
 	 * for IPv6 (set by socket option).
+	 *
+	 * Note, we are only interested in != 0 or == 0, thus the
+	 * force to int.
 	 */
-	return skb_checksum_init_zero_check(skb, proto, uh->check,
-					   ip6_compute_pseudo);
+	return (__force int)skb_checksum_init_zero_check(skb, proto, uh->check,
+							 ip6_compute_pseudo);
 }
 EXPORT_SYMBOL(udp6_csum_init);
 
-- 
2.5.5

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

* Re: [PATCH net v2] ipv6: fix checksum annotation in udp6_csum_init
  2016-06-11 19:15 ` [PATCH net v2] " Hannes Frederic Sowa
@ 2016-06-12  1:07   ` Cong Wang
  2016-06-14 19:28   ` David Miller
  1 sibling, 0 replies; 5+ messages in thread
From: Cong Wang @ 2016-06-12  1:07 UTC (permalink / raw)
  To: Hannes Frederic Sowa; +Cc: Linux Kernel Network Developers, Tom Herbert

On Sat, Jun 11, 2016 at 12:15 PM, Hannes Frederic Sowa
<hannes@stressinduktion.org> wrote:
> Cc: Tom Herbert <tom@herbertland.com>
> Fixes: 4068579e1e098fa ("net: Implmement RFC 6936 (zero RX csums for UDP/IPv6")
> Signed-off-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
> ---
>  net/ipv6/ip6_checksum.c | 7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/net/ipv6/ip6_checksum.c b/net/ipv6/ip6_checksum.c
> index b2025bf3da4af2..c0cbcb259f5a9a 100644
> --- a/net/ipv6/ip6_checksum.c
> +++ b/net/ipv6/ip6_checksum.c
> @@ -78,9 +78,12 @@ int udp6_csum_init(struct sk_buff *skb, struct udphdr *uh, int proto)
>          * we accept a checksum of zero here. When we find the socket
>          * for the UDP packet we'll check if that socket allows zero checksum
>          * for IPv6 (set by socket option).
> +        *
> +        * Note, we are only interested in != 0 or == 0, thus the
> +        * force to int.
>          */
> -       return skb_checksum_init_zero_check(skb, proto, uh->check,
> -                                          ip6_compute_pseudo);
> +       return (__force int)skb_checksum_init_zero_check(skb, proto, uh->check,
> +                                                        ip6_compute_pseudo);

Same for udp4_csum_init() ?

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

* Re: [PATCH net v2] ipv6: fix checksum annotation in udp6_csum_init
  2016-06-11 19:15 ` [PATCH net v2] " Hannes Frederic Sowa
  2016-06-12  1:07   ` Cong Wang
@ 2016-06-14 19:28   ` David Miller
  1 sibling, 0 replies; 5+ messages in thread
From: David Miller @ 2016-06-14 19:28 UTC (permalink / raw)
  To: hannes; +Cc: netdev, tom

From: Hannes Frederic Sowa <hannes@stressinduktion.org>
Date: Sat, 11 Jun 2016 21:15:37 +0200

> Cc: Tom Herbert <tom@herbertland.com>
> Fixes: 4068579e1e098fa ("net: Implmement RFC 6936 (zero RX csums for UDP/IPv6")
> Signed-off-by: Hannes Frederic Sowa <hannes@stressinduktion.org>

Applied.

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

end of thread, other threads:[~2016-06-14 19:28 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-06-11 18:56 [PATCH net] ipv6: fix checksum annotation in udp6_csum_init Hannes Frederic Sowa
2016-06-11 19:10 ` Hannes Frederic Sowa
2016-06-11 19:15 ` [PATCH net v2] " Hannes Frederic Sowa
2016-06-12  1:07   ` Cong Wang
2016-06-14 19:28   ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).