OSDN Git Service

net: mscc: ocelot: store a namespaced VCAP filter ID
authorVladimir Oltean <vladimir.oltean@nxp.com>
Fri, 29 Jan 2021 01:00:01 +0000 (03:00 +0200)
committerJakub Kicinski <kuba@kernel.org>
Sat, 30 Jan 2021 05:24:30 +0000 (21:24 -0800)
commit50c6cc5b9283efdbf72162dee467bd68c7167807
tree6adccf47480132dab0030afb54b4b8d3a1f9cf9c
parent0e9bb4e9d93f2711897b8e2a613899f7b8a15a3b
net: mscc: ocelot: store a namespaced VCAP filter ID

We will be adding some private VCAP filters that should not interfere in
any way with the filters added using tc-flower. So we need to allocate
some IDs which will not be used by tc.

Currently ocelot uses an u32 id derived from the flow cookie, which in
itself is an unsigned long. This is a problem in itself, since on 64 bit
systems, sizeof(unsigned long)=8, so the driver is already truncating
these.

Create a struct ocelot_vcap_id which contains the full unsigned long
cookie from tc, as well as a boolean that is supposed to namespace the
filters added by tc with the ones that aren't.

Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/mscc/ocelot_flower.c
drivers/net/ethernet/mscc/ocelot_vcap.c
drivers/net/ethernet/mscc/ocelot_vcap.h
include/soc/mscc/ocelot_vcap.h