mbox series

[RFC,v2,0/2] Add DSA MultiCPU port support

Message ID 20220123003526.22366-1-ansuelsmth@gmail.com
Headers show
Series Add DSA MultiCPU port support | expand

Message

Christian Marangi Jan. 23, 2022, 12:35 a.m. UTC
This adds the hack patches for DSA multicpu support.
I still have to clean patch 1, 3, 4 but considering this is still a bit WIP
I decided to clean and provide a correct patches for the final version.

This version won't change the logic by DSA that assing every port to the first
cpu port. A init script is required to change the cpu port at runtime.

This change was done for the only reason that a round-robin way can't be trusted
and is too random. Some cpu port in some switch (brcm) for example doesn't
behave the same way and randomly assigning the cpu port would cause
problems/malfunctions.

v2:
- Rework iproute logic to not pollute link
- Rework the round-robin cpu port assign logic

Ansuel Smith (2):
  linux: introduce multi-cpu dsa patch
  iproute2: add support for cpu set

 ...101-iplink_allow_to_change_cpu_value.patch |  81 ++++++++++
 ...net-dsa-allow_for_multiple_CPU_ports.patch | 151 ++++++++++++++++++
 ...add_ndo_for_setting_the_cpu_property.patch | 113 +++++++++++++
 ..._set_cpu_for_changing_ports_CPU_port.patch |  89 +++++++++++
 ...clude-net-add-dsa_cpu_ports-function.patch |  34 ++++
 5 files changed, 468 insertions(+)
 create mode 100644 package/network/utils/iproute2/patches/101-iplink_allow_to_change_cpu_value.patch
 create mode 100644 target/linux/generic/hack-5.10/780-1-net-dsa-allow_for_multiple_CPU_ports.patch
 create mode 100644 target/linux/generic/hack-5.10/780-2-net-add_ndo_for_setting_the_cpu_property.patch
 create mode 100644 target/linux/generic/hack-5.10/780-3-net-dsa-implement_ndo_set_cpu_for_changing_ports_CPU_port.patch
 create mode 100644 target/linux/generic/hack-5.10/780-4-include-net-add-dsa_cpu_ports-function.patch

Comments

Daniel Golle Jan. 23, 2022, 1:29 a.m. UTC | #1
On Sun, Jan 23, 2022 at 01:35:24AM +0100, Ansuel Smith wrote:
> This adds the hack patches for DSA multicpu support.
> I still have to clean patch 1, 3, 4 but considering this is still a bit WIP
> I decided to clean and provide a correct patches for the final version.
> 
> This version won't change the logic by DSA that assing every port to the first
> cpu port. A init script is required to change the cpu port at runtime.

Imho we should also add patch

 From: LGA1150 <dqfext@gmail.com>
 Date: Mon, 17 May 2021 10:34:58 +0200
 Subject: [PATCH] net: dsa: add dts-property default_cpu

so this can be done in device-tree rather than using an init-script.

> This change was done for the only reason that a round-robin way can't be trusted
> and is too random. Some cpu port in some switch (brcm) for example doesn't
> behave the same way and randomly assigning the cpu port would cause
> problems/malfunctions.

I agree that round-robin is not such a good idea, the commit message of
the patch itself will also have to be updated to reflect that change.

