<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/net/sched/sch_generic.c, branch linux-4.18.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-4.18.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-4.18.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2018-05-31T17:26:19Z</updated>
<entry>
<title>net: remove bypassed check in sch_direct_xmit()</title>
<updated>2018-05-31T17:26:19Z</updated>
<author>
<name>Song Liu</name>
</author>
<published>2018-05-29T17:03:21Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=4341f8308d53f95a4a1ab54f45fa9af2c30ff596'/>
<id>urn:sha1:4341f8308d53f95a4a1ab54f45fa9af2c30ff596</id>
<content type='text'>
Checking netif_xmit_frozen_or_stopped() at the end of sch_direct_xmit()
is being bypassed. This is because "ret" from sch_direct_xmit() will be
either NETDEV_TX_OK or NETDEV_TX_BUSY, and only ret == NETDEV_TX_OK == 0
will reach the condition:

    if (ret &amp;&amp; netif_xmit_frozen_or_stopped(txq))
        return false;

This patch cleans up the code by removing the whole condition.

For more discussion about this, please refer to
   https://marc.info/?t=152727195700008

Signed-off-by: Song Liu &lt;songliubraving@fb.com&gt;
Cc: John Fastabend &lt;john.fastabend@gmail.com&gt;
Cc: Alexei Starovoitov &lt;ast@kernel.org&gt;
Cc: David S. Miller &lt;davem@davemloft.net&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>pfifo_fast: drop unneeded additional lock on dequeue</title>
<updated>2018-05-17T16:46:54Z</updated>
<author>
<name>Paolo Abeni</name>
</author>
<published>2018-05-15T14:24:37Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=021a17ed796b62383f7623f4fea73787abddad77'/>
<id>urn:sha1:021a17ed796b62383f7623f4fea73787abddad77</id>
<content type='text'>
After the previous patch, for NOLOCK qdiscs, q-&gt;seqlock is
always held when the dequeue() is invoked, we can drop
any additional locking to protect such operation.

Signed-off-by: Paolo Abeni &lt;pabeni@redhat.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>sched: replace __QDISC_STATE_RUNNING bit with a spin lock</title>
<updated>2018-05-17T16:46:54Z</updated>
<author>
<name>Paolo Abeni</name>
</author>
<published>2018-05-15T14:24:36Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=96009c7d500efdd5534e83b2e3eb2c58d4b137ae'/>
<id>urn:sha1:96009c7d500efdd5534e83b2e3eb2c58d4b137ae</id>
<content type='text'>
So that we can use lockdep on it.
The newly introduced sequence lock has the same scope of busylock,
so it shares the same lockdep annotation, but it's only used for
NOLOCK qdiscs.

With this changeset we acquire such lock in the control path around
flushing operation (qdisc reset), to allow more NOLOCK qdisc perf
improvement in the next patch.

Signed-off-by: Paolo Abeni &lt;pabeni@redhat.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>sched: manipulate __QDISC_STATE_RUNNING in qdisc_run_* helpers</title>
<updated>2018-05-16T16:26:25Z</updated>
<author>
<name>Paolo Abeni</name>
</author>
<published>2018-05-15T08:50:31Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=32f7b44d0f5661044fcfa84e9ad402ed9d759107'/>
<id>urn:sha1:32f7b44d0f5661044fcfa84e9ad402ed9d759107</id>
<content type='text'>
Currently NOLOCK qdiscs pay a measurable overhead to atomically
manipulate the __QDISC_STATE_RUNNING. Such bit is flipped twice per
packet in the uncontended scenario with packet rate below the
line rate: on packed dequeue and on the next, failing dequeue attempt.

This changeset moves the bit manipulation into the qdisc_run_{begin,end}
helpers, so that the bit is now flipped only once per packet, with
measurable performance improvement in the uncontended scenario.

This also allows simplifying the qdisc teardown code path - since
qdisc_is_running() is now effective for each qdisc type - and avoid a
possible race between qdisc_run() and dev_deactivate_many(), as now
the some_qdisc_is_busy() can properly detect NOLOCK qdiscs being busy
dequeuing packets.

