Skip to content

Commit e6ebe6c

Browse files
committed
Merge branch 'taprio-auto-qmaxsdu-new-tx'
Vladimir Oltean says: ==================== taprio automatic queueMaxSDU and new TXQ selection procedure This patch set addresses 2 design limitations in the taprio software scheduler: 1. Software scheduling fundamentally prioritizes traffic incorrectly, in a way which was inspired from Intel igb/igc drivers and does not follow the inputs user space gives (traffic classes and TC to TXQ mapping). Patch 05/15 handles this, 01/15 - 04/15 are preparations for this work. 2. Software scheduling assumes that the gate for a traffic class closes as soon as the next interval begins. But this isn't true. If consecutive schedule entries have that traffic class gate open, there is no "gate close" event and taprio should keep dequeuing from that TC without interruptions. Patches 06/15 - 15/15 handle this. Patch 10/15 is a generic Qdisc change required for this to work. Future development directions which depend on this patch set are: - Propagating the automatic queueMaxSDU calculation down to offloading device drivers, instead of letting them calculate this, as vsc9959_tas_guard_bands_update() does today. - A software data path for tc-taprio with preemptible traffic and Hold/Release events. v1 at: https://patchwork.kernel.org/project/netdevbpf/cover/[email protected]/ ==================== Signed-off-by: David S. Miller <[email protected]>
2 parents 6da13bf + 39b02d6 commit e6ebe6c

File tree

5 files changed

+500
-197
lines changed

5 files changed

+500
-197
lines changed

drivers/net/ethernet/intel/igb/igb_main.c

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2810,6 +2810,22 @@ static int igb_offload_txtime(struct igb_adapter *adapter,
28102810
return 0;
28112811
}
28122812

2813+
static int igb_tc_query_caps(struct igb_adapter *adapter,
2814+
struct tc_query_caps_base *base)
2815+
{
2816+
switch (base->type) {
2817+
case TC_SETUP_QDISC_TAPRIO: {
2818+
struct tc_taprio_caps *caps = base->caps;
2819+
2820+
caps->broken_mqprio = true;
2821+
2822+
return 0;
2823+
}
2824+
default:
2825+
return -EOPNOTSUPP;
2826+
}
2827+
}
2828+
28132829
static LIST_HEAD(igb_block_cb_list);
28142830

28152831
static int igb_setup_tc(struct net_device *dev, enum tc_setup_type type,
@@ -2818,6 +2834,8 @@ static int igb_setup_tc(struct net_device *dev, enum tc_setup_type type,
28182834
struct igb_adapter *adapter = netdev_priv(dev);
28192835

28202836
switch (type) {
2837+
case TC_QUERY_CAPS:
2838+
return igb_tc_query_caps(adapter, type_data);
28212839
case TC_SETUP_QDISC_CBS:
28222840
return igb_offload_cbs(adapter, type_data);
28232841
case TC_SETUP_BLOCK:

drivers/net/ethernet/intel/igc/igc_main.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6214,10 +6214,10 @@ static int igc_tc_query_caps(struct igc_adapter *adapter,
62146214
case TC_SETUP_QDISC_TAPRIO: {
62156215
struct tc_taprio_caps *caps = base->caps;
62166216

6217-
if (hw->mac.type != igc_i225)
6218-
return -EOPNOTSUPP;
6217+
caps->broken_mqprio = true;
62196218

6220-
caps->gate_mask_per_txq = true;
6219+
if (hw->mac.type == igc_i225)
6220+
caps->gate_mask_per_txq = true;
62216221

62226222
return 0;
62236223
}

include/net/pkt_sched.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,11 @@ struct tc_mqprio_qopt_offload {
177177
struct tc_taprio_caps {
178178
bool supports_queue_max_sdu:1;
179179
bool gate_mask_per_txq:1;
180+
/* Device expects lower TXQ numbers to have higher priority over higher
181+
* TXQs, regardless of their TC mapping. DO NOT USE FOR NEW DRIVERS,
182+
* INSTEAD ENFORCE A PROPER TC:TXQ MAPPING COMING FROM USER SPACE.
183+
*/
184+
bool broken_mqprio:1;
180185
};
181186

182187
struct tc_taprio_sched_entry {

net/sched/sch_api.c

Lines changed: 11 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1282,12 +1282,6 @@ static struct Qdisc *qdisc_create(struct net_device *dev,
12821282
if (err)
12831283
goto err_out3;
12841284

1285-
if (ops->init) {
1286-
err = ops->init(sch, tca[TCA_OPTIONS], extack);
1287-
if (err != 0)
1288-
goto err_out5;
1289-
}
1290-
12911285
if (tca[TCA_STAB]) {
12921286
stab = qdisc_get_stab(tca[TCA_STAB], extack);
12931287
if (IS_ERR(stab)) {
@@ -1296,11 +1290,18 @@ static struct Qdisc *qdisc_create(struct net_device *dev,
12961290
}
12971291
rcu_assign_pointer(sch->stab, stab);
12981292
}
1293+
1294+
if (ops->init) {
1295+
err = ops->init(sch, tca[TCA_OPTIONS], extack);
1296+
if (err != 0)
1297+
goto err_out5;
1298+
}
1299+
12991300
if (tca[TCA_RATE]) {
13001301
err = -EOPNOTSUPP;
13011302
if (sch->flags & TCQ_F_MQROOT) {
13021303
NL_SET_ERR_MSG(extack, "Cannot attach rate estimator to a multi-queue root qdisc");
1303-
goto err_out4;
1304+
goto err_out5;
13041305
}
13051306

13061307
err = gen_new_estimator(&sch->bstats,
@@ -1311,7 +1312,7 @@ static struct Qdisc *qdisc_create(struct net_device *dev,
13111312
tca[TCA_RATE]);
13121313
if (err) {
13131314
NL_SET_ERR_MSG(extack, "Failed to generate new estimator");
1314-
goto err_out4;
1315+
goto err_out5;
13151316
}
13161317
}
13171318

@@ -1321,6 +1322,8 @@ static struct Qdisc *qdisc_create(struct net_device *dev,
13211322
return sch;
13221323

13231324
err_out5:
1325+
qdisc_put_stab(rtnl_dereference(sch->stab));
1326+
err_out4:
13241327
/* ops->init() failed, we call ->destroy() like qdisc_create_dflt() */
13251328
if (ops->destroy)
13261329
ops->destroy(sch);
@@ -1332,16 +1335,6 @@ static struct Qdisc *qdisc_create(struct net_device *dev,
13321335
err_out:
13331336
*errp = err;
13341337
return NULL;
1335-
1336-
err_out4:
1337-
/*
1338-
* Any broken qdiscs that would require a ops->reset() here?
1339-
* The qdisc was never in action so it shouldn't be necessary.
1340-
*/
1341-
qdisc_put_stab(rtnl_dereference(sch->stab));
1342-
if (ops->destroy)
1343-
ops->destroy(sch);
1344-
goto err_out3;
13451338
}
13461339

13471340
static int qdisc_change(struct Qdisc *sch, struct nlattr **tca,

0 commit comments

Comments
 (0)