Re: [RFC PATCH v2 0/2] Add DSA MultiCPU port support

2022-01-22 Thread Ansuel Smith
Il giorno dom 23 gen 2022 alle ore 02:29 Daniel Golle
 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 
>  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

___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [RFC PATCH v2 1/2] linux: introduce multi-cpu dsa patch

2022-01-22 Thread Daniel Golle
Please see two comments inline below

On Sun, Jan 23, 2022 at 01:35:25AM +0100, Ansuel Smith wrote:
> Add support for multi-cpu dsa. This is a reworked version of the RFC patch
> proposed some time ago.
> By default every dsa port is connected to the first cpu port and the command
> 'ip link set PORT cpu CPU_PORT' can be used to change the used cpu port at
> runtime.
> A specific function port_change_cpu_port is required to correctly setup the
> port on cpu change request.
> 
> Signed-off-by: Ansuel Smith 
> ---
>  ...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 
>  4 files changed, 387 insertions(+)
>  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
> 
> diff --git 
> a/target/linux/generic/hack-5.10/780-1-net-dsa-allow_for_multiple_CPU_ports.patch
>  
> b/target/linux/generic/hack-5.10/780-1-net-dsa-allow_for_multiple_CPU_ports.patch
> new file mode 100644
> index ..7f2f349a
> --- /dev/null
> +++ 
> b/target/linux/generic/hack-5.10/780-1-net-dsa-allow_for_multiple_CPU_ports.patch
> @@ -0,0 +1,151 @@
> +From mboxrd@z Thu Jan  1 00:00:00 1970
> +Return-Path: 
> +X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on
> + aws-us-west-2-korg-lkml-1.web.codeaurora.org
> +X-Spam-Level: 
> +X-Spam-Status: No, score=-9.9 required=3.0 tests=DKIM_SIGNED,DKIM_VALID,
> + 
> DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,
> + SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham
> + autolearn_force=no version=3.4.0
> +Received: from mail.kernel.org (mail.kernel.org [198.145.29.99])
> + by smtp.lore.kernel.org (Postfix) with ESMTP id 98EBDC3A5A2
> + for ; Sat, 24 Aug 2019 02:43:07 + (UTC)
> +Received: from vger.kernel.org (vger.kernel.org [209.132.180.67])
> + by mail.kernel.org (Postfix) with ESMTP id 6168A2173B
> + for ; Sat, 24 Aug 2019 02:43:07 + (UTC)
> +Authentication-Results: mail.kernel.org;
> + dkim=pass (1024-bit key) header.d=nic.cz header.i=@nic.cz 
> header.b="Kl8qU9Mx"
> +Received: (majord...@vger.kernel.org) by vger.kernel.org via listexpand
> +id S1726888AbfHXCnF (ORCPT );
> +Fri, 23 Aug 2019 22:43:05 -0400
> +Received: from mail.nic.cz ([217.31.204.67]:37268 "EHLO mail.nic.cz"
> +rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP
> +id S1725807AbfHXCnD (ORCPT );
> +Fri, 23 Aug 2019 22:43:03 -0400
> +Received: from dellmb.labs.office.nic.cz (unknown 
> [IPv6:2001:1488:fffe:6:cac7:3539:7f1f:463])
> +by mail.nic.cz (Postfix) with ESMTP id 94D1E140D1E;
> +Sat, 24 Aug 2019 04:42:59 +0200 (CEST)
> +DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=nic.cz; s=default;
> +t=1566614579; bh=jPa21EsnWy9WksW68HSx/O+la2qm4ImIACY+K2cEnLY=;
> +h=From:To:Date;
> +b=Kl8qU9MxZdC3EQnTetDA7VbGXYIuwCO2zS6HinOo7XykIKQDlvB7jIUcH0FQLgG6T
> + BNf/aIsDASIL1PBSAlNynoTMSDf8m6I2Xo8auxQr4L6sslF683w8hY9PN7f+pYyL2R
> + FQs93FIJYSp5I2NCSktTxGFNumTvYPxA8lEqBaZo=
> +From:   =?UTF-8?q?Marek=20Beh=C3=BAn?= 
> +To: net...@vger.kernel.org
> +Cc: Andrew Lunn ,
> +Vivien Didelot ,
> +Florian Fainelli ,
> +David Ahern ,
> +Stephen Hemminger ,
> +=?UTF-8?q?Marek=20Beh=C3=BAn?= 
> +Subject: [PATCH RFC net-next 1/3] net: dsa: allow for multiple CPU ports
> +Date:   Sat, 24 Aug 2019 04:42:48 +0200
> +Message-Id: <20190824024251.4542-2-marek.be...@nic.cz>
> +X-Mailer: git-send-email 2.21.0
> +In-Reply-To: <20190824024251.4542-1-marek.be...@nic.cz>
> +References: <20190824024251.4542-1-marek.be...@nic.cz>
> +MIME-Version: 1.0
> +Content-Type: text/plain; charset=UTF-8
> +Content-Transfer-Encoding: 8bit
> +X-Virus-Scanned: clamav-milter 0.100.3 at mail.nic.cz
> +X-Virus-Status: Clean
> +Sender: netdev-ow...@vger.kernel.org
> +Precedence: bulk
> +List-ID: 
> +X-Mailing-List: net...@vger.kernel.org
> +Archived-At: 
> 
> +List-Archive: 
> +List-Post: 
> +
> +Allow for multiple CPU ports in a DSA switch tree. By default assign the
> +CPU ports to user ports in a round robin way, ie. if there are two CPU
> +ports connected to eth0 and eth1, and five user ports (lan1..lan5),
> +assign them as:
> +  lan1 <-> eth0
> +  lan2 <-> eth1
> +  lan3 <-> eth0
> +  lan4 <-> eth1
> + 

Re: [RFC PATCH v2 0/2] Add DSA MultiCPU port support

2022-01-22 Thread Daniel Golle
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 
 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

___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[RFC PATCH v2 1/2] linux: introduce multi-cpu dsa patch

2022-01-22 Thread Ansuel Smith
Add support for multi-cpu dsa. This is a reworked version of the RFC patch
proposed some time ago.
By default every dsa port is connected to the first cpu port and the command
'ip link set PORT cpu CPU_PORT' can be used to change the used cpu port at
runtime.
A specific function port_change_cpu_port is required to correctly setup the
port on cpu change request.

Signed-off-by: Ansuel Smith 
---
 ...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 
 4 files changed, 387 insertions(+)
 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

diff --git 
a/target/linux/generic/hack-5.10/780-1-net-dsa-allow_for_multiple_CPU_ports.patch
 
b/target/linux/generic/hack-5.10/780-1-net-dsa-allow_for_multiple_CPU_ports.patch
new file mode 100644
index ..7f2f349a
--- /dev/null
+++ 
b/target/linux/generic/hack-5.10/780-1-net-dsa-allow_for_multiple_CPU_ports.patch
@@ -0,0 +1,151 @@
+From mboxrd@z Thu Jan  1 00:00:00 1970
+Return-Path: 
+X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on
+   aws-us-west-2-korg-lkml-1.web.codeaurora.org
+X-Spam-Level: 
+X-Spam-Status: No, score=-9.9 required=3.0 tests=DKIM_SIGNED,DKIM_VALID,
+   
DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,
+   SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham
+   autolearn_force=no version=3.4.0
+Received: from mail.kernel.org (mail.kernel.org [198.145.29.99])
+   by smtp.lore.kernel.org (Postfix) with ESMTP id 98EBDC3A5A2
+   for ; Sat, 24 Aug 2019 02:43:07 + (UTC)
+Received: from vger.kernel.org (vger.kernel.org [209.132.180.67])
+   by mail.kernel.org (Postfix) with ESMTP id 6168A2173B
+   for ; Sat, 24 Aug 2019 02:43:07 + (UTC)
+Authentication-Results: mail.kernel.org;
+   dkim=pass (1024-bit key) header.d=nic.cz header.i=@nic.cz 
header.b="Kl8qU9Mx"
+Received: (majord...@vger.kernel.org) by vger.kernel.org via listexpand
+id S1726888AbfHXCnF (ORCPT );
+Fri, 23 Aug 2019 22:43:05 -0400
+Received: from mail.nic.cz ([217.31.204.67]:37268 "EHLO mail.nic.cz"
+rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP
+id S1725807AbfHXCnD (ORCPT );
+Fri, 23 Aug 2019 22:43:03 -0400
+Received: from dellmb.labs.office.nic.cz (unknown 
[IPv6:2001:1488:fffe:6:cac7:3539:7f1f:463])
+by mail.nic.cz (Postfix) with ESMTP id 94D1E140D1E;
+Sat, 24 Aug 2019 04:42:59 +0200 (CEST)
+DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=nic.cz; s=default;
+t=1566614579; bh=jPa21EsnWy9WksW68HSx/O+la2qm4ImIACY+K2cEnLY=;
+h=From:To:Date;
+b=Kl8qU9MxZdC3EQnTetDA7VbGXYIuwCO2zS6HinOo7XykIKQDlvB7jIUcH0FQLgG6T
+ BNf/aIsDASIL1PBSAlNynoTMSDf8m6I2Xo8auxQr4L6sslF683w8hY9PN7f+pYyL2R
+ FQs93FIJYSp5I2NCSktTxGFNumTvYPxA8lEqBaZo=
+From:   =?UTF-8?q?Marek=20Beh=C3=BAn?= 
+To: net...@vger.kernel.org
+Cc: Andrew Lunn ,
+Vivien Didelot ,
+Florian Fainelli ,
+David Ahern ,
+Stephen Hemminger ,
+=?UTF-8?q?Marek=20Beh=C3=BAn?= 
+Subject: [PATCH RFC net-next 1/3] net: dsa: allow for multiple CPU ports
+Date:   Sat, 24 Aug 2019 04:42:48 +0200
+Message-Id: <20190824024251.4542-2-marek.be...@nic.cz>
+X-Mailer: git-send-email 2.21.0
+In-Reply-To: <20190824024251.4542-1-marek.be...@nic.cz>
+References: <20190824024251.4542-1-marek.be...@nic.cz>
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+X-Virus-Scanned: clamav-milter 0.100.3 at mail.nic.cz
+X-Virus-Status: Clean
+Sender: netdev-ow...@vger.kernel.org
+Precedence: bulk
+List-ID: 
+X-Mailing-List: net...@vger.kernel.org
+Archived-At: 

+List-Archive: 
+List-Post: 
+
+Allow for multiple CPU ports in a DSA switch tree. By default assign the
+CPU ports to user ports in a round robin way, ie. if there are two CPU
+ports connected to eth0 and eth1, and five user ports (lan1..lan5),
+assign them as:
+  lan1 <-> eth0
+  lan2 <-> eth1
+  lan3 <-> eth0
+  lan4 <-> eth1
+  lan5 <-> eth0
+
+Signed-off-by: Marek Behún 
+---
+ include/net/dsa.h |  5 +--
+ net/dsa/dsa2.c| 84 +++
+ 2 files changed, 58 insertions(+), 31 deletions(-)
+
+--- a/net/dsa/dsa2.c
 b/net/dsa/dsa2.c
+@@ -211,7 +211,7 @@ static bool 

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

2022-01-22 Thread Ansuel Smith
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

-- 
2.33.1


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[RFC PATCH v2 2/2] iproute2: add support for cpu set

2022-01-22 Thread Ansuel Smith
Add support for cpu set useful to set CPU port for dsa devices.

Signed-off-by: Ansuel Smith 
---
 ...101-iplink_allow_to_change_cpu_value.patch | 81 +++
 1 file changed, 81 insertions(+)
 create mode 100644 
package/network/utils/iproute2/patches/101-iplink_allow_to_change_cpu_value.patch

diff --git 
a/package/network/utils/iproute2/patches/101-iplink_allow_to_change_cpu_value.patch
 
b/package/network/utils/iproute2/patches/101-iplink_allow_to_change_cpu_value.patch
new file mode 100644
index ..1bb2bb1f
--- /dev/null
+++ 
b/package/network/utils/iproute2/patches/101-iplink_allow_to_change_cpu_value.patch
@@ -0,0 +1,81 @@
+From 8642516618b60a2827215f2bed54d4d0aa1da48a Mon Sep 17 00:00:00 2001
+From: Ansuel Smith 
+Date: Sun, 23 Jan 2022 00:31:49 +0100
+Subject: [PATCH] iplink: allow to change cpu of dsa device
+
+Allow to change the cpu port linked to a given dsa interface.
+This is useful in the case of multi-CPU port DSA to assign the correct
+port to the different user ports.
+
+Signed-off-by: Ansuel Smith 
+---
+ include/uapi/linux/if_link.h | 1 +
+ ip/iplink.c  | 7 +++
+ man/man8/ip-link.8.in| 7 +++
+ 3 files changed, 15 insertions(+)
+
+diff --git a/include/uapi/linux/if_link.h b/include/uapi/linux/if_link.h
+index 41708e26..901b5544 100644
+--- a/include/uapi/linux/if_link.h
 b/include/uapi/linux/if_link.h
+@@ -279,6 +279,7 @@ enum {
+   IFLA_BROADCAST,
+   IFLA_IFNAME,
+   IFLA_MTU,
++  IFLA_CPU,
+   IFLA_LINK,
+   IFLA_QDISC,
+   IFLA_STATS,
+diff --git a/ip/iplink.c b/ip/iplink.c
+index a3ea775d..254c35c5 100644
+--- a/ip/iplink.c
 b/ip/iplink.c
+@@ -595,6 +595,7 @@ int iplink_parse(int argc, char **argv, struct iplink_req 
*req, char **type)
+   int index = 0;
+   int group = -1;
+   int addr_len = 0;
++  int cpu = -1;
+   int err;
+ 
+   ret = argc;
+@@ -625,6 +626,12 @@ int iplink_parse(int argc, char **argv, struct iplink_req 
*req, char **type)
+   } else if (matches(*argv, "link") == 0) {
+   NEXT_ARG();
+   link = *argv;
++  } else if (matches(*argv, "cpu") == 0) {
++  NEXT_ARG();
++  cpu = ll_name_to_index(*argv);
++  if (!cpu)
++  return nodev(*argv);
++  addattr32(>n, sizeof(*req), IFLA_CPU, cpu);
+   } else if (matches(*argv, "address") == 0) {
+   NEXT_ARG();
+   addr_len = ll_addr_a2n(abuf, sizeof(abuf), *argv);
+diff --git a/man/man8/ip-link.8.in b/man/man8/ip-link.8.in
+index 19a0c9ca..406db8ad 100644
+--- a/man/man8/ip-link.8.in
 b/man/man8/ip-link.8.in
+@@ -152,6 +152,9 @@ ip-link \- network device configuration
+ .br
+ .RB "[ " nomaster " ]"
+ .br
++.RB "[ " cpu
++.IR DEVICE " ]"
++.br
+ .RB "[ " vrf
+ .IR NAME " ]"
+ .br
+@@ -2299,6 +2302,10 @@ set master device of the device (enslave device).
+ .BI nomaster
+ unset master device of the device (release device).
+ 
++.TP
++.BI cpu " DEVICE"
++set cpu device of the dsa device.
++
+ .TP
+ .BI addrgenmode " eui64|none|stable_secret|random"
+ set the IPv6 address generation mode
+-- 
+2.33.1
+
-- 
2.33.1


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[PATCH] kernel: bpf-headers: fix build error when testing kernel is used

2022-01-22 Thread Ansuel Smith
Now that we have separate files for each kernel version, only the version/hash
for the target kernel are available.
This cause a missing hash error (and wrong kernel version) for bpf-headers
when a testing kernel version is used for the current target.

Fix this error by manually including the kernel version/hash file for the
specific kernel version requested.

Signed-off-by: Ansuel Smith 
---
 package/kernel/bpf-headers/Makefile | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/package/kernel/bpf-headers/Makefile 
b/package/kernel/bpf-headers/Makefile
index f3c0584007..b3f1c0c7f3 100644
--- a/package/kernel/bpf-headers/Makefile
+++ b/package/kernel/bpf-headers/Makefile
@@ -14,6 +14,9 @@ include $(INCLUDE_DIR)/kernel.mk
 
 PKG_NAME:=linux
 PKG_PATCHVER:=5.10
+# Manually include kernel version/hash from kernel details file
+include $(INCLUDE_DIR)/kernel-$(PKG_PATCHVER)
+
 PKG_VERSION:=$(PKG_PATCHVER)$(strip $(LINUX_VERSION-$(PKG_PATCHVER)))
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=$(LINUX_SITE)
-- 
2.30.2.windows.1


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[PATCH] arc770: Remove arc770 target

2022-01-22 Thread Hauke Mehrtens
The arc700 target is not booting up since some time, see here:
https://github.com/foss-for-synopsys-dwc-arc-processors/toolchain/issues/400

It looks like there is a problem in the toolchain when using glibc.

Currently no one is working on fixing this problem, remove the target
instead. This target also does not have many users we are aware of.

If someone wants to have this target back, feel free to add a fixed
version of this target again.

Signed-off-by: Hauke Mehrtens 
---
 package/devel/perf/Makefile   |   2 +-
 target/linux/arc770/Makefile  |  22 --
 .../arc770/base-files/etc/board.d/02_network  |  17 --
 target/linux/arc770/config-5.4| 195 --
 .../arc770/generic/profiles/00-default.mk |  13 --
 target/linux/arc770/generic/target.mk |   8 -
 target/linux/arc770/image/Config.in   |   5 -
 target/linux/arc770/image/Makefile|  84 
 .../arc770/image/gen_axs10x_sdcard_img.sh |  29 ---
 target/linux/arc770/image/uEnv.txt|   7 -
 ...c-Disable-frame-filtering-completely.patch |  31 ---
 11 files changed, 1 insertion(+), 412 deletions(-)
 delete mode 100644 target/linux/arc770/Makefile
 delete mode 100644 target/linux/arc770/base-files/etc/board.d/02_network
 delete mode 100644 target/linux/arc770/config-5.4
 delete mode 100644 target/linux/arc770/generic/profiles/00-default.mk
 delete mode 100644 target/linux/arc770/generic/target.mk
 delete mode 100644 target/linux/arc770/image/Config.in
 delete mode 100644 target/linux/arc770/image/Makefile
 delete mode 100755 target/linux/arc770/image/gen_axs10x_sdcard_img.sh
 delete mode 100644 target/linux/arc770/image/uEnv.txt
 delete mode 100644 
target/linux/arc770/patches-5.4/700-stmmac-Disable-frame-filtering-completely.patch

diff --git a/package/devel/perf/Makefile b/package/devel/perf/Makefile
index bbf3aaf9ceac..9efd8f56e6b9 100644
--- a/package/devel/perf/Makefile
+++ b/package/devel/perf/Makefile
@@ -27,7 +27,7 @@ include $(INCLUDE_DIR)/nls.mk
 define Package/perf
   SECTION:=devel
   CATEGORY:=Development
-  DEPENDS:= +libelf +libdw +PACKAGE_libunwind:libunwind +libpthread +librt 
+objdump @!IN_SDK @!TARGET_arc770 @KERNEL_PERF_EVENTS
+  DEPENDS:= +libelf +libdw +PACKAGE_libunwind:libunwind +libpthread +librt 
+objdump @!IN_SDK @KERNEL_PERF_EVENTS
   TITLE:=Linux performance monitoring tool
   VERSION:=$(LINUX_VERSION)-$(PKG_RELEASE)
   URL:=http://www.kernel.org
diff --git a/target/linux/arc770/Makefile b/target/linux/arc770/Makefile
deleted file mode 100644
index 1320c8283ba3..
--- a/target/linux/arc770/Makefile
+++ /dev/null
@@ -1,22 +0,0 @@
-# SPDX-License-Identifier: GPL-2.0-only
-#
-# Copyright (C) 2015 OpenWrt.org
-
-include $(TOPDIR)/rules.mk
-
-ARCH:=arc
-BOARD:=arc770
-BOARDNAME:=Synopsys DesignWare ARC 770D
-SUBTARGETS:=generic
-
-KERNEL_PATCHVER:=5.4
-
-DEVICE_TYPE:=basic
-
-define Target/Description
-   Synopsys DesignWare boards
-endef
-
-include $(INCLUDE_DIR)/target.mk
-
-$(eval $(call BuildTarget))
diff --git a/target/linux/arc770/base-files/etc/board.d/02_network 
b/target/linux/arc770/base-files/etc/board.d/02_network
deleted file mode 100644
index c90f3fb6a695..
--- a/target/linux/arc770/base-files/etc/board.d/02_network
+++ /dev/null
@@ -1,17 +0,0 @@
-#
-# Copyright (C) 2015 OpenWrt.org
-#
-
-. /lib/functions/uci-defaults.sh
-
-board_config_update
-
-case "$(board_name)" in
-snps,axs101)
-   ucidef_set_interface_lan "eth0" "dhcp"
-   ;;
-esac
-
-board_config_flush
-
-exit 0
diff --git a/target/linux/arc770/config-5.4 b/target/linux/arc770/config-5.4
deleted file mode 100644
index 4cd5f195e698..
--- a/target/linux/arc770/config-5.4
+++ /dev/null
@@ -1,195 +0,0 @@
-# CONFIG_16KSTACKS is not set
-CONFIG_ARC=y
-CONFIG_ARCH_32BIT_OFF_T=y
-CONFIG_ARCH_HAS_CACHE_LINE_SIZE=y
-CONFIG_ARCH_HAS_DMA_COHERENT_TO_PFN=y
-CONFIG_ARCH_HAS_DMA_PREP_COHERENT=y
-CONFIG_ARCH_HAS_PTE_SPECIAL=y
-CONFIG_ARCH_HAS_SETUP_DMA_OPS=y
-CONFIG_ARCH_HAS_SYNC_DMA_FOR_CPU=y
-CONFIG_ARCH_HAS_SYNC_DMA_FOR_DEVICE=y
-CONFIG_ARCH_SUPPORTS_ATOMIC_RMW=y
-CONFIG_ARC_BUILTIN_DTB_NAME=""
-CONFIG_ARC_CACHE=y
-CONFIG_ARC_CACHE_LINE_SHIFT=5
-CONFIG_ARC_CACHE_PAGES=y
-# CONFIG_ARC_CACHE_VIPT_ALIASING is not set
-# CONFIG_ARC_COMPACT_IRQ_LEVELS is not set
-# CONFIG_ARC_CPU_750D is not set
-CONFIG_ARC_CPU_770=y
-CONFIG_ARC_CURR_IN_REG=y
-CONFIG_ARC_DBG=y
-# CONFIG_ARC_DBG_TLB_PARANOIA is not set
-CONFIG_ARC_DW2_UNWIND=y
-CONFIG_ARC_EMUL_UNALIGNED=y
-# CONFIG_ARC_FPU_SAVE_RESTORE is not set
-CONFIG_ARC_HAS_DCACHE=y
-# CONFIG_ARC_HAS_DCCM is not set
-CONFIG_ARC_HAS_ICACHE=y
-# CONFIG_ARC_HAS_ICCM is not set
-CONFIG_ARC_HAS_LLSC=y
-CONFIG_ARC_HAS_SWAPE=y
-CONFIG_ARC_KVADDR_SIZE=256
-# CONFIG_ARC_METAWARE_HLINK is not set
-# CONFIG_ARC_MMU_V1 is not set
-# CONFIG_ARC_MMU_V2 is not set
-CONFIG_ARC_MMU_V3=y
-# CONFIG_ARC_PAGE_SIZE_16K is not set
-# CONFIG_ARC_PAGE_SIZE_4K is not set
-CONFIG_ARC_PAGE_SIZE_8K=y

Re: [PATCH 2/2] iproute2: add support for link set

2022-01-22 Thread Marek Behún
On Sat, 22 Jan 2022 09:38:01 +
Rui Salvaterra  wrote:

> Hi, Ansuel,
> 
> On Sat, 22 Jan 2022 at 01:08, Ansuel Smith  wrote:
> >
> >
> > So.. how should we proceed with this? From what I understand the idea is to 
> > merge this ASAP.  
> 
> But not a moment sooner. ;) I'm sure we agree that this patch won't be
> merged upstream in its current form, according to the comments
> received, and the less we diverge from upstream, the better for
> maintenance.
> 
> > Think we have to change this with the DSA specific attribute.  
> 
> Ok, let's step back and take a look at our possibilities. Stephen
> Hemminger suggested auditing all kernel usage of IFLA_LINK and adding
> checks where needed to make sure the current users don't break [1].
> This would certainly work, but that would mean sprinkling error checks
> in possibly quite a number of places [2]. Vladimir Oltean, instead,
> suggested creating a new netlink attribute for this specific purpose
> [3] (let's call it IFLA_CPU, for example). I believe the latter is the
> less intrusive of the options, with the added bonus of not having to
> overload IFLA_LINK with different semantics (something I personally
> dislike). I would also rename "link" to "cpu" in the ip patch
> (avoiding the overload, once again).
> 
> [1] https://lore.kernel.org/netdev/20210411100411.6d16e51d@hermes.local/
> [2] https://elixir.bootlin.com/linux/latest/A/ident/IFLA_LINK
> [3] https://lore.kernel.org/netdev/20210411170939.cxmva5vdcpqu4bmi@skbuf/

Hello guys,

I am pessimistic about this being resolved soon in upstream, so my
suggestion to you for OpenWRT is to do something that can be used now,
for example a sysfs attribute, and create an utility for changing port's
CPU port.

Then if things get solved in upstream, you can just change the
utility's code.

Marek

___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[firmware-utils 2/2] iptime-crc32: add image header tool for new ipTIME models

2022-01-22 Thread Sungbo Eo
Some ipTIME models (e.g. A8004T-XR) started to use a new 56-byte header
format which uses accumulated CRC-32 for its checksum algorithm. This tool
helps to pass through the factory image verification process on the
applicable models.

Signed-off-by: Sungbo Eo 
---
 CMakeLists.txt |   1 +
 src/iptime-crc32.c | 147 +
 2 files changed, 148 insertions(+)
 create mode 100644 src/iptime-crc32.c

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 9c7e0e1..46af4b3 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -42,6 +42,7 @@ FW_UTIL(encode_crc "" "" "")
 FW_UTIL(fix-u-media-header src/cyg_crc32.c "" "")
 FW_UTIL(hcsmakeimage src/bcmalgo.c "" "")
 FW_UTIL(imagetag "src/imagetag_cmdline.c;src/cyg_crc32.c" "" "")
+FW_UTIL(iptime-crc32 src/cyg_crc32.c "" "")
 FW_UTIL(iptime-naspkg "" "" "")
 FW_UTIL(jcgimage "" "" "${ZLIB_LIBRARIES}")
 FW_UTIL(lxlfw "" "" "")
diff --git a/src/iptime-crc32.c b/src/iptime-crc32.c
new file mode 100644
index 000..51b0519
--- /dev/null
+++ b/src/iptime-crc32.c
@@ -0,0 +1,147 @@
+// SPDX-License-Identifier: GPL-2.0-only
+/*
+ * Copyright (c) 2021 Sungbo Eo 
+ *
+ * This code is based on mkdhpimg.c and mkzcfw.c
+ * Copyright (C) 2010 Gabor Juhos 
+ * Copyright (c) 2016 FUKAUMI Naoki 
+ *
+ * Checksum algorithm is derived from add_iptime_fw_header.c
+ * Copyright (C) 2020 Jaehoon You 
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include "cyg_crc.h"
+
+#if !defined(__BYTE_ORDER)
+#error "Unknown byte order"
+#endif
+
+#if (__BYTE_ORDER == __BIG_ENDIAN)
+#define HOST_TO_LE32(x)bswap_32(x)
+#elif (__BYTE_ORDER == __LITTLE_ENDIAN)
+#define HOST_TO_LE32(x)(x)
+#else
+#error "Unsupported endianness"
+#endif
+
+#define FW_VERSION "00_000"
+
+struct fw_header {
+   uint8_t model[8];
+   uint8_t version[8];
+   uint8_t reserved[32];
+   uint32_t size;
+   uint32_t checksum;
+} __attribute__ ((packed));
+
+struct board_info {
+   const char *model;
+   size_t payload_offset;
+};
+
+struct board_info boards[] = {
+   { .model = "ax2004m", .payload_offset = 0x38 },
+   { /* sentinel */ }
+};
+
+struct board_info *find_board(const char *model)
+{
+   struct board_info *ret = NULL;
+   struct board_info *board;
+
+   for (board = boards; board->model != NULL; board++) {
+   if (strcmp(model, board->model) == 0) {
+   ret = board;
+   break;
+   }
+   }
+
+   return ret;
+}
+
+uint32_t make_checksum(struct fw_header *header, uint8_t *payload, int size)
+{
+   cyg_uint32 checksum;
+
+   /* get CRC of header */
+   checksum = cyg_crc32_accumulate(~0L, header, sizeof(*header));
+
+   /* get CRC of payload buffer with header CRC as initial value */
+   return (uint32_t)cyg_crc32_accumulate(checksum, payload, size);
+}
+
+void make_header(struct board_info *board, uint8_t *buffer, size_t img_size)
+{
+   struct fw_header *header = (struct fw_header *)buffer;
+   uint32_t checksum;
+
+   strncpy((char *)header->model, board->model, sizeof(header->model)-1);
+   strncpy((char *)header->version, FW_VERSION, sizeof(header->version)-1);
+   header->size = HOST_TO_LE32(img_size);
+   checksum = make_checksum(header, buffer + board->payload_offset, 
img_size);
+   header->checksum = HOST_TO_LE32(checksum);
+}
+
+int main(int argc, const char *argv[])
+{
+   const char *model_name, *img_in, *img_out;
+   struct board_info *board;
+   int file_in, file_out;
+   struct stat stat_in;
+   size_t size_in, size_out;
+   uint8_t *buffer;
+
+   if (argc != 4) {
+   fprintf(stderr, "Usage: %s   \n", 
argv[0]);
+   return EXIT_FAILURE;
+   }
+   model_name = argv[1];
+   img_in = argv[2];
+   img_out = argv[3];
+
+   board = find_board(model_name);
+   if (board == NULL) {
+   fprintf(stderr, "%s: Not supported model\n", model_name);
+   return EXIT_FAILURE;
+   }
+
+   if ((file_in = open(img_in, O_RDONLY)) == -1)
+   err(EXIT_FAILURE, "%s", img_in);
+
+   if (fstat(file_in, _in) == -1)
+   err(EXIT_FAILURE, "%s", img_in);
+
+   size_in = stat_in.st_size;
+   size_out = board->payload_offset + size_in;
+
+   if ((buffer = malloc(size_out)) == NULL)
+   err(EXIT_FAILURE, "malloc");
+
+   read(file_in, buffer + board->payload_offset, size_in);
+   close(file_in);
+
+   memset(buffer, 0, board->payload_offset);
+
+   make_header(board, buffer, size_in);
+
+   if ((file_out = creat(img_out, 0644)) == -1)
+   err(EXIT_FAILURE, "%s", img_out);
+   write(file_out, buffer, size_out);
+   close(file_out);
+
+   free(buffer);
+
+   return EXIT_SUCCESS;
+}
-- 
2.34.1



[firmware-utils 1/2] iptime-naspkg: add image header tool for ipTIME NAS series

2022-01-22 Thread Sungbo Eo
The purpose of this tool is to pass the factory image verification process,
and it does not provide a full image with kernel and rootfs. The tool prepends
a factory header to kernel image, and rootfs should be appended separately.

This tool has been developed and tested on NAS1 and NAS1dual, but it can
also be used on other similar models with additional tweaking.

Signed-off-by: Sungbo Eo 
---
 CMakeLists.txt  |   1 +
 src/iptime-naspkg.c | 228 
 2 files changed, 229 insertions(+)
 create mode 100644 src/iptime-naspkg.c

diff --git a/CMakeLists.txt b/CMakeLists.txt
index f406520..9c7e0e1 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -42,6 +42,7 @@ FW_UTIL(encode_crc "" "" "")
 FW_UTIL(fix-u-media-header src/cyg_crc32.c "" "")
 FW_UTIL(hcsmakeimage src/bcmalgo.c "" "")
 FW_UTIL(imagetag "src/imagetag_cmdline.c;src/cyg_crc32.c" "" "")
+FW_UTIL(iptime-naspkg "" "" "")
 FW_UTIL(jcgimage "" "" "${ZLIB_LIBRARIES}")
 FW_UTIL(lxlfw "" "" "")
 FW_UTIL(lzma2eva "" "" "${ZLIB_LIBRARIES}")
