aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/drivers/net/ethernet/microchip/vcap/vcap_api.c
diff options
context:
space:
mode:
authorSteen Hegelund <steen.hegelund@microchip.com>2022-11-17 22:31:11 +0100
committerDavid S. Miller <davem@davemloft.net>2022-11-21 11:33:02 +0000
commit3a7921560d2fd38433fdb2e9b8728ab832880680 (patch)
treed7ce33631ef40cef64dc13e4961694d910f61196 /drivers/net/ethernet/microchip/vcap/vcap_api.c
parentnet: microchip: sparx5: Add raw VCAP debugFS support for the VCAP API (diff)
downloadwireguard-linux-3a7921560d2fd38433fdb2e9b8728ab832880680.tar.xz
wireguard-linux-3a7921560d2fd38433fdb2e9b8728ab832880680.zip
net: microchip: sparx5: Add VCAP rule debugFS support for the VCAP API
This add support to show all rules in a VCAP instance. The information shown is: - rule id - address range - size - chain id - keyset name, subword size, register span - actionset name, subword size, register span - counter value - sticky bit (one bit width counter) Signed-off-by: Steen Hegelund <steen.hegelund@microchip.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/microchip/vcap/vcap_api.c')
-rw-r--r--drivers/net/ethernet/microchip/vcap/vcap_api.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/drivers/net/ethernet/microchip/vcap/vcap_api.c b/drivers/net/ethernet/microchip/vcap/vcap_api.c
index 153e28e124bc..3da714e9639c 100644
--- a/drivers/net/ethernet/microchip/vcap/vcap_api.c
+++ b/drivers/net/ethernet/microchip/vcap/vcap_api.c
@@ -502,7 +502,7 @@ int vcap_api_check(struct vcap_control *ctrl)
return 0;
}
-static void vcap_erase_cache(struct vcap_rule_internal *ri)
+void vcap_erase_cache(struct vcap_rule_internal *ri)
{
ri->vctrl->ops->cache_erase(ri->admin);
}
@@ -578,7 +578,7 @@ int vcap_lookup_rule_by_cookie(struct vcap_control *vctrl, u64 cookie)
EXPORT_SYMBOL_GPL(vcap_lookup_rule_by_cookie);
/* Make a shallow copy of the rule without the fields */
-static struct vcap_rule_internal *vcap_dup_rule(struct vcap_rule_internal *ri)
+struct vcap_rule_internal *vcap_dup_rule(struct vcap_rule_internal *ri)
{
struct vcap_rule_internal *duprule;
@@ -782,9 +782,16 @@ const char *vcap_keyfield_name(struct vcap_control *vctrl,
}
EXPORT_SYMBOL_GPL(vcap_keyfield_name);
+/* map actionset id to a string with the actionset name */
+const char *vcap_actionset_name(struct vcap_control *vctrl,
+ enum vcap_actionfield_set actionset)
+{
+ return vctrl->stats->actionfield_set_names[actionset];
+}
+
/* map action field id to a string with the action name */
-static const char *vcap_actionfield_name(struct vcap_control *vctrl,
- enum vcap_action_field action)
+const char *vcap_actionfield_name(struct vcap_control *vctrl,
+ enum vcap_action_field action)
{
return vctrl->stats->actionfield_names[action];
}