Re: [PATCH net-next 1/2] net: enetc: declare NETIF_F_IP_CSUM and do it in software
From: Ioana Ciornei <ioana.ciornei@nxp.com>
Date: 2021-10-07 12:12:51
On Thu, Oct 07, 2021 at 09:47:20AM +0300, Ioana Ciornei wrote:
On Wed, Oct 06, 2021 at 05:24:18PM -0700, Jakub Kicinski wrote:quoted
On Wed, 6 Oct 2021 23:13:07 +0300 Ioana Ciornei wrote:quoted
This is just a preparation patch for software TSO in the enetc driver. Unfortunately, ENETC does not support Tx checksum offload which would normally render TSO, even software, impossible. Declare NETIF_F_IP_CSUM as part of the feature set and do it at driver level using skb_csum_hwoffload_help() so that we can move forward and also add support for TSO in the next patch. Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com>Did you choose NETIF_F_IP_CSUM intentionally? It'll only support IPv4, and since you always fall back to SW I'd think NETIF_F_HW_CSUM makes more sense.Somewhat intentionally, yes. If I would use NETIF_F_HW_CSUM, as I understand it, the GSO path, added in the next patch, would have to compute the checksum not only for IPv6 but also for any other protocols other than UDP and TCP (which currently it supports). I just didn't look into that at the moment.
Now that I think of it, you have a point with declaring NETIF_F_HW_CSUM. In the non-GSO case, skb_checksum_help() will be able to handle anything that we throw at it. On the GSO case, only skbs with TCP over IPv4 or IPv6 (depending on what we declare in the features - TSO/TSO6) will be received - which the csum code can handle. Anyhow, I'll change this to use NETIF_F_HW_CSUM instead of NETIF_F_IP_CSUM and I'll also look into IPv6 for the TSO part. Thanks, Ioana