Skip to contentSkip to conversation

[Enable Designware XGMAC VLAN Stripping Feature 0/2]

PATCH In review [email protected] 10 participants 39 messages Jul 21, 2023 – Jul 26, 2023

Subsystems (7)
lore
Share & tools
lore
#0 lore raw

cover [Enable Designware XGMAC VLAN Stripping Feature 0/2]

From: Boon Khai Ng <[email protected]>

Hi,
The Designware 10G MAC(dwxgmac) driver has lack of vlan support in term of hardware, such as the hardware accelerated VLAN stripping. The driver was not draft from scratch, however it was ported from the Ethernet Quality-of-Service (dwmac4) driver, it was tested working on ourside.

Boon Khai Ng (2):
dt-bindings: net: snps,dwmac: Add description for rx-vlan-offload
net: stmmac: dwxgmac2: Add support for HW-accelerated VLAN Stripping

 .../devicetree/bindings/net/snps,dwmac.yaml   |  5 +++
 .../net/ethernet/stmicro/stmmac/dwxgmac2.h    | 28 ++++++++++++++
 .../ethernet/stmicro/stmmac/dwxgmac2_core.c   | 38 +++++++++++++++++++
 .../ethernet/stmicro/stmmac/dwxgmac2_descs.c  | 18 +++++++++
 drivers/net/ethernet/stmicro/stmmac/hwif.h    | 16 ++++++++
 .../net/ethernet/stmicro/stmmac/stmmac_main.c | 29 +++++++++++---
 .../ethernet/stmicro/stmmac/stmmac_platform.c |  6 +++
 include/linux/stmmac.h                        |  1 +
 8 files changed, 136 insertions(+), 5 deletions(-)
Signature · 1 line
2.25.1
#1 lore raw

PATCH 1/2 dt-bindings: net: snps,dwmac: Add description for rx-vlan-offload

From: Boon Khai Ng <[email protected]>

This patch is to add the dts setting for the MAC controller on synopsys 10G Ethernet MAC which allow the 10G MAC to turn on hardware accelerated VLAN stripping. Once the hardware accelerated VLAN stripping is turn on, the VLAN tag will be stripped by the 10G Ethernet MAC.

---
 Documentation/devicetree/bindings/net/snps,dwmac.yaml | 5 +++++
 1 file changed, 5 insertions(+)
Documentation/devicetree/bindings/net/snps,dwmac.yaml +5 -0
index ddf9522a5dc2..905de37e861f 100644
@@ -487,6 +487,11 @@ properties:
     description:
       Frequency division factor for MDC clock.
 
+  snps,rx-vlan-offload:
+    $ref: /schemas/types.yaml#/definitions/flag
+    description:
+      Enable hardware-accelerated RX VLAN stripping.
+
   mdio:
     $ref: mdio.yaml#
     unevaluatedProperties: false
Signature · 1 line
2.25.1
#2 lore raw

Re: [Enable Designware XGMAC VLAN Stripping Feature 1/2] dt-bindings: net: snps,dwmac: Add description for rx-vlan-offload

Quoted 6 lines · On 21/07/2023 08:26, [email protected] wrote:

From: Boon Khai Ng <[email protected]>

This patch is to add the dts setting for the MAC controller on synopsys 10G Ethernet MAC which allow the 10G MAC to turn on hardware accelerated VLAN stripping. Once the hardware accelerated VLAN stripping is turn on, the VLAN tag will be stripped by the

Subject prefix is totally bogus.

Quoted 4 lines

10G Ethernet MAC.

Please use scripts/get_maintainers.pl to get a list of necessary people and lists to CC. It might happen, that command when run on an older kernel, gives you outdated entries. Therefore please be sure you base your patches on recent Linux kernel.

You missed at least DT list (maybe more), so this won't be tested by automated tooling. Performing review on untested code might be a waste of time, thus I will skip this patch entirely till you follow the process allowing the patch to be tested.

Please kindly resend and include all necessary To/Cc entries.

Best regards,
Krzysztof

#3 lore raw

RE: [Enable Designware XGMAC VLAN Stripping Feature 1/2] dt-bindings: net: snps,dwmac: Add description for rx-vlan-offload

Quoted 21 lines

-----Original Message-----
From: Krzysztof Kozlowski <[email protected]>
Sent: Friday, July 21, 2023 6:11 PM
To: [email protected]; [email protected]; "Ng <boon.khai.ng"@intel.com; Giuseppe Cavallaro <[email protected]>; Alexandre Torgue <[email protected]>; Jose Abreu <[email protected]>; David S . Miller <[email protected]>; Eric Dumazet <[email protected]>; Jakub Kicinski <[email protected]>; Paolo Abeni <[email protected]>; Maxime Coquelin <[email protected]>; [email protected]; linux-stm32@st-md- mailman.stormreply.com; [email protected]; linux- [email protected]
Cc: Ng, Boon Khai <[email protected]>; Shevchenko, Andriy <[email protected]>; Tham, Mun Yew <[email protected]>; Swee, Leong Ching <[email protected]>; G Thomas, Rohan <[email protected]>; Shevchenko Andriy <[email protected]>
Subject: Re: [Enable Designware XGMAC VLAN Stripping Feature 1/2] dt-bindings:
net: snps,dwmac: Add description for rx-vlan-offload

On 21/07/2023 08:26, [email protected] wrote:

Quoted 9 lines
Quoted 6 lines

From: Boon Khai Ng <[email protected]>

This patch is to add the dts setting for the MAC controller on synopsys 10G Ethernet MAC which allow the 10G MAC to turn on hardware accelerated VLAN stripping. Once the hardware accelerated VLAN stripping is turn on, the VLAN tag will be stripped by the

Subject prefix is totally bogus.

Which part? It's a 10G Ethernet IP from Sysnopsys, in Roman character it is X (mean 10), so XGMAC. Even the driver file I'm editing it is dw"xgmac".

Quoted 11 lines
Quoted 5 lines

10G Ethernet MAC.

Please use scripts/get_maintainers.pl to get a list of necessary people and lists to CC. It might happen, that command when run on an older kernel, gives you outdated entries. Therefore please be sure you base your patches on recent Linux kernel.

This is based on net-next repository suggested by the get maintainer script.

I got the latest net-next just now at the Commit-id b44693495af8 which just committed yesterday.

$ ./scripts/get_maintainer.pl  --scm  -f drivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c
Giuseppe Cavallaro <[email protected]> (supporter:STMMAC ETHERNET DRIVER)
Alexandre Torgue <[email protected]> (supporter:STMMAC ETHERNET DRIVER)
Jose Abreu <[email protected]> (supporter:STMMAC ETHERNET DRIVER)
"David S. Miller" <[email protected]> (maintainer:NETWORKING DRIVERS)
Eric Dumazet <[email protected]> (maintainer:NETWORKING DRIVERS)
Jakub Kicinski <[email protected]> (maintainer:NETWORKING DRIVERS)
Paolo Abeni <[email protected]> (maintainer:NETWORKING DRIVERS)
Maxime Coquelin <[email protected]> (maintainer:ARM/STM32 ARCHITECTURE)
Richard Cochran <[email protected]> (maintainer:PTP HARDWARE CLOCK SUPPORT)
[email protected] (open list:STMMAC ETHERNET DRIVER)
[email protected] (moderated list:ARM/STM32 ARCHITECTURE)
[email protected] (moderated list:ARM/STM32 ARCHITECTURE)
[email protected] (open list)
git git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net.git
git git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next.git
git git://git.kernel.org/pub/scm/linux/kernel/git/atorgue/stm32.git stm32-next
git git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
Quoted 5 lines

You missed at least DT list (maybe more), so this won't be tested by automated tooling. Performing review on untested code might be a waste of time, thus I will skip this patch entirely till you follow the process allowing the patch to be tested.

This is a new device bringup, thus the DT is not available yet. The DTS will be upstreamed by my another colleague, unless, if I can upstream only my part on the setting?

Quoted 4 lines

Please kindly resend and include all necessary To/Cc entries.

Best regards,
Krzysztof

#4 lore raw

Re: [Enable Designware XGMAC VLAN Stripping Feature 1/2] dt-bindings: net: snps,dwmac: Add description for rx-vlan-offload

Quoted 28 lines · Boon Khai
Quoted 28 lines

-----Original Message-----
From: Krzysztof Kozlowski <[email protected]>
Sent: Friday, July 21, 2023 6:11 PM
To: [email protected]; [email protected]; "Ng <boon.khai.ng"@intel.com; Giuseppe Cavallaro <[email protected]>; Alexandre Torgue <[email protected]>; Jose Abreu <[email protected]>; David S . Miller <[email protected]>; Eric Dumazet <[email protected]>; Jakub Kicinski <[email protected]>; Paolo Abeni <[email protected]>; Maxime Coquelin <[email protected]>; [email protected]; linux-stm32@st-md- mailman.stormreply.com; [email protected]; linux- [email protected]
Cc: Ng, Boon Khai <[email protected]>; Shevchenko, Andriy <[email protected]>; Tham, Mun Yew <[email protected]>; Swee, Leong Ching <[email protected]>; G Thomas, Rohan <[email protected]>; Shevchenko Andriy <[email protected]>
Subject: Re: [Enable Designware XGMAC VLAN Stripping Feature 1/2] dt-bindings:
net: snps,dwmac: Add description for rx-vlan-offload

Quoted 6 lines · On 21/07/2023 08:26, [email protected] wrote:

From: Boon Khai Ng <[email protected]>

This patch is to add the dts setting for the MAC controller on synopsys 10G Ethernet MAC which allow the 10G MAC to turn on hardware accelerated VLAN stripping. Once the hardware accelerated VLAN stripping is turn on, the VLAN tag will be stripped by the

Quoted 5 lines
Quoted 2 lines

Subject prefix is totally bogus.

Which part? It's a 10G Ethernet IP from Sysnopsys, in Roman character it is X (mean 10), so XGMAC. Even the driver file I'm editing it is dw"xgmac".

Everything in [].

Quoted 13 lines
Quoted 4 lines
Quoted 4 lines

10G Ethernet MAC.

Quoted 8 lines
Quoted 2 lines

Please use scripts/get_maintainers.pl to get a list of necessary people and lists to CC. It might happen, that command when run on an older kernel, gives you outdated entries. Therefore please be sure you base your patches on recent Linux kernel.

Quoted 6 lines

This is based on net-next repository suggested by the get maintainer script.

I got the latest net-next just now at the Commit-id b44693495af8 which just committed yesterday.

$ ./scripts/get_maintainer.pl  --scm  -f drivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c

That's not how you run it. get_maintainers.pl should be run on patches or on all files, not just some selection.

Quoted 18 lines

Giuseppe Cavallaro <[email protected]> (supporter:STMMAC ETHERNET DRIVER) Alexandre Torgue <[email protected]> (supporter:STMMAC ETHERNET DRIVER) Jose Abreu <[email protected]> (supporter:STMMAC ETHERNET DRIVER) "David S. Miller" <[email protected]> (maintainer:NETWORKING DRIVERS) Eric Dumazet <[email protected]> (maintainer:NETWORKING DRIVERS) Jakub Kicinski <[email protected]> (maintainer:NETWORKING DRIVERS) Paolo Abeni <[email protected]> (maintainer:NETWORKING DRIVERS) Maxime Coquelin <[email protected]> (maintainer:ARM/STM32 ARCHITECTURE) Richard Cochran <[email protected]> (maintainer:PTP HARDWARE CLOCK SUPPORT) [email protected] (open list:STMMAC ETHERNET DRIVER) [email protected] (moderated list:ARM/STM32 ARCHITECTURE) [email protected] (moderated list:ARM/STM32 ARCHITECTURE) [email protected] (open list)
git git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net.git
git git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next.git
git git://git.kernel.org/pub/scm/linux/kernel/git/atorgue/stm32.git stm32-next git git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git

Quoted 8 lines
Quoted 5 lines

You missed at least DT list (maybe more), so this won't be tested by automated tooling. Performing review on untested code might be a waste of time, thus I will skip this patch entirely till you follow the process allowing the patch to be tested.

This is a new device bringup, thus the DT is not available yet. The DTS will be upstreamed by my another colleague, unless, if I can upstream only my part on the setting?

You are mixing now DTS and DT bindings. Sorry, we do not talk about DTS.

Follow our process of submitting patches. For sure there are folks in Intel which can explain it to you.

Best regards,
Krzysztof

