net/sched: taprio: pass mqprio queue configuration to ndo_setup_tc()
The taprio qdisc does not currently pass the mqprio queue configuration down to the offloading device driver. So the driver cannot act upon the TXQ counts/offsets per TC, or upon the prio->tc map. It was probably assumed that the driver only wants to offload num_tc (see TC_MQPRIO_HW_OFFLOAD_TCS), which it can get from netdev_get_num_tc(), but there's clearly more to the mqprio configuration than that. I've considered 2 mechanisms to remedy that. First is to pass a struct tc_mqprio_qopt_offload as part of the tc_taprio_qopt_offload. The second is to make taprio actually call TC_SETUP_QDISC_MQPRIO, *in addition to* TC_SETUP_QDISC_TAPRIO. The difference is that in the first case, existing drivers (offloading or not) all ignore taprio's mqprio portion currently, whereas in the second case, we could control whether to call TC_SETUP_QDISC_MQPRIO, based on a new capability. The question is which approach would be better. I'm afraid that calling TC_SETUP_QDISC_MQPRIO unconditionally (not based on a taprio capability bit) would risk introducing regressions. For example, taprio doesn't populate (or validate) qopt->hw, as well as mqprio.flags, mqprio.shaper, mqprio.min_rate, mqprio.max_rate. In comparison, adding a capability is functionally equivalent to just passing the mqprio in a way that drivers can ignore it, except it's slightly more complicated to use it (need to set the capability). Ultimately, what made me go for the "mqprio in taprio" variant was that it's easier for offloading drivers to interpret the mqprio qopt slightly differently when it comes from taprio vs when it comes from mqprio, should that ever become necessary. Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com> Reviewed-by: Simon Horman <simon.horman@corigine.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
9dd6ad674c
commit
09c794c0a8
|
@ -187,6 +187,7 @@ struct tc_taprio_sched_entry {
|
|||
};
|
||||
|
||||
struct tc_taprio_qopt_offload {
|
||||
struct tc_mqprio_qopt_offload mqprio;
|
||||
u8 enable;
|
||||
ktime_t base_time;
|
||||
u64 cycle_time;
|
||||
|
|
|
@ -1228,6 +1228,7 @@ static int taprio_enable_offload(struct net_device *dev,
|
|||
return -ENOMEM;
|
||||
}
|
||||
offload->enable = 1;
|
||||
mqprio_qopt_reconstruct(dev, &offload->mqprio.qopt);
|
||||
taprio_sched_to_offload(dev, sched, offload);
|
||||
|
||||
for (tc = 0; tc < TC_MAX_QUEUE; tc++)
|
||||
|
|
Loading…
Reference in New Issue