mbox series

[net-next,v5,0/3] net: dsa: realtek: add rtl8_4t tag

Message ID 20220303015235.18907-1-luizluca@gmail.com (mailing list archive)
Headers show
Series net: dsa: realtek: add rtl8_4t tag | expand

Message

Luiz Angelo Daros de Luca March 3, 2022, 1:52 a.m. UTC
This patch series adds support for rtl8_4t tag. It is a variant of
rtl8_4 tag, with identical values but placed at the end of the packet
(before CRC).

It forces checksum in software before adding the tag as those extra
bytes at the end of the packet would be summed together with the rest of
the payload. When the switch removes the tag before sending the packet
to the network, that checksum will not match.

It might be useful to diagnose or avoid checksum offload issues. With an
ethertype tag like rtl8_4, the cpu port ethernet driver must work with
cksum_start and chksum_offset to correctly calculate checksums. If not,
the checksum field will be broken (it will contain the fake ip header
sum).  In those cases, using 'rtl8_4t' might be an alternative way to
avoid checksum offload, either using runtime or device-tree property.

Regards,

Luiz

v4-v5)
- tags in alphabetical order in dsa_port.yaml
- remove ret var from rtl8365mb_change_tag_protocol
- Comment typos fixes

v3-v4)
- added rtl8_4 and rtl8_4t to dsa_port.yaml
- removed generic considerations about checksum problems with DSA tags.
  They belong to Documentation/networking/dsa/dsa.rst

v2-v3)
- updated tag documentation (file header)
- do not remove position and format from rtl8365mb_cpu
- reinstate cpu to rtl8365mb
- moved rtl8365mb_change_tag_protocol after rtl8365mb_cpu_config
- do not modify rtl8365mb_cpu_config() logic
- remove cpu arg from rtl8365mb_cpu_config(); get it from priv
- dropped tag_protocol from rtl8365mb. It is now derived from
  cpu->position.
- init cpu struct before dsa_register as default tag must be already
  defined before dsa_register()
- fix formatting issues

v1-v2)
- remove mention to tail tagger, use trailing tagger.
- use void* instead of char* for pointing to tag beginning
- use memcpy to avoid problems with unaligned tags
- calculate checksum if it still pending
- keep in-use tag protocol in memory instead of reading from switch
  register

Comments

patchwork-bot+netdevbpf@kernel.org March 5, 2022, 11:10 a.m. UTC | #1
Hello:

This series was applied to netdev/net-next.git (master)
by David S. Miller <davem@davemloft.net>:

On Wed,  2 Mar 2022 22:52:32 -0300 you wrote:
> This patch series adds support for rtl8_4t tag. It is a variant of
> rtl8_4 tag, with identical values but placed at the end of the packet
> (before CRC).
> 
> It forces checksum in software before adding the tag as those extra
> bytes at the end of the packet would be summed together with the rest of
> the payload. When the switch removes the tag before sending the packet
> to the network, that checksum will not match.
> 
> [...]

Here is the summary with links:
  - [net-next,v5,1/3] dt-bindings: net: dsa: add rtl8_4 and rtl8_4t tag formats
    https://git.kernel.org/netdev/net-next/c/617c3cc3aafd
  - [net-next,v5,2/3] net: dsa: tag_rtl8_4: add rtl8_4t trailing variant
    https://git.kernel.org/netdev/net-next/c/cd87fecdedd7
  - [net-next,v5,3/3] net: dsa: realtek: rtl8365mb: add support for rtl8_4t
    https://git.kernel.org/netdev/net-next/c/59dc7b4f7f45

You are awesome, thank you!