Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp1210230pxb; Sun, 11 Apr 2021 11:09:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzuU8xUsKGfCz04zRcySauvC5Mlsu3qldYtO423KKWvOVQYpmuLfQYkVeJgLm7iPZR99x9n X-Received: by 2002:aa7:c351:: with SMTP id j17mr24078112edr.199.1618164565970; Sun, 11 Apr 2021 11:09:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618164565; cv=none; d=google.com; s=arc-20160816; b=nHuxuKglZ4k1+zCcwtJ8GQdCoxtkgVdAL38uF3hzEYncnyUh8Q2iXC1fYlHms+G4qT UZbypOOvw1pm/mcUOpCnJ90WiepQ4FtZkINrc7q33K7TleBXZ39CShInTrRajKmN4dHU /vh8qquN3GkWhETwAJ/CoVs9s6d4kwquVUSMtSIhAm2xg+KnMf9VUFaTc/Mv4Fq10kRM 3D21OalxDa5U5Ic+Zncya0r4Rf+d1IlC6kRIx2QM20I+n44Q8tRp5AAYjMw5M072dbjC im5SFS9cgcJcSyIawzIbJnGuED0zhO8THqR20Z35WM6FrXJ3p7aULqpfC2bWAPrL1bRx TtLw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date; bh=R56wELKOUwb6x46sz/CXZrB/M7Sc1smf9ya+NtYWY+8=; b=BkBTvKhlPpPj0B0WvkMUjfegF0aBnLuANp7zR9kxM4YlLHeCWDFqORxvwXOkujPH8o 7hIHM8nnZjx9+cJJw1v7Y9CAdq8SDIKF2Zq7aEuL16fUEnTch3uzYO5NNwRYaKiSEm8N EEFvLWP23ir6YlWSxHISCtJ08OyzJKLlhJuG0BktRIOoXqcmqBwUtqofjw9c50IeeW1+ ZOvMi4cDuG6/sU0lz2iYM84m65R0OgN9oWk1rn+9ZyBDeJNrtdgkpWdlrvpEd2cCBrpi 95IVQuUXM8WqVJWySV3WS8v8MWoSXtiBSyFzvgmKoeo7Z9HJw6I8bXskiBLSiuJhDM+R aFrA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nic.cz Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m20si967010eja.616.2021.04.11.11.09.03; Sun, 11 Apr 2021 11:09:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nic.cz Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235749AbhDKSBz (ORCPT + 99 others); Sun, 11 Apr 2021 14:01:55 -0400 Received: from mail.nic.cz ([217.31.204.67]:39192 "EHLO mail.nic.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235284AbhDKSBy (ORCPT ); Sun, 11 Apr 2021 14:01:54 -0400 Received: from thinkpad (unknown [IPv6:2a0e:b107:ae1:0:3e97:eff:fe61:c680]) by mail.nic.cz (Postfix) with ESMTPSA id 7D44C140679; Sun, 11 Apr 2021 20:01:36 +0200 (CEST) Date: Sun, 11 Apr 2021 20:01:35 +0200 From: Marek Behun To: Ansuel Smith Cc: netdev@vger.kernel.org, "David S. Miller" , Jakub Kicinski , Andrew Lunn , Vivien Didelot , Florian Fainelli , Vladimir Oltean , Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Eric Dumazet , Wei Wang , Cong Wang , Taehee Yoo , =?UTF-8?B?QmrDtnJuIFTDtnBlbA==?= , zhang kai , Weilong Chen , Roopa Prabhu , Di Zhu , Francis Laniel , linux-kernel@vger.kernel.org Subject: Re: [PATCH RFC net-next 0/3] Multi-CPU DSA support Message-ID: <20210411200135.35fb5985@thinkpad> In-Reply-To: <20210410133454.4768-1-ansuelsmth@gmail.com> References: <20210410133454.4768-1-ansuelsmth@gmail.com> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-100.0 required=5.9 tests=SHORTCIRCUIT, USER_IN_WELCOMELIST,USER_IN_WHITELIST shortcircuit=ham autolearn=disabled version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mail.nic.cz X-Virus-Scanned: clamav-milter 0.102.2 at mail X-Virus-Status: Clean Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, 10 Apr 2021 15:34:46 +0200 Ansuel Smith wrote: > Hi, > this is a respin of the Marek series in hope that this time we can > finally make some progress with dsa supporting multi-cpu port. > > This implementation is similar to the Marek series but with some tweaks. > This adds support for multiple-cpu port but leave the driver the > decision of the type of logic to use about assigning a CPU port to the > various port. The driver can also provide no preference and the CPU port > is decided using a round-robin way. In the last couple of months I have been giving some thought to this problem, and came up with one important thing: if there are multiple upstream ports, it would make a lot of sense to dynamically reallocate them to each user port, based on which user port is actually used, and at what speed. For example on Turris Omnia we have 2 CPU ports and 5 user ports. All ports support at most 1 Gbps. Round-robin would assign: CPU port 0 - Port 0 CPU port 1 - Port 1 CPU port 0 - Port 2 CPU port 1 - Port 3 CPU port 0 - Port 4 Now suppose that the user plugs ethernet cables only into ports 0 and 2, with 1, 3 and 4 free: CPU port 0 - Port 0 (plugged) CPU port 1 - Port 1 (free) CPU port 0 - Port 2 (plugged) CPU port 1 - Port 3 (free) CPU port 0 - Port 4 (free) We end up in a situation where ports 0 and 2 share 1 Gbps bandwidth to CPU, and the second CPU port is not used at all. A mechanism for automatic reassignment of CPU ports would be ideal here. What do you guys think? Marek