mbox series

[net-next,0/9] DSA changes for multiple CPU ports (part 4)

Message ID 20220830195932.683432-1-vladimir.oltean@nxp.com (mailing list archive)
Headers show
Series DSA changes for multiple CPU ports (part 4) | expand

Message

Vladimir Oltean Aug. 30, 2022, 7:59 p.m. UTC
Those who have been following part 1:
https://patchwork.kernel.org/project/netdevbpf/cover/20220511095020.562461-1-vladimir.oltean@nxp.com/
part 2:
https://patchwork.kernel.org/project/netdevbpf/cover/20220521213743.2735445-1-vladimir.oltean@nxp.com/
and part 3:
https://patchwork.kernel.org/project/netdevbpf/cover/20220819174820.3585002-1-vladimir.oltean@nxp.com/
will know that I am trying to enable the second internal port pair from
the NXP LS1028A Felix switch for DSA-tagged traffic via "ocelot-8021q".

This series represents the final part of that effort. We have:

- the introduction of new UAPI in the form of IFLA_DSA_MASTER

- preparation for LAG DSA masters in terms of suppressing some
  operations for masters in the DSA core that simply don't make sense
  when those masters are a bonding/team interface

- handling all the net device events that occur between DSA and a
  LAG DSA master, including migration to a different DSA master when the
  current master joins a LAG, or the LAG gets destroyed

- updating documentation

- adding an implementation for NXP LS1028A, where things are insanely
  complicated due to hardware limitations. We have 2 tagging protocols:

  * the native "ocelot" protocol (NPI port mode). This does not support
    CPU ports in a LAG, and supports a single DSA master. The DSA master
    can be changed between eno2 (2.5G) and eno3 (1G), but all ports must
    be down during the changing process, and user ports assigned to the
    old DSA master will refuse to come up if the user requests that
    during a "transient" state.

  * the "ocelot-8021q" software-defined protocol, where the Ethernet
    ports connected to the CPU are not actually "god mode" ports as far
    as the hardware is concerned. So here, static assignment between
    user and CPU ports is possible by editing the PGID_SRC masks for
    the port-based forwarding matrix, and "CPU ports in a LAG" simply
    means "a LAG like any other".

The series was regression-tested on LS1028A using the local_termination.sh
kselftest, in most of the possible operating modes and tagging protocols.
I have not done a detailed performance evaluation yet, but using LAG, is
possible to exceed the termination bandwidth of a single CPU port in an
iperf3 test with multiple senders and multiple receivers.

There was a previous RFC posted, which contains most of these changes,
however it's so old by now that it's unlikely anyone of the reviewers
remembers it in detail. I've applied most of the feedback requested by
Florian and Ansuel there.
https://lore.kernel.org/netdev/20220523104256.3556016-1-olteanv@gmail.com/

Vladimir Oltean (9):
  net: introduce iterators over synced hw addresses
  net: dsa: introduce dsa_port_get_master()
  net: dsa: allow the DSA master to be seen and changed through
    rtnetlink
  net: dsa: don't keep track of admin/oper state on LAG DSA masters
  net: dsa: suppress appending ethtool stats to LAG DSA masters
  net: dsa: suppress device links to LAG DSA masters
  net: dsa: allow masters to join a LAG
  docs: net: dsa: update information about multiple CPU ports
  net: dsa: felix: add support for changing DSA master

 .../networking/dsa/configuration.rst          |  84 +++++
 Documentation/networking/dsa/dsa.rst          |  38 ++-
 drivers/net/dsa/bcm_sf2.c                     |   4 +-
 drivers/net/dsa/bcm_sf2_cfp.c                 |   4 +-
 drivers/net/dsa/lan9303-core.c                |   4 +-
 drivers/net/dsa/ocelot/felix.c                | 117 ++++++-
 drivers/net/dsa/ocelot/felix.h                |   3 +
 .../net/ethernet/mediatek/mtk_ppe_offload.c   |   2 +-
 drivers/net/ethernet/mscc/ocelot.c            |   3 +-
 include/linux/netdevice.h                     |   6 +
 include/net/dsa.h                             |  19 ++
 include/soc/mscc/ocelot.h                     |   1 +
 include/uapi/linux/if_link.h                  |  10 +
 net/dsa/Makefile                              |  10 +-
 net/dsa/dsa.c                                 |   9 +
 net/dsa/dsa2.c                                |  34 ++-
 net/dsa/dsa_priv.h                            |  17 +-
 net/dsa/master.c                              |  82 ++++-
 net/dsa/netlink.c                             |  62 ++++
 net/dsa/port.c                                | 159 +++++++++-
 net/dsa/slave.c                               | 288 +++++++++++++++++-
 net/dsa/switch.c                              |  22 +-
 net/dsa/tag_8021q.c                           |   4 +-
 23 files changed, 924 insertions(+), 58 deletions(-)
 create mode 100644 net/dsa/netlink.c

Comments

Vladimir Oltean Sept. 2, 2022, 10:31 a.m. UTC | #1
On Tue, Aug 30, 2022 at 10:59:23PM +0300, Vladimir Oltean wrote:
> This series represents the final part of that effort. We have:
> 
> - the introduction of new UAPI in the form of IFLA_DSA_MASTER

Call for opinions: when I resend this, should I keep rtnl_link_ops,
or should I do what Marek attempted to do, and make the existing iflink
between a user port and its master writable from user space?
https://lore.kernel.org/netdev/20190824024251.4542-4-marek.behun@nic.cz/

I'm not sure if we have that many more use cases for rtnl_link_ops..
at some point I was thinking we could change the way in which dsa_loop
probes, and allow dynamic creation of such interfaces using RTM_NEWLINK;
but looking closer at that, it's a bit more complicated, since we'd need
to attach dsa_loop user ports to a virtual switch, and probe all ports
at the same time rather than one by one.
Florian Fainelli Sept. 2, 2022, 6:33 p.m. UTC | #2
On 9/2/2022 3:31 AM, Vladimir Oltean wrote:
> On Tue, Aug 30, 2022 at 10:59:23PM +0300, Vladimir Oltean wrote:
>> This series represents the final part of that effort. We have:
>>
>> - the introduction of new UAPI in the form of IFLA_DSA_MASTER
> 
> Call for opinions: when I resend this, should I keep rtnl_link_ops,
> or should I do what Marek attempted to do, and make the existing iflink
> between a user port and its master writable from user space?
> https://lore.kernel.org/netdev/20190824024251.4542-4-marek.behun@nic.cz/
> 
> I'm not sure if we have that many more use cases for rtnl_link_ops..

It's a bit hard to see one right now, I agree.

> at some point I was thinking we could change the way in which dsa_loop
> probes, and allow dynamic creation of such interfaces using RTM_NEWLINK;
> but looking closer at that, it's a bit more complicated, since we'd need
> to attach dsa_loop user ports to a virtual switch, and probe all ports
> at the same time rather than one by one.

Yes, not sure the custom netlink operations would be the preferred way 
of doing that configuration, maybe module parameters and/or debugfs 
might just do?
Vladimir Oltean Sept. 2, 2022, 6:40 p.m. UTC | #3
On Fri, Sep 02, 2022 at 11:33:31AM -0700, Florian Fainelli wrote:
> > at some point I was thinking we could change the way in which dsa_loop
> > probes, and allow dynamic creation of such interfaces using RTM_NEWLINK;
> > but looking closer at that, it's a bit more complicated, since we'd need
> > to attach dsa_loop user ports to a virtual switch, and probe all ports
> > at the same time rather than one by one.
> 
> Yes, not sure the custom netlink operations would be the preferred way of
> doing that configuration, maybe module parameters and/or debugfs might just
> do?

Yeah, or make dsa_loop OF-based and just insert a device tree overlay,
something of that sort, I'd guess.

So it's likely that we won't be extending the DSA rtnl_link_ops too much
in the future. However, it's also likely that "writable iflink" isn't
going to be very useful for other virtual netdevices except DSA, either.
So the argument goes both ways. And while the writable iflink requires a
new ndo operation, the IFLA_DSA_MASTER can be handled 100% within DSA.

I don't know, I'm just rambling, I'm open to suggestions.
Christian Marangi Sept. 2, 2022, 6:44 p.m. UTC | #4
On Tue, Aug 30, 2022 at 10:59:23PM +0300, Vladimir Oltean wrote:
> Those who have been following part 1:
> https://patchwork.kernel.org/project/netdevbpf/cover/20220511095020.562461-1-vladimir.oltean@nxp.com/
> part 2:
> https://patchwork.kernel.org/project/netdevbpf/cover/20220521213743.2735445-1-vladimir.oltean@nxp.com/
> and part 3:
> https://patchwork.kernel.org/project/netdevbpf/cover/20220819174820.3585002-1-vladimir.oltean@nxp.com/
> will know that I am trying to enable the second internal port pair from
> the NXP LS1028A Felix switch for DSA-tagged traffic via "ocelot-8021q".
> 
> This series represents the final part of that effort. We have:
> 
> - the introduction of new UAPI in the form of IFLA_DSA_MASTER
> 
> - preparation for LAG DSA masters in terms of suppressing some
>   operations for masters in the DSA core that simply don't make sense
>   when those masters are a bonding/team interface
> 
> - handling all the net device events that occur between DSA and a
>   LAG DSA master, including migration to a different DSA master when the
>   current master joins a LAG, or the LAG gets destroyed
> 
> - updating documentation
> 
> - adding an implementation for NXP LS1028A, where things are insanely
>   complicated due to hardware limitations. We have 2 tagging protocols:
> 
>   * the native "ocelot" protocol (NPI port mode). This does not support
>     CPU ports in a LAG, and supports a single DSA master. The DSA master
>     can be changed between eno2 (2.5G) and eno3 (1G), but all ports must
>     be down during the changing process, and user ports assigned to the
>     old DSA master will refuse to come up if the user requests that
>     during a "transient" state.
> 
>   * the "ocelot-8021q" software-defined protocol, where the Ethernet
>     ports connected to the CPU are not actually "god mode" ports as far
>     as the hardware is concerned. So here, static assignment between
>     user and CPU ports is possible by editing the PGID_SRC masks for
>     the port-based forwarding matrix, and "CPU ports in a LAG" simply
>     means "a LAG like any other".
> 
> The series was regression-tested on LS1028A using the local_termination.sh
> kselftest, in most of the possible operating modes and tagging protocols.
> I have not done a detailed performance evaluation yet, but using LAG, is
> possible to exceed the termination bandwidth of a single CPU port in an
> iperf3 test with multiple senders and multiple receivers.
> 
> There was a previous RFC posted, which contains most of these changes,
> however it's so old by now that it's unlikely anyone of the reviewers
> remembers it in detail. I've applied most of the feedback requested by
> Florian and Ansuel there.
> https://lore.kernel.org/netdev/20220523104256.3556016-1-olteanv@gmail.com/

