From: Vladimir Oltean <olteanv@gmail.com>
To: Ansuel Smith <ansuelsmth@gmail.com>
Cc: Andrew Lunn <andrew@lunn.ch>,
Vivien Didelot <vivien.didelot@gmail.com>,
Florian Fainelli <f.fainelli@gmail.com>,
"David S. Miller" <davem@davemloft.net>,
Jakub Kicinski <kuba@kernel.org>,
linux-kernel@vger.kernel.org, netdev@vger.kernel.org
Subject: Re: [net-next RFC PATCH 0/6] Add support for qca8k mdio rw in Ethernet packet
Date: Wed, 8 Dec 2021 01:20:20 +0200 [thread overview]
Message-ID: <20211207232020.ckdc6polqat4aefo@skbuf> (raw)
In-Reply-To: <61afe8a9.1c69fb81.897ba.6022@mx.google.com>
On Wed, Dec 08, 2021 at 12:05:11AM +0100, Ansuel Smith wrote:
> Hm. Interesting idea. So qca8k would provide the way to parse the packet
> and made the request. The tagger would just detect the packet and
> execute the dedicated function.
> About mib considering the driver autocast counter for every port and
> every packet have the relevant port to it (set in the qca tag), the
> idea was to put a big array and directly write the data. The ethtool
> function will then just read the data and report it. (or even work
> directly on the ethtool data array).
Apart from the fact that you'd be running inside the priv->rw_reg_ack_handler()
which runs in softirq context (so you need spinlocks to serialize with
the code that runs in process and/or workqueue context), you have access
to all the data structures from the switch driver that you're used to.
So you could copy from the void *buf into something owned by struct
qca8k_priv *priv, sure.
> > My current idea is maybe not ideal and a bit fuzzy, because the switch
> > driver would need to be aware of the fact that the tagger private data
> > is in dp->priv, and some code in one folder needs to be in sync with
> > some code in another folder. But at least it should be safer this way,
> > because we are in more control over the exact connection that's being
> > made.
> >
> > - to avoid leaking memory, we also need to patch dsa_tree_put() to issue
> > a disconnect event on unbind.
> >
> > - the tagging protocol driver would always need to NULL-check the
> > function pointer before dereferencing it, because it may connect to a
> > switch driver that doesn't set them up (dsa_loop):
> >
> > struct qca8k_tagger_private *priv = dp->priv;
> >
> > if (priv->rw_reg_ack_handler)
> > priv->rw_reg_ack_handler(dp, skb_mac_header(skb));
>
> Ok so your idea is to make the driver the one controlling ""everything""
> and keep the tagger as dummy as possible. That would also remove all the
> need to put stuff in the global include dir. Looks complex but handy. We
> still need to understand the state part. Any hint about that?
>
> In the mean time I will try implement this.
What do you mean exactly by understanding the state?
next prev parent reply other threads:[~2021-12-07 23:20 UTC|newest]
Thread overview: 40+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-12-07 14:59 [net-next RFC PATCH 0/6] Add support for qca8k mdio rw in Ethernet packet Ansuel Smith
2021-12-07 14:59 ` [net-next RFC PATCH 1/6] net: dsa: tag_qca: convert to FIELD macro Ansuel Smith
2021-12-07 14:59 ` [net-next RFC PATCH 2/6] net: dsa: tag_qca: move define to include linux/dsa Ansuel Smith
2021-12-07 14:59 ` [net-next RFC PATCH 3/6] net: dsa: tag_qca: add define for mdio read/write in ethernet packet Ansuel Smith
2021-12-07 14:59 ` [net-next RFC PATCH 4/6] net: dsa: qca8k: Add support for mdio read/write in Ethernet packet Ansuel Smith
2021-12-07 14:59 ` [net-next RFC PATCH 5/6] net: dsa: tag_qca: Add support for handling mdio read/write packet Ansuel Smith
2021-12-07 14:59 ` [net-next RFC PATCH 6/6] net: dsa: qca8k: cache lo and hi for mdio write Ansuel Smith
2021-12-07 15:15 ` [net-next RFC PATCH 0/6] Add support for qca8k mdio rw in Ethernet packet Andrew Lunn
2021-12-07 15:33 ` Ansuel Smith
2021-12-07 18:49 ` Florian Fainelli
2021-12-07 19:44 ` Ansuel Smith
2021-12-07 21:10 ` Vladimir Oltean
2021-12-07 22:01 ` Ansuel Smith
2021-12-07 22:37 ` Andrew Lunn
2021-12-07 18:41 ` Andrew Lunn
2021-12-07 18:53 ` Ansuel Smith
2021-12-07 19:15 ` Andrew Lunn
2021-12-07 19:21 ` Ansuel Smith
2021-12-07 20:52 ` Vladimir Oltean
2021-12-07 21:47 ` Ansuel Smith
2021-12-07 22:22 ` Andrew Lunn
2021-12-07 22:30 ` Ansuel Smith
2021-12-07 22:46 ` Andrew Lunn
2021-12-07 23:47 ` Vladimir Oltean
2021-12-08 0:04 ` Vladimir Oltean
2021-12-08 0:40 ` Vladimir Oltean
2021-12-08 0:42 ` Ansuel Smith
2021-12-08 1:09 ` Vladimir Oltean
2021-12-08 3:32 ` Ansuel Smith
2021-12-08 11:54 ` Vladimir Oltean
2021-12-08 1:15 ` Andrew Lunn
2021-12-07 22:45 ` Vladimir Oltean
2021-12-07 22:54 ` Andrew Lunn
2021-12-07 23:14 ` Vladimir Oltean
2021-12-08 1:35 ` Andrew Lunn
2021-12-08 3:39 ` Ansuel Smith
2021-12-08 11:51 ` Vladimir Oltean
2021-12-07 23:05 ` Ansuel Smith
2021-12-07 23:20 ` Vladimir Oltean [this message]
2021-12-07 23:24 ` Ansuel Smith
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=20211207232020.ckdc6polqat4aefo@skbuf \
--to=olteanv@gmail.com \
--cc=andrew@lunn.ch \
--cc=ansuelsmth@gmail.com \
--cc=davem@davemloft.net \
--cc=f.fainelli@gmail.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--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).