> 
> v2:
> - Rework iproute logic to not pollute link
> - Rework the round-robin cpu port assign logic
> 
> Ansuel Smith (2):
>   linux: introduce multi-cpu dsa patch
>   iproute2: add support for cpu set
> 
>  ...101-iplink_allow_to_change_cpu_value.patch |  81 ++++++++++
>  ...net-dsa-allow_for_multiple_CPU_ports.patch | 151 ++++++++++++++++++
>  ...add_ndo_for_setting_the_cpu_property.patch | 113 +++++++++++++
>  ..._set_cpu_for_changing_ports_CPU_port.patch |  89 +++++++++++
>  ...clude-net-add-dsa_cpu_ports-function.patch |  34 ++++
>  5 files changed, 468 insertions(+)
>  create mode 100644 package/network/utils/iproute2/patches/101-iplink_allow_to_change_cpu_value.patch
>  create mode 100644 target/linux/generic/hack-5.10/780-1-net-dsa-allow_for_multiple_CPU_ports.patch
>  create mode 100644 target/linux/generic/hack-5.10/780-2-net-add_ndo_for_setting_the_cpu_property.patch
>  create mode 100644 target/linux/generic/hack-5.10/780-3-net-dsa-implement_ndo_set_cpu_for_changing_ports_CPU_port.patch
>  create mode 100644 target/linux/generic/hack-5.10/780-4-include-net-add-dsa_cpu_ports-function.patch
> 
> -- 
> 2.33.1
> 
> 
> _______________________________________________
> openwrt-devel mailing list
> openwrt-devel@lists.openwrt.org
> https://lists.openwrt.org/mailman/listinfo/openwrt-devel
Christian Marangi Jan. 23, 2022, 1:39 a.m. UTC | #2
Il giorno dom 23 gen 2022 alle ore 02:29 Daniel Golle
<daniel@makrotopia.org> ha scritto:
>
> On Sun, Jan 23, 2022 at 01:35:24AM +0100, Ansuel Smith wrote:
> > This adds the hack patches for DSA multicpu support.
> > I still have to clean patch 1, 3, 4 but considering this is still a bit WIP
> > I decided to clean and provide a correct patches for the final version.
> >
> > This version won't change the logic by DSA that assing every port to the first
> > cpu port. A init script is required to change the cpu port at runtime.
>
> Imho we should also add patch
>
>  From: LGA1150 <dqfext@gmail.com>
>  Date: Mon, 17 May 2021 10:34:58 +0200
>  Subject: [PATCH] net: dsa: add dts-property default_cpu
>
> so this can be done in device-tree rather than using an init-script.
>

Don't know if you check the pr but the additional binding was rejected upstream.
We need to understand if we can accept this kind of patch or not.
IMHO considering it should be a small patch, we can totally accept
that but we have
to be conscious that it won't ever be merged and it will stay in hack forever.

> > This change was done for the only reason that a round-robin way can't be trusted
> > and is too random. Some cpu port in some switch (brcm) for example doesn't
> > behave the same way and randomly assigning the cpu port would cause
> > problems/malfunctions.
>
> I agree that round-robin is not such a good idea, the commit message of
> the patch itself will also have to be updated to reflect that change.
>

Sure as I said, I still have to rework this and produce clear patches.
(I assume many changes are still needed for this)