Signed-off-by: Paolo Abeni &lt;pabeni@redhat.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net: sched, fix OOO packets with pfifo_fast</title>
<updated>2018-03-26T16:36:23Z</updated>
<author>
<name>John Fastabend</name>
</author>
<published>2018-03-25T05:25:06Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=eb82a994479245a79647d302f9b4eb8e7c9d7ca6'/>
<id>urn:sha1:eb82a994479245a79647d302f9b4eb8e7c9d7ca6</id>
<content type='text'>
After the qdisc lock was dropped in pfifo_fast we allow multiple
enqueue threads and dequeue threads to run in parallel. On the
enqueue side the skb bit ooo_okay is used to ensure all related
skbs are enqueued in-order. On the dequeue side though there is
no similar logic. What we observe is with fewer queues than CPUs
it is possible to re-order packets when two instances of
__qdisc_run() are running in parallel. Each thread will dequeue
a skb and then whichever thread calls the ndo op first will
be sent on the wire. This doesn't typically happen because
qdisc_run() is usually triggered by the same core that did the
enqueue. However, drivers will trigger __netif_schedule()
when queues are transitioning from stopped to awake using the
netif_tx_wake_* APIs. When this happens netif_schedule() calls
qdisc_run() on the same CPU that did the netif_tx_wake_* which
is usually done in the interrupt completion context. This CPU
is selected with the irq affinity which is unrelated to the
enqueue operations.

To resolve this we add a RUNNING bit to the qdisc to ensure
only a single dequeue per qdisc is running. Enqueue and dequeue
operations can still run in parallel and also on multi queue
NICs we can still have a dequeue in-flight per qdisc, which
is typically per CPU.

Fixes: c5ad119fb6c0 ("net: sched: pfifo_fast use skb_array")
Reported-by: Jakob Unterwurzacher &lt;jakob.unterwurzacher@theobroma-systems.com&gt;
Signed-off-by: John Fastabend &lt;john.fastabend@gmail.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net: sched: fix uses after free</title>
<updated>2018-03-17T21:03:45Z</updated>
<author>
<name>Eric Dumazet</name>
</author>
<published>2018-03-15T01:53:00Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=cce6294cc2eaa083482e1d85d8db5845c82a7e14'/>
<id>urn:sha1:cce6294cc2eaa083482e1d85d8db5845c82a7e14</id>
<content type='text'>
syzbot reported one use-after-free in pfifo_fast_enqueue() [1]

Issue here is that we can not reuse skb after a successful skb_array_produce()
since another cpu might have consumed it already.

I believe a similar problem exists in try_bulk_dequeue_skb_slow()
in case we put an skb into qdisc_enqueue_skb_bad_txq() for lockless qdisc.

[1]
BUG: KASAN: use-after-free in qdisc_pkt_len include/net/sch_generic.h:610 [inline]
BUG: KASAN: use-after-free in qdisc_qstats_cpu_backlog_inc include/net/sch_generic.h:712 [inline]
BUG: KASAN: use-after-free in pfifo_fast_enqueue+0x4bc/0x5e0 net/sched/sch_generic.c:639
Read of size 4 at addr ffff8801cede37e8 by task syzkaller717588/5543

CPU: 1 PID: 5543 Comm: syzkaller717588 Not tainted 4.16.0-rc4+ #265
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
 __dump_stack lib/dump_stack.c:17 [inline]
 dump_stack+0x194/0x24d lib/dump_stack.c:53
 print_address_description+0x73/0x250 mm/kasan/report.c:256
 kasan_report_error mm/kasan/report.c:354 [inline]
 kasan_report+0x23c/0x360 mm/kasan/report.c:412
 __asan_report_load4_noabort+0x14/0x20 mm/kasan/report.c:432
 qdisc_pkt_len include/net/sch_generic.h:610 [inline]
 qdisc_qstats_cpu_backlog_inc include/net/sch_generic.h:712 [inline]
 pfifo_fast_enqueue+0x4bc/0x5e0 net/sched/sch_generic.c:639
 __dev_xmit_skb net/core/dev.c:3216 [inline]