Hi,
I would love to test this but for me it's a bit problematic to use a
net-next kernel. I wonder if it's possible to backport the 4 part to
older kernel or other prereq are needed. (I know backporting the 4 part
will be crazy but it's something that has to be done anyway to actually
use this on OpenWrt where we currently use 5.10 and 5.15)

Would be good to know if the 4 part require other changes to dsa core to
make a LAG implementation working. (talking for 5.15 since backporting
this to 5.10 is a nono...)

> 
> Vladimir Oltean (9):
>   net: introduce iterators over synced hw addresses
>   net: dsa: introduce dsa_port_get_master()
>   net: dsa: allow the DSA master to be seen and changed through
>     rtnetlink
>   net: dsa: don't keep track of admin/oper state on LAG DSA masters
>   net: dsa: suppress appending ethtool stats to LAG DSA masters
>   net: dsa: suppress device links to LAG DSA masters
>   net: dsa: allow masters to join a LAG
>   docs: net: dsa: update information about multiple CPU ports
>   net: dsa: felix: add support for changing DSA master
> 
>  .../networking/dsa/configuration.rst          |  84 +++++
>  Documentation/networking/dsa/dsa.rst          |  38 ++-
>  drivers/net/dsa/bcm_sf2.c                     |   4 +-
>  drivers/net/dsa/bcm_sf2_cfp.c                 |   4 +-
>  drivers/net/dsa/lan9303-core.c                |   4 +-
>  drivers/net/dsa/ocelot/felix.c                | 117 ++++++-
>  drivers/net/dsa/ocelot/felix.h                |   3 +
>  .../net/ethernet/mediatek/mtk_ppe_offload.c   |   2 +-
>  drivers/net/ethernet/mscc/ocelot.c            |   3 +-
>  include/linux/netdevice.h                     |   6 +
>  include/net/dsa.h                             |  19 ++
>  include/soc/mscc/ocelot.h                     |   1 +
>  include/uapi/linux/if_link.h                  |  10 +
>  net/dsa/Makefile                              |  10 +-
>  net/dsa/dsa.c                                 |   9 +
>  net/dsa/dsa2.c                                |  34 ++-
>  net/dsa/dsa_priv.h                            |  17 +-
>  net/dsa/master.c                              |  82 ++++-
>  net/dsa/netlink.c                             |  62 ++++
>  net/dsa/port.c                                | 159 +++++++++-
>  net/dsa/slave.c                               | 288 +++++++++++++++++-
>  net/dsa/switch.c                              |  22 +-
>  net/dsa/tag_8021q.c                           |   4 +-
>  23 files changed, 924 insertions(+), 58 deletions(-)
>  create mode 100644 net/dsa/netlink.c
> 
> -- 
> 2.34.1
>
Marek Behún Sept. 3, 2022, 2:48 a.m. UTC | #5
On Fri, 2 Sep 2022 10:31:46 +0000
Vladimir Oltean <vladimir.oltean@nxp.com> wrote:

> On Tue, Aug 30, 2022 at 10:59:23PM +0300, Vladimir Oltean wrote:
> > This series represents the final part of that effort. We have:
> > 
> > - the introduction of new UAPI in the form of IFLA_DSA_MASTER  
> 
> Call for opinions: when I resend this, should I keep rtnl_link_ops,
> or should I do what Marek attempted to do, and make the existing iflink
> between a user port and its master writable from user space?
> https://lore.kernel.org/netdev/20190824024251.4542-4-marek.behun@nic.cz/
> 
> I'm not sure if we have that many more use cases for rtnl_link_ops..
> at some point I was thinking we could change the way in which dsa_loop
> probes, and allow dynamic creation of such interfaces using RTM_NEWLINK;
> but looking closer at that, it's a bit more complicated, since we'd need
> to attach dsa_loop user ports to a virtual switch, and probe all ports
> at the same time rather than one by one.

My opinion is that it would be better to add new DSA specific netlink
operations instead of using the existing iflink as I did in the that
patch.

I think that DSA should have it's own IP subcommands. Using the
standard, already existing API, is not sufficient for more complex
configurations/DSA routing settings. Consider DSA where there are
multiple switches and the switches are connected via multiple ports:

+----------+   +---------------+   +---------+
|     eth0 <---> sw0p0   sw0p2 <---> sw1p0
| cpu      |   |               |   |        ....
|     eth1 <---> sw0p1   s20p3 <---> sw1p1
+----------+   +---------------+   +---------+

The routing is more complicated in this scenario. The old API is not
sufficient.

Marek
Marek Behún Sept. 3, 2022, 2:50 a.m. UTC | #6
On Fri, 2 Sep 2022 20:44:37 +0200
Christian Marangi <ansuelsmth@gmail.com> wrote:

> On Tue, Aug 30, 2022 at 10:59:23PM +0300, Vladimir Oltean wrote:
> > Those who have been following part 1:
> > https://patchwork.kernel.org/project/netdevbpf/cover/20220511095020.562461-1-vladimir.oltean@nxp.com/
> > part 2:
> > https://patchwork.kernel.org/project/netdevbpf/cover/20220521213743.2735445-1-vladimir.oltean@nxp.com/
> > and part 3:
> > https://patchwork.kernel.org/project/netdevbpf/cover/20220819174820.3585002-1-vladimir.oltean@nxp.com/
> > will know that I am trying to enable the second internal port pair from
> > the NXP LS1028A Felix switch for DSA-tagged traffic via "ocelot-8021q".
> > 
> > This series represents the final part of that effort. We have:
> > 
> > - the introduction of new UAPI in the form of IFLA_DSA_MASTER
> > 
> > - preparation for LAG DSA masters in terms of suppressing some
> >   operations for masters in the DSA core that simply don't make sense
> >   when those masters are a bonding/team interface
> > 
> > - handling all the net device events that occur between DSA and a
> >   LAG DSA master, including migration to a different DSA master when the
> >   current master joins a LAG, or the LAG gets destroyed
> > 
> > - updating documentation
> > 
> > - adding an implementation for NXP LS1028A, where things are insanely
> >   complicated due to hardware limitations. We have 2 tagging protocols:
> > 
> >   * the native "ocelot" protocol (NPI port mode). This does not support
> >     CPU ports in a LAG, and supports a single DSA master. The DSA master
> >     can be changed between eno2 (2.5G) and eno3 (1G), but all ports must
> >     be down during the changing process, and user ports assigned to the
> >     old DSA master will refuse to come up if the user requests that
> >     during a "transient" state.
> > 
> >   * the "ocelot-8021q" software-defined protocol, where the Ethernet
> >     ports connected to the CPU are not actually "god mode" ports as far
> >     as the hardware is concerned. So here, static assignment between
> >     user and CPU ports is possible by editing the PGID_SRC masks for
> >     the port-based forwarding matrix, and "CPU ports in a LAG" simply
> >     means "a LAG like any other".
> > 
> > The series was regression-tested on LS1028A using the local_termination.sh
> > kselftest, in most of the possible operating modes and tagging protocols.
> > I have not done a detailed performance evaluation yet, but using LAG, is
> > possible to exceed the termination bandwidth of a single CPU port in an
> > iperf3 test with multiple senders and multiple receivers.
> > 
> > There was a previous RFC posted, which contains most of these changes,
> > however it's so old by now that it's unlikely anyone of the reviewers
> > remembers it in detail. I've applied most of the feedback requested by
> > Florian and Ansuel there.
> > https://lore.kernel.org/netdev/20220523104256.3556016-1-olteanv@gmail.com/  
> 
> Hi,
> I would love to test this but for me it's a bit problematic to use a
> net-next kernel. I wonder if it's possible to backport the 4 part to
> older kernel or other prereq are needed. (I know backporting the 4 part
> will be crazy but it's something that has to be done anyway to actually
> use this on OpenWrt where we currently use 5.10 and 5.15)
> 
> Would be good to know if the 4 part require other changes to dsa core to
> make a LAG implementation working. (talking for 5.15 since backporting
> this to 5.10 is a nono...)

Just use the newest kernel. Trust me, backporting new DSA changes to
5.15 is painful. And to 5.10 and earlier it is a literal hell.

:) Marek
Vladimir Oltean Sept. 4, 2022, 3:41 p.m. UTC | #7
On Sat, Sep 03, 2022 at 04:48:32AM +0200, Marek Behún wrote:
> My opinion is that it would be better to add new DSA specific netlink
> operations instead of using the existing iflink as I did in the that
> patch.

Ok, I'll send out the iproute2 patch today.

