netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tobias Waldekranz <tobias@waldekranz.com>
To: Andrew Lunn <andrew@lunn.ch>
Cc: davem@davemloft.net, kuba@kernel.org, vivien.didelot@gmail.com,
	f.fainelli@gmail.com, olteanv@gmail.com, netdev@vger.kernel.org
Subject: Re: [PATCH net-next] net: dsa: mv88e6xxx: Allow dynamic reconfiguration of tag protocol
Date: Wed, 24 Mar 2021 13:53:39 +0100	[thread overview]
Message-ID: <87v99glnl8.fsf@waldekranz.com> (raw)
In-Reply-To: <YFqLX+o2n2qRVW8M@lunn.ch>

On Wed, Mar 24, 2021 at 01:44, Andrew Lunn <andrew@lunn.ch> wrote:
>> This was my initial approach. It gets quite messy though. Since taggers
>> can be modules, there is no way of knowing if a supplied protocol name
>> is garbage ("asdf"), or just part of a module in an initrd that is not
>> loaded yet when you are probing the tree.
>
> Hi Tobias
>
> I don't think that is an issue. We currently lookup the tagger in
> dsa_port_parse_cpu(). If it does not exist, we return
> -EPROBE_DEFER. Either it eventually gets loaded, or the driver core
> gives up. I don't see why the same cannot be done for a DT
> property. If dsa_find_tagger_by_name() does not find the tagger return
> -EPROBE_DEFER. Garbage will result in the switch never loading, and
> the DT writer will go find their typo.
>
>> Even when the tagger is available, there is no way to verify if the
>> driver is compatible with it.
>
> I would of though, calling the switch drivers change_tag_protocol() op
> will that for you. If it comes back with -EINVAL, or -EOPNOTSUPP, you
> know it is not compatible.
>
> So i guess i would keep all the code you are adding here to allow
> dynamic setting of the protocol. And add more code in
> dsa_switch_parse_of() to parse the optional tagging protocol name,
> error out -EPROBE_DEFER if it is not known yet, otherwise store it
> away in something like dst->tag_ops_name. And then probably in
> dsa_switch_setup(), if dst->tag_ops_name is not NULL, invoke the
> dynamic change code to perform the actual change.

Sounds like a plan. I will try it out and get back with a v2. Thanks.

      reply	other threads:[~2021-03-24 12:54 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-23 10:23 [PATCH net-next] net: dsa: mv88e6xxx: Allow dynamic reconfiguration of tag protocol Tobias Waldekranz
2021-03-23 11:35 ` Vladimir Oltean
2021-03-23 12:32   ` Andrew Lunn
2021-03-23 14:48   ` Tobias Waldekranz
2021-03-23 16:30     ` Florian Fainelli
2021-03-23 19:03     ` Vladimir Oltean
2021-03-23 21:17       ` Tobias Waldekranz
2021-03-23 23:15         ` Vladimir Oltean
2021-03-24 10:52           ` Tobias Waldekranz
2021-03-24 11:34             ` Vladimir Oltean
2021-03-24 13:01               ` Tobias Waldekranz
2021-03-24 13:24                 ` Vladimir Oltean
2021-03-24 14:03         ` Vladimir Oltean
2021-03-24 14:10           ` Vladimir Oltean
2021-03-24 15:02           ` Tobias Waldekranz
2021-03-24 15:08             ` Vladimir Oltean
2021-03-24 16:07               ` Tobias Waldekranz
2021-03-25  1:34                 ` Vladimir Oltean
2021-03-25  8:04                   ` Tobias Waldekranz
2021-03-23 12:41 ` Andrew Lunn
2021-03-23 14:49   ` Tobias Waldekranz
2021-03-23 16:53     ` Florian Fainelli
2021-03-23 20:50       ` Tobias Waldekranz
2021-03-24  0:44     ` Andrew Lunn
2021-03-24 12:53       ` Tobias Waldekranz [this message]

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=87v99glnl8.fsf@waldekranz.com \
    --to=tobias@waldekranz.com \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=f.fainelli@gmail.com \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=olteanv@gmail.com \
    --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).