Re: [PATCH net-next v2 1/2] net: dsa: mv88e6xxx: Save switch rules

From: Miquel Raynal
Date: Mon Jan 28 2019 - 12:31:58 EST


Hi Andrew,

Thanks for helping!

Andrew Lunn <andrew@xxxxxxx> wrote on Mon, 28 Jan 2019 15:44:17 +0100:

> > I don't see where VLAN and bridge information are cached, can you point
> > me to the relevant locations?
>
> MiquÃl
>
> The bridge should have all that information. You need to ask it to
> enumerate the current configuration and replay it to the switch.
>
> There might be something in the Mellanox driver you can copy? But i've
> not looked, i'm just guessing.

I am still searching but so far I did not find a mechanism reading the
configuration of the bridge out of a 'net' object. Indeed there are
multiple lists with the configuration but they are all 'mellanox'
objects, they do not belong to the core.

Maybe I don't find this configuration because I don't know what it is.
I imagine this configuration being one (or multiple) list(s), stored
somewhere in a net_device being a bridge. Am I on the wrong path?

Otherwise I might just save my own structures in net/dsa/switch.c like
I did for the mv88e6xx driver, and once this works, net-folks might
want to optimize the memory consumption and re-use the bridge
configuration directly?

> We also need to think about how we are going to test this. There is a
> lot of state information in a switch. So we are going to need some
> pretty good tests to show we have recreated all of it.

My understanding of all this is rather short, until know I used what
you proposed in the v1 of this series but I am all ears if I need to
add anything to my test list.


Thanks,
MiquÃl