[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <04de48d4-12dc-4dd9-a234-afd26be02561@omp.ru>
Date: Wed, 2 Oct 2024 18:27:58 +0300
From: Sergey Shtylyov <s.shtylyov@....ru>
To: Simon Horman <horms@...nel.org>
CC: Paul Barker <paul@...rker.dev>, "David S . Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>, Jakub Kicinski <kuba@...nel.org>, Paolo
Abeni <pabeni@...hat.com>, Paul Barker <paul.barker.ct@...renesas.com>, Geert
Uytterhoeven <geert+renesas@...der.be>, Niklas Söderlund
<niklas.soderlund+renesas@...natech.se>, Biju Das
<biju.das.jz@...renesas.com>, Claudiu Beznea
<claudiu.beznea.uj@...renesas.com>, <netdev@...r.kernel.org>,
<linux-renesas-soc@...r.kernel.org>, <linux-kernel@...r.kernel.org>
Subject: Re: [net-next PATCH 11/11] net: ravb: Add VLAN checksum support
On 10/1/24 13:44, Simon Horman wrote:
[...]
>>> From: Paul Barker <paul.barker.ct@...renesas.com>
>>>
>>> The GbEth IP supports offloading checksum calculation for VLAN-tagged
>>> packets, provided that the EtherType is 0x8100 and only one VLAN tag is
>>> present.
>>>
>>> Signed-off-by: Paul Barker <paul.barker.ct@...renesas.com>
>> [...]
>>
>>> diff --git a/drivers/net/ethernet/renesas/ravb_main.c b/drivers/net/ethernet/renesas/ravb_main.c
>>> index 832132d44fb4..eb7499d42a9b 100644
>>> --- a/drivers/net/ethernet/renesas/ravb_main.c
>>> +++ b/drivers/net/ethernet/renesas/ravb_main.c
>>> @@ -2063,11 +2063,30 @@ static void ravb_tx_timeout_work(struct work_struct *work)
>>>
>>> static bool ravb_can_tx_csum_gbeth(struct sk_buff *skb)
>>> {
>>> - /* TODO: Need to add support for VLAN tag 802.1Q */
>>> - if (skb_vlan_tag_present(skb))
>>> + u16 net_protocol = ntohs(skb->protocol);
>>> +
>>> + /* GbEth IP can calculate the checksum if:
>>> + * - there are zero or one VLAN headers with TPID=0x8100
>>> + * - the network protocol is IPv4 or IPv6
>>> + * - the transport protocol is TCP, UDP or ICMP
>>> + * - the packet is not fragmented
>>> + */
>>> +
>>> + if (skb_vlan_tag_present(skb) &&
>>> + (skb->vlan_proto != ETH_P_8021Q || net_protocol == ETH_P_8021Q))
>>
>> Not sure I understand this check... Maybe s/==/!=/?
>
> A minor nit if the check stays in some form:
> vlan_proto is big endian, while ETH_P_8021Q is host byte order.
Not minor at all, thanks for spotting!
Luckily, we also have a kernel test robot which runs sparse. :-)
[...]
MBR, Sergey
Powered by blists - more mailing lists