[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YHPPlnXbElN4qJ/r@Ansuel-xps.localdomain>
Date: Mon, 12 Apr 2021 06:41:58 +0200
From: Ansuel Smith <ansuelsmth@...il.com>
To: DENG Qingfang <dqfext@...il.com>
Cc: netdev@...r.kernel.org,
Marek Behún <marek.behun@....cz>,
"David S. Miller" <davem@...emloft.net>,
Jakub Kicinski <kuba@...nel.org>, Andrew Lunn <andrew@...n.ch>,
Vivien Didelot <vivien.didelot@...il.com>,
Florian Fainelli <f.fainelli@...il.com>,
Vladimir Oltean <olteanv@...il.com>,
Alexei Starovoitov <ast@...nel.org>,
Daniel Borkmann <daniel@...earbox.net>,
Andrii Nakryiko <andriin@...com>,
Eric Dumazet <edumazet@...gle.com>,
Wei Wang <weiwan@...gle.com>,
Cong Wang <cong.wang@...edance.com>,
Taehee Yoo <ap420073@...il.com>,
Björn Töpel <bjorn@...nel.org>,
zhang kai <zhangkaiheb@....com>,
Roopa Prabhu <roopa@...ulusnetworks.com>,
Di Zhu <zhudi21@...wei.com>,
Nikolay Aleksandrov <nikolay@...dia.com>,
Francis Laniel <laniel_francis@...vacyrequired.com>,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH RFC net-next 1/3] net: dsa: allow for multiple CPU ports
On Mon, Apr 12, 2021 at 11:35:25AM +0800, DENG Qingfang wrote:
> On Sat, Apr 10, 2021 at 03:34:47PM +0200, Ansuel Smith wrote:
> > Allow for multiple CPU ports in a DSA switch tree. By default the first
> > CPU port is assigned mimic the original assignement logic. A DSA driver
> > can define a function to declare a preferred CPU port based on the
> > provided port. If the function doesn't have a preferred port the CPU
> > port is assigned using a round-robin way starting from the last assigned
> > CPU port.
> > Examples:
> > There are two CPU port but no port_get_preferred_cpu is provided:
> > - The old logic is used. Every port is assigned to the first cpu port.
> > There are two CPU port but the port_get_preferred_cpu return -1:
> > - The port is assigned using a round-robin way since no preference is
> > provided.
> > There are two CPU port and the port_get_preferred_cpu define only one
> > port and the rest with -1: (wan port with CPU1 and the rest no
> > preference)
> > lan1 <-> eth0
> > lan2 <-> eth1
> > lan3 <-> eth0
> > lan4 <-> eth1
> > wan <-> eth1
> > There are two CPU port and the port_get_preferred assign a preference
> > for every port: (wan port with CPU1 everything else CPU0)
> > lan1 <-> eth0
> > lan2 <-> eth0
> > lan3 <-> eth0
> > lan4 <-> eth0
> > wan <-> eth1
>
> So, drivers will read the name of every port and decide which CPU port
> does it use?
>
Yes, this seems to be an acceptable path to follow. The driver can
provide a preferred CPU port or just tell DSA that every cpu is equal
and assign them in a round-robin.
> >
> > Signed-off-by: Marek Beh?n <marek.behun@....cz>
> > Signed-off-by: Ansuel Smith <ansuelsmth@...il.com>
Powered by blists - more mailing lists