Skip to content

Commit

Permalink
net/mlx5: E-Switch, Enable setting goto slow path chain action
Browse files Browse the repository at this point in the history
A pre-step for the tc offloads code to use this when a neigh is
not available for encap rules.

Signed-off-by: Paul Blakey <paulb@mellanox.com>
Reviewed-by: Or Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
  • Loading branch information
Paul Blakey authored and Saeed Mahameed committed Oct 17, 2018
1 parent 6d2a3ed commit c92a0b9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/net/ethernet/mellanox/mlx5/core/eswitch.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
MLX5_CAP_ESW_FLOWTABLE(dev, fdb_multi_path_to_table)

#define FDB_MAX_CHAIN 3
#define FDB_SLOW_PATH_CHAIN (FDB_MAX_CHAIN + 1)
#define FDB_MAX_PRIO 16

struct vport_ingress {
Expand Down Expand Up @@ -356,6 +357,7 @@ static inline int mlx5_eswitch_enable_sriov(struct mlx5_eswitch *esw, int nvfs,
static inline void mlx5_eswitch_disable_sriov(struct mlx5_eswitch *esw) {}

#define FDB_MAX_CHAIN 1
#define FDB_SLOW_PATH_CHAIN (FDB_MAX_CHAIN + 1)
#define FDB_MAX_PRIO 1

#endif /* CONFIG_MLX5_ESWITCH */
Expand Down
6 changes: 6 additions & 0 deletions drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c
Original file line number Diff line number Diff line change
Expand Up @@ -671,6 +671,9 @@ esw_get_prio_table(struct mlx5_eswitch *esw, u32 chain, u16 prio, int level)
int table_prio, l = 0;
u32 flags = 0;

if (chain == FDB_SLOW_PATH_CHAIN)
return esw->fdb_table.offloads.slow_fdb;

mutex_lock(&esw->fdb_table.offloads.fdb_prio_lock);

fdb = fdb_prio_table(esw, chain, prio, level).fdb;
Expand Down Expand Up @@ -730,6 +733,9 @@ esw_put_prio_table(struct mlx5_eswitch *esw, u32 chain, u16 prio, int level)
{
int l;

if (chain == FDB_SLOW_PATH_CHAIN)
return;

mutex_lock(&esw->fdb_table.offloads.fdb_prio_lock);

for (l = level; l >= 0; l--) {
Expand Down

0 comments on commit c92a0b9

Please sign in to comment.