From: Vladimir Oltean <vladimir.oltean@nxp.com>
To: Xiaoliang Yang <xiaoliang.yang_1@nxp.com>
Cc: "davem@davemloft.net" <davem@davemloft.net>,
"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"kuba@kernel.org" <kuba@kernel.org>,
"n.zhandarovich@fintech.ru" <n.zhandarovich@fintech.ru>,
"edumazet@google.com" <edumazet@google.com>,
"pabeni@redhat.com" <pabeni@redhat.com>,
"wojciech.drewek@intel.com" <wojciech.drewek@intel.com>,
"Arvid.Brodin@xdin.com" <Arvid.Brodin@xdin.com>,
"horms@kernel.org" <horms@kernel.org>,
"lukma@denx.de" <lukma@denx.de>,
"m-karicheri2@ti.com" <m-karicheri2@ti.com>
Subject: Re: [PATCH net-next] net: hsr: create an API to get hsr port type
Date: Wed, 23 Jul 2025 13:37:34 +0300 [thread overview]
Message-ID: <20250723103734.64ydzav3fsw3lgxc@skbuf> (raw)
In-Reply-To: <DB9PR04MB9259A60ECD5FFAA71A0509A2F05FA@DB9PR04MB9259.eurprd04.prod.outlook.com>
On Wed, Jul 23, 2025 at 01:29:09PM +0300, Xiaoliang Yang wrote:
>
>
> > -----Original Message-----
> > From: Vladimir Oltean <vladimir.oltean@nxp.com>
> > Sent: Wednesday, July 23, 2025 6:06 PM
> > To: Xiaoliang Yang <xiaoliang.yang_1@nxp.com>
> > Cc: davem@davemloft.net; netdev@vger.kernel.org; linux-
> > kernel@vger.kernel.org; kuba@kernel.org; n.zhandarovich@fintech.ru;
> > edumazet@google.com; pabeni@redhat.com; wojciech.drewek@intel.com;
> > Arvid.Brodin@xdin.com; horms@kernel.org; lukma@denx.de; m-
> > karicheri2@ti.com
> > Subject: Re: [PATCH net-next] net: hsr: create an API to get hsr port type
> >
> > Hi Xiaoliang,
> >
> > On Wed, Jul 23, 2025 at 06:06:05PM +0800, Xiaoliang Yang wrote:
> > > If a switch device has HSR hardware ability and HSR configuration
> > > offload to hardware. The device driver needs to get the HSR port type
> > > when joining the port to HSR. Different port types require different
> > > settings for the hardware, like HSR_PT_SLAVE_A, HSR_PT_SLAVE_B, and
> > > HSR_PT_INTERLINK. Create the API hsr_get_port_type() and export it.
> > >
> > > When the hsr_get_port_type() is called in the device driver, if the
> > > port can be found in the HSR port list, the HSR port type can be obtained.
> > > Therefore, before calling the device driver, we need to first add the
> > > hsr_port to the HSR port list.
> > >
> > > Signed-off-by: Xiaoliang Yang <xiaoliang.yang_1@nxp.com>
> > > ---
> >
> > An API with no callers will never be accepted. You need to post the user together
> > with this change, for the maintainers to have the full picture and see whether it is
> > the best way to solve the problem.
>
> Thanks Vladimir, I want to use the API in dsa netc driver. The driver
> has not been upstream now. I see the HSR implemented on some devices
> only act as DANH. If the device act as RedBox, we don't know which
> port is interlink, which is slave_A or slave_B. I will re-send it as
> RFC patch, anyone can discuss how to handle this issue.
>
> Regards,
> Xiaoliang
It's not of much use if you still repost an API with no users with an
RFC tag.
I could equally propose populating struct netdev_notifier_changeupper_info :: upper_info
with the information you need (port type). Currently HSR calls netdev_upper_dev_link(),
which sets this argument to NULL.
But without seeing actual code which makes use of this, it is impossible
to know which one is preferable. So please don't send an empty RFC.
prev parent reply other threads:[~2025-07-23 10:37 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-23 10:06 [PATCH net-next] net: hsr: create an API to get hsr port type Xiaoliang Yang
2025-07-23 10:06 ` Vladimir Oltean
2025-07-23 10:29 ` Xiaoliang Yang
2025-07-23 10:37 ` Vladimir Oltean [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=20250723103734.64ydzav3fsw3lgxc@skbuf \
--to=vladimir.oltean@nxp.com \
--cc=Arvid.Brodin@xdin.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=horms@kernel.org \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lukma@denx.de \
--cc=m-karicheri2@ti.com \
--cc=n.zhandarovich@fintech.ru \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=wojciech.drewek@intel.com \
--cc=xiaoliang.yang_1@nxp.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