[PATCH net-next v2] net: stmmac: Programming sequence for VLAN packets with split header
Simon Horman
horms at kernel.org
Thu Oct 17 07:25:33 PDT 2024
On Wed, Oct 16, 2024 at 04:43:13PM -0700, Abhishek Chauhan wrote:
> Currently reset state configuration of split header works fine for
> non-tagged packets and we see no corruption in payload of any size
>
> We need additional programming sequence with reset configuration to
> handle VLAN tagged packets to avoid corruption in payload for packets
> of size greater than 256 bytes.
>
> Without this change ping application complains about corruption
> in payload when the size of the VLAN packet exceeds 256 bytes.
>
> With this change tagged and non-tagged packets of any size works fine
> and there is no corruption seen.
>
> Current configuration which has the issue for VLAN packet
> ----------------------------------------------------------
>
> Split happens at the position at Layer 3 header
> |MAC-DA|MAC-SA|Vlan Tag|Ether type|IP header|IP data|Rest of the payload|
> 2 bytes ^
> |
>
> With the fix we are making sure that the split happens now at
> Layer 2 which is end of ethernet header and start of IP payload
>
> Ip traffic split
> -----------------
>
> Bits which take care of this are SPLM and SPLOFST
> SPLM = Split mode is set to Layer 2
> SPLOFST = These bits indicate the value of offset from the beginning
> of Length/Type field at which header split should take place when the
> appropriate SPLM is selected. Reset value is 2bytes.
>
> Un-tagged data (without VLAN)
> |MAC-DA|MAC-SA|Ether type|IP header|IP data|Rest of the payload|
> 2bytes ^
> |
>
> Tagged data (with VLAN)
> |MAC-DA|MAC-SA|VLAN Tag|Ether type|IP header|IP data|Rest of the payload|
> 2bytes ^
> |
>
> Non-IP traffic split such AV packet
> ------------------------------------
>
> Bits which take care of this are
> SAVE = Split AV Enable
> SAVO = Split AV Offset, similar to SPLOFST but this is for AVTP
> packets.
>
> |Preamble|MAC-DA|MAC-SA|VLAN tag|Ether type|IEEE 1722 payload|CRC|
> 2bytes ^
> |
>
> Signed-off-by: Abhishek Chauhan <quic_abchauha at quicinc.com>
> ---
> Changes since v1
> - took care of comments from Simon on FIELD_PREP
> - explained the details of l2 and l3 split as requested by Andrew
> - Added folks from intel and Nvidia who disabled split header
> need to check if they faced similar issues and if this fix
> can help them too.
>
> Changes since v0
> - The reason for posting it on net-next is to enable this new feature.
Reviewed-by: Simon Horman <horms at kernel.org>
More information about the linux-arm-kernel
mailing list