[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20250723103734.64ydzav3fsw3lgxc@skbuf>
Date: Wed, 23 Jul 2025 13:37:34 +0300
From: Vladimir Oltean <vladimir.oltean@....com>
To: Xiaoliang Yang <xiaoliang.yang_1@....com>
Cc: "davem@...emloft.net" <davem@...emloft.net>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"kuba@...nel.org" <kuba@...nel.org>,
"n.zhandarovich@...tech.ru" <n.zhandarovich@...tech.ru>,
"edumazet@...gle.com" <edumazet@...gle.com>,
"pabeni@...hat.com" <pabeni@...hat.com>,
"wojciech.drewek@...el.com" <wojciech.drewek@...el.com>,
"Arvid.Brodin@...n.com" <Arvid.Brodin@...n.com>,
"horms@...nel.org" <horms@...nel.org>,
"lukma@...x.de" <lukma@...x.de>,
"m-karicheri2@...com" <m-karicheri2@...com>
Subject: Re: [PATCH net-next] net: hsr: create an API to get hsr port type
On Wed, Jul 23, 2025 at 01:29:09PM +0300, Xiaoliang Yang wrote:
>
>
> > -----Original Message-----
> > From: Vladimir Oltean <vladimir.oltean@....com>
> > Sent: Wednesday, July 23, 2025 6:06 PM
> > To: Xiaoliang Yang <xiaoliang.yang_1@....com>
> > Cc: davem@...emloft.net; netdev@...r.kernel.org; linux-
> > kernel@...r.kernel.org; kuba@...nel.org; n.zhandarovich@...tech.ru;
> > edumazet@...gle.com; pabeni@...hat.com; wojciech.drewek@...el.com;
> > Arvid.Brodin@...n.com; horms@...nel.org; lukma@...x.de; m-
> > karicheri2@...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@....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.
Powered by blists - more mailing lists