> I think that DSA should have it's own IP subcommands. Using the
> standard, already existing API, is not sufficient for more complex
> configurations/DSA routing settings. Consider DSA where there are
> multiple switches and the switches are connected via multiple ports:
> 
> +----------+   +---------------+   +---------+
> |     eth0 <---> sw0p0   sw0p2 <---> sw1p0
> | cpu      |   |               |   |        ....
> |     eth1 <---> sw0p1   s20p3 <---> sw1p1
> +----------+   +---------------+   +---------+
> 
> The routing is more complicated in this scenario.

This is so problematic that I don't even know where to start.

Does anyone do this? What do they want to achieve? How do they want the
system to behave?

Let's push your example even one step further:

 +----------+   +---------------+   +---------------+   +---------+
 |     eth0 <---> sw0p0   sw0p2 <---> sw1p0   sw1p2 <---> sw2p0
 | cpu      |   |               |   |               |   |        ....
 |     eth1 <---> sw0p1   sw0p3 <---> sw1p1   sw1p3 <---> sw2p1
 +----------+   +---------------+   +---------------+   +---------+

With our current DT bindings, DSA (cascade) ports would need to contain
links to all DSA ports of indirectly connected switches, because this is
what the dst->rtable expects.

	switch@0 {
		reg = <0>;
		dsa,member = <0 0>;

		ethernet-ports {
			port@0 {
				reg = <0>;
				ethernet = <&eth0>;
			};

			port@1 {
				reg = <1>;
				ethernet = <&eth1>;
			};

			sw0p2: port@2 {
				reg = <2>;
				link = <&sw1p0>, <&sw2p0>, <&sw2p1>;
			};

			sw0p3: port@3 {
				reg = <3>;
				link = <&sw1p1>, <&sw2p0>, <&sw2p1>;
			};
		};
	};

	switch@1 {
		reg = <1>;
		dsa,member = <0 1>;

		ethernet-ports {
			sw1p0: port@0 {
				reg = <0>;
				link = <&sw0p2>;
			};

			sw1p1: port@1 {
				reg = <1>;
				link = <&sw0p3>;
			};

			sw1p2: port@2 {
				reg = <2>;
				link = <&sw2p0>;
			};

			sw1p3: port@3 {
				reg = <3>;
				link = <&sw2p1>;
			};
		};
	};

	switch@2 {
		reg = <2>;
		dsa,member = <0 2>;

		ethernet-ports {
			port@0 {
				reg = <0>;
				link = <&sw1p2>, <&sw0p2>, <&sw0p3>;
			};

			port@1 {
				reg = <1>;
				link = <&sw1p3>, <&sw0p2>, <&sw0p3>;
			};
		};
	};

> The old API is not sufficient.

There is no "old API" to speak of, because none of this is exposed.
So, 'insufficient' is an understatement. Furthermore, the rtnl_link_ops
are exposed per *user* port, we still gain zero control of the
dst->rtable.

The main consumer of the dst->rtable is this:

/* Return the local port used to reach an arbitrary switch device */
static inline unsigned int dsa_routing_port(struct dsa_switch *ds, int device)
{
	struct dsa_switch_tree *dst = ds->dst;
	struct dsa_link *dl;

	list_for_each_entry(dl, &dst->rtable, list)
		if (dl->dp->ds == ds && dl->link_dp->ds->index == device)
			return dl->dp->index;

	return ds->num_ports;
}

Notice the singular *the* local port. So it would currently return the
local cascade port from the first dsa_link added to the rtable (in turn,
the first port which has a 'link' OF node description to a cascade port
of @device). If there are any further dsa_links between a cascade port
of this switch and a cascade port of that switch, they are ignored
(which is a good thing in terms of compatibility between old kernels and
new device trees, but still raises questions).

For each of the functions in the call graph below, we need to determine
exactly what we need to make behave differently (consider a potential
second, third, fourth dsa_link, and how to expose this structure):

                             dsa_port_host_address_match
                              |
                              |  dsa_port_host_vlan_match
                              |   |
                              v   v
                  dsa_switch_is_upstream_of
                  |                        |
                  |                        |
                  | mv88e6xxx_lag_sync_map |
                  v            |           |
          dsa_is_upstream_port |           |
                          |    |           |
   mv88e6xxx_port_vlan    |    |           |
              |           |    |           |
              v           |    |           |
dsa_switch_upstream_port  |    |           |
                     |    |    |           |
                     |    |    |           |
 plenty of drivers   |    |    |           |
               |     |    |    |           |
               v     v    v    |           |
           dsa_upstream_port   |           |
                       |       |           |
                       v       v           |
                     dsa_towards_port      |
                                   |       |
                                   |       |
                                   v       v
                              dsa_routing_port
Vladimir Oltean Sept. 4, 2022, 7:34 p.m. UTC | #8
On Fri, Sep 02, 2022 at 08:44:37PM +0200, Christian Marangi wrote:
> Hi,
> I would love to test this but for me it's a bit problematic to use a
> net-next kernel. I wonder if it's possible to backport the 4 part to
> older kernel or other prereq are needed. (I know backporting the 4 part
> will be crazy but it's something that has to be done anyway to actually
> use this on OpenWrt where we currently use 5.10 and 5.15)
> 
> Would be good to know if the 4 part require other changes to dsa core to
> make a LAG implementation working. (talking for 5.15 since backporting
> this to 5.10 is a nono...)

For testing, iproute2 patch should be coming up soon here:
https://lore.kernel.org/netdev/20220904190025.813574-1-vladimir.oltean@nxp.com/

I tried to backport something on the current linux-stable/linux-5.15.y.
https://github.com/vladimiroltean/linux/tree/dsa-5.15.y

Consider it a work in progress. It compiles and boots on NXP LS1028A,
but I can't guarantee anything beyond that. Furthermore, I've only
backported the merged patches, not the patch set discussed here proper.

I think it would be nice if we had a collaborative tree with DSA
backports for 5.15, because here I just tried to backport the DSA core
rather than all driver changes (since I would be unable to test those).

For transparency, here is the commit list I used to produce the backport (top-most is most recent):

