Lines Matching defs:qopt
62 static int mqprio_parse_opt(struct net_device *dev, struct tc_mqprio_qopt *qopt)
67 if (qopt->num_tc > TC_MAX_QUEUE)
72 if (qopt->prio_tc_map[i] >= qopt->num_tc)
76 /* Limit qopt->hw to maximum supported offload value. Drivers have
80 if (qopt->hw > TC_MQPRIO_HW_OFFLOAD_MAX)
81 qopt->hw = TC_MQPRIO_HW_OFFLOAD_MAX;
88 if (qopt->hw)
91 for (i = 0; i < qopt->num_tc; i++) {
92 unsigned int last = qopt->offset[i] + qopt->count[i];
97 if (qopt->offset[i] >= dev->real_num_tx_queues ||
98 !qopt->count[i] ||
103 for (j = i + 1; j < qopt->num_tc; j++) {
104 if (last > qopt->offset[j])
133 static int mqprio_parse_nlattr(struct Qdisc *sch, struct tc_mqprio_qopt *qopt,
143 sizeof(*qopt));
147 if (!qopt->hw) {
184 if (i >= qopt->num_tc)
213 if (i >= qopt->num_tc)
232 struct tc_mqprio_qopt *qopt = NULL;
248 if (!opt || nla_len(opt) < sizeof(*qopt))
251 qopt = nla_data(opt);
252 if (mqprio_parse_opt(dev, qopt))
255 len = nla_len(opt) - NLA_ALIGN(sizeof(*qopt));
257 err = mqprio_parse_nlattr(sch, qopt, opt, extack);
285 if (qopt->hw) {
286 struct tc_mqprio_qopt_offload mqprio = {.qopt = *qopt};
300 for (i = 0; i < mqprio.qopt.num_tc; i++)
303 for (i = 0; i < mqprio.qopt.num_tc; i++)
315 priv->hw_offload = mqprio.qopt.hw;
317 netdev_set_num_tc(dev, qopt->num_tc);
318 for (i = 0; i < qopt->num_tc; i++)
320 qopt->count[i], qopt->offset[i]);
325 netdev_set_prio_tc_map(dev, i, qopt->prio_tc_map[i]);