[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <e71607dc-d51f-d5b9-e95a-c11b149083cb@omp.ru>
Date: Wed, 24 Jan 2024 23:50:42 +0300
From: Sergey Shtylyov <s.shtylyov@....ru>
To: Biju Das <biju.das.jz@...renesas.com>, Jakub Kicinski <kuba@...nel.org>
CC: "David S. Miller" <davem@...emloft.net>, Eric Dumazet
<edumazet@...gle.com>, Paolo Abeni <pabeni@...hat.com>, 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
On 1/24/24 11:31 AM, Biju Das wrote:
[...]
>> -----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.
You could have waited for my review...
Dave, Jakub, please don't merge these patches before I have a chance
to review them. I'm overwhelmed by reviews (both internal and public)
ATM... :-/
> Cheers,
> Biju
MBR, Sergey
Powered by blists - more mailing lists