From: Biju Das <biju.das.jz@bp.renesas.com> Date: 2021-11-23 13:32:05
TOE has hw support for calculating IP header checkum for IPV4 and
TCP/UDP/ICMP checksum for both IPV4 and IPV6.
This patch series aims to adds Rx checksum offload supported by TOE.
For RX, The result of checksum calculation is attached to last 4byte
of ethernet frames. First 2bytes is result of IPV4 header checksum
and next 2 bytes is TCP/UDP/ICMP.
if frame does not have error "0000" attached to checksum calculation
result. For unsupported frames "ffff" is attached to checksum calculation
result. Cases like IPV6, IPV4 header is always set to "FFFF".
we can test this functionality by the below commands
ethtool -K eth0 rx on --> to turn on Rx checksum offload
ethtool -K eth0 rx off --> to turn off Rx checksum offload
Biju Das (2):
ravb: Fillup ravb_set_features_gbeth() stub
ravb: Add Rx checksum offload support
drivers/net/ethernet/renesas/ravb.h | 20 +++++++++
drivers/net/ethernet/renesas/ravb_main.c | 55 +++++++++++++++++++++++-
2 files changed, 74 insertions(+), 1 deletion(-)
--
2.17.1
From: Biju Das <biju.das.jz@bp.renesas.com> Date: 2021-11-23 13:32:08
Fillup ravb_set_features_gbeth() function to support RZ/G2L.
Also set the net_hw_features bits with rx checksum offload
supported by TOE.
Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
---
drivers/net/ethernet/renesas/ravb.h | 16 ++++++++++++++++
drivers/net/ethernet/renesas/ravb_main.c | 24 +++++++++++++++++++++++-
2 files changed, 39 insertions(+), 1 deletion(-)
From: Biju Das <biju.das.jz@bp.renesas.com> Date: 2021-11-23 13:32:10
TOE has hw support for calculating IP header checkum for IPV4 and
TCP/UDP/ICMP checksum for both IPV4 and IPV6.
This patch adds Rx checksum offload supported by TOE.
Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
---
drivers/net/ethernet/renesas/ravb.h | 4 +++
drivers/net/ethernet/renesas/ravb_main.c | 31 ++++++++++++++++++++++++
2 files changed, 35 insertions(+)
TOE has hw support for calculating IP header checkum for IPV4 and
hw == hardware? And checksum. :-)
TCP/UDP/ICMP checksum for both IPV4 and IPV6.
This patch series aims to adds Rx checksum offload supported by TOE.
For RX, The result of checksum calculation is attached to last 4byte
of ethernet frames. First 2bytes is result of IPV4 header checksum
and next 2 bytes is TCP/UDP/ICMP.
if frame does not have error "0000" attached to checksum calculation
result. For unsupported frames "ffff" is attached to checksum calculation
result. Cases like IPV6, IPV4 header is always set to "FFFF".
You just said IPv4 header checksum is supported?
we can test this functionality by the below commands
ethtool -K eth0 rx on --> to turn on Rx checksum offload
ethtool -K eth0 rx off --> to turn off Rx checksum offload
Biju Das (2):
ravb: Fillup ravb_set_features_gbeth() stub
ravb: Add Rx checksum offload support
drivers/net/ethernet/renesas/ravb.h | 20 +++++++++
drivers/net/ethernet/renesas/ravb_main.c | 55 +++++++++++++++++++++++-
2 files changed, 74 insertions(+), 1 deletion(-)
Dave, Jakub, I'll try reviewing these later today.
MBR, Sergey
From: Biju Das <biju.das.jz@bp.renesas.com> Date: 2021-11-23 15:40:11
Hi Sergey Shtylyov,
Subject: Re: [RFC 0/2] Add Rx checksum offload support
Hello!
On 23.11.2021 16:31, Biju Das wrote:
quoted
TOE has hw support for calculating IP header checkum for IPV4 and
hw == hardware? And checksum. :-)
Oops typo. My mistake.
quoted
TCP/UDP/ICMP checksum for both IPV4 and IPV6.
This patch series aims to adds Rx checksum offload supported by TOE.
For RX, The result of checksum calculation is attached to last 4byte
of ethernet frames. First 2bytes is result of IPV4 header checksum and
next 2 bytes is TCP/UDP/ICMP.
if frame does not have error "0000" attached to checksum calculation
result. For unsupported frames "ffff" is attached to checksum
calculation result. Cases like IPV6, IPV4 header is always set to
"FFFF".
You just said IPv4 header checksum is supported?
Yes you are correct.
for IPV4, IPv4 header checksum is supported. If it is supported case and no error
the result is set to "0000" by the hardware.
Where as for IPv6, IPV4 header is unsupported case,
so the result is always set to "ffff" by the hardware
Cheers,
Biju
quoted
we can test this functionality by the below commands
ethtool -K eth0 rx on --> to turn on Rx checksum offload ethtool -K
eth0 rx off --> to turn off Rx checksum offload
Biju Das (2):
ravb: Fillup ravb_set_features_gbeth() stub
ravb: Add Rx checksum offload support
drivers/net/ethernet/renesas/ravb.h | 20 +++++++++
drivers/net/ethernet/renesas/ravb_main.c | 55 +++++++++++++++++++++++-
2 files changed, 74 insertions(+), 1 deletion(-)
Dave, Jakub, I'll try reviewing these later today.
MBR, Sergey
TOE has hw support for calculating IP header checkum for IPV4 and
TCP/UDP/ICMP checksum for both IPV4 and IPV6.
This patch adds Rx checksum offload supported by TOE.
Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
---
drivers/net/ethernet/renesas/ravb.h | 4 +++
drivers/net/ethernet/renesas/ravb_main.c | 31 ++++++++++++++++++++++++
2 files changed, 35 insertions(+)
TOE has hw support for calculating IP header checkum for IPV4 and
TCP/UDP/ICMP checksum for both IPV4 and IPV6.
This patch series aims to adds Rx checksum offload supported by TOE.
For RX, The result of checksum calculation is attached to last 4byte
of ethernet frames. First 2bytes is result of IPV4 header checksum
and next 2 bytes is TCP/UDP/ICMP.
if frame does not have error "0000" attached to checksum calculation
result. For unsupported frames "ffff" is attached to checksum calculation
result. Cases like IPV6, IPV4 header is always set to "FFFF".
we can test this functionality by the below commands
ethtool -K eth0 rx on --> to turn on Rx checksum offload
ethtool -K eth0 rx off --> to turn off Rx checksum offload
Biju Das (2):
ravb: Fillup ravb_set_features_gbeth() stub
ravb: Add Rx checksum offload support
That's all fine but why in the world did you separate these patches?
MBR, Sergey
From: Biju Das <biju.das.jz@bp.renesas.com> Date: 2021-11-25 10:17:10
Hi Sergey Shtylyov,
Subject: Re: [RFC 2/2] ravb: Add Rx checksum offload support
Hello!
On 11/23/21 4:31 PM, Biju Das wrote:
quoted
TOE has hw support for calculating IP header checkum for IPV4 and
TCP/UDP/ICMP checksum for both IPV4 and IPV6.
This patch adds Rx checksum offload supported by TOE.
Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
---
drivers/net/ethernet/renesas/ravb.h | 4 +++
drivers/net/ethernet/renesas/ravb_main.c | 31
++++++++++++++++++++++++
2 files changed, 35 insertions(+)
diff --git a/drivers/net/ethernet/renesas/ravb.h
b/drivers/net/ethernet/renesas/ravb.h
index a96552348e2d..d0e5eec0636e 100644
Checksum is unsupported and you declare it unnecessary?
Do you mean takeout the check for unsupported headercsum for IPV6 and the code like one below?
If(!csum_proto) {
if ((skb->protocol == htons(ETH_P_IP) && !csum_ip_hdr) || skb->protocol == htons(ETH_P_IPV6))
skb->ip_summed = CHECKSUM_UNNECESSARY;
}
Snippet from H/W manual for reception handling
(1) Reception Handling
The result of Checksum Calculation is attached to last 4 byte of Ethernet Frames like Figure 30.25. And then the
handled frames are transferred to memory by DMAC. If the frame does not have checksum error at the part of IPv4
Header or TCP/UDP/ICMP, the value of “0000h” is attached to each part as the result of Checksum Calculation. The
case of Unsupported Frame, the value of “FFFFh” is attached. For example, if the part of IP Header is unsupported,
“FFFFh” is set to both field of IPv4 Header and TCP/UDP/ICMP. The case of IPv6, IPv4 Header field is always set to
“FFFFh”.
quoted
+ }
Now where's a call to skb_trim()?
Currently I haven't seen any issue without using skb_trim.
OK, as you suggested, will check and add skb_trim to takeout the last 4bytes.
Regards,
Biju
From: Biju Das <biju.das.jz@bp.renesas.com> Date: 2021-11-25 10:19:12
Hi Sergey Shtylyov,
Subject: Re: [RFC 0/2] Add Rx checksum offload support
On 11/23/21 4:31 PM, Biju Das wrote:
quoted
TOE has hw support for calculating IP header checkum for IPV4 and
TCP/UDP/ICMP checksum for both IPV4 and IPV6.
This patch series aims to adds Rx checksum offload supported by TOE.
For RX, The result of checksum calculation is attached to last 4byte
of ethernet frames. First 2bytes is result of IPV4 header checksum and
next 2 bytes is TCP/UDP/ICMP.
if frame does not have error "0000" attached to checksum calculation
result. For unsupported frames "ffff" is attached to checksum
calculation result. Cases like IPV6, IPV4 header is always set to
"FFFF".
quoted
we can test this functionality by the below commands
ethtool -K eth0 rx on --> to turn on Rx checksum offload ethtool -K
eth0 rx off --> to turn off Rx checksum offload
Biju Das (2):
ravb: Fillup ravb_set_features_gbeth() stub
ravb: Add Rx checksum offload support
That's all fine but why in the world did you separate these patches?
OK, as you suggested will merge this patches and send an RFC for further feedback.
Regards,
Biju
TOE has hw support for calculating IP header checkum for IPV4 and
TCP/UDP/ICMP checksum for both IPV4 and IPV6.
This patch adds Rx checksum offload supported by TOE.
Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
---
drivers/net/ethernet/renesas/ravb.h | 4 +++
drivers/net/ethernet/renesas/ravb_main.c | 31
++++++++++++++++++++++++
2 files changed, 35 insertions(+)
diff --git a/drivers/net/ethernet/renesas/ravb.h
b/drivers/net/ethernet/renesas/ravb.h
index a96552348e2d..d0e5eec0636e 100644
I think this statement doesn't make sense, unless the TOE itself doesn't check the protocol ID in
the Ethernet frame (which it should). It also seems (after reading <linux/skbuff.h>) that enabling
IPv4 header checksum calculation is pointless -- you don't have the means to report it anyway...
You may want to set skb-csum_level though (not sure if that's not already 0).
skb->ip_summed = CHECKSUM_UNNECESSARY;
}
Snippet from H/W manual for reception handling
(1) Reception Handling
The result of Checksum Calculation is attached to last 4 byte of Ethernet Frames like Figure 30.25. And then the
handled frames are transferred to memory by DMAC. If the frame does not have checksum error at the part of IPv4
Header or TCP/UDP/ICMP, the value of “0000h” is attached to each part as the result of Checksum Calculation. The
case of Unsupported Frame, the value of “FFFFh” is attached. For example, if the part of IP Header is unsupported,
“FFFFh” is set to both field of IPv4 Header and TCP/UDP/ICMP. The case of IPv6, IPv4 Header field is always set to
“FFFFh”.
quoted
quoted
+ }
Now where's a call to skb_trim()?
Currently I haven't seen any issue without using skb_trim.
OK, as you suggested, will check and add skb_trim to takeout the last 4bytes.