Fixes: c5ad119fb6c0 ("net: sched: pfifo_fast use skb_array")
Signed-off-by: Eric Dumazet &lt;edumazet@google.com&gt;
Reported-by: syzbot+ed43b6903ab968b16f54@syzkaller.appspotmail.com
Cc: John Fastabend &lt;john.fastabend@gmail.com&gt;
Cc: Jamal Hadi Salim &lt;jhs@mojatatu.com&gt;
Cc:	Cong Wang &lt;xiyou.wangcong@gmail.com&gt;
Cc:	Jiri Pirko &lt;jiri@resnulli.us&gt;
Acked-by: John Fastabend &lt;john.fastabend@gmail.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net_sched: implement -&gt;change_tx_queue_len() for pfifo_fast</title>
<updated>2018-01-29T17:42:15Z</updated>
<author>
<name>Cong Wang</name>
</author>
<published>2018-01-26T02:26:24Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=7007ba630e4a6f809eab9abfc0e3a6e864e9d880'/>
<id>urn:sha1:7007ba630e4a6f809eab9abfc0e3a6e864e9d880</id>
<content type='text'>
pfifo_fast used to drop based on qdisc_dev(qdisc)-&gt;tx_queue_len,
so we have to resize skb array when we change tx_queue_len.

Other qdiscs which read tx_queue_len are fine because they
all save it to sch-&gt;limit or somewhere else in qdisc during init.
They don't have to implement this, it is nicer if they do so
that users don't have to re-configure qdisc after changing
tx_queue_len.

Cc: John Fastabend &lt;john.fastabend@gmail.com&gt;
Signed-off-by: Cong Wang &lt;xiyou.wangcong@gmail.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net_sched: plug in qdisc ops change_tx_queue_len</title>
<updated>2018-01-29T17:42:15Z</updated>
<author>
<name>Cong Wang</name>
</author>
<published>2018-01-26T02:26:23Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=48bfd55e7e4149a304e89c1999436cf52d094a27'/>
<id>urn:sha1:48bfd55e7e4149a304e89c1999436cf52d094a27</id>
<content type='text'>
Introduce a new qdisc ops -&gt;change_tx_queue_len() so that
each qdisc could decide how to implement this if it wants.
Previously we simply read dev-&gt;tx_queue_len, after pfifo_fast
switches to skb array, we need this API to resize the skb array
when we change dev-&gt;tx_queue_len.

To avoid handling race conditions with TX BH, we need to
deactivate all TX queues before change the value and bring them
back after we are done, this also makes implementation easier.

Cc: John Fastabend &lt;john.fastabend@gmail.com&gt;
Signed-off-by: Cong Wang &lt;xiyou.wangcong@gmail.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net: core: Expose number of link up/down transitions</title>
<updated>2018-01-22T20:42:05Z</updated>
<author>
<name>David Decotigny</name>
</author>
<published>2018-01-18T17:59:13Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=b2d3bcfa26a7a8de41f358a6cae8b848673b3c6e'/>
<id>urn:sha1:b2d3bcfa26a7a8de41f358a6cae8b848673b3c6e</id>
<content type='text'>
Expose the number of times the link has been going UP or DOWN, and
update the "carrier_changes" counter to be the sum of these two events.
While at it, also update the sysfs-class-net documentation to cover:
carrier_changes (3.15), carrier_up_count (4.16) and carrier_down_count
(4.16)

Signed-off-by: David Decotigny &lt;decot@googlers.com&gt;
[Florian:
* rebase
* add documentation
* merge carrier_changes with up/down counters]
Signed-off-by: Florian Fainelli &lt;f.fainelli@gmail.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net</title>
<updated>2018-01-17T05:10:42Z</updated>
<author>
<name>David S. Miller</name>
</author>
<published>2018-01-17T05:00:25Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=c02b3741eb99a1ec733e6134c53ba59e43e19e97'/>
<id>urn:sha1:c02b3741eb99a1ec733e6134c53ba59e43e19e97</id>
<content type='text'>
Overlapping changes all over.

The mini-qdisc bits were a little bit tricky, however.

Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
</feed>
