From: Vladimir Oltean <olteanv@gmail.com>
To: Luiz Angelo Daros de Luca <luizluca@gmail.com>
Cc: netdev@vger.kernel.org, linus.walleij@linaro.org, andrew@lunn.ch,
vivien.didelot@gmail.com, f.fainelli@gmail.com,
davem@davemloft.net, kuba@kernel.org, alsi@bang-olufsen.dk,
arinc.unal@arinc9.com
Subject: Re: [PATCH net-next v3 1/2] net: dsa: tag_rtl8_4: add rtl8_4t trailing variant
Date: Thu, 24 Feb 2022 02:04:23 +0200 [thread overview]
Message-ID: <20220224000423.6cb33jf47pl4e36h@skbuf> (raw)
In-Reply-To: <20220222224758.11324-2-luizluca@gmail.com>
On Tue, Feb 22, 2022 at 07:47:57PM -0300, Luiz Angelo Daros de Luca wrote:
> diff --git a/net/dsa/tag_rtl8_4.c b/net/dsa/tag_rtl8_4.c
> index 02686ad4045d..2e81ab49d928 100644
> --- a/net/dsa/tag_rtl8_4.c
> +++ b/net/dsa/tag_rtl8_4.c
> @@ -9,11 +9,6 @@
> *
> * This tag header has the following format:
> *
> - * -------------------------------------------
> - * | MAC DA | MAC SA | 8 byte tag | Type | ...
> - * -------------------------------------------
> - * _______________/ \______________________________________
> - * / \
> * 0 7|8 15
> * |-----------------------------------+-----------------------------------|---
> * | (16-bit) | ^
> @@ -58,6 +53,28 @@
> * TX/RX | TX (switch->CPU): port number the packet was received on
> * | RX (CPU->switch): forwarding port mask (if ALLOW=0)
> * | allowance port mask (if ALLOW=1)
> + *
> + * The tag can be positioned before Ethertype, using tag "rtl8_4":
> + *
> + * +--------+--------+------------+------+-----
> + * | MAC DA | MAC SA | 8 byte tag | Type | ...
> + * +--------+--------+------------+------+-----
> + *
> + * If checksum offload is enabled for CPU port device, it might break if the
> + * driver does not use csum_start/csum_offset.
Please. This is true of any DSA header. If you feel you have something
to add on this topic please do so in Documentation/networking/dsa/dsa.rst
under "Switch tagging protocols".
Also, s/CPU port device/DSA master/.
> + *
> + * The tag can also appear between the end of the payload and before the CRC,
> + * using tag "rtl8_4t":
> + *
> + * +--------+--------+------+-----+---------+------------+-----+
> + * | MAC DA | MAC SA | TYPE | ... | payload | 8-byte tag | CRC |
> + * +--------+--------+------+-----+---------+------------+-----+
> + *
> + * The added bytes after the payload will break most checksums, either in
> + * software or hardware. To avoid this issue, if the checksum is still pending,
> + * this tagger checksum the packet before adding the tag, rendering any
s/checksum/checksums/
> + * checksum offload useless.
If you're adding a tail tagging driver to work around checksum offload
issues, this solution is about as bad as it gets. You're literally not
gaining anything in performance over fixing your DSA master driver to
turn off checksum offloading for unrecognized DSA tagging protocols.
And on top of that, you're requiring your users to be aware of this
issue and make changes to their configuration, for something that can be
done automatically.
Do you have another use case as well?
next prev parent reply other threads:[~2022-02-24 0:04 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-22 22:47 [PATCH net-next v3 0/2] net: dsa: realtek: add rtl8_4t tag Luiz Angelo Daros de Luca
2022-02-22 22:47 ` [PATCH net-next v3 1/2] net: dsa: tag_rtl8_4: add rtl8_4t trailing variant Luiz Angelo Daros de Luca
2022-02-23 14:54 ` Alvin Šipraga
2022-02-24 0:04 ` Vladimir Oltean [this message]
2022-02-25 6:10 ` Luiz Angelo Daros de Luca
2022-02-22 22:47 ` [PATCH net-next v3 2/2] net: dsa: realtek: rtl8365mb: add support for rtl8_4t Luiz Angelo Daros de Luca
2022-02-23 14:58 ` Alvin Šipraga
2022-02-23 23:43 ` [PATCH net-next v3 0/2] net: dsa: realtek: add rtl8_4t tag Vladimir Oltean
2022-02-25 5:16 ` Luiz Angelo Daros de Luca
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220224000423.6cb33jf47pl4e36h@skbuf \
--to=olteanv@gmail.com \
--cc=alsi@bang-olufsen.dk \
--cc=andrew@lunn.ch \
--cc=arinc.unal@arinc9.com \
--cc=davem@davemloft.net \
--cc=f.fainelli@gmail.com \
--cc=kuba@kernel.org \
--cc=linus.walleij@linaro.org \
--cc=luizluca@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=vivien.didelot@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).