public inbox for linux-doc@vger.kernel.org
 help / color / mirror / Atom feed
From: Vladimir Oltean <vladimir.oltean@nxp.com>
To: Luiz Angelo Daros de Luca <luizluca@gmail.com>
Cc: Andrew Lunn <andrew@lunn.ch>,
	Kurt Kanzenbach <kurt@linutronix.de>,
	George McCollister <george.mccollister@gmail.com>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"linux-doc@vger.kernel.org" <linux-doc@vger.kernel.org>,
	"bhelgaas@google.com" <bhelgaas@google.com>,
	"corbet@lwn.net" <corbet@lwn.net>,
	"pabeni@redhat.com" <pabeni@redhat.com>,
	"kuba@kernel.org" <kuba@kernel.org>,
	"davem@davemloft.net" <davem@davemloft.net>,
	Florian Fainelli <f.fainelli@gmail.com>
Subject: Re: [PATCH net-next v2] docs: net: dsa: describe issues with checksum offload
Date: Thu, 14 Apr 2022 12:58:50 +0000	[thread overview]
Message-ID: <20220414125849.hinuxwesqrwumpd2@skbuf> (raw)
In-Reply-To: <CAJq09z7h_M9u=7jC3i3xEXCt+8wjkV9PfD4iVdje_jZ=9NZNKA@mail.gmail.com>

On Wed, Apr 13, 2022 at 11:48:46PM -0300, Luiz Angelo Daros de Luca wrote:
> > Ok, I'll go with "no checksum offload for its trailer tag, and bugs
> > never fixed because no one uses it", in any case no Sasquatch. Thanks.
> 
> Vladimir, so the DSA switch will not copy the offload flags when a tag
> requests tail room? At least it will work.
> 
> Now, if the offload HW does support that tag, what would be the
> options? Set the slave port checksum flag from userland?
> It would be nice to have some type of "magic trick" to have it enabled
> by default. I'm already expecting a no, but wouldn't it be a nice case
> for a DSA property in the device tree?
> 
> Regards,
> 
> Luiz

DSA calls netdev_upper_dev_link(master, slave_dev, NULL) to establish a
relationship with its master and the master driver can detect this by
monitoring NETDEV_CHANGEUPPER.

If we look a bit closer at the implementation of netdev_upper_dev_link
we see it calls __netdev_upper_dev_link() which contains an interesting
pair of arguments "void *upper_priv, void *upper_info". These are
accessible to netdev_master_upper_dev_link(), and the bonding driver
(for example) makes use of them, see bond_master_upper_dev_link().

I'm thinking DSA could create a struct netdev_dsa_upper_info too, and
certain DSA masters could populate things in it. Then DSA could look at
what the DSA master has said (or not said) and fix up features
accordingly.

One information that could get populated by the master is a bit field of
whether checksumming is supported for a certain tagging protocol.
I'd rather pass a full bit field of all tagging protocols, rather than
just the protocol in current use by the slave, because:
(a) it's less gory compared to having the master look at
    dsa_port_from_netdev(info->upper_dev)->cpu_dp->tag_ops->proto
(b) the DSA tagging protocol can change at runtime, and when it does, no
    NETDEV_CHANGEUPPER will be emitted, so the master won't have a
    chance to inform us whether it can offload checksumming for the new
    protocol. So it's better to have this information from the get go.

We'd also need the DSA master to populate a "bool acked=true" from this
new struct netdev_dsa_upper_info. The reason is to be able to
distinguish between an empty bit mask that means "yup, I really can't
offload checksumming for anything", and a bit mask that means "DSA who?"
(where checksum offloading is expected to work under the normal
circumstances described by you, no special code required).

  reply	other threads:[~2022-04-14 12:59 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-11 23:03 [PATCH net-next v2] docs: net: dsa: describe issues with checksum offload Luiz Angelo Daros de Luca
2022-04-13 20:08 ` Vladimir Oltean
2022-04-13 20:49   ` Andrew Lunn
2022-04-13 20:53     ` Vladimir Oltean
2022-04-13 20:57       ` Andrew Lunn
2022-04-13 21:00         ` Vladimir Oltean
2022-04-14  2:48           ` Luiz Angelo Daros de Luca
2022-04-14 12:58             ` Vladimir Oltean [this message]
2022-04-15  8:01               ` Luiz Angelo Daros de Luca
2022-04-15 10:22                 ` Vladimir Oltean
2022-04-16  5:30                   ` Luiz Angelo Daros de Luca
2022-04-13 20:56   ` Andrew Lunn
2022-04-14  6:29   ` Kurt Kanzenbach
2022-04-14 15:22     ` Vladimir Oltean

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=20220414125849.hinuxwesqrwumpd2@skbuf \
    --to=vladimir.oltean@nxp.com \
    --cc=andrew@lunn.ch \
    --cc=bhelgaas@google.com \
    --cc=corbet@lwn.net \
    --cc=davem@davemloft.net \
    --cc=f.fainelli@gmail.com \
    --cc=george.mccollister@gmail.com \
    --cc=kuba@kernel.org \
    --cc=kurt@linutronix.de \
    --cc=linux-doc@vger.kernel.org \
    --cc=luizluca@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.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