Re: [PATCH RFC net-next 1/3] net: dsa: allow for multiple CPU ports

2021-04-12 Thread Frank Wunderlich
Am 12. April 2021 17:30:58 MESZ schrieb DENG Qingfang : >So we somehow configured default CPU port in dts (by port name). In >my opinion we can just add a default CPU property in dts to specify >it (like Frank Wunderlich did earlier), and fall back to round-robin >if the property is not present, w

Re: [PATCH RFC net-next 1/3] net: dsa: allow for multiple CPU ports

2021-04-12 Thread DENG Qingfang
On Mon, Apr 12, 2021 at 06:41:58AM +0200, Ansuel Smith wrote: > > 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 equ

Re: [PATCH RFC net-next 1/3] net: dsa: allow for multiple CPU ports

2021-04-12 Thread Ansuel Smith
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 fun

Re: [PATCH RFC net-next 1/3] net: dsa: allow for multiple CPU ports

2021-04-11 Thread DENG Qingfang
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

[PATCH RFC net-next 1/3] net: dsa: allow for multiple CPU ports

2021-04-11 Thread Ansuel Smith
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 us

Re: [PATCH RFC net-next 1/3] net: dsa: allow for multiple CPU ports

2019-08-24 Thread Marek Behun
On Sat, 24 Aug 2019 17:43:02 +0200 Andrew Lunn wrote: > But i don't know if it is worth the effort. I've never seen a D in DSA > setup with multiple CPUs ports. I've only ever seen an single switch > with multiple CPU ports. Yes, that exactly. I was thinking about the most optimal algorithm, but

Re: [PATCH RFC net-next 1/3] net: dsa: allow for multiple CPU ports

2019-08-24 Thread Andrew Lunn
> +static int dsa_tree_setup_default_cpus(struct dsa_switch_tree *dst) > { > struct dsa_switch *ds; > struct dsa_port *dp; > - int device, port; > + int device, port, i; > > - /* DSA currently only supports a single CPU port */ > - dst->cpu_dp = dsa_tree_find_first_cp

[PATCH RFC net-next 1/3] net: dsa: allow for multiple CPU ports

2019-08-23 Thread Marek BehĂșn
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