$ cat stable-commits.txt
5dc760d12082 net: dsa: use dsa_tree_for_each_cpu_port in dsa_tree_{setup,teardown}_master
f41ec1fd1c20 net: dsa: all DSA masters must be down when changing the tagging protocol
7136097e1199 net: dsa: only bring down user ports assigned to a given DSA master
4f03dcc6b9a0 net: dsa: existing DSA masters cannot join upper interfaces
920a33cd7231 net: bridge: move DSA master bridging restriction to DSA
0498277ee17b net: dsa: don't stop at NOTIFY_OK when calling ds->ops->port_prechangeupper
4c3f80d22b2e net: dsa: walk through all changeupper notifier functions
be6ff9665d64 net: dsa: don't emit targeted cross-chip notifiers for MTU change
4715029fa7e9 net: dsa: drop dsa_slave_priv from dsa_slave_change_mtu
cf1c39d3b3a5 net: dsa: avoid one dsa_to_port() in dsa_slave_change_mtu
b2033a05a719 net: dsa: use dsa_tree_for_each_user_port in dsa_slave_change_mtu
726816a129cb net: dsa: make cross-chip notifiers more efficient for host events
8e9e678e4758 net: dsa: move reset of VLAN filtering to dsa_port_switchdev_unsync_attrs
762c2998c962 Revert "net: dsa: setup master before ports"
8e6598a7b0fa net: dsa: Pass VLAN MSTI migration notifications to driver
332afc4c8c0d net: dsa: Validate hardware support for MST
f54fd0e16306 net: bridge: mst: Add helper to query a port's MST state
48d57b2e5f43 net: bridge: mst: Add helper to check if MST is enabled
cceac97afa09 net: bridge: mst: Add helper to map an MSTI to a VID set
7ae9147f4312 net: bridge: mst: Notify switchdev drivers of MST state changes
6284c723d9b9 net: bridge: mst: Notify switchdev drivers of VLAN MSTI migrations
87c167bb94ee net: bridge: mst: Notify switchdev drivers of MST mode changes
122c29486e1f net: bridge: mst: Support setting and reporting MST port states
8c678d60562f net: bridge: mst: Allow changing a VLAN's MSTI
ec7328b59176 net: bridge: mst: Multiple Spanning Tree (MST) mode
0832cd9f1f02 net: dsa: warn if port lists aren't empty in dsa_port_teardown
afb3cc1a397d net: dsa: unlock the rtnl_mutex when dsa_master_setup() fails
7569459a52c9 net: dsa: manage flooding on the CPU ports
499aa9e1b332 net: dsa: install the primary unicast MAC address as standalone port host FDB
5e8a1e03aa4d net: dsa: install secondary unicast and multicast addresses as host FDB/MDB
68d6d71eafd1 net: dsa: rename the host FDB and MDB methods to contain the "bridge" namespace
35aae5ab9121 net: dsa: remove workarounds for changing master promisc/allmulti only while up
06b9cce42634 net: dsa: pass extack to .port_bridge_join driver methods
c26933639b54 net: dsa: request drivers to perform FDB isolation
b6362bdf750b net: dsa: tag_8021q: rename dsa_8021q_bridge_tx_fwd_offload_vid
04b67e18ce5b net: dsa: tag_8021q: merge RX and TX VLANs
08f44db3abe6 net: dsa: felix: delete workarounds present due to SVL tag_8021q bridging
d27656d02d85 docs: net: dsa: sja1105: document limitations of tc-flower rule VLAN awareness
d7f9787a763f net: dsa: tag_8021q: add support for imprecise RX based on the VBID
91495f21fcec net: dsa: tag_8021q: replace the SVL bridging with VLAN-unaware IVL bridging
961d8b699070 net: dsa: felix: support FDB entries on offloaded LAG interfaces
e212fa7c5418 net: dsa: support FDB events on offloaded LAG interfaces
93c798230af5 net: dsa: call SWITCHDEV_FDB_OFFLOADED for the orig_dev
e35f12e993d4 net: dsa: remove "ds" and "port" from struct dsa_switchdev_event_work
ec638740fce9 net: switchdev: remove lag_mod_cb from switchdev_handle_fdb_event_to_device
dedd6a009f41 net: dsa: create a dsa_lag structure
b99dbdf00bc1 net: dsa: mv88e6xxx: use dsa_switch_for_each_port in mv88e6xxx_lag_sync_masks
3d4a0a2a46ab net: dsa: make LAG IDs one-based
066ce9779c7a net: dsa: qca8k: rename references to "lag" as "lag_dev"
e23eba722861 net: dsa: mv88e6xxx: rename references to "lag" as "lag_dev"
46a76724e4c9 net: dsa: rename references to "lag" as "lag_dev"
b9e8b58fd2cb net: dsa: Include BR_PORT_LOCKED in the list of synced brport flags
a21d9a670d81 net: bridge: Add support for bridge port in locked mode
acd8df5880d7 net: switchdev: avoid infinite recursion from LAG to bridge with port object handler
342b6419193c net: dsa: fix panic when removing unoffloaded port from bridge
8940e6b669ca net: dsa: avoid call to __dev_set_promiscuity() while rtnl_mutex isn't held
ba43b547515e net: lan966x: remove guards against !BRIDGE_VLAN_INFO_BRENTRY
e42bd4ed09aa net: mscc: ocelot: keep traps in a list
85ea0daabe5a net: mscc: ocelot: avoid overlap in VCAP IS2 between PTP and MRP traps
b9bace6e534d net: mscc: ocelot: use a single VCAP filter for all MRP traps
36fac35b2907 net: mscc: ocelot: delete OCELOT_MRP_CPUQ
c518afec2883 net: mscc: ocelot: consolidate cookie allocation for private VCAP rules
e3c02b7c655c net: mscc: ocelot: use a consistent cookie for MRP traps
164f861bd40c net: dsa: offload bridge port VLANs on foreign interfaces
134ef2388e7f net: dsa: add explicit support for host bridge VLANs
c4076cdd21f8 net: switchdev: introduce switchdev_handle_port_obj_{add,del} for foreign interfaces
7b465f4cf39e net: switchdev: rename switchdev_lower_dev_find to switchdev_lower_dev_find_rcu
b28d580e2939 net: bridge: switchdev: replay all VLAN groups
263029ae3172 net: bridge: make nbp_switchdev_unsync_objs() follow reverse order of sync()
8d23a54f5bee net: bridge: switchdev: differentiate new VLANs from changed ones
27c5f74c7ba7 net: bridge: vlan: notify switchdev only when something changed
cab2cd770051 net: bridge: vlan: make __vlan_add_flags react only to PVID and UNTAGGED
3116ad0696dd net: bridge: vlan: don't notify to switchdev master VLANs without BRENTRY flag
b2bc58d41fde net: bridge: vlan: check early for lack of BRENTRY flag in br_vlan_add_existing
ef5764057540 net: mscc: ocelot: fix use-after-free in ocelot_vlan_del()
5454f5c28eca net: bridge: vlan: check for errors from __vlan_del in __vlan_flush
867b1db874c9 net: lan966x: Fix when CONFIG_IPV6 is not set
1da52b0e4724 net: lan966x: Fix when CONFIG_PTP_1588_CLOCK is compiled as module
59085208e4a2 net: mscc: ocelot: fix all IP traffic getting trapped to CPU with PTP over IP
47aeea0d57e8 net: lan966x: Implement the callback SWITCHDEV_ATTR_ID_BRIDGE_MC_DISABLED
cddbec19466a net: dsa: qca8k: add tracking state of master port
e83d56537859 net: dsa: replay master state events in dsa_tree_{setup,teardown}_master
295ab96f478d net: dsa: provide switch operations for tracking the master state
a1ff94c2973c net: dsa: stop updating master MTU from master.c
77eecf25bd9d net: lan966x: Update extraction/injection for timestamping
735fec995b21 net: lan966x: Implement SIOCSHWTSTAMP and SIOCGHWTSTAMP
d096459494a8 net: lan966x: Add support for ptp clocks
108dc8741c20 net: dsa: Avoid cross-chip syncing of VLAN filtering
381a730182f1 net: dsa: Move VLAN filtering syncing out of dsa_switch_bridge_leave
5cad43a52ee3 net: dsa: felix: add port fast age support
1b26d364e4e9 net: dsa: warn about dsa_port and dsa_switch bit fields being non atomic
63cfc65753d6 net: dsa: don't enumerate dsa_switch and dsa_port bit fields using commas
11fd667dac31 net: dsa: setup master before ports
1e3f407f3cac net: dsa: first set up shared ports, then non-shared ports
c146f9bc195a net: dsa: hold rtnl_mutex when calling dsa_master_{setup,teardown}
a68dc7b938fb net: dsa: remove cross-chip support for HSR
cad69019f2f8 net: dsa: remove cross-chip support for MRP
4b026e82893b net: dsa: combine two holes in struct dsa_switch_tree
b035c88c6a30 net: dsa: move dsa_switch_tree :: ports and lags to first cache line
258030acc93b net: dsa: make dsa_switch :: num_ports an unsigned int
7787ff776398 net: dsa: merge all bools of struct dsa_switch into a single u32
0625125877da net: dsa: move dsa_port :: type near dsa_port :: index
bde82f389af1 net: dsa: merge all bools of struct dsa_port into a single u8
b08db33dabd1 net: dsa: move dsa_port :: stp_state near dsa_port :: mac
7aacb894b1ad net: lan966x: Extend switchdev with mdb support
11b0a27772f5 net: lan966x: Add PGID_GP_START and PGID_GP_END
fc0c3fe7486f net: lan966x: Add function lan966x_mac_ip_learn()
0c94d657d2a4 net: lan966x: Fix the vlan used by host ports
2e49761e4fd1 net: lan966x: Add support for multiple bridge flags
811ba2771182 net: lan966x: Extend switchdev with fdb support
e14f72398df4 net: lan966x: Extend switchdev bridge flags
6d2c186afa5d net: lan966x: Add vlan support.
cf2f60897e92 net: lan966x: Add support to offload the forwarding.
571bb516a869 net: lan966x: Remove .ndo_change_rx_flags
25ee9561ec62 net: lan966x: More MAC table functionality
5ccd66e01cbe net: lan966x: add support for interrupts from analyzer
ef14049f4db9 net: lan966x: Add registers that are used for switch and vlan functionality
7f2973149c22 net: dsa: make tagging protocols connect to individual switches from a tree
e2f01bfe1406 net: dsa: tag_sja1105: fix zeroization of ds->priv on tag proto disconnect
b26980ab2a97 net: lan966x: Fix the configuration of the pcs
950a419d9de1 net: dsa: tag_sja1105: split sja1105_tagger_data into private and public sections
fcbf979a5b4b Revert "net: dsa: move sja1110_process_meta_tstamp inside the tagging protocol driver"
c79e84866d2a net: dsa: tag_sja1105: convert to tagger-owned data
22ee9f8e4011 net: dsa: sja1105: move ts_id from sja1105_tagger_data
bfcf14252220 net: dsa: sja1105: make dp->priv point directly to sja1105_tagger_data
6f6770ab1ce2 net: dsa: sja1105: remove hwts_tx_en from tagger data
d38049bbe760 net: dsa: sja1105: bring deferred xmit implementation in line with ocelot-8021q
a3d74295d790 net: dsa: sja1105: let deferred packets time out when sent to ports going down
35d976802124 net: dsa: tag_ocelot: convert to tagger-owned data
dc452a471dba net: dsa: introduce tagger-owned storage for private and shared data
857fdd74fb38 net: dsa: eliminate dsa_switch_ops :: port_bridge_tx_fwd_{,un}offload
b079922ba2ac net: dsa: add a "tx_fwd_offload" argument to ->port_bridge_join
d3eed0e57d5d net: dsa: keep the bridge_dev and bridge_num as part of the same structure
6a43cba30340 net: dsa: export bridging offload helpers to drivers
936db8a2dba2 net: dsa: rename dsa_port_offloads_bridge to dsa_port_offloads_bridge_dev
41fb0cf1bced net: dsa: hide dp->bridge_dev and dp->bridge_num in drivers behind helpers
36cbf39b5690 net: dsa: hide dp->bridge_dev and dp->bridge_num in the core behind helpers
65144067d360 net: dsa: mv88e6xxx: compute port vlan membership based on dp->bridge_dev comparison
0493fa7927af net: dsa: mv88e6xxx: iterate using dsa_switch_for_each_user_port in mv88e6xxx_port_check_hw_vlan
872bb81dfbc3 net: dsa: mt7530: iterate using dsa_switch_for_each_user_port in bridging ops
947c8746e2c3 net: dsa: assign a bridge number even without TX forwarding offload
3f9bb0301d50 net: dsa: make dp->bridge_num one-based
bb14bfc7eb92 net: lan966x: fix a IS_ERR() vs NULL check in lan966x_create_targets()
cc9cf69eea48 net: lan966x: Fix builds for lan966x driver
a290cf692779 net: lan966x: Fix duplicate check in frame extraction
12c2d0a5b8e2 net: lan966x: add ethtool configuration and statistics
e18aba8941b4 net: lan966x: add mactable support
d28d6d2e37d1 net: lan966x: add port module support
db8bcaad5393 net: lan966x: add the basic lan966x driver
ef136837aaf6 net: dsa: rtl8365mb: set RGMII RX delay in steps of 0.3 ns
b014861d96a6 net: dsa: realtek-smi: don't log an error on EPROBE_DEFER
1e89ad864d03 net: dsa: realtek-smi: fix indirect reg access for ports>3
b3612ccdf284 net: dsa: microchip: implement multi-bridge support
96ca08c05838 net: mscc: ocelot: set up traps for PTP packets
ec15baec3272 net: ptp: add a definition for the UDP port for IEEE 1588 general messages
95706be13b9f net: mscc: ocelot: create a function that replaces an existing VCAP filter
8abe19703825 net: dsa: felix: enable cut-through forwarding between ports by default
a8bd9fa5b527 net: ocelot: remove "bridge" argument from ocelot_get_bridge_fwd_mask
4636440f913b net: dsa: qca8k: Fix spelling mistake "Mismateched" -> "Mismatched"
0898ca67b86e net: dsa: qca8k: fix warning in LAG feature
def975307c01 net: dsa: qca8k: add LAG support
2c1bdbc7e756 net: dsa: qca8k: add support for mirror mode
ba8f870dfa63 net: dsa: qca8k: add support for mdb_add/del
6a3bdc5209f4 net: dsa: qca8k: add set_ageing_time support
4592538bfb0d net: dsa: qca8k: add support for port fast aging
c126f118b330 net: dsa: qca8k: add additional MIB counter and make it dynamic
8b5f3f29a81a net: dsa: qca8k: initial conversion to regmap helper
36b8af12f424 net: dsa: qca8k: move regmap init in probe and set it mandatory
994c28b6f971 net: dsa: qca8k: remove extra mutex_init in qca8k_setup
90ae68bfc2ff net: dsa: qca8k: convert to GENMASK/FIELD_PREP/FIELD_GET
b9133f3ef5a2 net: dsa: qca8k: remove redundant check in parse_port_config
65258b9d8cde net: dsa: qca8k: fix MTU calculation
3b00a07c2443 net: dsa: qca8k: fix internal delay applied to the wrong PAD config
a7e13edf37be net: dsa: felix: restrict psfp rules on ingress port
76c13ede7120 net: dsa: felix: use vcap policer to set flow meter for psfp
77043c37096d net: mscc: ocelot: use index to set vcap policer
23ae3a787771 net: dsa: felix: add stream gate settings for psfp
7d4b564d6add net: dsa: felix: support psfp filter on vsc9959
23e2c506ad6c net: mscc: ocelot: add gate and police action offload to PSFP
5b1918a54a91 net: mscc: ocelot: set vcap IS2 chain to goto PSFP chain
0568c3bf3f34 net: mscc: ocelot: add MAC table stream learn and lookup operations
02d6fdecb9c3 regmap: allow to define reg_update_bits for no bus configuration
5f15d392dcb4 net: dsa: qca8k: make sure PAD0 MAC06 exchange is disabled
ae0393500e3b net: bridge: switchdev: fix shim definition for br_switchdev_mdb_notify
326b212e9cd6 net: bridge: switchdev: consistent function naming
9776457c784f net: bridge: mdb: move all switchdev logic to br_switchdev.c
9ae9ff994b0e net: bridge: split out the switchdev portion of br_mdb_notify
4a6849e46173 net: bridge: move br_vlan_replay to br_switchdev.c
c5f6e5ebc2af net: bridge: provide shim definition for br_vlan_flags
716a30a97a52 net: switchdev: merge switchdev_handle_fdb_{add,del}_to_device
fab9eca88410 net: bridge: create a common function for populating switchdev FDB entries
5cda5272a460 net: bridge: move br_fdb_replay inside br_switchdev.c
9574fb558044 net: bridge: reduce indentation level in fdb_create
f6814fdcfe1b net: bridge: rename br_fdb_insert to br_fdb_add_local
4731b6d6b257 net: bridge: rename fdb_insert to fdb_add_local
5f94a5e276ae net: bridge: remove fdb_insert forward declaration
4682048af0c8 net: bridge: remove fdb_notify forward declaration
425d19cedef8 net: dsa: stop calling dev_hold in dsa_slave_fdb_event
d7d0d423dbaa net: dsa: flush switchdev workqueue when leaving the bridge
0faf890fc519 net: dsa: drop rtnl_lock from dsa_slave_switchdev_event_work
338a3a4745aa net: dsa: introduce locking for the address lists on CPU and DSA ports
cf231b436f7c net: dsa: lantiq_gswip: serialize access to the PCE registers
f7eb4a1c0864 net: dsa: b53: serialize access to the ARL table
edc90d15850c selftests: net: dsa: add a stress test for unlocked FDB operations
016748961ba5 selftests: lib: forwarding: allow tests to not require mz and jq
f239934cffe5 net: dsa: b53: serialize access to the ARL table
f2c4bdf62d76 net: mscc: ocelot: serialize access to the MAC table
1681ae1691ef net: dsa: sja1105: serialize access to the dynamic config interface
643979cf5ec4 net: dsa: sja1105: wait for dynamic config command completion on writes too
992e5cc7be8e net: dsa: tag_8021q: make dsa_8021q_{rx,tx}_vid take dp as argument
5068887a4fbe net: dsa: tag_sja1105: do not open-code dsa_switch_for_each_port
fac6abd5f132 net: dsa: convert cross-chip notifiers to iterate using dp
57d77986e742 net: dsa: remove gratuitous use of dsa_is_{user,dsa,cpu}_port
65c563a67755 net: dsa: do not open-code dsa_switch_for_each_port
d0004a020bb5 net: dsa: remove the "dsa_to_port in a loop" antipattern from the core
82b318983c51 net: dsa: introduce helpers for iterating through ports using dp
d4004422f6f9 net: mscc: ocelot: track the port pvid using a pointer
bfbab3104413 net: mscc: ocelot: add the local station MAC addresses in VID 0
0da1a1c48911 net: mscc: ocelot: allow a config where all bridge VLANs are egress-untagged
90e0aa8d108d net: mscc: ocelot: convert the VLAN masks to a list
62a22bcbd30e net: mscc: ocelot: add a type definition for REW_TAG_CFG_TAG_CFG
040e926f5813 net: dsa: qca8k: tidy for loop in setup and add cpu port check
9ca482a246f0 net: dsa: sja1105: parse {rx, tx}-internal-delay-ps properties for RGMII delays
4af2950c50c8 net: dsa: realtek-smi: add rtl8365mb subdriver for RTL8365MB-VC
1521d5adfc2b net: dsa: tag_rtl8_4: add realtek 8 byte protocol 4 tag
9cb8edda2157 net: dsa: move NET_DSA_TAG_RTL4_A to right place in Kconfig/Makefile
7bbbbfaa7a1b ether: add EtherType for proprietary Realtek protocols
fd0bb28c547f net: dsa: qca8k: move port config to dedicated struct
cef08115846e net: dsa: qca8k: set internal delay also for sgmii
f477d1c8bdbe net: dsa: qca8k: add support for QCA8328
ed7988d77fbf dt-bindings: net: dsa: qca8k: document support for qca8328
362bb238d8bf net: dsa: qca8k: add support for pws config reg
924087c5c3d4 dt-bindings: net: dsa: qca8k: Document qca,led-open-drain binding
bbc4799e8bb6 net: dsa: qca8k: add explicit SGMII PLL enable
13ad5ccc093f dt-bindings: net: dsa: qca8k: Document qca,sgmii-enable-pll
5654ec78dd7e net: dsa: qca8k: rework rgmii delay logic and scan for cpu port 6
3fcf734aa482 net: dsa: qca8k: add support for cpu port 6
731d613338ec dt-bindings: net: dsa: qca8k: Document support for CPU port 6
6c43809bf1be net: dsa: qca8k: add support for sgmii falling edge
fdbf35df9c09 dt-bindings: net: dsa: qca8k: Add SGMII clock phase properties
d8b6f5bae6d3 dsa: qca8k: add mac_power_sel support
39e222bfd7f3 net: dsa: unregister cross-chip notifier after ds->ops->teardown
339e75f6b9a0 net: dsa: rtl8366rb: remove unneeded semicolon
e674cfd08537 net: dsa: rtl8366rb: Support setting STP state
1fbd19e10b73 net: dsa: rtl8366rb: Support fast aging
56d8bb71a811 net: dsa: rtl8366rb: Support disabling learning
5ca721c54d86 net: dsa: tag_ocelot: set the classified VLAN during xmit
e8c0722927e8 net: mscc: ocelot: write full VLAN TCI in the injection header
de5bbb6f7e4c net: mscc: ocelot: support egress VLAN rewriting via VCAP ES0
55b115c7ecd9 net: dsa: rtl8366rb: Use core filtering tracking
d310b14ae748 net: dsa: rtl8366: Drop and depromote pointless prints
a4eff910ec63 net: dsa: rtl8366rb: Rewrite weird VLAN filering enablement
7776e33c68ae net: dsa: rtl8366: Drop custom VLAN set-up
d5a680295be2 net: dsa: rtl8366rb: Support bridge offloading
bd936bd53b2d net: dsa: Move devlink registration to be last devlink command
6d709cadfde6 net: dsa: move sja1110_process_meta_tstamp inside the tagging protocol driver
68a81bb2eebd net: dsa: sja1105: remove sp->dp
db4278c55fa5 devlink: Make devlink_register to be void
4dcd183fbd67 net: wwan: iosm: devlink registration

