Commit 9fe63d5f authored by Naveen Mamindlapalli's avatar Naveen Mamindlapalli Committed by David S. Miller

sch_htb: Allow HTB quantum parameter in offload mode

The current implementation of HTB offload returns the EINVAL error for
quantum parameter. This patch removes the error returning checks for
'quantum' parameter and populates its value to tc_htb_qopt_offload
structure such that driver can use the same.

Add quantum parameter check in mlx5 driver, as mlx5 devices are not capable
of supporting the quantum parameter when htb offload is used. Report error
if quantum parameter is set to a non-default value.
Signed-off-by: default avatarNaveen Mamindlapalli <naveenm@marvell.com>
Signed-off-by: default avatarHariprasad Kelam <hkelam@marvell.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent f78dca69
...@@ -379,9 +379,9 @@ int mlx5e_htb_setup_tc(struct mlx5e_priv *priv, struct tc_htb_qopt_offload *htb_ ...@@ -379,9 +379,9 @@ int mlx5e_htb_setup_tc(struct mlx5e_priv *priv, struct tc_htb_qopt_offload *htb_
if (!htb && htb_qopt->command != TC_HTB_CREATE) if (!htb && htb_qopt->command != TC_HTB_CREATE)
return -EINVAL; return -EINVAL;
if (htb_qopt->prio) { if (htb_qopt->prio || htb_qopt->quantum) {
NL_SET_ERR_MSG_MOD(htb_qopt->extack, NL_SET_ERR_MSG_MOD(htb_qopt->extack,
"prio parameter is not supported by device with HTB offload enabled."); "prio and quantum parameters are not supported by device with HTB offload enabled.");
return -EOPNOTSUPP; return -EOPNOTSUPP;
} }
......
...@@ -866,6 +866,7 @@ struct tc_htb_qopt_offload { ...@@ -866,6 +866,7 @@ struct tc_htb_qopt_offload {
u32 parent_classid; u32 parent_classid;
u16 classid; u16 classid;
u16 qid; u16 qid;
u32 quantum;
u64 rate; u64 rate;
u64 ceil; u64 ceil;
u8 prio; u8 prio;
......
...@@ -1810,10 +1810,6 @@ static int htb_change_class(struct Qdisc *sch, u32 classid, ...@@ -1810,10 +1810,6 @@ static int htb_change_class(struct Qdisc *sch, u32 classid,
NL_SET_ERR_MSG(extack, "HTB offload doesn't support the mpu parameter"); NL_SET_ERR_MSG(extack, "HTB offload doesn't support the mpu parameter");
goto failure; goto failure;
} }
if (hopt->quantum) {
NL_SET_ERR_MSG(extack, "HTB offload doesn't support the quantum parameter");
goto failure;
}
} }
/* Keeping backward compatible with rate_table based iproute2 tc */ /* Keeping backward compatible with rate_table based iproute2 tc */
...@@ -1910,6 +1906,7 @@ static int htb_change_class(struct Qdisc *sch, u32 classid, ...@@ -1910,6 +1906,7 @@ static int htb_change_class(struct Qdisc *sch, u32 classid,
.rate = max_t(u64, hopt->rate.rate, rate64), .rate = max_t(u64, hopt->rate.rate, rate64),
.ceil = max_t(u64, hopt->ceil.rate, ceil64), .ceil = max_t(u64, hopt->ceil.rate, ceil64),
.prio = hopt->prio, .prio = hopt->prio,
.quantum = hopt->quantum,
.extack = extack, .extack = extack,
}; };
err = htb_offload(dev, &offload_opt); err = htb_offload(dev, &offload_opt);
...@@ -1931,6 +1928,7 @@ static int htb_change_class(struct Qdisc *sch, u32 classid, ...@@ -1931,6 +1928,7 @@ static int htb_change_class(struct Qdisc *sch, u32 classid,
.rate = max_t(u64, hopt->rate.rate, rate64), .rate = max_t(u64, hopt->rate.rate, rate64),
.ceil = max_t(u64, hopt->ceil.rate, ceil64), .ceil = max_t(u64, hopt->ceil.rate, ceil64),
.prio = hopt->prio, .prio = hopt->prio,
.quantum = hopt->quantum,
.extack = extack, .extack = extack,
}; };
err = htb_offload(dev, &offload_opt); err = htb_offload(dev, &offload_opt);
...@@ -2017,6 +2015,7 @@ static int htb_change_class(struct Qdisc *sch, u32 classid, ...@@ -2017,6 +2015,7 @@ static int htb_change_class(struct Qdisc *sch, u32 classid,
.rate = max_t(u64, hopt->rate.rate, rate64), .rate = max_t(u64, hopt->rate.rate, rate64),
.ceil = max_t(u64, hopt->ceil.rate, ceil64), .ceil = max_t(u64, hopt->ceil.rate, ceil64),
.prio = hopt->prio, .prio = hopt->prio,
.quantum = hopt->quantum,
.extack = extack, .extack = extack,
}; };
err = htb_offload(dev, &offload_opt); err = htb_offload(dev, &offload_opt);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment