From patchwork Thu Feb 3 00:44:12 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Marangi X-Patchwork-Id: 1587833 X-Patchwork-Delegate: ansuelsmth@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=qwFG/bIU; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=jQXH7sw3; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.openwrt.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4Jq0QW6Srrz9sCD for ; Thu, 3 Feb 2022 11:48:19 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=VhTvy7KAU5RMSjb1BBbrur7yssPc7mInhRJVpGko82E=; b=qwFG/bIUmWYEjV +C1gcTZTKV8dKm6HU9lzYbg/s8evdHmrQ4/D3vAzNlPEB/Y9tMiPAENMRqQbM1JjkeJD3Y4iy984O rQba5ce7dplUNGoxM9OZdfNi+B/G43GZD/2I+Y97s/QS1g0sCCH5yz4FwMbAoWgI1swI/w0junWCu MWmFP1PhGpZ5KmaHD06QSJzLuaIO0NU0V/kmCVa0j/0oPs2U0hllVWQ7EDdj69LhBP4qEFhRMPFg+ 40aCnDI4jyVGyTFrs60c4m/2yz9zSj3dm180/2u5iUVhSdO/gddgMW0RDyrJwmA6Rx54xYPRj3ZPr 07G9lNgbMcsBxjwo6dxA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nFQEx-00HEcc-Du; Thu, 03 Feb 2022 00:44:47 +0000 Received: from mail-wr1-x432.google.com ([2a00:1450:4864:20::432]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nFQEX-00HEZK-EL for openwrt-devel@lists.openwrt.org; Thu, 03 Feb 2022 00:44:22 +0000 Received: by mail-wr1-x432.google.com with SMTP id l25so1660051wrb.13 for ; Wed, 02 Feb 2022 16:44:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=GVjJ/kcVzm/PtYmPe7f3gcYwSdZTAHeDVf1xeRQMFG4=; b=jQXH7sw3if1ygJqY/U42+QvREp4E9eR8pWgvEulls6QGr/eFluqrVuDUbzjtvqpqwy ZcsxZdoLAVGG3oe6JWUFsS5X/0LjJws9xy07DEE2P5a18QbJoZOhIJYh/mZ1eJR7aftS KIt9QytKXSSyg2xdUJam4H7WRVg378tEqZx/5pBGwU3orBaC8joGb0KG5JlmkJdlRgYk HtkLrxxA1sJGJeKWdQ16ZNqeRuhK93bDP0Ulu2HEbC8wz3Q4Bl/eyZQerdpELnxosD1g 0UHn9wGXl5xvwFd14Xx3RQISdJeFommyNz9MBjc4Sy8+2+Mk7qAM/iueDEbYBNt4wdgL TvBg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=GVjJ/kcVzm/PtYmPe7f3gcYwSdZTAHeDVf1xeRQMFG4=; b=oYzJHmvE0KUM19GM3A9Nki+tQ+ESyENIK7+I5Gh6RIyDOkVvnkTu4P/fCzgatWzH7r OO7t+oOqi8349ilEwYFWnWTp30zzrXullu8OblQrUgoe4+AYFr/dKK12ArZ74eAxM48l 8+XB0YT3eBLlFe9pprJQcRpOO1glR6atz9lnFFgxMBC2m8nC/zeMozMvVvWYklRQjpqy vVg8Ute3iVjdsi9HzXYV9I3ZPQPNVaNnOZ7z2wgb3QO8B2jYud71AVhd0ZSIMcNCrY2W IInfC2DsFNSF5T8mTYsC7oIvEkxsH9Jfdf8O+bWoPOu7J6jXmX8VUU+9TuiOnEuOxAC7 VvDA== X-Gm-Message-State: AOAM531rg1MAZcUyuiJEbT9T6s4rWI+lY7fpDyayYqKAUMnMhtS7/bVs gf/rKWk37Uv5m8acSxQUKX5aH25MKRY= X-Google-Smtp-Source: ABdhPJyZW5y8DS7IZBUOhp5iMJwk7YwNcg+pu6NVuRNKzLvqL/7jDjXafBZ3mCK7hmWD9EYkAUZ4Kw== X-Received: by 2002:adf:f984:: with SMTP id f4mr27670595wrr.510.1643849059295; Wed, 02 Feb 2022 16:44:19 -0800 (PST) Received: from Ansuel-xps.localdomain (93-42-71-246.ip85.fastwebnet.it. [93.42.71.246]) by smtp.googlemail.com with ESMTPSA id e10sm21981592wrq.53.2022.02.02.16.44.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Feb 2022 16:44:18 -0800 (PST) From: Ansuel Smith To: OpenWrt Development List Cc: Ansuel Smith Subject: [PATCH v3 2/2] iproute2: add support for cpu set Date: Thu, 3 Feb 2022 01:44:12 +0100 Message-Id: <20220203004412.19866-3-ansuelsmth@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220203004412.19866-1-ansuelsmth@gmail.com> References: <20220203004412.19866-1-ansuelsmth@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220202_164421_504087_9A7F942A X-CRM114-Status: GOOD ( 19.30 ) X-Spam-Score: -0.2 (/) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: 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- [...] Content analysis details: (-0.2 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:432 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [ansuelsmth[at]gmail.com] -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org 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 00000000..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 +@@ -341,6 +341,7 @@ enum { + IFLA_ALT_IFNAME, /* Alternative ifname */ + IFLA_PERM_ADDRESS, + IFLA_PROTO_DOWN_REASON, ++ IFLA_CPU, + + /* device (sysfs) name as parent, used instead + * of IFLA_LINK where there's no parent netdev +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(&req->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 +