There are 2 conflicts expected during merging this patch set due to net
<-> net-next overlaps at the time. One is in include/linux/dsa/sja1105.h
and the other is in net/dsa/dsa2.c. See the resolutions in my git tree
and make sure to enable git rerere so that you don't have to redo them
every time you recreate the branch.

For sorting a list of commits chronologically, I have this:

$ cat ~/bin/git-sort-commit-list
#!/bin/bash

set -e -u -o pipefail

error() {
	local lineno="$1"
	local code="${2:-1}"

	echo "Error on line ${lineno}; status ${code}."
	exit "${code}"
}
trap 'error ${LINENO}' ERR

usage() {
	echo "Usage:"
	echo "$0 --commit-file <file> --oldest-commit <ref> --newest-commit <ref>"
	exit
}

argc=$#
argv=( "$@" )

if [ $argc -lt 6 ]; then
	usage
fi

cmd="cat"

i=0
while [ $i -lt $argc ]; do
	key="${argv[$i]}"
	i=$((i + 1))
	case "$key" in
	-c|--commit-file)
		file="${argv[$i]}"
		i=$((i + 1))
		;;
	-n|--newest-commit)
		newest="${argv[$i]}"
		i=$((i + 1))
		;;
	-o|--oldest-commit)
		oldest="${argv[$i]}"
		i=$((i + 1))
		;;
	*)
		usage
		;;
	esac