#5 lore raw

RE: [Enable Designware XGMAC VLAN Stripping Feature 1/2] dt-bindings: net: snps,dwmac: Add description for rx-vlan-offload

Quoted 118 lines

-----Original Message-----
From: Krzysztof Kozlowski <[email protected]>
Sent: Saturday, July 22, 2023 12:22 AM
To: Ng, Boon Khai <[email protected]>; [email protected]; [email protected]; Giuseppe Cavallaro <[email protected]>; Alexandre Torgue <[email protected]>; Jose Abreu <[email protected]>; David S . Miller <[email protected]>; Eric Dumazet <[email protected]>; Jakub Kicinski <[email protected]>; Paolo Abeni <[email protected]>; Maxime Coquelin <[email protected]>; [email protected]; linux-stm32@st- md-mailman.stormreply.com; [email protected]; linux- [email protected]
Cc: Shevchenko, Andriy <[email protected]>; Tham, Mun Yew <[email protected]>; Swee, Leong Ching <[email protected]>; G Thomas, Rohan <[email protected]>; Shevchenko Andriy <[email protected]>
Subject: Re: [Enable Designware XGMAC VLAN Stripping Feature 1/2] dt-
bindings: net: snps,dwmac: Add description for rx-vlan-offload

Quoted 9 lines · Boon Khai
Quoted 9 lines

-----Original Message-----
From: Krzysztof Kozlowski <[email protected]>
Sent: Friday, July 21, 2023 6:11 PM
To: [email protected]; [email protected]; "Ng <boon.khai.ng"@intel.com; Giuseppe Cavallaro <[email protected]>; Alexandre Torgue <[email protected]>; Jose Abreu <[email protected]>; David S . Miller <[email protected]>; Eric Dumazet <[email protected]>; Jakub Kicinski <[email protected]>; Paolo

Abeni

Quoted 1 line
Quoted 1 line

<[email protected]>; Maxime Coquelin

<[email protected]>;

Quoted 9 lines
Quoted 9 lines

[email protected]; linux-stm32@st-md- mailman.stormreply.com; [email protected]; linux- [email protected]
Cc: Ng, Boon Khai <[email protected]>; Shevchenko, Andriy <[email protected]>; Tham, Mun Yew <[email protected]>; Swee, Leong Ching <[email protected]>; G Thomas, Rohan <[email protected]>; Shevchenko Andriy <[email protected]>
Subject: Re: [Enable Designware XGMAC VLAN Stripping Feature 1/2] dt-

bindings:

Quoted 10 lines
Quoted 10 lines

net: snps,dwmac: Add description for rx-vlan-offload

Quoted 6 lines · On 21/07/2023 08:26, [email protected] wrote:

From: Boon Khai Ng <[email protected]>

This patch is to add the dts setting for the MAC controller on synopsys 10G Ethernet MAC which allow the 10G MAC to turn on hardware accelerated VLAN stripping. Once the hardware accelerated VLAN stripping is turn on, the VLAN tag will be stripped by the

Quoted 4 lines
Quoted 2 lines

Subject prefix is totally bogus.

Which part? It's a 10G Ethernet IP from Sysnopsys, in Roman character it is

X (mean 10), so XGMAC.

Quoted 1 line

Even the driver file I'm editing it is dw"xgmac".

Everything in [].

Quoted 13 lines
Quoted 4 lines
Quoted 4 lines

10G Ethernet MAC.

Quoted 8 lines
Quoted 2 lines

Please use scripts/get_maintainers.pl to get a list of necessary people and lists to CC. It might happen, that command when run on an older kernel, gives you outdated entries. Therefore please be sure you base your patches on recent Linux kernel.

Quoted 7 lines

This is based on net-next repository suggested by the get maintainer script.

I got the latest net-next just now at the Commit-id b44693495af8 which just committed yesterday.

$ ./scripts/get_maintainer.pl  --scm  -f
drivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c

That's not how you run it. get_maintainers.pl should be run on patches or on all files, not just some selection.

Quoted 1 line

Giuseppe Cavallaro <[email protected]> (supporter:STMMAC

ETHERNET

Quoted 2 lines

DRIVER) Alexandre Torgue <[email protected]> (supporter:STMMAC ETHERNET DRIVER) Jose Abreu

<[email protected]>

Quoted 2 lines

(supporter:STMMAC ETHERNET DRIVER) "David S. Miller" <[email protected]> (maintainer:NETWORKING DRIVERS) Eric

Dumazet

Quoted 1 line

<[email protected]> (maintainer:NETWORKING DRIVERS) Jakub

Kicinski

Quoted 2 lines

<[email protected]> (maintainer:NETWORKING DRIVERS) Paolo Abeni <[email protected]> (maintainer:NETWORKING DRIVERS) Maxime

Coquelin

Quoted 19 lines

<[email protected]> (maintainer:ARM/STM32 ARCHITECTURE) Richard Cochran <[email protected]> (maintainer:PTP HARDWARE CLOCK SUPPORT) [email protected] (open list:STMMAC ETHERNET DRIVER) [email protected] (moderated list:ARM/STM32 ARCHITECTURE) [email protected] (moderated list:ARM/STM32 ARCHITECTURE) [email protected] (open list) git
git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net.git
git git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next.git
git git://git.kernel.org/pub/scm/linux/kernel/git/atorgue/stm32.git
stm32-next git
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git

Quoted 5 lines

You missed at least DT list (maybe more), so this won't be tested by automated tooling. Performing review on untested code might be a waste of time, thus I will skip this patch entirely till you follow the process allowing the patch to be tested.

Quoted 9 lines
Quoted 2 lines

This is a new device bringup, thus the DT is not available yet. The DTS will be upstreamed by my another colleague, unless, if I can upstream

only my part on the setting?

You are mixing now DTS and DT bindings. Sorry, we do not talk about DTS.

Follow our process of submitting patches. For sure there are folks in Intel which can explain it to you.

Ah see, so you were saying I'm missing the cc list of the maintainer related to the DT binding.

Quoted 3 lines

Best regards,
Krzysztof

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

maintainer
#6 lore raw

Re: [Enable Designware XGMAC VLAN Stripping Feature 1/2] dt-bindings: net: snps,dwmac: Add description for rx-vlan-offload

In reply to Krzysztof Kozlowski
Quoted 4 lines · On Fri, 21 Jul 2023 18:21:32 +0200 Krzysztof Kozlowski wrote:
Quoted 1 line
$ ./scripts/get_maintainer.pl  --scm  -f drivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c  

That's not how you run it. get_maintainers.pl should be run on patches or on all files, not just some selection.

