<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/include/net/act_api.h, branch v4.20</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=v4.20</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v4.20'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2018-10-05T07:36:31Z</updated>
<entry>
<title>net_sched: convert idrinfo-&gt;lock from spinlock to a mutex</title>
<updated>2018-10-05T07:36:31Z</updated>
<author>
<name>Cong Wang</name>
<email>xiyou.wangcong@gmail.com</email>
</author>
<published>2018-10-02T19:50:19Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=95278ddaa15cfa23e4a06ee9ed7b6ee0197c500b'/>
<id>urn:sha1:95278ddaa15cfa23e4a06ee9ed7b6ee0197c500b</id>
<content type='text'>
In commit ec3ed293e766 ("net_sched: change tcf_del_walker() to take idrinfo-&gt;lock")
we move fl_hw_destroy_tmplt() to a workqueue to avoid blocking
with the spinlock held. Unfortunately, this causes a lot of
troubles here:

1. tcf_chain_destroy() could be called right after we queue the work
   but before the work runs. This is a use-after-free.

2. The chain refcnt is already 0, we can't even just hold it again.
   We can check refcnt==1 but it is ugly.

3. The chain with refcnt 0 is still visible in its block, which means
   it could be still found and used!

4. The block has a refcnt too, we can't hold it without introducing a
   proper API either.

We can make it working but the end result is ugly. Instead of wasting
time on reviewing it, let's just convert the troubling spinlock to
a mutex, which allows us to use non-atomic allocations too.

Fixes: ec3ed293e766 ("net_sched: change tcf_del_walker() to take idrinfo-&gt;lock")
Reported-by: Ido Schimmel &lt;idosch@idosch.org&gt;
Cc: Jamal Hadi Salim &lt;jhs@mojatatu.com&gt;
Cc: Vlad Buslov &lt;vladbu@mellanox.com&gt;
Cc: Jiri Pirko &lt;jiri@mellanox.com&gt;
Signed-off-by: Cong Wang &lt;xiyou.wangcong@gmail.com&gt;
Tested-by: Ido Schimmel &lt;idosch@mellanox.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net/sched: Add hardware specific counters to TC actions</title>
<updated>2018-09-24T19:18:42Z</updated>
<author>
<name>Eelco Chaudron</name>
<email>echaudro@redhat.com</email>
</author>
<published>2018-09-21T11:14:02Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=28169abadb08333eb607621faa3a1dd7109e0d45'/>
<id>urn:sha1:28169abadb08333eb607621faa3a1dd7109e0d45</id>
<content type='text'>
Add additional counters that will store the bytes/packets processed by
hardware. These will be exported through the netlink interface for
displaying by the iproute2 tc tool

Signed-off-by: Eelco Chaudron &lt;echaudro@redhat.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>Revert "net: sched: act: add extack for lookup callback"</title>
<updated>2018-09-01T05:50:15Z</updated>
<author>
<name>Cong Wang</name>
<email>xiyou.wangcong@gmail.com</email>
</author>
<published>2018-08-29T17:15:35Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=f061b48c1787e6fece2190e27da6878f4f1796d0'/>
<id>urn:sha1:f061b48c1787e6fece2190e27da6878f4f1796d0</id>
<content type='text'>
This reverts commit 331a9295de23 ("net: sched: act: add extack for lookup callback").

This extack is never used after 6 months... In fact, it can be just
set in the caller, right after -&gt;lookup().

Cc: Alexander Aring &lt;aring@mojatatu.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: remove unused tcfa_capab</title>
<updated>2018-08-21T19:45:45Z</updated>
<author>
<name>Cong Wang</name>
<email>xiyou.wangcong@gmail.com</email>
</author>
<published>2018-08-19T19:22:10Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=a0c2e90fe131d9a7440ac05c9c31fc35dfac2fa8'/>
<id>urn:sha1:a0c2e90fe131d9a7440ac05c9c31fc35dfac2fa8</id>
<content type='text'>
Cc: Jamal Hadi Salim &lt;jhs@mojatatu.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: remove list_head from tc_action</title>
<updated>2018-08-21T19:45:44Z</updated>
<author>
<name>Cong Wang</name>
<email>xiyou.wangcong@gmail.com</email>
</author>
<published>2018-08-19T19:22:09Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=244cd96adb5f5ab39551081fb1f9009a54bb12ee'/>
<id>urn:sha1:244cd96adb5f5ab39551081fb1f9009a54bb12ee</id>
<content type='text'>
After commit 90b73b77d08e, list_head is no longer needed.
Now we just need to convert the list iteration to array
iteration for drivers.

