[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID:
<TYCPR01MB11269BEF48F2C2C111C91858A867B2@TYCPR01MB11269.jpnprd01.prod.outlook.com>
Date: Wed, 24 Jan 2024 08:31:06 +0000
From: Biju Das <biju.das.jz@...renesas.com>
To: Jakub Kicinski <kuba@...nel.org>
CC: "David S. Miller" <davem@...emloft.net>, Eric Dumazet
<edumazet@...gle.com>, Paolo Abeni <pabeni@...hat.com>, Sergey Shtylyov
<s.shtylyov@....ru>, Claudiu Beznea <claudiu.beznea.uj@...renesas.com>,
Yoshihiro Shimoda <yoshihiro.shimoda.uh@...esas.com>, Wolfram Sang
<wsa+renesas@...g-engineering.com>, nikita.yoush
<nikita.yoush@...entembedded.com>, "netdev@...r.kernel.org"
<netdev@...r.kernel.org>, "linux-renesas-soc@...r.kernel.org"
<linux-renesas-soc@...r.kernel.org>, Geert Uytterhoeven
<geert+renesas@...der.be>, Prabhakar Mahadev Lad
<prabhakar.mahadev-lad.rj@...renesas.com>, biju.das.au
<biju.das.au@...il.com>
Subject: RE: [PATCH net-next 1/2] ravb: Add Rx checksum offload support
Hi Jakub Kicinski,
Thanks for the feedback.
> -----Original Message-----
> From: Jakub Kicinski <kuba@...nel.org>
> Sent: Wednesday, January 24, 2024 1:09 AM
> Subject: Re: [PATCH net-next 1/2] ravb: Add Rx checksum offload support
>
> On Tue, 23 Jan 2024 15:19:23 +0000 Biju Das wrote:
> > +static void ravb_rx_csum_gbeth(struct sk_buff *skb) {
> > + __sum16 csum_ip_hdr, csum_proto;
> > + u8 *hw_csum;
> > +
> > + /* The hardware checksum status is contained in sizeof(__sum16) * 2
> = 4
> > + * bytes appended to packet data. First 2 bytes is ip header csum
> and
> > + * last 2 bytes is protocol csum.
> > + */
> > + if (unlikely(skb->len < sizeof(__sum16) * 2))
> > + return;
> > +
> > + hw_csum = skb_tail_pointer(skb) - sizeof(__sum16);
> > + csum_proto = csum_unfold((__force
> > +__sum16)get_unaligned_le16(hw_csum));
> > +
> > + hw_csum -= sizeof(__sum16);
> > + csum_ip_hdr = csum_unfold((__force
> __sum16)get_unaligned_le16(hw_csum));
> > + skb_trim(skb, skb->len - 2 * sizeof(__sum16));
> > +
> > + /* TODO: IPV6 Rx csum */
> > + if (skb->protocol == htons(ETH_P_IP) && csum_ip_hdr ==
> TOE_RX_CSUM_OK &&
> > + csum_proto == TOE_RX_CSUM_OK)
> > + /* Hardware validated our checksum */
> > + skb->ip_summed = CHECKSUM_UNNECESSARY; }
>
> sparse does not seem to be onboard:
>
> drivers/net/ethernet/renesas/ravb_main.c:771:20: warning: incorrect type
> in assignment (different base types)
> drivers/net/ethernet/renesas/ravb_main.c:771:20: expected restricted
> __sum16 [usertype] csum_proto
> drivers/net/ethernet/renesas/ravb_main.c:771:20: got restricted __wsum
> drivers/net/ethernet/renesas/ravb_main.c:774:21: warning: incorrect type
> in assignment (different base types)
> drivers/net/ethernet/renesas/ravb_main.c:774:21: expected restricted
> __sum16 [usertype] csum_ip_hdr
> drivers/net/ethernet/renesas/ravb_main.c:774:21: got restricted __wsum
I have reproduced this issue and the warning is fixed by replacing
__sum16->__wsum.
I will send v2 with this fix.
Cheers,
Biju
Powered by blists - more mailing lists