[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <DM8PR11MB5751B68955275006A16E1C75C13FA@DM8PR11MB5751.namprd11.prod.outlook.com>
Date: Fri, 21 Jul 2023 16:12:35 +0000
From: "Ng, Boon Khai" <boon.khai.ng@...el.com>
To: Florian Fainelli <f.fainelli@...il.com>,
Krzysztof Kozlowski <krzk@...nel.org>,
"Boon@...mtp.png.intel.com" <Boon@...mtp.png.intel.com>,
"Khai@...mtp.png.intel.com" <Khai@...mtp.png.intel.com>,
Giuseppe Cavallaro <peppe.cavallaro@...com>,
Alexandre Torgue <alexandre.torgue@...s.st.com>,
Jose Abreu <joabreu@...opsys.com>,
"David S . Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>,
"Paolo Abeni" <pabeni@...hat.com>,
Maxime Coquelin <mcoquelin.stm32@...il.com>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
"linux-stm32@...md-mailman.stormreply.com"
<linux-stm32@...md-mailman.stormreply.com>,
"linux-arm-kernel@...ts.infradead.org"
<linux-arm-kernel@...ts.infradead.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
CC: "Shevchenko, Andriy" <andriy.shevchenko@...el.com>,
"Tham, Mun Yew" <mun.yew.tham@...el.com>,
"Swee, Leong Ching" <leong.ching.swee@...el.com>,
"G Thomas, Rohan" <rohan.g.thomas@...el.com>,
Shevchenko Andriy <andriy.shevchenko@...ux.intel.com>
Subject: RE: [Enable Designware XGMAC VLAN Stripping Feature 2/2] net: stmmac:
dwxgmac2: Add support for HW-accelerated VLAN Stripping
> -----Original Message-----
> From: Florian Fainelli <f.fainelli@...il.com>
> Sent: Friday, July 21, 2023 11:59 PM
> To: Ng, Boon Khai <boon.khai.ng@...el.com>; Krzysztof Kozlowski
> <krzk@...nel.org>; Boon@...mtp.png.intel.com; Khai@...mtp.png.intel.com;
> Ng, Boon Khai <boon.khai.ng@...el.com>; Giuseppe Cavallaro
> <peppe.cavallaro@...com>; Alexandre Torgue <alexandre.torgue@...s.st.com>;
> Jose Abreu <joabreu@...opsys.com>; David S . Miller <davem@...emloft.net>;
> Eric Dumazet <edumazet@...gle.com>; Jakub Kicinski <kuba@...nel.org>;
> Paolo Abeni <pabeni@...hat.com>; Maxime Coquelin
> <mcoquelin.stm32@...il.com>; netdev@...r.kernel.org; linux-stm32@...md-
> mailman.stormreply.com; linux-arm-kernel@...ts.infradead.org; linux-
> kernel@...r.kernel.org
> Cc: Shevchenko, Andriy <andriy.shevchenko@...el.com>; Tham, Mun Yew
> <mun.yew.tham@...el.com>; Swee, Leong Ching
> <leong.ching.swee@...el.com>; G Thomas, Rohan
> <rohan.g.thomas@...el.com>; Shevchenko Andriy
> <andriy.shevchenko@...ux.intel.com>
> Subject: Re: [Enable Designware XGMAC VLAN Stripping Feature 2/2] net:
> stmmac: dwxgmac2: Add support for HW-accelerated VLAN Stripping
>
>
>
> On 7/21/2023 8:30 AM, Ng, Boon Khai wrote:
> >> -----Original Message-----
> >> From: Krzysztof Kozlowski <krzk@...nel.org>
> >> Sent: Friday, July 21, 2023 6:11 PM
> >> To: Boon@...mtp.png.intel.com; Khai@...mtp.png.intel.com; "Ng
> >> <boon.khai.ng"@intel.com; Giuseppe Cavallaro
> >> <peppe.cavallaro@...com>; Alexandre Torgue
> >> <alexandre.torgue@...s.st.com>; Jose Abreu <joabreu@...opsys.com>;
> >> David S . Miller <davem@...emloft.net>; Eric Dumazet
> >> <edumazet@...gle.com>; Jakub Kicinski <kuba@...nel.org>; Paolo Abeni
> >> <pabeni@...hat.com>; Maxime Coquelin <mcoquelin.stm32@...il.com>;
> >> netdev@...r.kernel.org; linux-stm32@st- md-mailman.stormreply.com;
> >> linux-arm-kernel@...ts.infradead.org; linux- kernel@...r.kernel.org
> >> Cc: Ng, Boon Khai <boon.khai.ng@...el.com>; Shevchenko, Andriy
> >> <andriy.shevchenko@...el.com>; Tham, Mun Yew
> >> <mun.yew.tham@...el.com>; Swee, Leong Ching
> >> <leong.ching.swee@...el.com>; G Thomas, Rohan
> >> <rohan.g.thomas@...el.com>; Shevchenko Andriy
> >> <andriy.shevchenko@...ux.intel.com>
> >> Subject: Re: [Enable Designware XGMAC VLAN Stripping Feature 2/2] net:
> >> stmmac: dwxgmac2: Add support for HW-accelerated VLAN Stripping
> >>
> >> On 21/07/2023 08:26, Boon@...mtp.png.intel.com wrote:
> >>> From: Boon Khai Ng <boon.khai.ng@...el.com>
> >>>
> >>> Currently, VLAN tag stripping is done by software driver in
> >>> stmmac_rx_vlan(). This patch is to Add support for VLAN tag
> >>> stripping by the MAC hardware and MAC drivers to support it.
> >>> This is done by adding rx_hw_vlan() and set_hw_vlan_mode() callbacks
> >>> at stmmac_ops struct which are called from upper software layer.
> >> ...
> >>
> >>> if (priv->dma_cap.vlhash) {
> >>> ndev->features |= NETIF_F_HW_VLAN_CTAG_FILTER;
> >>> ndev->features |= NETIF_F_HW_VLAN_STAG_FILTER; diff --
> >> git
> >>> a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
> >>> b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
> >>> index 23d53ea04b24..bd7f3326a44c 100644
> >>> --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
> >>> +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
> >>> @@ -543,6 +543,12 @@ stmmac_probe_config_dt(struct platform_device
> >> *pdev, u8 *mac)
> >>> plat->flags |= STMMAC_FLAG_TSO_EN;
> >>> }
> >>>
> >>> + /* Rx VLAN HW Stripping */
> >>> + if (of_property_read_bool(np, "snps,rx-vlan-offload")) {
> >>> + dev_info(&pdev->dev, "RX VLAN HW Stripping\n");
> >>
> >> Why? Drop.
> >>
> >
> > This is an dts option export to dts for user to choose whether or not
> > they Want a Hardware stripping or a software stripping.
> >
> > May I know what is the reason to drop this?
>
> Because the networking stack already exposes knobs for drivers to advertise and
> control VLAN stripping/insertion on RX/TX using ethtool and feature bits
> (NETIF_F_HW_VLAN_CTAG_RX, NETIF_F_HW_VLAN_CTAG_TX).
>
Hi Florian,
Understood, but how does user choose to have the default option
either hardware strip or software strip, when the device just boot up?
I don’t think ethool can "remember" the setting once the device get rebooted?
Any other suggestion of doing it other than using the dts method?
> What you are doing here is encode a policy as a Device Tree property rather
> than describe whether the hardware supports a given feature and this is frowned
> upon.
> --
> Florian
Powered by blists - more mailing lists