From: Tom Herbert <tom@herbertland.com>
To: Eric Dumazet <eric.dumazet@gmail.com>
Cc: "David S. Miller" <davem@davemloft.net>,
Linux Kernel Network Developers <netdev@vger.kernel.org>
Subject: Re: [PATCH net-next] net: fix two sparse errors
Date: Fri, 15 May 2015 11:11:58 -0400 [thread overview]
Message-ID: <CALx6S34ETTapmY7nBTohfs0Cu03PQuBteLXPVC7sSrvSJ5CdLQ@mail.gmail.com> (raw)
In-Reply-To: <1431694087.27831.99.camel@edumazet-glaptop2.roam.corp.google.com>
On Fri, May 15, 2015 at 8:48 AM, Eric Dumazet <eric.dumazet@gmail.com> wrote:
> From: Eric Dumazet <edumazet@google.com>
>
> First one in __skb_checksum_validate_complete() fixes the following
> (and other callers)
>
> make C=2 CF=-D__CHECK_ENDIAN__ net/ipv4/tcp_ipv4.o
> CHECK net/ipv4/tcp_ipv4.c
> include/linux/skbuff.h:3052:24: warning: incorrect type in return expression (different base types)
> include/linux/skbuff.h:3052:24: expected restricted __sum16
> include/linux/skbuff.h:3052:24: got int
>
> Second is fixing gso_make_checksum() :
>
> CHECK net/ipv4/gre_offload.c
> include/linux/skbuff.h:3360:14: warning: incorrect type in assignment (different base types)
> include/linux/skbuff.h:3360:14: expected unsigned short [unsigned] [usertype] csum
> include/linux/skbuff.h:3360:14: got restricted __sum16
> include/linux/skbuff.h:3365:16: warning: incorrect type in return expression (different base types)
> include/linux/skbuff.h:3365:16: expected restricted __sum16
> include/linux/skbuff.h:3365:16: got unsigned short [unsigned] [usertype] csum
>
>
> Fixes: 5a21232983aa7 ("net: Support for csum_bad in skbuff")
> Fixes: 7e2b10c1e52ca ("net: Support for multiple checksums with gso")
> Signed-off-by: Eric Dumazet <edumazet@google.com>
> CC: Tom Herbert <tom@herbertland.com>
Acked-by: Tom Herbert <tom@herbertland.com>
> ---
> include/linux/skbuff.h | 11 +++++------
> 1 file changed, 5 insertions(+), 6 deletions(-)
>
> diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
> index f83aa6568cbf5e1794fdb1a8da28642ea417cc76..b57eebfb67e06dc90addfe5f2fea9d913b2121cc 100644
> --- a/include/linux/skbuff.h
> +++ b/include/linux/skbuff.h
> @@ -3051,7 +3051,7 @@ static inline __sum16 __skb_checksum_validate_complete(struct sk_buff *skb,
> }
> } else if (skb->csum_bad) {
> /* ip_summed == CHECKSUM_NONE in this case */
> - return 1;
> + return (__force __sum16)1;
> }
>
> skb->csum = psum;
> @@ -3353,15 +3353,14 @@ static inline int gso_pskb_expand_head(struct sk_buff *skb, int extra)
> static inline __sum16 gso_make_checksum(struct sk_buff *skb, __wsum res)
> {
> int plen = SKB_GSO_CB(skb)->csum_start - skb_headroom(skb) -
> - skb_transport_offset(skb);
> - __u16 csum;
> + skb_transport_offset(skb);
> + __wsum partial;
>
> - csum = csum_fold(csum_partial(skb_transport_header(skb),
> - plen, skb->csum));
> + partial = csum_partial(skb_transport_header(skb), plen, skb->csum);
> skb->csum = res;
> SKB_GSO_CB(skb)->csum_start -= plen;
>
> - return csum;
> + return csum_fold(partial);
> }
>
> static inline bool skb_is_gso(const struct sk_buff *skb)
>
>
next prev parent reply other threads:[~2015-05-15 15:11 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-12 3:26 [PATCH v2 net-next 0/5] net: Increase inputs to flow_keys hashing Tom Herbert
2015-05-12 3:26 ` [PATCH v2 net-next 1/5] net: Get skb hash over flow_keys structure Tom Herbert
2015-05-12 4:56 ` Eric Dumazet
2015-05-12 14:30 ` David Miller
2015-05-12 3:26 ` [PATCH v2 net-next 2/5] net: Add full IPv6 addresses to flow_keys Tom Herbert
2015-05-12 3:26 ` [PATCH v2 net-next 3/5] net: Add VLAN ID " Tom Herbert
2015-05-12 3:26 ` [PATCH v2 net-next 4/5] net: Add IPv6 flow label " Tom Herbert
2015-05-12 3:26 ` [PATCH v2 net-next 5/5] net: Add GRE keyid in flow_keys Tom Herbert
2015-05-12 4:33 ` Eric Dumazet
2015-05-12 4:50 ` Eric Dumazet
2015-05-12 14:51 ` Tom Herbert
2015-05-12 16:06 ` Eric Dumazet
2015-05-15 12:48 ` [PATCH net-next] net: fix two sparse errors Eric Dumazet
2015-05-15 14:35 ` Sabrina Dubroca
2015-05-15 14:52 ` Eric Dumazet
2015-05-15 15:23 ` Sabrina Dubroca
2015-05-15 16:14 ` Eric Dumazet
2015-05-15 15:27 ` Tom Herbert
2015-05-15 15:54 ` Sabrina Dubroca
2015-05-15 16:19 ` David Miller
2015-05-15 16:26 ` Sabrina Dubroca
2015-05-15 15:11 ` Tom Herbert [this message]
2015-05-17 18:11 ` David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CALx6S34ETTapmY7nBTohfs0Cu03PQuBteLXPVC7sSrvSJ5CdLQ@mail.gmail.com \
--to=tom@herbertland.com \
--cc=davem@davemloft.net \
--cc=eric.dumazet@gmail.com \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).