net: dsa: felix: Wire up the ocelot cls_flower methods
Export the cls_flower methods from the ocelot driver and hook them up to the DSA passthrough layer. Tables for the VCAP IS2 parameters, as well as half key packing (field offsets and lengths) need to be defined for the VSC9959 core, as they are different from Ocelot, mainly due to the different port count. Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:

committed by
David S. Miller

parent
ed11bb1f96
commit
07d985eef0
@@ -2,6 +2,7 @@
|
||||
/* Copyright 2019 NXP Semiconductors
|
||||
*/
|
||||
#include <uapi/linux/if_bridge.h>
|
||||
#include <soc/mscc/ocelot_vcap.h>
|
||||
#include <soc/mscc/ocelot_qsys.h>
|
||||
#include <soc/mscc/ocelot_sys.h>
|
||||
#include <soc/mscc/ocelot_dev.h>
|
||||
@@ -401,6 +402,9 @@ static int felix_init_structs(struct felix *felix, int num_phys_ports)
|
||||
ocelot->stats_layout = felix->info->stats_layout;
|
||||
ocelot->num_stats = felix->info->num_stats;
|
||||
ocelot->shared_queue_sz = felix->info->shared_queue_sz;
|
||||
ocelot->vcap_is2_keys = felix->info->vcap_is2_keys;
|
||||
ocelot->vcap_is2_actions= felix->info->vcap_is2_actions;
|
||||
ocelot->vcap = felix->info->vcap;
|
||||
ocelot->ops = felix->info->ops;
|
||||
|
||||
port_phy_modes = kcalloc(num_phys_ports, sizeof(phy_interface_t),
|
||||
@@ -595,6 +599,30 @@ static bool felix_txtstamp(struct dsa_switch *ds, int port,
|
||||
return false;
|
||||
}
|
||||
|
||||
static int felix_cls_flower_add(struct dsa_switch *ds, int port,
|
||||
struct flow_cls_offload *cls, bool ingress)
|
||||
{
|
||||
struct ocelot *ocelot = ds->priv;
|
||||
|
||||
return ocelot_cls_flower_replace(ocelot, port, cls, ingress);
|
||||
}
|
||||
|
||||
static int felix_cls_flower_del(struct dsa_switch *ds, int port,
|
||||
struct flow_cls_offload *cls, bool ingress)
|
||||
{
|
||||
struct ocelot *ocelot = ds->priv;
|
||||
|
||||
return ocelot_cls_flower_destroy(ocelot, port, cls, ingress);
|
||||
}
|
||||
|
||||
static int felix_cls_flower_stats(struct dsa_switch *ds, int port,
|
||||
struct flow_cls_offload *cls, bool ingress)
|
||||
{
|
||||
struct ocelot *ocelot = ds->priv;
|
||||
|
||||
return ocelot_cls_flower_stats(ocelot, port, cls, ingress);
|
||||
}
|
||||
|
||||
static const struct dsa_switch_ops felix_switch_ops = {
|
||||
.get_tag_protocol = felix_get_tag_protocol,
|
||||
.setup = felix_setup,
|
||||
@@ -626,6 +654,9 @@ static const struct dsa_switch_ops felix_switch_ops = {
|
||||
.port_hwtstamp_set = felix_hwtstamp_set,
|
||||
.port_rxtstamp = felix_rxtstamp,
|
||||
.port_txtstamp = felix_txtstamp,
|
||||
.cls_flower_add = felix_cls_flower_add,
|
||||
.cls_flower_del = felix_cls_flower_del,
|
||||
.cls_flower_stats = felix_cls_flower_stats,
|
||||
};
|
||||
|
||||
static struct felix_info *felix_instance_tbl[] = {
|
||||
|
Reference in New Issue
Block a user