summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/microchip/sparx5/sparx5_tc_flower.c
diff options
context:
space:
mode:
authorSteen Hegelund <steen.hegelund@microchip.com>2023-02-14 11:40:47 +0100
committerPaolo Abeni <pabeni@redhat.com>2023-02-16 08:59:49 +0100
commit3cbe7537a7f1aaafc4eebc124dfcc8eaf67f1ec7 (patch)
treeb445d65b63ad9e49eb6a95dcf3406c5b8e9af421 /drivers/net/ethernet/microchip/sparx5/sparx5_tc_flower.c
parentf2a77dd69f51358ab6fb169f5582c329a2315e6c (diff)
downloadlinux-3cbe7537a7f1aaafc4eebc124dfcc8eaf67f1ec7.tar.gz
linux-3cbe7537a7f1aaafc4eebc124dfcc8eaf67f1ec7.tar.bz2
linux-3cbe7537a7f1aaafc4eebc124dfcc8eaf67f1ec7.zip
net: microchip: sparx5: Add ES0 VCAP keyset configuration for Sparx5
This adds the ES0 VCAP port keyset configuration for Sparx5. Signed-off-by: Steen Hegelund <steen.hegelund@microchip.com> Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Diffstat (limited to 'drivers/net/ethernet/microchip/sparx5/sparx5_tc_flower.c')
-rw-r--r--drivers/net/ethernet/microchip/sparx5/sparx5_tc_flower.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/drivers/net/ethernet/microchip/sparx5/sparx5_tc_flower.c b/drivers/net/ethernet/microchip/sparx5/sparx5_tc_flower.c
index 82d5138f149e..3e29180b41a6 100644
--- a/drivers/net/ethernet/microchip/sparx5/sparx5_tc_flower.c
+++ b/drivers/net/ethernet/microchip/sparx5/sparx5_tc_flower.c
@@ -290,14 +290,29 @@ static int sparx5_tc_add_rule_counter(struct vcap_admin *admin,
{
int err;
- if (admin->vtype == VCAP_TYPE_IS2 || admin->vtype == VCAP_TYPE_ES2) {
+ switch (admin->vtype) {
+ case VCAP_TYPE_IS0:
+ break;
+ case VCAP_TYPE_ES0:
+ err = vcap_rule_mod_action_u32(vrule, VCAP_AF_ESDX,
+ vrule->id);
+ if (err)
+ return err;
+ vcap_rule_set_counter_id(vrule, vrule->id);
+ break;
+ case VCAP_TYPE_IS2:
+ case VCAP_TYPE_ES2:
err = vcap_rule_mod_action_u32(vrule, VCAP_AF_CNT_ID,
vrule->id);
if (err)
return err;
vcap_rule_set_counter_id(vrule, vrule->id);
+ break;
+ default:
+ pr_err("%s:%d: vcap type: %d not supported\n",
+ __func__, __LINE__, admin->vtype);
+ break;
}
-
return 0;
}