Skip to content

Commit bab9eed

Browse files
rkannoth1kuba-moo
authored andcommitted
octeontx2-af: FLR handler for exact match table.
FLR handler should remove/free all exact match table resources corresponding to each interface. Signed-off-by: Ratheesh Kannoth <[email protected]> Signed-off-by: Jakub Kicinski <[email protected]>
1 parent ef83e18 commit bab9eed

File tree

3 files changed

+31
-0
lines changed

3 files changed

+31
-0
lines changed

drivers/net/ethernet/marvell/octeontx2/af/rvu.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2555,6 +2555,9 @@ static void rvu_blklf_teardown(struct rvu *rvu, u16 pcifunc, u8 blkaddr)
25552555

25562556
static void __rvu_flr_handler(struct rvu *rvu, u16 pcifunc)
25572557
{
2558+
if (rvu_npc_exact_has_match_table(rvu))
2559+
rvu_npc_exact_reset(rvu, pcifunc);
2560+
25582561
mutex_lock(&rvu->flr_lock);
25592562
/* Reset order should reflect inter-block dependencies:
25602563
* 1. Reset any packet/work sources (NIX, CPT, TIM)

drivers/net/ethernet/marvell/octeontx2/af/rvu_npc_hash.c

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1183,6 +1183,33 @@ void rvu_npc_exact_disable_feature(struct rvu *rvu)
11831183
rvu->hw->cap.npc_exact_match_enabled = false;
11841184
}
11851185

1186+
/**
1187+
* rvu_npc_exact_reset - Delete and free all entry which match pcifunc.
1188+
* @rvu: resource virtualization unit.
1189+
* @pcifunc: PCI func to match.
1190+
*/
1191+
void rvu_npc_exact_reset(struct rvu *rvu, u16 pcifunc)
1192+
{
1193+
struct npc_exact_table *table = rvu->hw->table;
1194+
struct npc_exact_table_entry *tmp, *iter;
1195+
u32 seq_id;
1196+
1197+
mutex_lock(&table->lock);
1198+
list_for_each_entry_safe(iter, tmp, &table->lhead_gbl, glist) {
1199+
if (pcifunc != iter->pcifunc)
1200+
continue;
1201+
1202+
seq_id = iter->seq_id;
1203+
dev_dbg(rvu->dev, "%s: resetting pcifun=%d seq_id=%u\n", __func__,
1204+
pcifunc, seq_id);
1205+
1206+
mutex_unlock(&table->lock);
1207+
rvu_npc_exact_del_table_entry_by_id(rvu, seq_id);
1208+
mutex_lock(&table->lock);
1209+
}
1210+
mutex_unlock(&table->lock);
1211+
}
1212+
11861213
/**
11871214
* rvu_npc_exact_init - initialize exact match table
11881215
* @rvu: resource virtualization unit.

drivers/net/ethernet/marvell/octeontx2/af/rvu_npc_hash.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,5 +187,6 @@ int rvu_npc_exact_init(struct rvu *rvu);
187187

188188
bool rvu_npc_exact_can_disable_feature(struct rvu *rvu);
189189
void rvu_npc_exact_disable_feature(struct rvu *rvu);
190+
void rvu_npc_exact_reset(struct rvu *rvu, u16 pcifunc);
190191

191192
#endif /* RVU_NPC_HASH_H */

0 commit comments

Comments
 (0)