done

for rev in $(git rev-list "$newest" ^"$oldest"); do
	match="$(grep $(echo ${rev} | head -c 12) ${file} | uniq || :)"
	if [ -n "${match}" ]; then
		echo ${match}
	fi
done

The other script is for the backporting itself:

[tigrisor@skbuf /opt/linux] $ cat ~/bin/git-backport
#!/bin/bash

set -e -u -o pipefail

error() {
	local lineno="$1"
	local code="${2:-1}"

	echo "Error on line ${lineno}; status ${code}."
	exit "${code}"
}
trap 'error ${LINENO}' ERR

usage() {
	echo "Usage:"
	echo "$0 --commit-file <file> --base-branch <ref> --branch-name <string> [--reverse]"
	exit
}

argc=$#
argv=( "$@" )

if [ $argc -lt 6 ]; then
	usage
fi

cmd="cat"

i=0
while [ $i -lt $argc ]; do
	key="${argv[$i]}"
	i=$((i + 1))
	case "$key" in
	-c|--commit-file)
		file="${argv[$i]}"
		i=$((i + 1))
		;;
	-b|--branch-name)
		branch_name="${argv[$i]}"
		i=$((i + 1))
		;;
	-B|--base-branch)
		base_branch="${argv[$i]}"
		i=$((i + 1))
		;;
	-r|--reverse)
		cmd="tac"
		i=$((i + 1))
		;;
	*)
		usage
		;;
	esac
done

git checkout -B "${branch_name}"
git reset --hard "${base_branch}"
GIT_SEQUENCE_EDITOR="${cmd} ${file} | awk '{ print \"pick \" \$0; }' >" \
	git rebase -i --rerere-autoupdate "${base_branch}"

I run it using:

$ git-backport --commit-file stable-commits.txt --base-branch linux-5.15.y --branch-name dsa-5.15.y --reverse

You can add commits to the commit list pretty much anywhere, and run the sorting script afterwards:

$ git sort-commit-list --commit-file stable-commits.txt --oldest-commit v5.15 --newest-commit 5dc760d12082 | tee stable-commits-sorted.txt

You'll probably need to add more, and rebase onto a different base branch for OpenWRT. Nonetheless, it should be a valid start.
Have fun and let me know if you have something useful to share back!
Colin Foster Sept. 6, 2022, 4:10 p.m. UTC | #9
On Sun, Sep 04, 2022 at 07:34:14PM +0000, Vladimir Oltean wrote:
> On Fri, Sep 02, 2022 at 08:44:37PM +0200, Christian Marangi wrote:
> For transparency, here is the commit list I used to produce the backport (top-most is most recent):

Tangentially related: how did you come up with this list?

I can only assume this is a manual process based on intricate knowledge
of net / DSA as a whole. I just want to make sure there isn't a "git
backport net/dsa origin/master v5.10" sort of thing ;-)

