Skip to content

Commit a005a7f

Browse files
Jiri Pirkokuba-moo
authored andcommitted
mlxsw: spectrum_router: Track FIB entry committed state and skip uncommitted on delete
In case bulking is used, the entry that was previously added may not be yet committed to the HW as it waits in the queue for bulk send. For such entries, skip the deletion. Signed-off-by: Jiri Pirko <[email protected]> Signed-off-by: Ido Schimmel <[email protected]> Signed-off-by: Jakub Kicinski <[email protected]>
1 parent ae9ce81 commit a005a7f

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4453,6 +4453,12 @@ mlxsw_sp_router_ll_basic_fib_entry_commit(struct mlxsw_sp *mlxsw_sp,
44534453
op_ctx_basic->ralue_pl);
44544454
}
44554455

4456+
static bool
4457+
mlxsw_sp_router_ll_basic_fib_entry_is_committed(struct mlxsw_sp_fib_entry_priv *priv)
4458+
{
4459+
return true;
4460+
}
4461+
44564462
static void mlxsw_sp_fib_entry_pack(struct mlxsw_sp_fib_entry_op_ctx *op_ctx,
44574463
struct mlxsw_sp_fib_entry *fib_entry,
44584464
enum mlxsw_sp_fib_entry_op op)
@@ -4712,6 +4718,10 @@ static int mlxsw_sp_fib_entry_del(struct mlxsw_sp *mlxsw_sp,
47124718
struct mlxsw_sp_fib_entry_op_ctx *op_ctx,
47134719
struct mlxsw_sp_fib_entry *fib_entry)
47144720
{
4721+
const struct mlxsw_sp_router_ll_ops *ll_ops = fib_entry->fib_node->fib->ll_ops;
4722+
4723+
if (!ll_ops->fib_entry_is_committed(fib_entry->priv))
4724+
return 0;
47154725
return mlxsw_sp_fib_entry_op(mlxsw_sp, op_ctx, fib_entry,
47164726
MLXSW_SP_FIB_ENTRY_OP_DELETE);
47174727
}
@@ -8370,6 +8380,7 @@ static const struct mlxsw_sp_router_ll_ops mlxsw_sp_router_ll_basic_ops = {
83708380
.fib_entry_act_ip2me_pack = mlxsw_sp_router_ll_basic_fib_entry_act_ip2me_pack,
83718381
.fib_entry_act_ip2me_tun_pack = mlxsw_sp_router_ll_basic_fib_entry_act_ip2me_tun_pack,
83728382
.fib_entry_commit = mlxsw_sp_router_ll_basic_fib_entry_commit,
8383+
.fib_entry_is_committed = mlxsw_sp_router_ll_basic_fib_entry_is_committed,
83738384
};
83748385

83758386
static int mlxsw_sp_router_ll_op_ctx_init(struct mlxsw_sp_router *router)

drivers/net/ethernet/mellanox/mlxsw/spectrum_router.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ struct mlxsw_sp_router_ll_ops {
112112
int (*fib_entry_commit)(struct mlxsw_sp *mlxsw_sp,
113113
struct mlxsw_sp_fib_entry_op_ctx *op_ctx,
114114
bool *postponed_for_bulk);
115+
bool (*fib_entry_is_committed)(struct mlxsw_sp_fib_entry_priv *priv);
115116
};
116117

117118
int mlxsw_sp_fib_entry_commit(struct mlxsw_sp *mlxsw_sp,

0 commit comments

Comments
 (0)