Hi Sergey, > Subject: Re: [RFC 07/12] ravb: Fillup ravb_rx_gbeth() stub > > On 10/6/21 11:22 PM, Biju Das wrote: > > [...] > >>> Fillup ravb_rx_gbeth() function to support RZ/G2L. > >>> > >>> This patch also renames ravb_rcar_rx to ravb_rx_rcar to be > >>> consistent with the naming convention used in sh_eth driver. > >>> > >>> Signed-off-by: Biju Das <biju.das.jz@xxxxxxxxxxxxxx> > >>> Reviewed-by: Lad Prabhakar > >>> <prabhakar.mahadev-lad.rj@xxxxxxxxxxxxxx>[...] > >>> diff --git a/drivers/net/ethernet/renesas/ravb_main.c > >>> b/drivers/net/ethernet/renesas/ravb_main.c > >>> index 37164a983156..42573eac82b9 100644 > >>> --- a/drivers/net/ethernet/renesas/ravb_main.c > >>> +++ b/drivers/net/ethernet/renesas/ravb_main.c > >>> @@ -720,6 +720,23 @@ static void ravb_get_tx_tstamp(struct > >>> net_device > >> *ndev) > >>> } > >>> } > >>> > >>> +static void ravb_rx_csum_gbeth(struct sk_buff *skb) { > >>> + u8 *hw_csum; > >>> + > >>> + /* The hardware checksum is contained in sizeof(__sum16) (2) bytes > >>> + * appended to packet data > >>> + */ > >>> + if (unlikely(skb->len < sizeof(__sum16))) > >>> + return; > >>> + hw_csum = skb_tail_pointer(skb) - sizeof(__sum16); > >> > >> Not 32-bit? The manual says the IP checksum is stored in the first > >> 2 bytes. > > > > It is 16 bit. It is on last 2 bytes. > > So you're saying the manual is wrong? I am not sure which manual you are referring here. I am referring to Rev.1.00 Sep, 2021 of RZ/G2L hardware manual and I have shared the link[1] for you to download. Hope you are referring same manual [1] https://www.renesas.com/document/mah/rzg2l-group-rzg2lc-group-users-manual-hardware-0?language=en&r=1467981 Please check the section 30.5.6.1 checksum calculation handling And figure 30.25 the field of checksum attaching field Also see Table 30.17 for checksum values for non-error conditions. TCP/UDP/ICPM checksum is at last 2bytes. > > >> > >>> + > >>> + if (*hw_csum == 0) > >> > >> You only check the 1st byte, not the full checksum! > > > > As I said earlier, "0" value on last 16 bit, means no checksum error. > > How's that? 'hw_csum' is declared as 'u8 *'! It is my mistake, which will be taken care in the next patch by using u16 *. > > >>> + skb->ip_summed = CHECKSUM_UNNECESSARY; > >>> + else > >>> + skb->ip_summed = CHECKSUM_NONE; > >> > >> So the TCP/UDP/ICMP checksums are not dealt with? Why enable them > then? > > > > If last 2bytes is zero, means there is no checksum error w.r.to > TCP/UDP/ICMP checksums. > > Why checksum them independently then? It is a hardware feature. Regards, Biju > > > RZ/G2L checksum part is different from R-Car Gen3. There is no TOE block > at all for R-Car Gen3. > > > > Regards, > > Biju > > [...] > > MBR, Sergey