Adding Joe for visibility (I proposed to print a warning when people do this and IIRC he wasn't on board).

maintainer
#7 lore raw

Re: [Enable Designware XGMAC VLAN Stripping Feature 1/2] dt-bindings: net: snps,dwmac: Add description for rx-vlan-offload

Quoted 8 lines · Jakub Kicinski
Quoted 4 lines · On Fri, 21 Jul 2023 18:21:32 +0200 Krzysztof Kozlowski wrote:
Quoted 1 line
$ ./scripts/get_maintainer.pl  --scm  -f drivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c  

That's not how you run it. get_maintainers.pl should be run on patches or on all files, not just some selection.

Adding Joe for visibility (I proposed to print a warning when people do this and IIRC he wasn't on board).

What's the issue here? Other than _how_ the script was used, I don't see an actual problem with the script itself.

https://lore.kernel.org/lkml/[email protected]/

As far as I can tell, the patch series address list was identical for the 0/2, 1/2, and 2/2 submissions:

--------------------------------

0/2:

From: [email protected], [email protected], "Ng <boon.khai.ng"@intel.com
To: Giuseppe Cavallaro <[email protected]>,
Alexandre Torgue <[email protected]>,
Jose Abreu <[email protected]>,
"David S . Miller" <[email protected]>,
Eric Dumazet <[email protected]>,
Jakub Kicinski <[email protected]>, Paolo Abeni <[email protected]>, Maxime Coquelin <[email protected]>,
[email protected], [email protected], [email protected],
[email protected]
Cc: Boon Khai Ng <[email protected]>,
Shevchenko Andriy <[email protected]>,
Mun Yew Tham <[email protected]>,
Leong Ching Swee <[email protected]>,
G Thomas Rohan <[email protected]>,
Shevchenko Andriy <[email protected]>
Subject: [Enable Designware XGMAC VLAN Stripping Feature 0/2]

1/2:

From: [email protected], [email protected], "Ng <boon.khai.ng"@intel.com
To: Giuseppe Cavallaro <[email protected]>,
Alexandre Torgue <[email protected]>,
Jose Abreu <[email protected]>,
"David S . Miller" <[email protected]>,
Eric Dumazet <[email protected]>,
Jakub Kicinski <[email protected]>, Paolo Abeni <[email protected]>,
Maxime Coquelin <[email protected]>,
[email protected], [email protected], [email protected],
[email protected]
Cc: Boon Khai Ng <[email protected]>,
Shevchenko Andriy <[email protected]>,
Mun Yew Tham <[email protected]>,
Leong Ching Swee <[email protected]>,
G Thomas Rohan <[email protected]>,
Shevchenko Andriy <[email protected]>
Subject: [Enable Designware XGMAC VLAN Stripping Feature 1/2] dt-bindings: net: snps,dwmac: Add description for rx-vlan-offload

2/2:

From: [email protected], [email protected], "Ng <boon.khai.ng"@intel.com
To: Giuseppe Cavallaro <[email protected]>,
Alexandre Torgue <[email protected]>,
Jose Abreu <[email protected]>,
"David S . Miller" <[email protected]>,
Eric Dumazet <[email protected]>,
Jakub Kicinski <[email protected]>, Paolo Abeni <[email protected]>,
Maxime Coquelin <[email protected]>,
[email protected], [email protected],
[email protected],
[email protected]
Cc: Boon Khai Ng <[email protected]>,
Shevchenko Andriy <[email protected]>,
Mun Yew Tham <[email protected]>,
Leong Ching Swee <[email protected]>,
G Thomas Rohan <[email protected]>,
Shevchenko Andriy <[email protected]>
Subject: [Enable Designware XGMAC VLAN Stripping Feature 2/2] net: stmmac: dwxgmac2: Add support for HW-accelerated VLAN Stripping

--------------------------------

vger has a limit on the number of recipients for a single email so patch series that cc all possible recipients can be bounced and not forwarded by vger.

So I think when submitting a patch series, it's necessary to send just the cover letter to all mailing lists for all files/paths modified by any file in the patch series and specific patches are sent to maintainers, reviewers and the specific mailing lists modified by the specific patch.

I use the scripts below to send patch series where a patch series are the only files in individual directories.

(Well I used to use, I'm not actively reading or creating kernel patches right now)

$ cat ~/bin/to.sh
#!/bin/bash

opts="--nogit --nogit-fallback --norolestats --pattern-depth=1"

if [[ $(basename $1) =~ ^0000- ]] ; then

    ./scripts/get_maintainer.pl --nom $opts  $(dirname $1)/*
else
    maint=$(./scripts/get_maintainer.pl --nol $opts $1)
    if [ "$maint" == "" ] ; then
	echo "[email protected]"
    else
	echo "$maint"
    fi

fi

$ cat ~/bin/cc.sh
#!/bin/bash

opts="--nogit --nogit-fallback --norolestats"
maint_file=$(mktemp -t XXXXXXXX.cc)

if [[ $(basename $1) =~ ^0000- ]] ; then

    ./scripts/get_maintainer.pl $opts $(dirname $1)/* |  \
	~/bin/remove_undesirable_emails.sh > $maint_file
    count=$(wc -c $maint_file | cut -f1 -d" ")
    if [[ $count -lt 512 ]] ; then
	cat $maint_file
    else
	./scripts/get_maintainer.pl -nom -nor $opts $(dirname $1)/* | \
	    ~/bin/remove_undesirable_emails.sh
    fi
else
    ./scripts/get_maintainer.pl $opts $1 | \
	~/bin/remove_undesirable_emails.sh > $maint_file
    count=$(wc -l $maint_file | cut -f1 -d" ")
    if [[ $count -gt 0 ]] ; then
	cat $maint_file
    else
	./scripts/get_maintainer.pl --git --git-fallback --norolestats $1 | \
	    ~/bin/remove_undesirable_emails.sh
    fi

fi
rm -f $maint_file

$ cat ~/bin/remove_undesirable_emails.sh
grep -vPi "(?:\bIngo\s+Molnar\b)"

$

(nb: Ingo asked not to receive any emails from me)

And these scripts are used with git send-email with a .gitconfig block

[sendemail]
chainreplyto = false
thread = false
suppresscc = self
cccmd = ~/bin/cc.sh
tocmd = ~/bin/to.sh

These scripts would have added 2 mailing lists to patch 0/n:

[email protected] (open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS) [email protected] (open list:ARM/RISC-V/RENESAS ARCHITECTURE)

and it would also have had a different recipient list for 1/2 as well

$ ./scripts/get_maintainer.pl -f Documentation/devicetree/bindings/net/snps,dwmac.yaml
"David S. Miller" <[email protected]> (maintainer:NETWORKING DRIVERS)
Eric Dumazet <[email protected]> (maintainer:NETWORKING DRIVERS)
Jakub Kicinski <[email protected]> (maintainer:NETWORKING DRIVERS)
Paolo Abeni <[email protected]> (maintainer:NETWORKING DRIVERS)
Rob Herring <[email protected]> (maintainer:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS)
Krzysztof Kozlowski <[email protected]> (maintainer:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS)
Conor Dooley <[email protected]> (maintainer:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS)
Richard Cochran <[email protected]> (maintainer:PTP HARDWARE CLOCK SUPPORT)
Geert Uytterhoeven <[email protected]> (supporter:ARM/RISC-V/RENESAS ARCHITECTURE)
Magnus Damm <[email protected]> (supporter:ARM/RISC-V/RENESAS ARCHITECTURE)
Alexandre Torgue <[email protected]> (in file)
Giuseppe Cavallaro <[email protected]> (in file)
Jose Abreu <[email protected]> (in file)
[email protected] (open list:NETWORKING DRIVERS)
[email protected] (open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS)
[email protected] (open list)
[email protected] (open list:ARM/RISC-V/RENESAS ARCHITECTURE)
maintainer
#8 lore raw

Re: [Enable Designware XGMAC VLAN Stripping Feature 1/2] dt-bindings: net: snps,dwmac: Add description for rx-vlan-offload

[clean up the CC list]

Quoted 10 lines · On Fri, 21 Jul 2023 20:32:44 -0700 Joe Perches wrote:
Quoted 6 lines · Jakub Kicinski
Quoted 2 lines · On Fri, 21 Jul 2023 18:21:32 +0200 Krzysztof Kozlowski wrote:

That's not how you run it. get_maintainers.pl should be run on patches or on all files, not just some selection.

Adding Joe for visibility (I proposed to print a warning when people do this and IIRC he wasn't on board).

What's the issue here? Other than _how_ the script was used, I don't see an actual problem with the script itself.

I just CCed you on another case. If people keep using get_maintainers wrong, it *is* an issue with the script.

Quoted 2 lines

I use the scripts below to send patch series where a patch series are the only files in individual directories.

The fact that most people end up wrapping get_maintainers in another script is also a pretty strong indication that the user experience is inadequate.

To be clear - I'm happy to put in the work to make the changes. It's just that from past experience you seem to have strong opinions which run counter to maintainers' needs, and I don't really enjoy writing Perl for the sake of it.

maintainer
#9 lore raw

Re: [Enable Designware XGMAC VLAN Stripping Feature 1/2] dt-bindings: net: snps,dwmac: Add description for rx-vlan-offload

Quoted 8 lines · Jakub Kicinski

[clean up the CC list]

Quoted 5 lines · On Fri, 21 Jul 2023 20:32:44 -0700 Joe Perches wrote:
Quoted 4 lines · Jakub Kicinski
Quoted 2 lines · On Fri, 21 Jul 2023 18:21:32 +0200 Krzysztof Kozlowski wrote:

That's not how you run it. get_maintainers.pl should be run on patches or on all files, not just some selection.

Quoted 8 lines
Quoted 5 lines
Quoted 2 lines

Adding Joe for visibility (I proposed to print a warning when people do this and IIRC he wasn't on board).

What's the issue here? Other than _how_ the script was used, I don't see an actual problem with the script itself.

I just CCed you on another case. If people keep using get_maintainers wrong, it *is* an issue with the script.

Silly. No it's not.

Quoted 6 lines
Quoted 2 lines

I use the scripts below to send patch series where a patch series are the only files in individual directories.

The fact that most people end up wrapping get_maintainers in another script is also a pretty strong indication that the user experience is inadequate.

Not a useful argument. Process and documentation are required.

Quoted 4 lines

To be clear - I'm happy to put in the work to make the changes. It's just that from past experience you seem to have strong opinions which run counter to maintainers' needs, and I don't really enjoy writing Perl for the sake of it.

Does anyone? Knock yourself out doing whatever you like.

I do suggest you instead write wrapper scripts to get the output you want rather than updating the defaults for the script and update the process documentation to let other people know what do to as well.

Something akin to Mario Limonciello's suggestion back in 2022:

https://lore.kernel.org/lkml/[email protected]/

#10 lore raw

Re: [Enable Designware XGMAC VLAN Stripping Feature 1/2] dt-bindings: net: snps,dwmac: Add description for rx-vlan-offload

Hi Joe,

Quoted 8 lines · Joe Perches

I do suggest you instead write wrapper scripts to get the output you want rather than updating the defaults for the script and update the process documentation to let other people know what do to as well.

Something akin to Mario Limonciello's suggestion back in 2022:

https://lore.kernel.org/lkml/[email protected]/

FTR, this is more or less what I am using to generate a script to send out patches:

    OUT=...
    echo git send-email \\ > $OUT
    # Add -cc
    # Wrap comment inside $(: ...)
    # Replace (...) in comment by [...]
    # Replace ] at EOL by ) again
    # Add continuation to EOL
    scripts/get_maintainer.pl $* | \
    tr -d \" | \
    sed -e 's/^/--cc "/' \
        -e 's/ (/" $(: /' \
        -e 's/ (/ [/' -e 's/)/]/' \
        -e 's/]$/)/' \
        -e 's/$/ \\/' | \
    tee -a $OUT
    echo "*[0-9][0-9][0-9][0-9]-*.*" >> $OUT

After generation, I edit the script to
- Replace some --cc by --to,
- Add/remove some people,
and run "source $OUT" to send the patches...

Gr{oetje,eeting}s,

Geert

Signature · 5 lines
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
#11 lore raw

Re: [Enable Designware XGMAC VLAN Stripping Feature 1/2] dt-bindings: net: snps,dwmac: Add description for rx-vlan-offload

Quoted 32 lines · Geert Uytterhoeven

Hi Joe,

Quoted 8 lines · Joe Perches

I do suggest you instead write wrapper scripts to get the output you want rather than updating the defaults for the script and update the process documentation to let other people know what do to as well.

Something akin to Mario Limonciello's suggestion back in 2022:

https://lore.kernel.org/lkml/[email protected]/

FTR, this is more or less what I am using to generate a script to send out patches:

     OUT=...
     echo git send-email \\ > $OUT
     # Add -cc
     # Wrap comment inside $(: ...)
     # Replace (...) in comment by [...]
     # Replace ] at EOL by ) again
     # Add continuation to EOL
     scripts/get_maintainer.pl $* | \
     tr -d \" | \
     sed -e 's/^/--cc "/' \
         -e 's/ (/" $(: /' \
         -e 's/ (/ [/' -e 's/)/]/' \
         -e 's/]$/)/' \
         -e 's/$/ \\/' | \
     tee -a $OUT
     echo "*[0-9][0-9][0-9][0-9]-*.*" >> $OUT
Quoted 6 lines

After generation, I edit the script to
- Replace some --cc by --to,
- Add/remove some people,
and run "source $OUT" to send the patches...

Gr{oetje,eeting}s,

My script is great for single subsystem patches as it gets all the right people but I've found problems whenever it crosses multiple subsystems.

Many subsystem owners want to see the whole series of patches to understand how they interact. So the group of patches needs to be treated together which would need the wrapper to look at all patches instead.

maintainer
#12 lore raw

Re: [Enable Designware XGMAC VLAN Stripping Feature 1/2] dt-bindings: net: snps,dwmac: Add description for rx-vlan-offload

Quoted 40 lines · Mario Limonciello
Quoted 32 lines · Geert Uytterhoeven

Hi Joe,

Quoted 8 lines · Joe Perches

I do suggest you instead write wrapper scripts to get the output you want rather than updating the defaults for the script and update the process documentation to let other people know what do to as well.

Something akin to Mario Limonciello's suggestion back in 2022:

https://lore.kernel.org/lkml/[email protected]/

FTR, this is more or less what I am using to generate a script to send out patches:

     OUT=...
     echo git send-email \\ > $OUT
     # Add -cc
     # Wrap comment inside $(: ...)
     # Replace (...) in comment by [...]
     # Replace ] at EOL by ) again
     # Add continuation to EOL
     scripts/get_maintainer.pl $* | \
     tr -d \" | \
     sed -e 's/^/--cc "/' \
         -e 's/ (/" $(: /' \
         -e 's/ (/ [/' -e 's/)/]/' \
         -e 's/]$/)/' \
         -e 's/$/ \\/' | \
     tee -a $OUT
     echo "*[0-9][0-9][0-9][0-9]-*.*" >> $OUT
Quoted 6 lines

After generation, I edit the script to
- Replace some --cc by --to,
- Add/remove some people,
and run "source $OUT" to send the patches...

Gr{oetje,eeting}s,

Quoted 7 lines

My script is great for single subsystem patches as it gets all the right people but I've found problems whenever it crosses multiple subsystems.

Many subsystem owners want to see the whole series of patches to understand how they interact. So the group of patches needs to be treated together which would need the wrapper to look at all patches instead.

Which can't really work all the time as vger has a recipient limit and subsystem spanning patches frequently exceed that limit.

bcc's don't work well either as the reply-to chain is broken.

No great solution to that.

#13 lore raw

Re: [Enable Designware XGMAC VLAN Stripping Feature 1/2] dt-bindings: net: snps,dwmac: Add description for rx-vlan-offload

Quoted 49 lines · Joe Perches
Quoted 40 lines · Mario Limonciello
Quoted 32 lines · Geert Uytterhoeven

Hi Joe,

Quoted 8 lines · Joe Perches

I do suggest you instead write wrapper scripts to get the output you want rather than updating the defaults for the script and update the process documentation to let other people know what do to as well.

Something akin to Mario Limonciello's suggestion back in 2022:

https://lore.kernel.org/lkml/[email protected]/

FTR, this is more or less what I am using to generate a script to send out patches:

     OUT=...
     echo git send-email \\ > $OUT
     # Add -cc
     # Wrap comment inside $(: ...)
     # Replace (...) in comment by [...]
     # Replace ] at EOL by ) again
     # Add continuation to EOL
     scripts/get_maintainer.pl $* | \
     tr -d \" | \
     sed -e 's/^/--cc "/' \
         -e 's/ (/" $(: /' \
         -e 's/ (/ [/' -e 's/)/]/' \
         -e 's/]$/)/' \
         -e 's/$/ \\/' | \
     tee -a $OUT
     echo "*[0-9][0-9][0-9][0-9]-*.*" >> $OUT
Quoted 6 lines

After generation, I edit the script to
- Replace some --cc by --to,
- Add/remove some people,
and run "source $OUT" to send the patches...

Gr{oetje,eeting}s,

Quoted 7 lines

My script is great for single subsystem patches as it gets all the right people but I've found problems whenever it crosses multiple subsystems.

Many subsystem owners want to see the whole series of patches to understand how they interact. So the group of patches needs to be treated together which would need the wrapper to look at all patches instead.

Quoted 7 lines

Which can't really work all the time as vger has a recipient limit and subsystem spanning patches frequently exceed that limit.

bcc's don't work well either as the reply-to chain is broken.

No great solution to that.

For small patchsets (and recipients list) I recommend:
https://github.com/krzk/tools/blob/master/linux/.bash_aliases_linux#L91

For bigger patchsets - Rob's sendemail identity could work:
https://lore.kernel.org/all/CAL_JsqLubWBr2W3xZPsuPLOGav7CFgBdH=aCfT22F_m0_cx3cQ@mail.gmail.com/
but cover letter has to be treated separately.

Anyway, it is not the case here. This is small patchset and the submitter should run get_maintainers.pl on *the patchset*, not on one chosen file. Running it one one file, ignoring maintainers of all other patches, does not make sense. There is nothing to fix in get_maintainers.pl. I believe our docs are also correct here.

Best regards,
Krzysztof

maintainer
#14 lore raw

PATCH 1/1 scripts: checkpatch: steer people away from using file paths

We repeatedly see noobs misuse get_maintainer by running it on the file paths rather than the patchfile. This leads to authors of changes (quoted commits and commits under Fixes) not getting CCed. These are usually the best reviewers!

The file option should really not be used by noobs, unless they are just trying to find a maintainer to manually contact.

Print a warning when someone tries to use -f and remove the "auto-guessing" of file paths.

This script may break people's "scripts on top of get_maintainer" if they are using -f... but that's the point.

---
This is what I had in mind.

---
 scripts/get_maintainer.pl | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)
scripts/get_maintainer.pl +14 -1
index ab123b498fd9..3635b3d40ebe 100755
@@ -51,6 +51,7 @@ my $output_roles = 0;
 my $output_rolestats = 1;
 my $output_section_maxlen = 50;
 my $scm = 0;
+my $silence_file_warning = 0;
 my $tree = 1;
 my $web = 0;
 my $subsystem = 0;
@@ -267,6 +268,7 @@ if (!GetOptions(
 		'subsystem!' => \$subsystem,
 		'status!' => \$status,
 		'scm!' => \$scm,
+		'silence-file-warning!' => \$silence_file_warning,
 		'tree!' => \$tree,
 		'web!' => \$web,
 		'letters=s' => \$letters,
@@ -544,7 +546,13 @@ foreach my $file (@ARGV) {
     if ($from_filename && (vcs_exists() && !vcs_file_exists($file))) {
 	warn "$P: file '$file' not found in version control $!\n";
     }
-    if ($from_filename || ($file ne "&STDIN" && vcs_file_exists($file))) {
+    if ($from_filename) {
+	if (!$silence_file_warning) {
+	    warn "$P: WARNING: Prefer running the script on patches as "
+	        . "generated by git format-patch. Selecting paths is known "
+		. "to miss recipients!\n";
+	}
+
 	$file =~ s/^\Q${cur_path}\E//;	#strip any absolute path
 	$file =~ s/^\Q${lk_path}\E//;	#or the path to the lk tree
 	push(@files, $file);
@@ -1081,6 +1089,7 @@ version: $V
   --mailmap => use .mailmap file (default: $email_use_mailmap)
   --no-tree => run without a kernel tree
   --self-test => show potential issues with MAINTAINERS file content
+  --silence-file-warning => silence the warning about -f being used (see Notes)
   --version => show version
   --help => show this help information
 
@@ -1089,6 +1098,10 @@ version: $V
    --pattern-depth=0 --remove-duplicates --rolestats]
 
 Notes:
+  Using "-f file" is generally discouraged, running the script on a filepatch
+      (as generated by git format-patch) is usually the right thing to do.
+      Commit message is an integral part of the change and $P
+      will extract additional information from it (keywords, Fixes tags etc.)
   Using "-f directory" may give unexpected results:
       Used with "--git", git signators for _all_ files in and below
           directory are examined as git recurses directories.
Signature · 1 line
2.41.0
#15 lore raw

Re: [PATCH] scripts: checkpatch: steer people away from using file paths

Quoted 5 lines · Jakub Kicinski

We repeatedly see noobs misuse get_maintainer by running it on the file paths rather than the patchfile. This leads to authors of changes (quoted commits and commits under Fixes) not getting CCed. These are usually the best reviewers!

Quoted 8 lines

The file option should really not be used by noobs, unless they are just trying to find a maintainer to manually contact.

Print a warning when someone tries to use -f and remove the "auto-guessing" of file paths.

This script may break people's "scripts on top of get_maintainer" if they are using -f... but that's the point.

Ok, I'll go fix up my local scripts, but you should change your subject line to say "get_maintainer", not "checkpatch" :)

thanks,

greg k-h

maintainer
#16 lore raw

Re: [PATCH] scripts: checkpatch: steer people away from using file paths

Quoted 4 lines · On Tue, 25 Jul 2023 18:53:48 +0200 Greg KH wrote:
Quoted 2 lines

This script may break people's "scripts on top of get_maintainer" if they are using -f... but that's the point.

Ok, I'll go fix up my local scripts,

Which one? I spotted this in your repo but it already seems to use patches:

https://github.com/gregkh/gregkh-linux/blob/master/scripts/generate_cc_list

How do you use this, BTW?

Quoted 2 lines

but you should change your subject
line to say "get_maintainer", not "checkpatch" :)

Ugh, will do :)

#17 lore raw

Re: [PATCH] scripts: checkpatch: steer people away from using file paths

Quoted 10 lines · Jakub Kicinski
Quoted 4 lines · On Tue, 25 Jul 2023 18:53:48 +0200 Greg KH wrote:
Quoted 2 lines

This script may break people's "scripts on top of get_maintainer" if they are using -f... but that's the point.

Ok, I'll go fix up my local scripts,

Which one? I spotted this in your repo but it already seems to use patches:

https://github.com/gregkh/gregkh-linux/blob/master/scripts/generate_cc_list

Oh yeah, it does work on patches. Nevermind, I think I just use the -f version manually when trying to figure out who to blame for a bug report in a specific file :)

Quoted 1 line

How do you use this, BTW?

I do:
- git format-patch to generate the patch series.
- run the generate_cc_list script which creates XXXX.info files (the XXXX being the patch number) that contain the people/lists to cc: on the patch
- git rebase -i on the patch series and edit the changelog description and paste in the XXXX.info file for that specific patch.

Yeah, it's a lot of manual steps, I should use b4 for it, one of these days...

thanks,

greg k-h

maintainer
#18 lore raw

Re: [PATCH] scripts: checkpatch: steer people away from using file paths

Quoted 11 lines · On Tue, 25 Jul 2023 19:25:09 +0200 Greg KH wrote:

I do:
- git format-patch to generate the patch series.
- run the generate_cc_list script which creates XXXX.info files (the XXXX being the patch number) that contain the people/lists to cc: on the patch
- git rebase -i on the patch series and edit the changelog description and paste in the XXXX.info file for that specific patch.

Yeah, it's a lot of manual steps, I should use b4 for it, one of these days...

Oh, neat! I do a similar thing. Modulo the number of steps:

  git rebase --exec './ccer.py --inline'

I was wondering if I was the only one who pastes the Cc: person into the patch, because I'd love to teach get_maintainer to do the --inline thing, instead of carrying my own wrapper...

maintainer
#19 lore raw

Re: [PATCH] scripts: checkpatch: steer people away from using file paths

Quoted 13 lines · Jakub Kicinski
Quoted 11 lines · On Tue, 25 Jul 2023 19:25:09 +0200 Greg KH wrote:

I do:
- git format-patch to generate the patch series.
- run the generate_cc_list script which creates XXXX.info files (the XXXX being the patch number) that contain the people/lists to cc: on the patch
- git rebase -i on the patch series and edit the changelog description and paste in the XXXX.info file for that specific patch.

Yeah, it's a lot of manual steps, I should use b4 for it, one of these days...

Quoted 7 lines

Oh, neat! I do a similar thing. Modulo the number of steps:

  git rebase --exec './ccer.py --inline'

I was wondering if I was the only one who pastes the Cc: person into the patch, because I'd love to teach get_maintainer to do the --inline thing, instead of carrying my own wrapper...

Now for that, you'd want checkpatch or yet another script to do it.

Acked-by on v1 1/1
#20 lore raw

Re: [PATCH] scripts: checkpatch: steer people away from using file paths

In reply to Jakub Kicinski
Quoted 11 lines · Jakub Kicinski

We repeatedly see noobs misuse get_maintainer by running it on the file paths rather than the patchfile. This leads to authors of changes (quoted commits and commits under Fixes) not getting CCed. These are usually the best reviewers!

The file option should really not be used by noobs, unless they are just trying to find a maintainer to manually contact.

Print a warning when someone tries to use -f and remove the "auto-guessing" of file paths.

Quoted 6 lines

This script may break people's "scripts on top of get_maintainer" if they are using -f... but that's the point.

---
This is what I had in mind.

"Anything that can go wrong will go wrong."
https://en.wikipedia.org/wiki/Murphy%27s_law

Therefore:

Best regards,
Krzysztof

maintainer
#21 lore raw

Re: [PATCH] scripts: checkpatch: steer people away from using file paths

In reply to Jakub Kicinski
Quoted 7 lines · Jakub Kicinski

We repeatedly see noobs misuse get_maintainer by running it on the file paths rather than the patchfile. This leads to authors of changes (quoted commits and commits under Fixes) not getting CCed. These are usually the best reviewers!

The file option should really not be used by noobs, unless they are just trying to find a maintainer to manually contact.

noobs is not an appropriate use IMO for a commit message.

Quoted 1 line

This is what I had in mind.

<shrug> I think it's unnecessary and this content should be better described in some process doc.

scripts/get_maintainer.pl

Quoted 1 line
scripts/get_maintainer.pl +0 -0

[]

scripts/get_maintainer.pl foreach my $file (@ARGV) { · line 553

Quoted 10 lines
scripts/get_maintainer.pl +5 -1
@@ -544,7 +546,13 @@ foreach my $file (@ARGV) {
     if ($from_filename && (vcs_exists() && !vcs_file_exists($file))) {
 	warn "$P: file '$file' not found in version control $!\n";
     }
-    if ($from_filename || ($file ne "&STDIN" && vcs_file_exists($file))) {
+    if ($from_filename) {
+	if (!$silence_file_warning) {
+	    warn "$P: WARNING: Prefer running the script on patches as "
+	        . "generated by git format-patch. Selecting paths is known "
+		. "to miss recipients!\n";

Don't separate a single output message into multiple lines. Coalesce the string elements.

Also, this should show some reason why this isn't appropriate as a patch to a single file would not have this issue.

e.g.: When a patch series touches multiple files, showing all maintainers is useful. see: <some process doc>

scripts/get_maintainer.pl version: $V · line 1104

Quoted 8 lines
scripts/get_maintainer.pl +4 -0
@@ -1089,6 +1098,10 @@ version: $V
    --pattern-depth=0 --remove-duplicates --rolestats]
 
 Notes:
+  Using "-f file" is generally discouraged, running the script on a filepatch
+      (as generated by git format-patch) is usually the right thing to do.
+      Commit message is an integral part of the change and $P
+      will extract additional information from it (keywords, Fixes tags etc.)

-f <file>

"filepatch" doesn't appear in the kernel at all. Use "patch file".

grammar: The commit message is...

may instead of will

maintainer
#22 lore raw

Re: [PATCH] scripts: checkpatch: steer people away from using file paths

Quoted 14 lines · On Tue, 25 Jul 2023 14:18:15 -0700 Joe Perches wrote:

scripts/get_maintainer.pl foreach my $file (@ARGV) { · line 553

Quoted 10 lines
scripts/get_maintainer.pl +5 -1
@@ -544,7 +546,13 @@ foreach my $file (@ARGV) {
     if ($from_filename && (vcs_exists() && !vcs_file_exists($file))) {
 	warn "$P: file '$file' not found in version control $!\n";
     }
-    if ($from_filename || ($file ne "&STDIN" && vcs_file_exists($file))) {
+    if ($from_filename) {
+	if (!$silence_file_warning) {
+	    warn "$P: WARNING: Prefer running the script on patches as "
+	        . "generated by git format-patch. Selecting paths is known "
+		. "to miss recipients!\n";  

Don't separate a single output message into multiple lines. Coalesce the string elements.

Quoted 4 lines

Also, this should show some reason why this isn't appropriate as a patch to a single file would not have this issue.

e.g.: When a patch series touches multiple files, showing all maintainers is useful. see: <some process doc>

I tried to do that in --help. Added the "multiple files" one there, too.

Quoted 10 lines

scripts/get_maintainer.pl version: $V · line 1104

Quoted 8 lines
scripts/get_maintainer.pl +4 -0
@@ -1089,6 +1098,10 @@ version: $V
    --pattern-depth=0 --remove-duplicates --rolestats]
 
 Notes:
+  Using "-f file" is generally discouraged, running the script on a filepatch
+      (as generated by git format-patch) is usually the right thing to do.
+      Commit message is an integral part of the change and $P
+      will extract additional information from it (keywords, Fixes tags etc.)  

"filepatch" doesn't appear in the kernel at all. Use "patch file".

I got it the wrong way around. I'll use patchfile (no space) for v2 since that's what's what get_maintainer uses in two other places.

maintainer
#23 lore raw

Re: [PATCH] scripts: checkpatch: steer people away from using file paths

Quoted 15 lines · Jakub Kicinski
Quoted 14 lines · On Tue, 25 Jul 2023 14:18:15 -0700 Joe Perches wrote:

scripts/get_maintainer.pl foreach my $file (@ARGV) { · line 553

Quoted 10 lines
scripts/get_maintainer.pl +5 -1
@@ -544,7 +546,13 @@ foreach my $file (@ARGV) {
     if ($from_filename && (vcs_exists() && !vcs_file_exists($file))) {
 	warn "$P: file '$file' not found in version control $!\n";
     }
-    if ($from_filename || ($file ne "&STDIN" && vcs_file_exists($file))) {
+    if ($from_filename) {
+	if (!$silence_file_warning) {
+	    warn "$P: WARNING: Prefer running the script on patches as "
+	        . "generated by git format-patch. Selecting paths is known "
+		. "to miss recipients!\n";  

Don't separate a single output message into multiple lines. Coalesce the string elements.

Quoted 6 lines
Quoted 4 lines

Also, this should show some reason why this isn't appropriate as a patch to a single file would not have this issue.

e.g.: When a patch series touches multiple files, showing all maintainers is useful. see: <some process doc>

I tried to do that in --help. Added the "multiple files" one there, too.

It'd be more useful in the warning message.
Hardly anyone reads help.

Quoted 14 lines
Quoted 11 lines

scripts/get_maintainer.pl version: $V · line 1104

Quoted 9 lines
scripts/get_maintainer.pl +4 -0
@@ -1089,6 +1098,10 @@ version: $V
    --pattern-depth=0 --remove-duplicates --rolestats]
 
 Notes:
+  Using "-f file" is generally discouraged, running the script on a filepatch
+      (as generated by git format-patch) is usually the right thing to do.
+      Commit message is an integral part of the change and $P
+      will extract additional information from it (keywords, Fixes tags etc.)  

"filepatch" doesn't appear in the kernel at all. Use "patch file".

I got it the wrong way around. I'll use patchfile (no space) for v2 since that's what's what get_maintainer uses in two other places.

#24 lore raw

Re: [Enable Designware XGMAC VLAN Stripping Feature 1/2] dt-bindings: net: snps,dwmac: Add description for rx-vlan-offload

In reply to Ng, Boon Khai
Quoted 4 lines · Boon Khai

This is a new device bringup, thus the DT is not available yet. The DTS will be upstreamed by my another colleague, unless, if I can upstream only my part on the setting?

Quoted 1 line

Please kindly resend and include all necessary To/Cc entries.

To be clear, since you do not agree with my comment you skipped vital lists, this was not tested by automation so it is NAK from me.

Sorry.

Best regards,
Krzysztof

#25 lore raw

RE: [Enable Designware XGMAC VLAN Stripping Feature 1/2] dt-bindings: net: snps,dwmac: Add description for rx-vlan-offload

Quoted 23 lines

-----Original Message-----
From: Krzysztof Kozlowski <[email protected]>
Sent: Saturday, July 22, 2023 12:26 AM
To: Ng, Boon Khai <[email protected]>; [email protected]; [email protected]; Giuseppe Cavallaro <[email protected]>; Alexandre Torgue <[email protected]>; Jose Abreu <[email protected]>; David S . Miller <[email protected]>; Eric Dumazet <[email protected]>; Jakub Kicinski <[email protected]>; Paolo Abeni <[email protected]>; Maxime Coquelin <[email protected]>; [email protected]; linux-stm32@st- md-mailman.stormreply.com; [email protected]; linux- [email protected]
Cc: Shevchenko, Andriy <[email protected]>; Tham, Mun Yew <[email protected]>; Swee, Leong Ching <[email protected]>; G Thomas, Rohan <[email protected]>; Shevchenko Andriy <[email protected]>
Subject: Re: [Enable Designware XGMAC VLAN Stripping Feature 1/2] dt-
bindings: net: snps,dwmac: Add description for rx-vlan-offload

Quoted 2 lines · Boon Khai

This is a new device bringup, thus the DT is not available yet. The DTS will be upstreamed by my another colleague, unless, if I can upstream

Quoted 9 lines

only my part on the setting?

Quoted 2 lines
Quoted 2 lines

Please kindly resend and include all necessary To/Cc entries.

To be clear, since you do not agree with my comment you skipped vital lists, this was not tested by automation so it is NAK from me.

Sorry.

I understand that I already get a NAK at the beginning. But I don’t understand why, Please don’t get me wrong, I'm not disagreeing your comments, was trying to understand the reason behind and also which are the step that I made a mistake(s) on, this is to help me to learn at the same time to smoothen the upstreaming process.

Quoted 2 lines

Best regards,
Krzysztof

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

#26 lore raw

Re: [Enable Designware XGMAC VLAN Stripping Feature 1/2] dt-bindings: net: snps,dwmac: Add description for rx-vlan-offload

In reply to [email protected]
Quoted 7 lines · On Fri, Jul 21, 2023 at 02:26:16PM +0800, [email protected] wrote:

From: Boon Khai Ng <[email protected]>

This patch is to add the dts setting for the MAC controller on synopsys 10G Ethernet MAC which allow the 10G MAC to turn on hardware accelerated VLAN stripping. Once the hardware accelerated VLAN stripping is turn on, the VLAN tag will be stripped by the 10G Ethernet MAC.

...

Quoted 1 line

This is wrong:
- I never reviewed DT bindings in all your series.
- My name for the patches is also wrong.

P.S. What I mentioned in the internal mail is that you can add my tag to
the code, and not to the DT. Sorry, I probably hadn't been clear.

Signature · 9 lines
With Best Regards,
Andy Shevchenko



_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
#27 lore raw

RE: [Enable Designware XGMAC VLAN Stripping Feature 1/2] dt-bindings: net: snps,dwmac: Add description for rx-vlan-offload

Quoted 28 lines

-----Original Message-----
From: Shevchenko, Andriy <[email protected]>
Sent: Friday, July 21, 2023 6:18 PM
Cc: Giuseppe Cavallaro <[email protected]>; Alexandre Torgue <[email protected]>; Jose Abreu <[email protected]>; David S . Miller <[email protected]>; Eric Dumazet <[email protected]>; Jakub Kicinski <[email protected]>; Paolo Abeni <[email protected]>; Maxime Coquelin <[email protected]>; [email protected]; [email protected]; [email protected]; [email protected]; Ng, Boon Khai <[email protected]>; Tham, Mun Yew <[email protected]>; Swee, Leong Ching <[email protected]>; G Thomas, Rohan <[email protected]>
Subject: Re: [Enable Designware XGMAC VLAN Stripping Feature 1/2] dt-
bindings: net: snps,dwmac: Add description for rx-vlan-offload

Quoted 7 lines · On Fri, Jul 21, 2023 at 02:26:16PM +0800, [email protected] wrote:

From: Boon Khai Ng <[email protected]>

This patch is to add the dts setting for the MAC controller on synopsys 10G Ethernet MAC which allow the 10G MAC to turn on hardware accelerated VLAN stripping. Once the hardware accelerated VLAN stripping is turn on, the VLAN tag will be stripped by the 10G Ethernet MAC.

...

Quoted 9 lines
Quoted 1 line

This is wrong:
- I never reviewed DT bindings in all your series.
- My name for the patches is also wrong.

P.S. What I mentioned in the internal mail is that you can add my tag to
the code, and not to the DT. Sorry, I probably hadn't been clear.

My bad, sorry for interpreting the meaning wrongly, I will remove all the "Reviewed-by" stamp from all the DT patches on the next update.

However I copied the Reviewed-by: from the previous email, your name Shouldn't be wrong.

Quoted 4 lines

--
With Best Regards,
Andy Shevchenko

#28 lore raw

Re: [Enable Designware XGMAC VLAN Stripping Feature 1/2] dt-bindings: net: snps,dwmac: Add description for rx-vlan-offload

Quoted 4 lines · Boon Khai
Quoted 4 lines

From: Shevchenko, Andriy <[email protected]>
Sent: Friday, July 21, 2023 6:18 PM

Quoted 1 line · On Fri, Jul 21, 2023 at 02:26:16PM +0800, [email protected] wrote:

From: Boon Khai Ng <[email protected]>

...

Quoted 6 lines
Quoted 6 lines
Quoted 1 line

This is wrong:
- I never reviewed DT bindings in all your series.
- My name for the patches is also wrong.

Quoted 8 lines
Quoted 2 lines

P.S. What I mentioned in the internal mail is that you can add my tag to
the code, and not to the DT. Sorry, I probably hadn't been clear.

My bad, sorry for interpreting the meaning wrongly, I will remove all the "Reviewed-by" stamp from all the DT patches on the next update.

However I copied the Reviewed-by: from the previous email, your name Shouldn't be wrong.

Oh, this is a bit messy. The address for the kernel work should be Andy Shevchenko <[email protected]>

Signature · 2 lines
With Best Regards,
Andy Shevchenko
#29 lore raw

RE: [Enable Designware XGMAC VLAN Stripping Feature 1/2] dt-bindings: net: snps,dwmac: Add description for rx-vlan-offload

Quoted 35 lines

-----Original Message-----
From: Shevchenko, Andriy <[email protected]>
Sent: Friday, July 21, 2023 11:49 PM
To: Ng, Boon Khai <[email protected]>
Cc: Giuseppe Cavallaro <[email protected]>; Alexandre Torgue <[email protected]>; Jose Abreu <[email protected]>; David S . Miller <[email protected]>; Eric Dumazet <[email protected]>; Jakub Kicinski <[email protected]>; Paolo Abeni <[email protected]>; Maxime Coquelin <[email protected]>; [email protected]; [email protected]; [email protected]; [email protected]; Tham, Mun Yew <[email protected]>; Swee, Leong Ching <[email protected]>; G Thomas, Rohan <[email protected]>
Subject: Re: [Enable Designware XGMAC VLAN Stripping Feature 1/2] dt-
bindings: net: snps,dwmac: Add description for rx-vlan-offload

Quoted 3 lines · Boon Khai
Quoted 3 lines

From: Shevchenko, Andriy <[email protected]>
Sent: Friday, July 21, 2023 6:18 PM
On Fri, Jul 21, 2023 at 02:26:16PM +0800, [email protected]

Quoted 1 line · wrote:
Quoted 1 line
Quoted 1 line

From: Boon Khai Ng <[email protected]>

...

Quoted 9 lines
Quoted 8 lines
Quoted 1 line

This is wrong:
- I never reviewed DT bindings in all your series.
- My name for the patches is also wrong.

P.S. What I mentioned in the internal mail is that you can add my tag to
the code, and not to the DT. Sorry, I probably hadn't been clear.

Quoted 9 lines
Quoted 5 lines

My bad, sorry for interpreting the meaning wrongly, I will remove all the "Reviewed-by" stamp from all the DT patches on the next update.

However I copied the Reviewed-by: from the previous email, your name Shouldn't be wrong.

Oh, this is a bit messy. The address for the kernel work should be Andy Shevchenko <[email protected]>

Ah okay, got it. Will update that in the next patch.

Quoted 4 lines

--
With Best Regards,
Andy Shevchenko

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

#30 lore raw

PATCH 2/2 net: stmmac: dwxgmac2: Add support for HW-accelerated VLAN Stripping

In reply to [email protected]

From: Boon Khai Ng <[email protected]>

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.

The setting can be turn on and off at the dts by specifying the dts node with "snps,rx-vlan-offload" The setting can be turn on and off at ethool as well by running the command below:
ethtool -k eth0 rx-vlan-offload on
ethtool -k eth0 rx-vlan-offload off

This implementation was ported from the dwmac4 driver.

---
 .../net/ethernet/stmicro/stmmac/dwxgmac2.h    | 28 ++++++++++++++
 .../ethernet/stmicro/stmmac/dwxgmac2_core.c   | 38 +++++++++++++++++++
 .../ethernet/stmicro/stmmac/dwxgmac2_descs.c  | 18 +++++++++
 drivers/net/ethernet/stmicro/stmmac/hwif.h    | 16 ++++++++
 .../net/ethernet/stmicro/stmmac/stmmac_main.c | 29 +++++++++++---
 .../ethernet/stmicro/stmmac/stmmac_platform.c |  6 +++
 include/linux/stmmac.h                        |  1 +
 7 files changed, 131 insertions(+), 5 deletions(-)
drivers/net/ethernet/stmicro/stmmac/dwxgmac2.h +28 -0
index 153321fe42c3..2a75faf8443b 100644
@@ -431,6 +431,7 @@
 #define XGMAC_TDES2_VTIR		GENMASK(15, 14)
 #define XGMAC_TDES2_VTIR_SHIFT		14
 #define XGMAC_TDES2_B1L			GENMASK(13, 0)
+#define XGMAC_TDES2_VLAN_TAG_MASK	GENMASK(15, 14)
 #define XGMAC_TDES3_OWN			BIT(31)
 #define XGMAC_TDES3_CTXT		BIT(30)
 #define XGMAC_TDES3_FD			BIT(29)
@@ -462,6 +463,8 @@
 #define XGMAC_RDES3_RSV			BIT(26)
 #define XGMAC_RDES3_L34T		GENMASK(23, 20)
 #define XGMAC_RDES3_L34T_SHIFT		20
+#define XGMAC_RDES3_ET_LT		GENMASK(19, 16)
+#define XGMAC_RDES3_ET_LT_SHIFT		16
 #define XGMAC_L34T_IP4TCP		0x1
 #define XGMAC_L34T_IP4UDP		0x2
 #define XGMAC_L34T_IP6TCP		0x9
@@ -471,4 +474,29 @@
 #define XGMAC_RDES3_TSD			BIT(6)
 #define XGMAC_RDES3_TSA			BIT(4)
 
+/* RDES0 (write back format) */
+#define XGMAC_RDES0_VLAN_TAG_MASK	GENMASK(15, 0)
+
+/* MAC VLAN Tag Control */
+#define XGMAC_VLAN_TAG_CTRL_OB		BIT(0)
+#define XGMAC_VLAN_TAG_CTRL_CT		BIT(1)
+#define XGMAC_VLAN_TAG_CTRL_OFS_MASK	GENMASK(6, 2)
+#define XGMAC_VLAN_TAG_CTRL_OFS_SHIFT	2
+#define XGMAC_VLAN_TAG_CTRL_EVLS_MASK	GENMASK(22, 21)
+#define XGMAC_VLAN_TAG_CTRL_EVLS_SHIFT	21
+#define XGMAC_VLAN_TAG_CTRL_EVLRXS	BIT(24)
+
+#define XGMAC_VLAN_TAG_STRIP_NONE	(0x0 << XGMAC_VLAN_TAG_CTRL_EVLS_SHIFT)
+#define XGMAC_VLAN_TAG_STRIP_PASS	(0x1 << XGMAC_VLAN_TAG_CTRL_EVLS_SHIFT)
+#define XGMAC_VLAN_TAG_STRIP_FAIL	(0x2 << XGMAC_VLAN_TAG_CTRL_EVLS_SHIFT)
+#define XGMAC_VLAN_TAG_STRIP_ALL	(0x3 << XGMAC_VLAN_TAG_CTRL_EVLS_SHIFT)
+
+/* Error Type or L2 Type(ET/LT) Field Number */
+#define XGMAC_ET_LT_VLAN_STAG		8
+#define XGMAC_ET_LT_VLAN_CTAG		9
+#define XGMAC_ET_LT_DVLAN_CTAG_CTAG	10
+#define XGMAC_ET_LT_DVLAN_STAG_STAG	11
+#define XGMAC_ET_LT_DVLAN_CTAG_STAG	12
+#define XGMAC_ET_LT_DVLAN_STAG_CTAG	13
+
 #endif /* __STMMAC_DWXGMAC2_H__ */
drivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c +38 -0
index a0c2ef8bb0ac..0f8120427d5c 100644
@@ -6,6 +6,7 @@
 
 #include <linux/bitrev.h>
 #include <linux/crc32.h>
+#include <linux/if_vlan.h>
 #include <linux/iopoll.h>
 #include "stmmac.h"
 #include "stmmac_ptp.h"
@@ -1177,6 +1178,39 @@ static void dwxgmac2_sarc_configure(void __iomem *ioaddr, int val)
 	writel(value, ioaddr + XGMAC_TX_CONFIG);
 }
 
+static void dwxgmac2_rx_hw_vlan(struct net_device *dev,
+				struct mac_device_info *hw,
+				struct dma_desc *rx_desc, struct sk_buff *skb)
+{
+	if ((dev->features & NETIF_F_HW_VLAN_CTAG_RX) &&
+	    hw->desc->get_rx_vlan_valid(rx_desc)) {
+		u16 vid = hw->desc->get_rx_vlan_tci(rx_desc);
+
+		__vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q), vid);
+	}
+}
+
+static void dwxgmac2_set_hw_vlan_mode(void __iomem *ioaddr,
+				      netdev_features_t features)
+{
+	u32 val;
+
+	val = readl(ioaddr + XGMAC_VLAN_TAG);
+	val &= ~XGMAC_VLAN_TAG_CTRL_EVLS_MASK;
+
+	if (features & NETIF_F_HW_VLAN_CTAG_RX)
+		/* Always strip VLAN on Receive */
+		val |= XGMAC_VLAN_TAG_STRIP_ALL;
+	else
+		/* Do not strip VLAN on Receive */
+		val |= XGMAC_VLAN_TAG_STRIP_NONE;
+
+	/* Enable outer VLAN Tag in Rx DMA descriptro */
+	val |= XGMAC_VLAN_TAG_CTRL_EVLRXS;
+
+	writel(val, ioaddr + XGMAC_VLAN_TAG);
+}
+
 static void dwxgmac2_enable_vlan(struct mac_device_info *hw, u32 type)
 {
 	void __iomem *ioaddr = hw->pcsr;
@@ -1501,6 +1535,8 @@ const struct stmmac_ops dwxgmac210_ops = {
 	.set_arp_offload = dwxgmac2_set_arp_offload,
 	.est_configure = dwxgmac3_est_configure,
 	.fpe_configure = dwxgmac3_fpe_configure,
+	.rx_hw_vlan = dwxgmac2_rx_hw_vlan,
+	.set_hw_vlan_mode = dwxgmac2_set_hw_vlan_mode,
 };
 
 static void dwxlgmac2_rx_queue_enable(struct mac_device_info *hw, u8 mode,
@@ -1562,6 +1598,8 @@ const struct stmmac_ops dwxlgmac2_ops = {
 	.set_arp_offload = dwxgmac2_set_arp_offload,
 	.est_configure = dwxgmac3_est_configure,
 	.fpe_configure = dwxgmac3_fpe_configure,
+	.rx_hw_vlan = dwxgmac2_rx_hw_vlan,
+	.set_hw_vlan_mode = dwxgmac2_set_hw_vlan_mode,
 };
 
 int dwxgmac2_setup(struct stmmac_priv *priv)
drivers/net/ethernet/stmicro/stmmac/dwxgmac2_descs.c +18 -0
index fc82862a612c..b8cc17c9c0db 100644
@@ -67,6 +67,22 @@ static int dwxgmac2_get_tx_ls(struct dma_desc *p)
 	return (le32_to_cpu(p->des3) & XGMAC_RDES3_LD) > 0;
 }
 
+static inline int dwxgmac2_wrback_get_rx_vlan_tci(struct dma_desc *p)
+{
+	return le32_to_cpu(p->des0) & XGMAC_RDES0_VLAN_TAG_MASK;
+}
+
+static inline bool dwxgmac2_wrback_get_rx_vlan_valid(struct dma_desc *p)
+{
+	u32 et_lt;
+
+	et_lt = (le32_to_cpu(p->des3) & XGMAC_RDES3_ET_LT) >>
+		XGMAC_RDES3_ET_LT_SHIFT;
+
+	return et_lt >= XGMAC_ET_LT_VLAN_STAG &&
+		et_lt <= XGMAC_ET_LT_DVLAN_STAG_CTAG;
+}
+
 static int dwxgmac2_get_rx_frame_len(struct dma_desc *p, int rx_coe)
 {
 	return (le32_to_cpu(p->des3) & XGMAC_RDES3_PL);
@@ -349,6 +365,8 @@ const struct stmmac_desc_ops dwxgmac210_desc_ops = {
 	.set_tx_owner = dwxgmac2_set_tx_owner,
 	.set_rx_owner = dwxgmac2_set_rx_owner,
 	.get_tx_ls = dwxgmac2_get_tx_ls,
+	.get_rx_vlan_tci = dwxgmac2_wrback_get_rx_vlan_tci,
+	.get_rx_vlan_valid = dwxgmac2_wrback_get_rx_vlan_valid,
 	.get_rx_frame_len = dwxgmac2_get_rx_frame_len,
 	.enable_tx_timestamp = dwxgmac2_enable_tx_timestamp,
 	.get_tx_timestamp_status = dwxgmac2_get_tx_timestamp_status,
drivers/net/ethernet/stmicro/stmmac/hwif.h +16 -0
index 652af8f6e75f..d37fa2400f62 100644
@@ -97,6 +97,10 @@ struct stmmac_desc_ops {
 			     u32 inner_type);
 	void (*set_vlan)(struct dma_desc *p, u32 type);
 	void (*set_tbs)(struct dma_edesc *p, u32 sec, u32 nsec);
+	/* get rx vlan id */
+	int (*get_rx_vlan_tci)(struct dma_desc *p);
+	/* get rx vlan valid status */
+	bool (*get_rx_vlan_valid)(struct dma_desc *p);
 };
 
 #define stmmac_init_rx_desc(__priv, __args...) \
@@ -117,6 +121,10 @@ struct stmmac_desc_ops {
 	stmmac_do_void_callback(__priv, desc, set_tx_ic, __args)
 #define stmmac_get_tx_ls(__priv, __args...) \
 	stmmac_do_callback(__priv, desc, get_tx_ls, __args)
+#define stmmac_get_rx_vlan_tci(__priv, __args...) \
+	stmmac_do_callback(__priv, desc, get_rx_vlan_tci, __args)
+#define stmmac_get_rx_vlan_valid(__priv, __args...) \
+	stmmac_do_callback(__priv, desc, get_rx_vlan_valid, __args)
 #define stmmac_tx_status(__priv, __args...) \
 	stmmac_do_callback(__priv, desc, tx_status, __args)
 #define stmmac_get_tx_len(__priv, __args...) \
@@ -386,6 +394,10 @@ struct stmmac_ops {
 	void (*update_vlan_hash)(struct mac_device_info *hw, u32 hash,
 				 __le16 perfect_match, bool is_double);
 	void (*enable_vlan)(struct mac_device_info *hw, u32 type);
+	void (*rx_hw_vlan)(struct net_device *dev, struct mac_device_info *hw,
+			   struct dma_desc *rx_desc, struct sk_buff *skb);
+	void (*set_hw_vlan_mode)(void __iomem *ioaddr,
+				 netdev_features_t features);
 	int (*add_hw_vlan_rx_fltr)(struct net_device *dev,
 				   struct mac_device_info *hw,
 				   __be16 proto, u16 vid);
@@ -493,6 +505,10 @@ struct stmmac_ops {
 	stmmac_do_void_callback(__priv, mac, update_vlan_hash, __args)
 #define stmmac_enable_vlan(__priv, __args...) \
 	stmmac_do_void_callback(__priv, mac, enable_vlan, __args)
+#define stmmac_rx_hw_vlan(__priv, __args...) \
+	stmmac_do_void_callback(__priv, mac, rx_hw_vlan, __args)
+#define stmmac_set_hw_vlan_mode(__priv, __args...) \
+	stmmac_do_void_callback(__priv, mac, set_hw_vlan_mode, __args)
 #define stmmac_add_hw_vlan_rx_fltr(__priv, __args...) \
 	stmmac_do_callback(__priv, mac, add_hw_vlan_rx_fltr, __args)
 #define stmmac_del_hw_vlan_rx_fltr(__priv, __args...) \
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +24 -5
index e7ca52f0d2f2..2fe58bf3d936 100644
@@ -3451,6 +3451,10 @@ static int stmmac_hw_setup(struct net_device *dev, bool ptp_register)
 			stmmac_fpe_handshake(priv, true);
 	}
 
+	/* Set HW VLAN Stripping mode */
+	if (priv->plat->use_hw_vlan)
+		stmmac_set_hw_vlan_mode(priv, priv->ioaddr, dev->features);
+
 	return 0;
 }
 
@@ -4596,10 +4600,8 @@ static void stmmac_rx_vlan(struct net_device *dev, struct sk_buff *skb)
 	__be16 vlan_proto = veth->h_vlan_proto;
 	u16 vlanid;
 
-	if ((vlan_proto == htons(ETH_P_8021Q) &&
-	     dev->features & NETIF_F_HW_VLAN_CTAG_RX) ||
-	    (vlan_proto == htons(ETH_P_8021AD) &&
-	     dev->features & NETIF_F_HW_VLAN_STAG_RX)) {
+	if (vlan_proto == htons(ETH_P_8021Q) ||
+	    vlan_proto == htons(ETH_P_8021AD)) {
 		/* pop the vlan tag */
 		vlanid = ntohs(veth->h_vlan_TCI);
 		memmove(skb->data + VLAN_HLEN, veth, ETH_ALEN * 2);
@@ -5466,7 +5468,14 @@ static int stmmac_rx(struct stmmac_priv *priv, int limit, u32 queue)
 		/* Got entire packet into SKB. Finish it. */
 
 		stmmac_get_rx_hwtstamp(priv, p, np, skb);
-		stmmac_rx_vlan(priv->dev, skb);
+
+		/* Switch between rx_hw_vlan or rx_vlan */
+		if (priv->plat->use_hw_vlan)
+			stmmac_rx_hw_vlan(priv, priv->dev,
+					  priv->hw, p, skb);
+		else
+			stmmac_rx_vlan(priv->dev, skb);
+
 		skb->protocol = eth_type_trans(skb, priv->dev);
 
 		if (unlikely(!coe))
@@ -5746,6 +5755,9 @@ static int stmmac_set_features(struct net_device *netdev,
 			       netdev_features_t features)
 {
 	struct stmmac_priv *priv = netdev_priv(netdev);
+	netdev_features_t changed;
+
+	changed = netdev->features ^ features;
 
 	/* Keep the COE Type in case of csum is supporting */
 	if (features & NETIF_F_RXCSUM)
@@ -5765,6 +5777,11 @@ static int stmmac_set_features(struct net_device *netdev,
 			stmmac_enable_sph(priv, priv->ioaddr, sph_en, chan);
 	}
 
+	if (changed & NETIF_F_HW_VLAN_CTAG_RX) {
+		stmmac_set_hw_vlan_mode(priv, priv->ioaddr, features);
+		priv->plat->use_hw_vlan = features & NETIF_F_HW_VLAN_CTAG_RX;
+	}
+
 	return 0;
 }
 
@@ -7418,6 +7435,8 @@ int stmmac_dvr_probe(struct device *device,
 #ifdef STMMAC_VLAN_TAG_USED
 	/* Both mac100 and gmac support receive VLAN tag detection */
 	ndev->features |= NETIF_F_HW_VLAN_CTAG_RX | NETIF_F_HW_VLAN_STAG_RX;
+	ndev->hw_features |= NETIF_F_HW_VLAN_CTAG_RX | NETIF_F_HW_VLAN_STAG_RX;
+
 	if (priv->dma_cap.vlhash) {
 		ndev->features |= NETIF_F_HW_VLAN_CTAG_FILTER;
 		ndev->features |= NETIF_F_HW_VLAN_STAG_FILTER;
drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c +6 -0
index 23d53ea04b24..bd7f3326a44c 100644
@@ -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");
+		plat->use_hw_vlan = true;
+	}
+
 	dma_cfg = devm_kzalloc(&pdev->dev, sizeof(*dma_cfg),
 			       GFP_KERNEL);
 	if (!dma_cfg) {
include/linux/stmmac.h +1 -0
index ef67dba775d0..a989c5d82482 100644
@@ -282,6 +282,7 @@ struct plat_stmmacenet_data {
 	int rss_en;
 	int mac_port_sel_speed;
 	int has_xgmac;
+	bool use_hw_vlan;
 	u8 vlan_fail_q;
 	unsigned int eee_usecs_rate;
 	struct pci_dev *pdev;
Signature · 1 line
2.25.1
#31 lore raw

Re: [Enable Designware XGMAC VLAN Stripping Feature 2/2] net: stmmac: dwxgmac2: Add support for HW-accelerated VLAN Stripping

Quoted 8 lines · On 21/07/2023 08:26, [email protected] wrote:

From: Boon Khai Ng <[email protected]>

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.

...

Quoted 8 lines
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +0 -0
 	if (priv->dma_cap.vlhash) {
 		ndev->features |= NETIF_F_HW_VLAN_CTAG_FILTER;
 		ndev->features |= NETIF_F_HW_VLAN_STAG_FILTER;
drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c +0 -0
index 23d53ea04b24..bd7f3326a44c 100644

drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c stmmac_probe_config_dt(struct platform_device *pdev, u8 *mac) · line 548

Quoted 6 lines
drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c +3 -0
@@ -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.

Best regards,
Krzysztof

#32 lore raw

RE: [Enable Designware XGMAC VLAN Stripping Feature 2/2] net: stmmac: dwxgmac2: Add support for HW-accelerated VLAN Stripping

Quoted 42 lines

-----Original Message-----
From: Krzysztof Kozlowski <[email protected]>
Sent: Friday, July 21, 2023 6:11 PM
To: [email protected]; [email protected]; "Ng <boon.khai.ng"@intel.com; Giuseppe Cavallaro <[email protected]>; Alexandre Torgue <[email protected]>; Jose Abreu <[email protected]>; David S . Miller <[email protected]>; Eric Dumazet <[email protected]>; Jakub Kicinski <[email protected]>; Paolo Abeni <[email protected]>; Maxime Coquelin <[email protected]>; [email protected]; linux-stm32@st- md-mailman.stormreply.com; [email protected]; linux- [email protected]
Cc: Ng, Boon Khai <[email protected]>; Shevchenko, Andriy <[email protected]>; Tham, Mun Yew <[email protected]>; Swee, Leong Ching <[email protected]>; G Thomas, Rohan <[email protected]>; Shevchenko Andriy <[email protected]>
Subject: Re: [Enable Designware XGMAC VLAN Stripping Feature 2/2] net:
stmmac: dwxgmac2: Add support for HW-accelerated VLAN Stripping

Quoted 7 lines · On 21/07/2023 08:26, [email protected] wrote:

From: Boon Khai Ng <[email protected]>

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.

...

drivers/net/ethernet/stmicro/stmmac/stmmac_main.c int stmmac_dvr_probe(struct device *device,

Quoted 3 lines
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +0 -0
 	if (priv->dma_cap.vlhash) {
 		ndev->features |= NETIF_F_HW_VLAN_CTAG_FILTER;
 		ndev->features |= NETIF_F_HW_VLAN_STAG_FILTER; diff --

git

drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c stmmac_probe_config_dt(struct platform_device

Quoted 6 lines

a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c index 23d53ea04b24..bd7f3326a44c 100644

drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c +0 -0
@@ -543,6 +543,12 @@ stmmac_probe_config_dt(struct platform_device

*pdev, u8 *mac)

Quoted 9 lines

drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c stmmac_probe_config_dt(struct platform_device *pdev, u8 *mac) · line 548

Quoted 6 lines
drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c +3 -0
 			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?

Quoted 4 lines

Best regards,
Krzysztof

#33 lore raw

Re: [Enable Designware XGMAC VLAN Stripping Feature 2/2] net: stmmac: dwxgmac2: Add support for HW-accelerated VLAN Stripping

Quoted 52 lines · Boon Khai
Quoted 42 lines

-----Original Message-----
From: Krzysztof Kozlowski <[email protected]>
Sent: Friday, July 21, 2023 6:11 PM
To: [email protected]; [email protected]; "Ng <boon.khai.ng"@intel.com; Giuseppe Cavallaro <[email protected]>; Alexandre Torgue <[email protected]>; Jose Abreu <[email protected]>; David S . Miller <[email protected]>; Eric Dumazet <[email protected]>; Jakub Kicinski <[email protected]>; Paolo Abeni <[email protected]>; Maxime Coquelin <[email protected]>; [email protected]; linux-stm32@st- md-mailman.stormreply.com; [email protected]; linux- [email protected]
Cc: Ng, Boon Khai <[email protected]>; Shevchenko, Andriy <[email protected]>; Tham, Mun Yew <[email protected]>; Swee, Leong Ching <[email protected]>; G Thomas, Rohan <[email protected]>; Shevchenko Andriy <[email protected]>
Subject: Re: [Enable Designware XGMAC VLAN Stripping Feature 2/2] net:
stmmac: dwxgmac2: Add support for HW-accelerated VLAN Stripping

Quoted 7 lines · On 21/07/2023 08:26, [email protected] wrote:

From: Boon Khai Ng <[email protected]>

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.

...

Quoted 3 lines
  	if (priv->dma_cap.vlhash) {
  		ndev->features |= NETIF_F_HW_VLAN_CTAG_FILTER;
  		ndev->features |= NETIF_F_HW_VLAN_STAG_FILTER; diff --

git

drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c stmmac_probe_config_dt(struct platform_device

Quoted 6 lines

a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c index 23d53ea04b24..bd7f3326a44c 100644

drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c +0 -0
@@ -543,6 +543,12 @@ stmmac_probe_config_dt(struct platform_device

*pdev, u8 *mac)

Quoted 9 lines

drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c stmmac_probe_config_dt(struct platform_device *pdev, u8 *mac) · line 548

Quoted 6 lines
drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c +3 -0
  			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.

Quoted 4 lines

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).

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.

Signature · 1 line
Florian
#34 lore raw

RE: [Enable Designware XGMAC VLAN Stripping Feature 2/2] net: stmmac: dwxgmac2: Add support for HW-accelerated VLAN Stripping

Quoted 76 lines

-----Original Message-----
From: Florian Fainelli <[email protected]>
Sent: Friday, July 21, 2023 11:59 PM
To: Ng, Boon Khai <[email protected]>; Krzysztof Kozlowski <[email protected]>; [email protected]; [email protected]; Ng, Boon Khai <[email protected]>; Giuseppe Cavallaro <[email protected]>; Alexandre Torgue <[email protected]>; Jose Abreu <[email protected]>; David S . Miller <[email protected]>; Eric Dumazet <[email protected]>; Jakub Kicinski <[email protected]>; Paolo Abeni <[email protected]>; Maxime Coquelin <[email protected]>; [email protected]; linux-stm32@st-md- mailman.stormreply.com; [email protected]; linux- [email protected]
Cc: Shevchenko, Andriy <[email protected]>; Tham, Mun Yew <[email protected]>; Swee, Leong Ching <[email protected]>; G Thomas, Rohan <[email protected]>; Shevchenko Andriy <[email protected]>
Subject: Re: [Enable Designware XGMAC VLAN Stripping Feature 2/2] net:
stmmac: dwxgmac2: Add support for HW-accelerated VLAN Stripping

Quoted 52 lines · Boon Khai
Quoted 51 lines

-----Original Message-----
From: Krzysztof Kozlowski <[email protected]>
Sent: Friday, July 21, 2023 6:11 PM
To: [email protected]; [email protected]; "Ng <boon.khai.ng"@intel.com; Giuseppe Cavallaro <[email protected]>; Alexandre Torgue <[email protected]>; Jose Abreu <[email protected]>; David S . Miller <[email protected]>; Eric Dumazet <[email protected]>; Jakub Kicinski <[email protected]>; Paolo Abeni <[email protected]>; Maxime Coquelin <[email protected]>; [email protected]; linux-stm32@st- md-mailman.stormreply.com; [email protected]; linux- [email protected]
Cc: Ng, Boon Khai <[email protected]>; Shevchenko, Andriy <[email protected]>; Tham, Mun Yew <[email protected]>; Swee, Leong Ching <[email protected]>; G Thomas, Rohan <[email protected]>; Shevchenko Andriy <[email protected]>
Subject: Re: [Enable Designware XGMAC VLAN Stripping Feature 2/2] net:
stmmac: dwxgmac2: Add support for HW-accelerated VLAN Stripping

Quoted 7 lines · On 21/07/2023 08:26, [email protected] wrote:

From: Boon Khai Ng <[email protected]>

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.

...

Quoted 3 lines
  	if (priv->dma_cap.vlhash) {
  		ndev->features |= NETIF_F_HW_VLAN_CTAG_FILTER;
  		ndev->features |= NETIF_F_HW_VLAN_STAG_FILTER; diff --

git

drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c stmmac_probe_config_dt(struct platform_device

Quoted 6 lines

a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c index 23d53ea04b24..bd7f3326a44c 100644

drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c +0 -0
@@ -543,6 +543,12 @@ stmmac_probe_config_dt(struct platform_device

*pdev, u8 *mac)

drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c stmmac_probe_config_dt(struct platform_device *pdev, u8 *mac) · line 548

Quoted 6 lines
drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c +3 -0
  			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.

Quoted 9 lines
Quoted 4 lines

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?

Quoted 5 lines

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

#35 lore raw

Re: [Enable Designware XGMAC VLAN Stripping Feature 2/2] net: stmmac: dwxgmac2: Add support for HW-accelerated VLAN Stripping

Quoted 86 lines · Boon Khai
Quoted 76 lines

-----Original Message-----
From: Florian Fainelli <[email protected]>
Sent: Friday, July 21, 2023 11:59 PM
To: Ng, Boon Khai <[email protected]>; Krzysztof Kozlowski <[email protected]>; [email protected]; [email protected]; Ng, Boon Khai <[email protected]>; Giuseppe Cavallaro <[email protected]>; Alexandre Torgue <[email protected]>; Jose Abreu <[email protected]>; David S . Miller <[email protected]>; Eric Dumazet <[email protected]>; Jakub Kicinski <[email protected]>; Paolo Abeni <[email protected]>; Maxime Coquelin <[email protected]>; [email protected]; linux-stm32@st-md- mailman.stormreply.com; [email protected]; linux- [email protected]
Cc: Shevchenko, Andriy <[email protected]>; Tham, Mun Yew <[email protected]>; Swee, Leong Ching <[email protected]>; G Thomas, Rohan <[email protected]>; Shevchenko Andriy <[email protected]>
Subject: Re: [Enable Designware XGMAC VLAN Stripping Feature 2/2] net:
stmmac: dwxgmac2: Add support for HW-accelerated VLAN Stripping

Quoted 52 lines · Boon Khai
Quoted 51 lines

-----Original Message-----
From: Krzysztof Kozlowski <[email protected]>
Sent: Friday, July 21, 2023 6:11 PM
To: [email protected]; [email protected]; "Ng <boon.khai.ng"@intel.com; Giuseppe Cavallaro <[email protected]>; Alexandre Torgue <[email protected]>; Jose Abreu <[email protected]>; David S . Miller <[email protected]>; Eric Dumazet <[email protected]>; Jakub Kicinski <[email protected]>; Paolo Abeni <[email protected]>; Maxime Coquelin <[email protected]>; [email protected]; linux-stm32@st- md-mailman.stormreply.com; [email protected]; linux- [email protected]
Cc: Ng, Boon Khai <[email protected]>; Shevchenko, Andriy <[email protected]>; Tham, Mun Yew <[email protected]>; Swee, Leong Ching <[email protected]>; G Thomas, Rohan <[email protected]>; Shevchenko Andriy <[email protected]>
Subject: Re: [Enable Designware XGMAC VLAN Stripping Feature 2/2] net:
stmmac: dwxgmac2: Add support for HW-accelerated VLAN Stripping

Quoted 7 lines · On 21/07/2023 08:26, [email protected] wrote:

From: Boon Khai Ng <[email protected]>

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.

...

Quoted 3 lines
   	if (priv->dma_cap.vlhash) {
   		ndev->features |= NETIF_F_HW_VLAN_CTAG_FILTER;
   		ndev->features |= NETIF_F_HW_VLAN_STAG_FILTER; diff --

git

drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c stmmac_probe_config_dt(struct platform_device

Quoted 6 lines

a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c index 23d53ea04b24..bd7f3326a44c 100644

drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c +0 -0
@@ -543,6 +543,12 @@ stmmac_probe_config_dt(struct platform_device

*pdev, u8 *mac)

drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c stmmac_probe_config_dt(struct platform_device *pdev, u8 *mac) · line 548

Quoted 6 lines
drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c +3 -0
   			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.

Quoted 9 lines
Quoted 4 lines

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).

Quoted 4 lines

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?

You need the hardware to advertise it and decide as a maintainer of that driver whether it makes sense to have one or the other behavior by default.

Quoted 2 lines

I don’t think ethool can "remember" the setting once the device get rebooted?

If by "device" you mean a system that incorporates a XGMAC core, then I suppose that is true, though you could have some user-space logic that does remember the various ethtool options and re-applies them as soon as the device is made available to user-space, this would not be too far fetched.

Quoted 1 line

Any other suggestion of doing it other than using the dts method?

Let me ask you this question: what are you trying to solve by making this configurable? HW stripping should always be more efficient, should not it, if so, what would be the reasons for not enabling that by default? If not, then leave it off and let users enable it if they feel like they want it.

Signature · 6 lines
Florian

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
#36 lore raw

RE: [Enable Designware XGMAC VLAN Stripping Feature 2/2] net: stmmac: dwxgmac2: Add support for HW-accelerated VLAN Stripping

Quoted 121 lines

-----Original Message-----
From: Florian Fainelli <[email protected]>
Sent: Saturday, July 22, 2023 12:30 AM
To: Ng, Boon Khai <[email protected]>; Krzysztof Kozlowski <[email protected]>; [email protected]; [email protected]; Giuseppe Cavallaro <[email protected]>; Alexandre Torgue <[email protected]>; Jose Abreu <[email protected]>; David S . Miller <[email protected]>; Eric Dumazet <[email protected]>; Jakub Kicinski <[email protected]>; Paolo Abeni <[email protected]>; Maxime Coquelin <[email protected]>; [email protected]; linux-stm32@st- md-mailman.stormreply.com; [email protected]; linux- [email protected]
Cc: Shevchenko, Andriy <[email protected]>; Tham, Mun Yew <[email protected]>; Swee, Leong Ching <[email protected]>; G Thomas, Rohan <[email protected]>; Shevchenko Andriy <[email protected]>
Subject: Re: [Enable Designware XGMAC VLAN Stripping Feature 2/2] net:
stmmac: dwxgmac2: Add support for HW-accelerated VLAN Stripping

Quoted 10 lines · Boon Khai
Quoted 10 lines

-----Original Message-----
From: Florian Fainelli <[email protected]>
Sent: Friday, July 21, 2023 11:59 PM
To: Ng, Boon Khai <[email protected]>; Krzysztof Kozlowski <[email protected]>; [email protected]; [email protected]; Ng, Boon Khai <[email protected]>; Giuseppe Cavallaro <[email protected]>; Alexandre Torgue <[email protected]>; Jose Abreu <[email protected]>; David S . Miller <[email protected]>; Eric Dumazet <[email protected]>; Jakub Kicinski <[email protected]>; Paolo

Abeni

Quoted 1 line
Quoted 1 line

<[email protected]>; Maxime Coquelin

<[email protected]>;

Quoted 3 lines
Quoted 3 lines

[email protected]; linux-stm32@st-md- mailman.stormreply.com; [email protected]; linux- [email protected]
Cc: Shevchenko, Andriy <[email protected]>; Tham, Mun

Yew

Quoted 9 lines
Quoted 9 lines

<[email protected]>; Swee, Leong Ching <[email protected]>; G Thomas, Rohan <[email protected]>; Shevchenko Andriy <[email protected]>
Subject: Re: [Enable Designware XGMAC VLAN Stripping Feature 2/2] net:
stmmac: dwxgmac2: Add support for HW-accelerated VLAN Stripping

Quoted 8 lines
Quoted 8 lines · Boon Khai
Quoted 7 lines
Quoted 7 lines

-----Original Message-----
From: Krzysztof Kozlowski <[email protected]>
Sent: Friday, July 21, 2023 6:11 PM
To: [email protected]; [email protected]; "Ng <boon.khai.ng"@intel.com; Giuseppe Cavallaro <[email protected]>; Alexandre Torgue <[email protected]>; Jose Abreu

<[email protected]>;

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines

David S . Miller <[email protected]>; Eric Dumazet <[email protected]>; Jakub Kicinski <[email protected]>; Paolo Abeni <[email protected]>; Maxime Coquelin <[email protected]>; [email protected]; linux-stm32@st- md-mailman.stormreply.com;

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

[email protected]; linux- [email protected]
Cc: Ng, Boon Khai <[email protected]>; Shevchenko, Andriy <[email protected]>; Tham, Mun Yew <[email protected]>; Swee, Leong Ching <[email protected]>; G Thomas, Rohan <[email protected]>; Shevchenko Andriy <[email protected]>
Subject: Re: [Enable Designware XGMAC VLAN Stripping Feature 2/2]

net:

Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
Quoted 10 lines

stmmac: dwxgmac2: Add support for HW-accelerated VLAN Stripping

Quoted 7 lines · On 21/07/2023 08:26, [email protected] wrote:

From: Boon Khai Ng <[email protected]>

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.

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

...

Quoted 2 lines
   	if (priv->dma_cap.vlhash) {
   		ndev->features |=

NETIF_F_HW_VLAN_CTAG_FILTER;

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
   		ndev->features |=

NETIF_F_HW_VLAN_STAG_FILTER; diff --

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines

git

drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c stmmac_probe_config_dt(struct

Quoted 6 lines

a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c index 23d53ea04b24..bd7f3326a44c 100644

drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c +0 -0
@@ -543,6 +543,12 @@ stmmac_probe_config_dt(struct

platform_device

Quoted 11 lines
Quoted 11 lines
Quoted 11 lines
Quoted 10 lines

*pdev, u8 *mac)

drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c stmmac_probe_config_dt(struct platform_device *pdev, u8 *mac) · line 548

Quoted 6 lines
drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c +3 -0
   			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.

Quoted 8 lines
Quoted 8 lines
Quoted 4 lines

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).

Quoted 2 lines
Quoted 1 line
Quoted 8 lines
Quoted 4 lines

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?

You need the hardware to advertise it and decide as a maintainer of that driver whether it makes sense to have one or the other behavior by default.

Okay got it.

Quoted 9 lines
Quoted 2 lines

I don’t think ethool can "remember" the setting once the device get

rebooted?

If by "device" you mean a system that incorporates a XGMAC core, then I suppose that is true, though you could have some user-space logic that does remember the various ethtool options and re-applies them as soon as the device is made available to user-space, this would not be too far fetched.

Okay, will try to search that, is adding the ethool command turning the Hw vlan striping at the startup script consider one way of doing it?

Quoted 6 lines
Quoted 1 line

Any other suggestion of doing it other than using the dts method?

Let me ask you this question: what are you trying to solve by making this configurable? HW stripping should always be more efficient, should not it, if so, what would be the reasons for not enabling that by default? If not, then leave it off and let users enable it if they feel like they want it.

Okay, so seem like it is solely depends on my side whether or not to turn it on by default, Either way, if it go against the user will to have it on/off by default, they will need to write A startup script to turn the ethool on/off?

Quoted 2 lines

--
Florian

#37 lore raw

Re: [Enable Designware XGMAC VLAN Stripping Feature 2/2] net: stmmac: dwxgmac2: Add support for HW-accelerated VLAN Stripping

In reply to Florian Fainelli
Quoted 12 lines · Florian Fainelli
Quoted 11 lines
Quoted 6 lines

drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c stmmac_probe_config_dt(struct platform_device *pdev, u8 *mac) · line 548

Quoted 3 lines
drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c +3 -0
+	/* 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?

Quoted 7 lines

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).

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.

That's even better reason...

Best regards,
Krzysztof

#38 lore raw

Re: [Enable Designware XGMAC VLAN Stripping Feature 2/2] net: stmmac: dwxgmac2: Add support for HW-accelerated VLAN Stripping

In reply to Ng, Boon Khai
Quoted 18 lines · Boon Khai
Quoted 8 lines

git

drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c stmmac_probe_config_dt(struct platform_device

Quoted 6 lines

a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c index 23d53ea04b24..bd7f3326a44c 100644

drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c +0 -0
@@ -543,6 +543,12 @@ stmmac_probe_config_dt(struct platform_device

*pdev, u8 *mac)

Quoted 9 lines

drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c stmmac_probe_config_dt(struct platform_device *pdev, u8 *mac) · line 548

Quoted 6 lines
drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c +3 -0
 			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.

Quoted 4 lines

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 we do not print simple confirmation of DT properties parsing. It's usually useless and obvious from DT.

To be clear - we talk about dev_info.

Best regards,
Krzysztof