mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-30 19:06:14 +00:00
mlxsw: spectrum_qdisc: Add handle parameter to ..._ops.replace
PRIO and ETS will need to check the value of qdisc handle in their handlers. Add it to the callback and propagate through. Signed-off-by: Petr Machata <petrm@mellanox.com> Signed-off-by: Ido Schimmel <idosch@mellanox.com> Acked-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
ee88450d25
commit
c4e372e2ac
1 changed files with 9 additions and 9 deletions
|
@ -29,7 +29,7 @@ struct mlxsw_sp_qdisc_ops {
|
||||||
int (*check_params)(struct mlxsw_sp_port *mlxsw_sp_port,
|
int (*check_params)(struct mlxsw_sp_port *mlxsw_sp_port,
|
||||||
struct mlxsw_sp_qdisc *mlxsw_sp_qdisc,
|
struct mlxsw_sp_qdisc *mlxsw_sp_qdisc,
|
||||||
void *params);
|
void *params);
|
||||||
int (*replace)(struct mlxsw_sp_port *mlxsw_sp_port,
|
int (*replace)(struct mlxsw_sp_port *mlxsw_sp_port, u32 handle,
|
||||||
struct mlxsw_sp_qdisc *mlxsw_sp_qdisc, void *params);
|
struct mlxsw_sp_qdisc *mlxsw_sp_qdisc, void *params);
|
||||||
int (*destroy)(struct mlxsw_sp_port *mlxsw_sp_port,
|
int (*destroy)(struct mlxsw_sp_port *mlxsw_sp_port,
|
||||||
struct mlxsw_sp_qdisc *mlxsw_sp_qdisc);
|
struct mlxsw_sp_qdisc *mlxsw_sp_qdisc);
|
||||||
|
@ -156,7 +156,7 @@ mlxsw_sp_qdisc_replace(struct mlxsw_sp_port *mlxsw_sp_port, u32 handle,
|
||||||
if (err)
|
if (err)
|
||||||
goto err_bad_param;
|
goto err_bad_param;
|
||||||
|
|
||||||
err = ops->replace(mlxsw_sp_port, mlxsw_sp_qdisc, params);
|
err = ops->replace(mlxsw_sp_port, handle, mlxsw_sp_qdisc, params);
|
||||||
if (err)
|
if (err)
|
||||||
goto err_config;
|
goto err_config;
|
||||||
|
|
||||||
|
@ -409,7 +409,7 @@ mlxsw_sp_qdisc_red_check_params(struct mlxsw_sp_port *mlxsw_sp_port,
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
mlxsw_sp_qdisc_red_replace(struct mlxsw_sp_port *mlxsw_sp_port,
|
mlxsw_sp_qdisc_red_replace(struct mlxsw_sp_port *mlxsw_sp_port, u32 handle,
|
||||||
struct mlxsw_sp_qdisc *mlxsw_sp_qdisc,
|
struct mlxsw_sp_qdisc *mlxsw_sp_qdisc,
|
||||||
void *params)
|
void *params)
|
||||||
{
|
{
|
||||||
|
@ -657,7 +657,7 @@ mlxsw_sp_qdisc_tbf_check_params(struct mlxsw_sp_port *mlxsw_sp_port,
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
mlxsw_sp_qdisc_tbf_replace(struct mlxsw_sp_port *mlxsw_sp_port,
|
mlxsw_sp_qdisc_tbf_replace(struct mlxsw_sp_port *mlxsw_sp_port, u32 handle,
|
||||||
struct mlxsw_sp_qdisc *mlxsw_sp_qdisc,
|
struct mlxsw_sp_qdisc *mlxsw_sp_qdisc,
|
||||||
void *params)
|
void *params)
|
||||||
{
|
{
|
||||||
|
@ -792,7 +792,7 @@ mlxsw_sp_qdisc_prio_check_params(struct mlxsw_sp_port *mlxsw_sp_port,
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
__mlxsw_sp_qdisc_ets_replace(struct mlxsw_sp_port *mlxsw_sp_port,
|
__mlxsw_sp_qdisc_ets_replace(struct mlxsw_sp_port *mlxsw_sp_port, u32 handle,
|
||||||
unsigned int nbands,
|
unsigned int nbands,
|
||||||
const unsigned int *quanta,
|
const unsigned int *quanta,
|
||||||
const unsigned int *weights,
|
const unsigned int *weights,
|
||||||
|
@ -849,14 +849,14 @@ __mlxsw_sp_qdisc_ets_replace(struct mlxsw_sp_port *mlxsw_sp_port,
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
mlxsw_sp_qdisc_prio_replace(struct mlxsw_sp_port *mlxsw_sp_port,
|
mlxsw_sp_qdisc_prio_replace(struct mlxsw_sp_port *mlxsw_sp_port, u32 handle,
|
||||||
struct mlxsw_sp_qdisc *mlxsw_sp_qdisc,
|
struct mlxsw_sp_qdisc *mlxsw_sp_qdisc,
|
||||||
void *params)
|
void *params)
|
||||||
{
|
{
|
||||||
struct tc_prio_qopt_offload_params *p = params;
|
struct tc_prio_qopt_offload_params *p = params;
|
||||||
unsigned int zeroes[TCQ_ETS_MAX_BANDS] = {0};
|
unsigned int zeroes[TCQ_ETS_MAX_BANDS] = {0};
|
||||||
|
|
||||||
return __mlxsw_sp_qdisc_ets_replace(mlxsw_sp_port, p->bands,
|
return __mlxsw_sp_qdisc_ets_replace(mlxsw_sp_port, handle, p->bands,
|
||||||
zeroes, zeroes, p->priomap);
|
zeroes, zeroes, p->priomap);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -955,13 +955,13 @@ mlxsw_sp_qdisc_ets_check_params(struct mlxsw_sp_port *mlxsw_sp_port,
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
mlxsw_sp_qdisc_ets_replace(struct mlxsw_sp_port *mlxsw_sp_port,
|
mlxsw_sp_qdisc_ets_replace(struct mlxsw_sp_port *mlxsw_sp_port, u32 handle,
|
||||||
struct mlxsw_sp_qdisc *mlxsw_sp_qdisc,
|
struct mlxsw_sp_qdisc *mlxsw_sp_qdisc,
|
||||||
void *params)
|
void *params)
|
||||||
{
|
{
|
||||||
struct tc_ets_qopt_offload_replace_params *p = params;
|
struct tc_ets_qopt_offload_replace_params *p = params;
|
||||||
|
|
||||||
return __mlxsw_sp_qdisc_ets_replace(mlxsw_sp_port, p->bands,
|
return __mlxsw_sp_qdisc_ets_replace(mlxsw_sp_port, handle, p->bands,
|
||||||
p->quanta, p->weights, p->priomap);
|
p->quanta, p->weights, p->priomap);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue