Skip to content

Commit f07d150

Browse files
Alexander Duyckdavem330
Alexander Duyck
authored andcommitted
multiq: Further multiqueue cleanup
This patch resolves a few issues found with multiq including wording suggestions and a problem seen in the allocation of queues. Signed-off-by: Alexander Duyck <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 67333bb commit f07d150

File tree

2 files changed

+16
-11
lines changed

2 files changed

+16
-11
lines changed

Documentation/networking/multiqueue.txt

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,15 @@ Section 2: Qdisc support for multiqueue devices
2929

3030
-----------------------------------------------
3131

32-
Currently two qdiscs support multiqueue devices. The first is the default
33-
pfifo_fast qdisc. This qdisc supports one qdisc per hardware queue. A new
34-
round-robin qdisc, sch_multiq also supports multiple hardware queues. The
32+
Currently two qdiscs are optimized for multiqueue devices. The first is the
33+
default pfifo_fast qdisc. This qdisc supports one qdisc per hardware queue.
34+
A new round-robin qdisc, sch_multiq also supports multiple hardware queues. The
3535
qdisc is responsible for classifying the skb's and then directing the skb's to
3636
bands and queues based on the value in skb->queue_mapping. Use this field in
3737
the base driver to determine which queue to send the skb to.
3838

39-
sch_multiq has been added for hardware that wishes to avoid unnecessary
40-
requeuing. It will cycle though the bands and verify that the hardware queue
39+
sch_multiq has been added for hardware that wishes to avoid head-of-line
40+
blocking. It will cycle though the bands and verify that the hardware queue
4141
associated with the band is not stopped prior to dequeuing a packet.
4242

4343
On qdisc load, the number of bands is based on the number of queues on the
@@ -63,8 +63,8 @@ band 1 => queue 1
6363
band 2 => queue 2
6464
band 3 => queue 3
6565

66-
Traffic will begin flowing through each queue if your base device has either
67-
the default simple_tx_hash or a custom netdev->select_queue() defined.
66+
Traffic will begin flowing through each queue based on either the simple_tx_hash
67+
function or based on netdev->select_queue() if you have it defined.
6868

6969
The behavior of tc filters remains the same. However a new tc action,
7070
skbedit, has been added. Assuming you wanted to route all traffic to a

net/sched/sch_multiq.c

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -214,8 +214,8 @@ static int multiq_tune(struct Qdisc *sch, struct nlattr *opt)
214214
sch_tree_lock(sch);
215215
q->bands = qopt->bands;
216216
for (i = q->bands; i < q->max_bands; i++) {
217-
struct Qdisc *child = xchg(&q->queues[i], &noop_qdisc);
218-
if (child != &noop_qdisc) {
217+
if (q->queues[i] != &noop_qdisc) {
218+
struct Qdisc *child = xchg(&q->queues[i], &noop_qdisc);
219219
qdisc_tree_decrease_qlen(child, child->q.qlen);
220220
qdisc_destroy(child);
221221
}
@@ -250,7 +250,7 @@ static int multiq_tune(struct Qdisc *sch, struct nlattr *opt)
250250
static int multiq_init(struct Qdisc *sch, struct nlattr *opt)
251251
{
252252
struct multiq_sched_data *q = qdisc_priv(sch);
253-
int i;
253+
int i, err;
254254

255255
q->queues = NULL;
256256

@@ -265,7 +265,12 @@ static int multiq_init(struct Qdisc *sch, struct nlattr *opt)
265265
for (i = 0; i < q->max_bands; i++)
266266
q->queues[i] = &noop_qdisc;
267267

268-
return multiq_tune(sch, opt);
268+
err = multiq_tune(sch,opt);
269+
270+
if (err)
271+
kfree(q->queues);
272+
273+
return err;
269274
}
270275

271276
static int multiq_dump(struct Qdisc *sch, struct sk_buff *skb)

0 commit comments

Comments
 (0)