> >
> > v2:
> > - Rework iproute logic to not pollute link
> > - Rework the round-robin cpu port assign logic
> >
> > Ansuel Smith (2):
> >   linux: introduce multi-cpu dsa patch
> >   iproute2: add support for cpu set
> >
> >  ...101-iplink_allow_to_change_cpu_value.patch |  81 ++++++++++
> >  ...net-dsa-allow_for_multiple_CPU_ports.patch | 151 ++++++++++++++++++
> >  ...add_ndo_for_setting_the_cpu_property.patch | 113 +++++++++++++
> >  ..._set_cpu_for_changing_ports_CPU_port.patch |  89 +++++++++++
> >  ...clude-net-add-dsa_cpu_ports-function.patch |  34 ++++
> >  5 files changed, 468 insertions(+)
> >  create mode 100644 package/network/utils/iproute2/patches/101-iplink_allow_to_change_cpu_value.patch
> >  create mode 100644 target/linux/generic/hack-5.10/780-1-net-dsa-allow_for_multiple_CPU_ports.patch
> >  create mode 100644 target/linux/generic/hack-5.10/780-2-net-add_ndo_for_setting_the_cpu_property.patch
> >  create mode 100644 target/linux/generic/hack-5.10/780-3-net-dsa-implement_ndo_set_cpu_for_changing_ports_CPU_port.patch
> >  create mode 100644 target/linux/generic/hack-5.10/780-4-include-net-add-dsa_cpu_ports-function.patch
> >
> > --
> > 2.33.1
> >
> >
> > _______________________________________________
> > openwrt-devel mailing list
> > openwrt-devel@lists.openwrt.org
> > https://lists.openwrt.org/mailman/listinfo/openwrt-devel
Christian Marangi Jan. 28, 2022, 4:44 p.m. UTC | #3
Il giorno dom 23 gen 2022 alle ore 02:39 Ansuel Smith
<ansuelsmth@gmail.com> ha scritto:
>
> Il giorno dom 23 gen 2022 alle ore 02:29 Daniel Golle
> <daniel@makrotopia.org> ha scritto:
> >
> > On Sun, Jan 23, 2022 at 01:35:24AM +0100, Ansuel Smith wrote:
> > > This adds the hack patches for DSA multicpu support.
> > > I still have to clean patch 1, 3, 4 but considering this is still a bit WIP
> > > I decided to clean and provide a correct patches for the final version.
> > >
> > > This version won't change the logic by DSA that assing every port to the first
> > > cpu port. A init script is required to change the cpu port at runtime.
> >
> > Imho we should also add patch
> >
> >  From: LGA1150 <dqfext@gmail.com>
> >  Date: Mon, 17 May 2021 10:34:58 +0200
> >  Subject: [PATCH] net: dsa: add dts-property default_cpu
> >
> > so this can be done in device-tree rather than using an init-script.
> >
>
> Don't know if you check the pr but the additional binding was rejected upstream.
> We need to understand if we can accept this kind of patch or not.
> IMHO considering it should be a small patch, we can totally accept
> that but we have
> to be conscious that it won't ever be merged and it will stay in hack forever.
>
> > > This change was done for the only reason that a round-robin way can't be trusted
> > > and is too random. Some cpu port in some switch (brcm) for example doesn't
> > > behave the same way and randomly assigning the cpu port would cause
> > > problems/malfunctions.
> >
> > I agree that round-robin is not such a good idea, the commit message of
> > the patch itself will also have to be updated to reflect that change.
> >
>
> Sure as I said, I still have to rework this and produce clear patches.
> (I assume many changes are still needed for this)
>

I will send v3 in the next few days. Any other comments?

> > >
> > > v2:
> > > - Rework iproute logic to not pollute link
> > > - Rework the round-robin cpu port assign logic
> > >
> > > Ansuel Smith (2):
> > >   linux: introduce multi-cpu dsa patch
> > >   iproute2: add support for cpu set
> > >
> > >  ...101-iplink_allow_to_change_cpu_value.patch |  81 ++++++++++
> > >  ...net-dsa-allow_for_multiple_CPU_ports.patch | 151 ++++++++++++++++++
> > >  ...add_ndo_for_setting_the_cpu_property.patch | 113 +++++++++++++
> > >  ..._set_cpu_for_changing_ports_CPU_port.patch |  89 +++++++++++
> > >  ...clude-net-add-dsa_cpu_ports-function.patch |  34 ++++
> > >  5 files changed, 468 insertions(+)
> > >  create mode 100644 package/network/utils/iproute2/patches/101-iplink_allow_to_change_cpu_value.patch
> > >  create mode 100644 target/linux/generic/hack-5.10/780-1-net-dsa-allow_for_multiple_CPU_ports.patch
> > >  create mode 100644 target/linux/generic/hack-5.10/780-2-net-add_ndo_for_setting_the_cpu_property.patch
> > >  create mode 100644 target/linux/generic/hack-5.10/780-3-net-dsa-implement_ndo_set_cpu_for_changing_ports_CPU_port.patch
> > >  create mode 100644 target/linux/generic/hack-5.10/780-4-include-net-add-dsa_cpu_ports-function.patch
> > >
> > > --
> > > 2.33.1
> > >
> > >
> > > _______________________________________________
> > > openwrt-devel mailing list
> > > openwrt-devel@lists.openwrt.org
> > > https://lists.openwrt.org/mailman/listinfo/openwrt-devel