From: Cedric Jehasse <redacted>
To be able to report reason for rejection when cbs offloading fails.
Signed-off-by: Cedric Jehasse <redacted>
---
include/net/pkt_sched.h | 1 +
net/sched/sch_cbs.c | 4 +++-
2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/include/net/pkt_sched.h b/include/net/pkt_sched.h
index 18a419cd9d949..d35c87004c279 100644
--- a/include/net/pkt_sched.h
+++ b/include/net/pkt_sched.h
@@ -150,6 +150,7 @@ struct tc_cbs_qopt_offload {
s32 locredit;
s32 idleslope;
s32 sendslope;
+ struct netlink_ext_ack *extack;
};
struct tc_etf_qopt_offload {diff --git a/net/sched/sch_cbs.c b/net/sched/sch_cbs.c
index 1c93469c56e3d..87c2eda108c8c 100644
--- a/net/sched/sch_cbs.c
+++ b/net/sched/sch_cbs.c
@@ -307,10 +307,12 @@ static int cbs_enable_offload(struct net_device *dev, struct cbs_sched_data *q,
cbs.locredit = opt->locredit;
cbs.idleslope = opt->idleslope;
cbs.sendslope = opt->sendslope;
+ cbs.extack = extack;
err = ops->ndo_setup_tc(dev, TC_SETUP_QDISC_CBS, &cbs);
if (err < 0) {
- NL_SET_ERR_MSG(extack, "Specified device failed to setup cbs hardware offload");
+ NL_SET_ERR_MSG_WEAK(extack,
+ "Specified device failed to setup cbs hardware offload");
return err;
}
--
2.43.0