Re: [PATCH net-next v4 11/11] net: dsa: realtek: rtl8365mb: multiple cpu ports, non cpu extint

Jakub Kicinski
2022-01-24T18:21:02Z

On Mon, 24 Jan 2022 09:35:56 -0800 Jakub Kicinski wrote:
> Sorry I used "geometry" loosely.
>
> What I meant is simply that if the driver uses NETIF_F_IP*_CSUM
> it should parse the packet before it hands it off to the HW.
>
> There is infinity of protocols users can come up with, while the device
> parser is very much finite, so it's only practical to check compliance
> with the HW parser in the driver. The reverse approach of adding
> per-protocol caps is a dead end IMO. And we should not bloat the stack
> when NETIF_F_HW_CSUM exists and the memo that parsing packets on Tx is
> bad b/c of protocol ossification went out a decade ago.

> It's not about DSA. The driver should not check
>
> if (dsa())
> blah;
>
> it should check
>
> if (!(eth [-> vlan] -> ip -> tcp/udp))
> csum_help();

Admittedly on a quick look thru the drivers which already do this
I only see L3, L4 and GRE/UDP encap checks. Nothing validates L2.