> 
> $ cat stable-commits.txt
> 5dc760d12082 net: dsa: use dsa_tree_for_each_cpu_port in dsa_tree_{setup,teardown}_master
> f41ec1fd1c20 net: dsa: all DSA masters must be down when changing the tagging protocol
> 7136097e1199 net: dsa: only bring down user ports assigned to a given DSA master
> 4f03dcc6b9a0 net: dsa: existing DSA masters cannot join upper interfaces
> 920a33cd7231 net: bridge: move DSA master bridging restriction to DSA
> 0498277ee17b net: dsa: don't stop at NOTIFY_OK when calling ds->ops->port_prechangeupper
> 4c3f80d22b2e net: dsa: walk through all changeupper notifier functions
> be6ff9665d64 net: dsa: don't emit targeted cross-chip notifiers for MTU change
> 4715029fa7e9 net: dsa: drop dsa_slave_priv from dsa_slave_change_mtu
> cf1c39d3b3a5 net: dsa: avoid one dsa_to_port() in dsa_slave_change_mtu
> b2033a05a719 net: dsa: use dsa_tree_for_each_user_port in dsa_slave_change_mtu
> 726816a129cb net: dsa: make cross-chip notifiers more efficient for host events
> 8e9e678e4758 net: dsa: move reset of VLAN filtering to dsa_port_switchdev_unsync_attrs
> 762c2998c962 Revert "net: dsa: setup master before ports"
> 8e6598a7b0fa net: dsa: Pass VLAN MSTI migration notifications to driver
> 332afc4c8c0d net: dsa: Validate hardware support for MST
> f54fd0e16306 net: bridge: mst: Add helper to query a port's MST state
> 48d57b2e5f43 net: bridge: mst: Add helper to check if MST is enabled
> cceac97afa09 net: bridge: mst: Add helper to map an MSTI to a VID set
> 7ae9147f4312 net: bridge: mst: Notify switchdev drivers of MST state changes
> 6284c723d9b9 net: bridge: mst: Notify switchdev drivers of VLAN MSTI migrations
> 87c167bb94ee net: bridge: mst: Notify switchdev drivers of MST mode changes
> 122c29486e1f net: bridge: mst: Support setting and reporting MST port states
> 8c678d60562f net: bridge: mst: Allow changing a VLAN's MSTI
> ec7328b59176 net: bridge: mst: Multiple Spanning Tree (MST) mode
> 0832cd9f1f02 net: dsa: warn if port lists aren't empty in dsa_port_teardown
> afb3cc1a397d net: dsa: unlock the rtnl_mutex when dsa_master_setup() fails
> 7569459a52c9 net: dsa: manage flooding on the CPU ports
> 499aa9e1b332 net: dsa: install the primary unicast MAC address as standalone port host FDB
> 5e8a1e03aa4d net: dsa: install secondary unicast and multicast addresses as host FDB/MDB
> 68d6d71eafd1 net: dsa: rename the host FDB and MDB methods to contain the "bridge" namespace
> 35aae5ab9121 net: dsa: remove workarounds for changing master promisc/allmulti only while up
> 06b9cce42634 net: dsa: pass extack to .port_bridge_join driver methods
> c26933639b54 net: dsa: request drivers to perform FDB isolation
> b6362bdf750b net: dsa: tag_8021q: rename dsa_8021q_bridge_tx_fwd_offload_vid
> 04b67e18ce5b net: dsa: tag_8021q: merge RX and TX VLANs
> 08f44db3abe6 net: dsa: felix: delete workarounds present due to SVL tag_8021q bridging
> d27656d02d85 docs: net: dsa: sja1105: document limitations of tc-flower rule VLAN awareness
> d7f9787a763f net: dsa: tag_8021q: add support for imprecise RX based on the VBID
> 91495f21fcec net: dsa: tag_8021q: replace the SVL bridging with VLAN-unaware IVL bridging
> 961d8b699070 net: dsa: felix: support FDB entries on offloaded LAG interfaces
> e212fa7c5418 net: dsa: support FDB events on offloaded LAG interfaces
> 93c798230af5 net: dsa: call SWITCHDEV_FDB_OFFLOADED for the orig_dev
> e35f12e993d4 net: dsa: remove "ds" and "port" from struct dsa_switchdev_event_work
> ec638740fce9 net: switchdev: remove lag_mod_cb from switchdev_handle_fdb_event_to_device
> dedd6a009f41 net: dsa: create a dsa_lag structure
> b99dbdf00bc1 net: dsa: mv88e6xxx: use dsa_switch_for_each_port in mv88e6xxx_lag_sync_masks
> 3d4a0a2a46ab net: dsa: make LAG IDs one-based
> 066ce9779c7a net: dsa: qca8k: rename references to "lag" as "lag_dev"
> e23eba722861 net: dsa: mv88e6xxx: rename references to "lag" as "lag_dev"
> 46a76724e4c9 net: dsa: rename references to "lag" as "lag_dev"
> b9e8b58fd2cb net: dsa: Include BR_PORT_LOCKED in the list of synced brport flags
> a21d9a670d81 net: bridge: Add support for bridge port in locked mode
> acd8df5880d7 net: switchdev: avoid infinite recursion from LAG to bridge with port object handler
> 342b6419193c net: dsa: fix panic when removing unoffloaded port from bridge
> 8940e6b669ca net: dsa: avoid call to __dev_set_promiscuity() while rtnl_mutex isn't held
> ba43b547515e net: lan966x: remove guards against !BRIDGE_VLAN_INFO_BRENTRY
> e42bd4ed09aa net: mscc: ocelot: keep traps in a list
> 85ea0daabe5a net: mscc: ocelot: avoid overlap in VCAP IS2 between PTP and MRP traps
> b9bace6e534d net: mscc: ocelot: use a single VCAP filter for all MRP traps
> 36fac35b2907 net: mscc: ocelot: delete OCELOT_MRP_CPUQ
> c518afec2883 net: mscc: ocelot: consolidate cookie allocation for private VCAP rules
> e3c02b7c655c net: mscc: ocelot: use a consistent cookie for MRP traps
> 164f861bd40c net: dsa: offload bridge port VLANs on foreign interfaces
> 134ef2388e7f net: dsa: add explicit support for host bridge VLANs
> c4076cdd21f8 net: switchdev: introduce switchdev_handle_port_obj_{add,del} for foreign interfaces
> 7b465f4cf39e net: switchdev: rename switchdev_lower_dev_find to switchdev_lower_dev_find_rcu
> b28d580e2939 net: bridge: switchdev: replay all VLAN groups
> 263029ae3172 net: bridge: make nbp_switchdev_unsync_objs() follow reverse order of sync()
> 8d23a54f5bee net: bridge: switchdev: differentiate new VLANs from changed ones
> 27c5f74c7ba7 net: bridge: vlan: notify switchdev only when something changed
> cab2cd770051 net: bridge: vlan: make __vlan_add_flags react only to PVID and UNTAGGED
> 3116ad0696dd net: bridge: vlan: don't notify to switchdev master VLANs without BRENTRY flag
> b2bc58d41fde net: bridge: vlan: check early for lack of BRENTRY flag in br_vlan_add_existing
> ef5764057540 net: mscc: ocelot: fix use-after-free in ocelot_vlan_del()
> 5454f5c28eca net: bridge: vlan: check for errors from __vlan_del in __vlan_flush
> 867b1db874c9 net: lan966x: Fix when CONFIG_IPV6 is not set
> 1da52b0e4724 net: lan966x: Fix when CONFIG_PTP_1588_CLOCK is compiled as module
> 59085208e4a2 net: mscc: ocelot: fix all IP traffic getting trapped to CPU with PTP over IP
> 47aeea0d57e8 net: lan966x: Implement the callback SWITCHDEV_ATTR_ID_BRIDGE_MC_DISABLED
> cddbec19466a net: dsa: qca8k: add tracking state of master port
> e83d56537859 net: dsa: replay master state events in dsa_tree_{setup,teardown}_master
> 295ab96f478d net: dsa: provide switch operations for tracking the master state
> a1ff94c2973c net: dsa: stop updating master MTU from master.c
> 77eecf25bd9d net: lan966x: Update extraction/injection for timestamping
> 735fec995b21 net: lan966x: Implement SIOCSHWTSTAMP and SIOCGHWTSTAMP
> d096459494a8 net: lan966x: Add support for ptp clocks
> 108dc8741c20 net: dsa: Avoid cross-chip syncing of VLAN filtering
> 381a730182f1 net: dsa: Move VLAN filtering syncing out of dsa_switch_bridge_leave
> 5cad43a52ee3 net: dsa: felix: add port fast age support
> 1b26d364e4e9 net: dsa: warn about dsa_port and dsa_switch bit fields being non atomic
> 63cfc65753d6 net: dsa: don't enumerate dsa_switch and dsa_port bit fields using commas
> 11fd667dac31 net: dsa: setup master before ports
> 1e3f407f3cac net: dsa: first set up shared ports, then non-shared ports
> c146f9bc195a net: dsa: hold rtnl_mutex when calling dsa_master_{setup,teardown}
> a68dc7b938fb net: dsa: remove cross-chip support for HSR
> cad69019f2f8 net: dsa: remove cross-chip support for MRP
> 4b026e82893b net: dsa: combine two holes in struct dsa_switch_tree
> b035c88c6a30 net: dsa: move dsa_switch_tree :: ports and lags to first cache line
> 258030acc93b net: dsa: make dsa_switch :: num_ports an unsigned int
> 7787ff776398 net: dsa: merge all bools of struct dsa_switch into a single u32
> 0625125877da net: dsa: move dsa_port :: type near dsa_port :: index
> bde82f389af1 net: dsa: merge all bools of struct dsa_port into a single u8
> b08db33dabd1 net: dsa: move dsa_port :: stp_state near dsa_port :: mac
> 7aacb894b1ad net: lan966x: Extend switchdev with mdb support
> 11b0a27772f5 net: lan966x: Add PGID_GP_START and PGID_GP_END
> fc0c3fe7486f net: lan966x: Add function lan966x_mac_ip_learn()
> 0c94d657d2a4 net: lan966x: Fix the vlan used by host ports
> 2e49761e4fd1 net: lan966x: Add support for multiple bridge flags
> 811ba2771182 net: lan966x: Extend switchdev with fdb support
> e14f72398df4 net: lan966x: Extend switchdev bridge flags
> 6d2c186afa5d net: lan966x: Add vlan support.
> cf2f60897e92 net: lan966x: Add support to offload the forwarding.
> 571bb516a869 net: lan966x: Remove .ndo_change_rx_flags
> 25ee9561ec62 net: lan966x: More MAC table functionality
> 5ccd66e01cbe net: lan966x: add support for interrupts from analyzer
> ef14049f4db9 net: lan966x: Add registers that are used for switch and vlan functionality
> 7f2973149c22 net: dsa: make tagging protocols connect to individual switches from a tree
> e2f01bfe1406 net: dsa: tag_sja1105: fix zeroization of ds->priv on tag proto disconnect
> b26980ab2a97 net: lan966x: Fix the configuration of the pcs
> 950a419d9de1 net: dsa: tag_sja1105: split sja1105_tagger_data into private and public sections
> fcbf979a5b4b Revert "net: dsa: move sja1110_process_meta_tstamp inside the tagging protocol driver"
> c79e84866d2a net: dsa: tag_sja1105: convert to tagger-owned data
> 22ee9f8e4011 net: dsa: sja1105: move ts_id from sja1105_tagger_data
> bfcf14252220 net: dsa: sja1105: make dp->priv point directly to sja1105_tagger_data
> 6f6770ab1ce2 net: dsa: sja1105: remove hwts_tx_en from tagger data
> d38049bbe760 net: dsa: sja1105: bring deferred xmit implementation in line with ocelot-8021q
> a3d74295d790 net: dsa: sja1105: let deferred packets time out when sent to ports going down
> 35d976802124 net: dsa: tag_ocelot: convert to tagger-owned data
> dc452a471dba net: dsa: introduce tagger-owned storage for private and shared data
> 857fdd74fb38 net: dsa: eliminate dsa_switch_ops :: port_bridge_tx_fwd_{,un}offload
> b079922ba2ac net: dsa: add a "tx_fwd_offload" argument to ->port_bridge_join
> d3eed0e57d5d net: dsa: keep the bridge_dev and bridge_num as part of the same structure
> 6a43cba30340 net: dsa: export bridging offload helpers to drivers
> 936db8a2dba2 net: dsa: rename dsa_port_offloads_bridge to dsa_port_offloads_bridge_dev
> 41fb0cf1bced net: dsa: hide dp->bridge_dev and dp->bridge_num in drivers behind helpers
> 36cbf39b5690 net: dsa: hide dp->bridge_dev and dp->bridge_num in the core behind helpers
> 65144067d360 net: dsa: mv88e6xxx: compute port vlan membership based on dp->bridge_dev comparison
> 0493fa7927af net: dsa: mv88e6xxx: iterate using dsa_switch_for_each_user_port in mv88e6xxx_port_check_hw_vlan
> 872bb81dfbc3 net: dsa: mt7530: iterate using dsa_switch_for_each_user_port in bridging ops
> 947c8746e2c3 net: dsa: assign a bridge number even without TX forwarding offload
> 3f9bb0301d50 net: dsa: make dp->bridge_num one-based
> bb14bfc7eb92 net: lan966x: fix a IS_ERR() vs NULL check in lan966x_create_targets()
> cc9cf69eea48 net: lan966x: Fix builds for lan966x driver
> a290cf692779 net: lan966x: Fix duplicate check in frame extraction
> 12c2d0a5b8e2 net: lan966x: add ethtool configuration and statistics
> e18aba8941b4 net: lan966x: add mactable support
> d28d6d2e37d1 net: lan966x: add port module support
> db8bcaad5393 net: lan966x: add the basic lan966x driver
> ef136837aaf6 net: dsa: rtl8365mb: set RGMII RX delay in steps of 0.3 ns
> b014861d96a6 net: dsa: realtek-smi: don't log an error on EPROBE_DEFER
> 1e89ad864d03 net: dsa: realtek-smi: fix indirect reg access for ports>3
> b3612ccdf284 net: dsa: microchip: implement multi-bridge support
> 96ca08c05838 net: mscc: ocelot: set up traps for PTP packets
> ec15baec3272 net: ptp: add a definition for the UDP port for IEEE 1588 general messages
> 95706be13b9f net: mscc: ocelot: create a function that replaces an existing VCAP filter
> 8abe19703825 net: dsa: felix: enable cut-through forwarding between ports by default
> a8bd9fa5b527 net: ocelot: remove "bridge" argument from ocelot_get_bridge_fwd_mask
> 4636440f913b net: dsa: qca8k: Fix spelling mistake "Mismateched" -> "Mismatched"
> 0898ca67b86e net: dsa: qca8k: fix warning in LAG feature
> def975307c01 net: dsa: qca8k: add LAG support
> 2c1bdbc7e756 net: dsa: qca8k: add support for mirror mode
> ba8f870dfa63 net: dsa: qca8k: add support for mdb_add/del
> 6a3bdc5209f4 net: dsa: qca8k: add set_ageing_time support
> 4592538bfb0d net: dsa: qca8k: add support for port fast aging
> c126f118b330 net: dsa: qca8k: add additional MIB counter and make it dynamic
> 8b5f3f29a81a net: dsa: qca8k: initial conversion to regmap helper
> 36b8af12f424 net: dsa: qca8k: move regmap init in probe and set it mandatory
> 994c28b6f971 net: dsa: qca8k: remove extra mutex_init in qca8k_setup
> 90ae68bfc2ff net: dsa: qca8k: convert to GENMASK/FIELD_PREP/FIELD_GET
> b9133f3ef5a2 net: dsa: qca8k: remove redundant check in parse_port_config
> 65258b9d8cde net: dsa: qca8k: fix MTU calculation
> 3b00a07c2443 net: dsa: qca8k: fix internal delay applied to the wrong PAD config
> a7e13edf37be net: dsa: felix: restrict psfp rules on ingress port
> 76c13ede7120 net: dsa: felix: use vcap policer to set flow meter for psfp
> 77043c37096d net: mscc: ocelot: use index to set vcap policer
> 23ae3a787771 net: dsa: felix: add stream gate settings for psfp
> 7d4b564d6add net: dsa: felix: support psfp filter on vsc9959
> 23e2c506ad6c net: mscc: ocelot: add gate and police action offload to PSFP
> 5b1918a54a91 net: mscc: ocelot: set vcap IS2 chain to goto PSFP chain
> 0568c3bf3f34 net: mscc: ocelot: add MAC table stream learn and lookup operations
> 02d6fdecb9c3 regmap: allow to define reg_update_bits for no bus configuration
> 5f15d392dcb4 net: dsa: qca8k: make sure PAD0 MAC06 exchange is disabled
> ae0393500e3b net: bridge: switchdev: fix shim definition for br_switchdev_mdb_notify
> 326b212e9cd6 net: bridge: switchdev: consistent function naming
> 9776457c784f net: bridge: mdb: move all switchdev logic to br_switchdev.c
> 9ae9ff994b0e net: bridge: split out the switchdev portion of br_mdb_notify
> 4a6849e46173 net: bridge: move br_vlan_replay to br_switchdev.c
> c5f6e5ebc2af net: bridge: provide shim definition for br_vlan_flags
> 716a30a97a52 net: switchdev: merge switchdev_handle_fdb_{add,del}_to_device
> fab9eca88410 net: bridge: create a common function for populating switchdev FDB entries
> 5cda5272a460 net: bridge: move br_fdb_replay inside br_switchdev.c
> 9574fb558044 net: bridge: reduce indentation level in fdb_create
> f6814fdcfe1b net: bridge: rename br_fdb_insert to br_fdb_add_local
> 4731b6d6b257 net: bridge: rename fdb_insert to fdb_add_local
> 5f94a5e276ae net: bridge: remove fdb_insert forward declaration
> 4682048af0c8 net: bridge: remove fdb_notify forward declaration
> 425d19cedef8 net: dsa: stop calling dev_hold in dsa_slave_fdb_event
> d7d0d423dbaa net: dsa: flush switchdev workqueue when leaving the bridge
> 0faf890fc519 net: dsa: drop rtnl_lock from dsa_slave_switchdev_event_work
> 338a3a4745aa net: dsa: introduce locking for the address lists on CPU and DSA ports
> cf231b436f7c net: dsa: lantiq_gswip: serialize access to the PCE registers
> f7eb4a1c0864 net: dsa: b53: serialize access to the ARL table
> edc90d15850c selftests: net: dsa: add a stress test for unlocked FDB operations
> 016748961ba5 selftests: lib: forwarding: allow tests to not require mz and jq
> f239934cffe5 net: dsa: b53: serialize access to the ARL table
> f2c4bdf62d76 net: mscc: ocelot: serialize access to the MAC table
> 1681ae1691ef net: dsa: sja1105: serialize access to the dynamic config interface
> 643979cf5ec4 net: dsa: sja1105: wait for dynamic config command completion on writes too
> 992e5cc7be8e net: dsa: tag_8021q: make dsa_8021q_{rx,tx}_vid take dp as argument
> 5068887a4fbe net: dsa: tag_sja1105: do not open-code dsa_switch_for_each_port
> fac6abd5f132 net: dsa: convert cross-chip notifiers to iterate using dp
> 57d77986e742 net: dsa: remove gratuitous use of dsa_is_{user,dsa,cpu}_port
> 65c563a67755 net: dsa: do not open-code dsa_switch_for_each_port
> d0004a020bb5 net: dsa: remove the "dsa_to_port in a loop" antipattern from the core
> 82b318983c51 net: dsa: introduce helpers for iterating through ports using dp
> d4004422f6f9 net: mscc: ocelot: track the port pvid using a pointer
> bfbab3104413 net: mscc: ocelot: add the local station MAC addresses in VID 0
> 0da1a1c48911 net: mscc: ocelot: allow a config where all bridge VLANs are egress-untagged
> 90e0aa8d108d net: mscc: ocelot: convert the VLAN masks to a list
> 62a22bcbd30e net: mscc: ocelot: add a type definition for REW_TAG_CFG_TAG_CFG
> 040e926f5813 net: dsa: qca8k: tidy for loop in setup and add cpu port check
> 9ca482a246f0 net: dsa: sja1105: parse {rx, tx}-internal-delay-ps properties for RGMII delays
> 4af2950c50c8 net: dsa: realtek-smi: add rtl8365mb subdriver for RTL8365MB-VC
> 1521d5adfc2b net: dsa: tag_rtl8_4: add realtek 8 byte protocol 4 tag
> 9cb8edda2157 net: dsa: move NET_DSA_TAG_RTL4_A to right place in Kconfig/Makefile
> 7bbbbfaa7a1b ether: add EtherType for proprietary Realtek protocols
> fd0bb28c547f net: dsa: qca8k: move port config to dedicated struct
> cef08115846e net: dsa: qca8k: set internal delay also for sgmii
> f477d1c8bdbe net: dsa: qca8k: add support for QCA8328
> ed7988d77fbf dt-bindings: net: dsa: qca8k: document support for qca8328
> 362bb238d8bf net: dsa: qca8k: add support for pws config reg
> 924087c5c3d4 dt-bindings: net: dsa: qca8k: Document qca,led-open-drain binding
> bbc4799e8bb6 net: dsa: qca8k: add explicit SGMII PLL enable
> 13ad5ccc093f dt-bindings: net: dsa: qca8k: Document qca,sgmii-enable-pll
> 5654ec78dd7e net: dsa: qca8k: rework rgmii delay logic and scan for cpu port 6
> 3fcf734aa482 net: dsa: qca8k: add support for cpu port 6
> 731d613338ec dt-bindings: net: dsa: qca8k: Document support for CPU port 6
> 6c43809bf1be net: dsa: qca8k: add support for sgmii falling edge
> fdbf35df9c09 dt-bindings: net: dsa: qca8k: Add SGMII clock phase properties
> d8b6f5bae6d3 dsa: qca8k: add mac_power_sel support
> 39e222bfd7f3 net: dsa: unregister cross-chip notifier after ds->ops->teardown
> 339e75f6b9a0 net: dsa: rtl8366rb: remove unneeded semicolon
> e674cfd08537 net: dsa: rtl8366rb: Support setting STP state
> 1fbd19e10b73 net: dsa: rtl8366rb: Support fast aging
> 56d8bb71a811 net: dsa: rtl8366rb: Support disabling learning
> 5ca721c54d86 net: dsa: tag_ocelot: set the classified VLAN during xmit
> e8c0722927e8 net: mscc: ocelot: write full VLAN TCI in the injection header
> de5bbb6f7e4c net: mscc: ocelot: support egress VLAN rewriting via VCAP ES0
> 55b115c7ecd9 net: dsa: rtl8366rb: Use core filtering tracking
> d310b14ae748 net: dsa: rtl8366: Drop and depromote pointless prints
> a4eff910ec63 net: dsa: rtl8366rb: Rewrite weird VLAN filering enablement
> 7776e33c68ae net: dsa: rtl8366: Drop custom VLAN set-up
> d5a680295be2 net: dsa: rtl8366rb: Support bridge offloading
> bd936bd53b2d net: dsa: Move devlink registration to be last devlink command
> 6d709cadfde6 net: dsa: move sja1110_process_meta_tstamp inside the tagging protocol driver
> 68a81bb2eebd net: dsa: sja1105: remove sp->dp
> db4278c55fa5 devlink: Make devlink_register to be void
> 4dcd183fbd67 net: wwan: iosm: devlink registration
Vladimir Oltean Sept. 6, 2022, 4:18 p.m. UTC | #10
On Tue, Sep 06, 2022 at 09:10:43AM -0700, Colin Foster wrote:
> On Sun, Sep 04, 2022 at 07:34:14PM +0000, Vladimir Oltean wrote:
> > On Fri, Sep 02, 2022 at 08:44:37PM +0200, Christian Marangi wrote:
> > For transparency, here is the commit list I used to produce the backport (top-most is most recent):
> 
> Tangentially related: how did you come up with this list?
> 
> I can only assume this is a manual process based on intricate knowledge
> of net / DSA as a whole. I just want to make sure there isn't a "git
> backport net/dsa origin/master v5.10" sort of thing ;-)

Years of practice ;)

Although I found a tool called git-deps and I ran it in a few places,
I found it to be fundamentally lacking for correct kernel backporting
work. The way that tool works is it finds patches related to the current
one based on what other lines from this patch's context they touch.
This obviously isn't going to work too well. There may very well be no
connection obvious to this tool between, say, a function prototype added
to include/net/dsa.h and its first use in drivers/net/dsa/mv88e6xxx/chip.c.
So it may not know it has to backport the include/net/dsa.h change.

I suspect one way in which git-deps may be modified in order to be much
more useful for kernel work is for it to backport the entire patch
series from which the dependency commit came. But (1) I don't know
python even enough to be able to manage a pip virtual environment, let
alone code up such a change, and (2) I'm not sure, from a kernel devel
process perspective, that we offer enough machine-parsable hints such
that a python program can just figure out "yes, these are the patches
that all belong to the same patch set as commit X".