diff options
author | Ratheesh Kannoth <rkannoth@marvell.com> | 2022-07-08 10:11:43 +0530 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2022-07-11 10:52:13 -0700 |
commit | ef83e186855df9ebf131dfa74c1e5c198ccdf02a (patch) | |
tree | 6defdfdc6bd47be8ac1949dd63b01e45f539e629 /drivers/net/ethernet/marvell/octeontx2/af/rvu_npc_hash.c | |
parent | 812103edf670247655f8840e7994fc8bd0000af8 (diff) |
octeontx2-af: devlink configuration support
CN10KB silicon supports Exact match feature. This feature can be disabled
through devlink configuration. Devlink command fails if DMAC filter rules
are already present. Once disabled, legacy RPM based DMAC filters will be
configured.
Signed-off-by: Ratheesh Kannoth <rkannoth@marvell.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'drivers/net/ethernet/marvell/octeontx2/af/rvu_npc_hash.c')
-rw-r--r-- | drivers/net/ethernet/marvell/octeontx2/af/rvu_npc_hash.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc_hash.c b/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc_hash.c index 273f4b648c73..fc18f543ca25 100644 --- a/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc_hash.c +++ b/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc_hash.c @@ -1155,6 +1155,35 @@ static int __maybe_unused rvu_npc_exact_update_table_entry(struct rvu *rvu, u8 c } /** + * rvu_npc_exact_can_disable_feature - Check if feature can be disabled. + * @rvu: resource virtualization unit. + * Return: True if exact match feature is supported. + */ +bool rvu_npc_exact_can_disable_feature(struct rvu *rvu) +{ + struct npc_exact_table *table = rvu->hw->table; + bool empty; + + if (!rvu->hw->cap.npc_exact_match_enabled) + return false; + + mutex_lock(&table->lock); + empty = list_empty(&table->lhead_gbl); + mutex_unlock(&table->lock); + + return empty; +} + +/** + * rvu_npc_exact_disable_feature - Disable feature. + * @rvu: resource virtualization unit. + */ +void rvu_npc_exact_disable_feature(struct rvu *rvu) +{ + rvu->hw->cap.npc_exact_match_enabled = false; +} + +/** * rvu_npc_exact_init - initialize exact match table * @rvu: resource virtualization unit. * |