Skip to content

Commit a85e84e

Browse files
idoschdavem330
authored andcommitted
mlxsw: spectrum_router: Propagate neighbour update errors
Next patch will add offload indication to neighbours, but the indication should only be altered in case the neighbour was successfully added to / deleted from the device. Propagate neighbour update errors, so that they could be taken into account by the next patch. Signed-off-by: Ido Schimmel <[email protected]> Acked-by: Jiri Pirko <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 95337b9 commit a85e84e

File tree

1 file changed

+15
-8
lines changed

1 file changed

+15
-8
lines changed

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

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2371,7 +2371,7 @@ static enum mlxsw_reg_rauht_op mlxsw_sp_rauht_op(bool adding)
23712371
MLXSW_REG_RAUHT_OP_WRITE_DELETE;
23722372
}
23732373

2374-
static void
2374+
static int
23752375
mlxsw_sp_router_neigh_entry_op4(struct mlxsw_sp *mlxsw_sp,
23762376
struct mlxsw_sp_neigh_entry *neigh_entry,
23772377
enum mlxsw_reg_rauht_op op)
@@ -2385,10 +2385,10 @@ mlxsw_sp_router_neigh_entry_op4(struct mlxsw_sp *mlxsw_sp,
23852385
if (neigh_entry->counter_valid)
23862386
mlxsw_reg_rauht_pack_counter(rauht_pl,
23872387
neigh_entry->counter_index);
2388-
mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(rauht), rauht_pl);
2388+
return mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(rauht), rauht_pl);
23892389
}
23902390

2391-
static void
2391+
static int
23922392
mlxsw_sp_router_neigh_entry_op6(struct mlxsw_sp *mlxsw_sp,
23932393
struct mlxsw_sp_neigh_entry *neigh_entry,
23942394
enum mlxsw_reg_rauht_op op)
@@ -2402,7 +2402,7 @@ mlxsw_sp_router_neigh_entry_op6(struct mlxsw_sp *mlxsw_sp,
24022402
if (neigh_entry->counter_valid)
24032403
mlxsw_reg_rauht_pack_counter(rauht_pl,
24042404
neigh_entry->counter_index);
2405-
mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(rauht), rauht_pl);
2405+
return mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(rauht), rauht_pl);
24062406
}
24072407

24082408
bool mlxsw_sp_neigh_ipv6_ignore(struct mlxsw_sp_neigh_entry *neigh_entry)
@@ -2424,17 +2424,24 @@ mlxsw_sp_neigh_entry_update(struct mlxsw_sp *mlxsw_sp,
24242424
struct mlxsw_sp_neigh_entry *neigh_entry,
24252425
bool adding)
24262426
{
2427+
enum mlxsw_reg_rauht_op op = mlxsw_sp_rauht_op(adding);
2428+
int err;
2429+
24272430
if (!adding && !neigh_entry->connected)
24282431
return;
24292432
neigh_entry->connected = adding;
24302433
if (neigh_entry->key.n->tbl->family == AF_INET) {
2431-
mlxsw_sp_router_neigh_entry_op4(mlxsw_sp, neigh_entry,
2432-
mlxsw_sp_rauht_op(adding));
2434+
err = mlxsw_sp_router_neigh_entry_op4(mlxsw_sp, neigh_entry,
2435+
op);
2436+
if (err)
2437+
return;
24332438
} else if (neigh_entry->key.n->tbl->family == AF_INET6) {
24342439
if (mlxsw_sp_neigh_ipv6_ignore(neigh_entry))
24352440
return;
2436-
mlxsw_sp_router_neigh_entry_op6(mlxsw_sp, neigh_entry,
2437-
mlxsw_sp_rauht_op(adding));
2441+
err = mlxsw_sp_router_neigh_entry_op6(mlxsw_sp, neigh_entry,
2442+
op);
2443+
if (err)
2444+
return;
24382445
} else {
24392446
WARN_ON_ONCE(1);
24402447
}

0 commit comments

Comments
 (0)