Fixes: 90b73b77d08e ("net: sched: change action API to use array of pointers to actions")
Cc: Jiri Pirko &lt;jiri@mellanox.com&gt;
Cc: Vlad Buslov &lt;vladbu@mellanox.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: remove unused tcf_idr_check()</title>
<updated>2018-08-21T19:45:44Z</updated>
<author>
<name>Cong Wang</name>
<email>xiyou.wangcong@gmail.com</email>
</author>
<published>2018-08-19T19:22:08Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=7d485c451fc82f8ae431cdb379521bc6d0641064'/>
<id>urn:sha1:7d485c451fc82f8ae431cdb379521bc6d0641064</id>
<content type='text'>
tcf_idr_check() is replaced by tcf_idr_check_alloc(),
and __tcf_idr_check() now can be folded into tcf_idr_search().

Fixes: 0190c1d452a9 ("net: sched: atomically check-allocate action")
Cc: Jiri Pirko &lt;jiri@mellanox.com&gt;
Cc: Vlad Buslov &lt;vladbu@mellanox.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: remove unnecessary ops-&gt;delete()</title>
<updated>2018-08-21T19:45:44Z</updated>
<author>
<name>Cong Wang</name>
<email>xiyou.wangcong@gmail.com</email>
</author>
<published>2018-08-19T19:22:06Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=97a3f84f2c84f81b859aedd2c186df09c2ee21a6'/>
<id>urn:sha1:97a3f84f2c84f81b859aedd2c186df09c2ee21a6</id>
<content type='text'>
All ops-&gt;delete() wants is getting the tn-&gt;idrinfo, but we already
have tc_action before calling ops-&gt;delete(), and tc_action has
a pointer -&gt;idrinfo.

More importantly, each type of action does the same thing, that is,
just calling tcf_idr_delete_index().

So it can be just removed.

Fixes: b409074e6693 ("net: sched: add 'delete' function to action ops")
Cc: Jiri Pirko &lt;jiri@mellanox.com&gt;
Cc: Vlad Buslov &lt;vladbu@mellanox.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: extend action ops with put_dev callback</title>
<updated>2018-08-11T19:37:10Z</updated>
<author>
<name>Vlad Buslov</name>
<email>vladbu@mellanox.com</email>
</author>
<published>2018-08-10T17:51:52Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=84a75b329be84c108a21ab9c02a52a9bf9e5a919'/>
<id>urn:sha1:84a75b329be84c108a21ab9c02a52a9bf9e5a919</id>
<content type='text'>
As a preparation for removing dependency on rtnl lock from rules update
path, all users of shared objects must take reference while working with
them.

Extend action ops with put_dev() API to be used on net device returned by
get_dev().

Modify mirred action (only action that implements get_dev callback):
- Take reference to net device in get_dev.
- Implement put_dev API that releases reference to net device.

Signed-off-by: Vlad Buslov &lt;vladbu@mellanox.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>tc/act: remove unneeded RCU lock in action callback</title>
<updated>2018-07-30T16:31:13Z</updated>
<author>
<name>Paolo Abeni</name>
<email>pabeni@redhat.com</email>
</author>
<published>2018-07-30T12:30:43Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=7fd4b288ea6a3e45ad8afbcd5ec39554d57f1ae0'/>
<id>urn:sha1:7fd4b288ea6a3e45ad8afbcd5ec39554d57f1ae0</id>
<content type='text'>
Each lockless action currently does its own RCU locking in -&gt;act().
This allows using plain RCU accessor, even if the context
is really RCU BH.

This change drops the per action RCU lock, replace the accessors
with the _bh variant, cleans up a bit the surrounding code and
documents the RCU status in the relevant header.
No functional nor performance change is intended.

The goal of this patch is clarifying that the RCU critical section
used by the tc actions extends up to the classifier's caller.

v1 -&gt; v2:
 - preserve rcu lock in act_bpf: it's needed by eBPF helpers,
   as pointed out by Daniel

v3 -&gt; v4:
 - fixed some typos in the commit message (JiriP)

Signed-off-by: Paolo Abeni &lt;pabeni@redhat.com&gt;
Acked-by: Jiri Pirko &lt;jiri@mellanox.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net: sched: change action API to use array of pointers to actions</title>
<updated>2018-07-08T03:42:29Z</updated>
<author>
<name>Vlad Buslov</name>
<email>vladbu@mellanox.com</email>
</author>
<published>2018-07-05T14:24:33Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=90b73b77d08ec395311411b545c756ca710aae59'/>
<id>urn:sha1:90b73b77d08ec395311411b545c756ca710aae59</id>
<content type='text'>
Act API used linked list to pass set of actions to functions. It is
intrusive data structure that stores list nodes inside action structure
itself, which means it is not safe to modify such list concurrently.
However, action API doesn't use any linked list specific operations on this
set of actions, so it can be safely refactored into plain pointer array.

Refactor action API to use array of pointers to tc_actions instead of
linked list. Change argument 'actions' type of exported action init,
destroy and dump functions.

Acked-by: Jiri Pirko &lt;jiri@mellanox.com&gt;
Signed-off-by: Vlad Buslov &lt;vladbu@mellanox.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
</feed>
