Skip to content

Commit a997157

Browse files
luizlucadavem330
authored andcommitted
docs: net: dsa: describe issues with checksum offload
DSA tags before IP header (categories 1 and 2) or after the payload (3) might introduce offload checksum issues. Signed-off-by: Luiz Angelo Daros de Luca <[email protected]> Reviewed-by: Vladimir Oltean <[email protected]> Reviewed-by: Florian Fainelli <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 2a38de0 commit a997157

File tree

1 file changed

+17
-0
lines changed
  • Documentation/networking/dsa

1 file changed

+17
-0
lines changed

Documentation/networking/dsa/dsa.rst

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,23 @@ protocol. If not all packets are of equal size, the tagger can implement the
193193
default behavior by specifying the correct offset incurred by each individual
194194
RX packet. Tail taggers do not cause issues to the flow dissector.
195195

196+
Checksum offload should work with category 1 and 2 taggers when the DSA master
197+
driver declares NETIF_F_HW_CSUM in vlan_features and looks at csum_start and
198+
csum_offset. For those cases, DSA will shift the checksum start and offset by
199+
the tag size. If the DSA master driver still uses the legacy NETIF_F_IP_CSUM
200+
or NETIF_F_IPV6_CSUM in vlan_features, the offload might only work if the
201+
offload hardware already expects that specific tag (perhaps due to matching
202+
vendors). DSA slaves inherit those flags from the master port, and it is up to
203+
the driver to correctly fall back to software checksum when the IP header is not
204+
where the hardware expects. If that check is ineffective, the packets might go
205+
to the network without a proper checksum (the checksum field will have the
206+
pseudo IP header sum). For category 3, when the offload hardware does not
207+
already expect the switch tag in use, the checksum must be calculated before any
208+
tag is inserted (i.e. inside the tagger). Otherwise, the DSA master would
209+
include the tail tag in the (software or hardware) checksum calculation. Then,
210+
when the tag gets stripped by the switch during transmission, it will leave an
211+
incorrect IP checksum in place.
212+
196213
Due to various reasons (most common being category 1 taggers being associated
197214
with DSA-unaware masters, mangling what the master perceives as MAC DA), the
198215
tagging protocol may require the DSA master to operate in promiscuous mode, to

0 commit comments

Comments
 (0)