diff --git a/src/iptime-naspkg.c b/src/iptime-naspkg.c
new file mode 100644
index 000..c0fc114
--- /dev/null
+++ b/src/iptime-naspkg.c
@@ -0,0 +1,228 @@
+// SPDX-License-Identifier: GPL-2.0-only
+/*
+ * Copyright (c) 2020 Sungbo Eo 
+ *
+ * This code is based on mkdhpimg.c and mkzcfw.c
+ * Copyright (C) 2010 Gabor Juhos 
+ * Copyright (c) 2016 FUKAUMI Naoki 
+ *
+ * Checksum algorithm is derived from EFM's mknas utility
+ * found in GPL'ed T16000 source.
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#if !defined(__BYTE_ORDER)
+#error "Unknown byte order"
+#endif
+
+#if (__BYTE_ORDER == __BIG_ENDIAN)
+#define HOST_TO_LE32(x)bswap_32(x)
+#elif (__BYTE_ORDER == __LITTLE_ENDIAN)
+#define HOST_TO_LE32(x)(x)
+#else
+#error "Unsupported endianness"
+#endif
+
+#define FW_HEADER_SIZE 0x400
+#define FW_VERSION "0.0.00"
+#define FW_MAGIC   "EFM_NAS_PKG"
+
+struct fw_header {
+   uint8_t model[32];
+   uint8_t version[32];
+   uint8_t ctime[32];
+   uint32_t size;
+   uint32_t checksum;
+   uint32_t offset_header;
+   uint32_t offset_rootfs;
+   uint32_t offset_app;
+   uint32_t checksum_kr;
+   uint8_t magic[16];
+
+   uint32_t size_kra;
+   uint32_t checksum_kra;
+   uint32_t offset_ext;
+} __attribute__ ((packed));
+
+enum board_type {
+   BOARD_KIRKWOOD,
+   BOARD_ARMADA380,
+};
+
+struct board_type_info {
+   int bootloader_size;
+   int block_size;
+};
+
+struct board_info {
+   const char *model;
+   enum board_type type;
+};
+
+struct board_type_info board_types[] = {
+   /* BOARD_KIRKWOOD */
+   { .bootloader_size = 0x4, .block_size = 0x0 },
+   /* BOARD_ARMADA380 */
+   { .bootloader_size = 0x10, .block_size = 0x1 },
+};
+
+struct board_info boards[] = {
+   { .model = "nas1", .type = BOARD_KIRKWOOD  },
+   { .model = "nas1dual", .type = BOARD_ARMADA380 },
+   { /* sentinel */ }
+};
+
+struct board_info *find_board(const char *model)
+{
+   struct board_info *ret = NULL;
+   struct board_info *board;
+
+   for (board = boards; board->model != NULL; board++) {
+   if (strcmp(model, board->model) == 0) {
+   ret = board;
+   break;
+   }
+   }
+
+   return ret;
+}
+
+/* (FW_HEADER_SIZE + size_in + padding) % block_size == 0 */
+size_t calc_padding(enum board_type type, size_t size_in)
+{
+   int block_size, remainder;
+
+   block_size = board_types[type].block_size;
+   if (block_size == 0)
+   return 0;
+   remainder = (FW_HEADER_SIZE + size_in) % block_size;
+   return remainder ? block_size - remainder : 0;
+}
+
+char *get_ctime(void)
+{
+   char *env = getenv("SOURCE_DATE_EPOCH");
+   char *endptr = env;
+   time_t timestamp = -1;
+
+   if (env && *env) {
+   errno = 0;
+   timestamp = strtoull(env, , 10);
+
+   if (errno || (endptr && *endptr != '\0')) {
+   fprintf(stderr, "Invalid SOURCE_DATE_EPOCH\n");
+   timestamp = -1;
+   }
+   }
+
+   if (timestamp == -1)
+   time();
+
+   return asctime(gmtime());
+}
+
+uint32_t make_checksum(const char *model_name, uint8_t *bytes, int length)
+{
+   int i;
+   uint32_t sum = 0;
+   uint32_t magic = 0x19283745;
+
+   for (i = 0; i < length; i++)
+   sum += bytes[i];
+   return ((uint32_t)strlen(model_name) * magic + ~sum) ^ sum;
+}
+
+void make_header(struct board_info *board, uint8_t *buffer, size_t img_size)
+{
+   struct fw_header *header = (struct fw_header *)buffer;
+   char *time_created;
+   uint32_t checksum;
+   size_t bootloader_size, image_end_offset;
+
+   time_created = get_ctime();
+   

Self hosted GitLab instance [Was: Re: Switch issues and CI to GitHub]

2022-01-22 Thread Petr Štetiar
Paul Spooren  [2022-01-07 10:34:34]:

Hi,

(adding openwrt-adm@ into the loop)

> None of the OpenWrt project members is willing to setup and maintain a
> GitLab instance

so what about having that GitLab instance prepared and co-maintained by some
trusted 3rd party? I mean, define our needs, find someone who would be willing
to do that, estimate the costs and then prepare some fundraiser which should
cover the costs for next 3-5 years, so we don't need to repeat this daunting
task every year.

Cheers,

Petr

___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: Update buildbots (was: Re: Switch issues and CI to GitHub)

2022-01-22 Thread Petr Štetiar
Etienne Champetier  [2022-01-20 14:56:28]:

Hi,

> Any chance you can update the buildbots docker images ?
> (I see only you 2 listed as admins here: https://openwrt.org/infrastructure)

should be done.

Cheers,

Petr

___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [PATCH 2/2] iproute2: add support for link set

2022-01-22 Thread Rui Salvaterra
Hi, Ansuel,

On Sat, 22 Jan 2022 at 01:08, Ansuel Smith  wrote:
>
>
> So.. how should we proceed with this? From what I understand the idea is to 
> merge this ASAP.

But not a moment sooner. ;) I'm sure we agree that this patch won't be
merged upstream in its current form, according to the comments
received, and the less we diverge from upstream, the better for
maintenance.

> Think we have to change this with the DSA specific attribute.

Ok, let's step back and take a look at our possibilities. Stephen
Hemminger suggested auditing all kernel usage of IFLA_LINK and adding
checks where needed to make sure the current users don't break [1].
This would certainly work, but that would mean sprinkling error checks
in possibly quite a number of places [2]. Vladimir Oltean, instead,
suggested creating a new netlink attribute for this specific purpose
[3] (let's call it IFLA_CPU, for example). I believe the latter is the
less intrusive of the options, with the added bonus of not having to
overload IFLA_LINK with different semantics (something I personally
dislike). I would also rename "link" to "cpu" in the ip patch
(avoiding the overload, once again).

[1] https://lore.kernel.org/netdev/20210411100411.6d16e51d@hermes.local/
[2] https://elixir.bootlin.com/linux/latest/A/ident/IFLA_LINK
[3] https://lore.kernel.org/netdev/20210411170939.cxmva5vdcpqu4bmi@skbuf/

Cheers,
Rui

___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel