<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-dev/net/sched/act_simple.c, branch linus/master</title>
<subtitle>Linux kernel development work - see feature branches</subtitle>
<id>https://git.zx2c4.com/linux-dev/atom/net/sched/act_simple.c?h=linus%2Fmaster</id>
<link rel='self' href='https://git.zx2c4.com/linux-dev/atom/net/sched/act_simple.c?h=linus%2Fmaster'/>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/'/>
<updated>2021-12-19T14:08:47Z</updated>
<entry>
<title>flow_offload: fill flags to action structure</title>
<updated>2021-12-19T14:08:47Z</updated>
<author>
<name>Baowen Zheng</name>
<email>baowen.zheng@corigine.com</email>
</author>
<published>2021-12-17T18:16:17Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=40bd094d65fc9f83941b024cde7c24516f036879'/>
<id>urn:sha1:40bd094d65fc9f83941b024cde7c24516f036879</id>
<content type='text'>
Fill flags to action structure to allow user control if
the action should be offloaded to hardware or not.

Signed-off-by: Baowen Zheng &lt;baowen.zheng@corigine.com&gt;
Signed-off-by: Louis Peens &lt;louis.peens@corigine.com&gt;
Signed-off-by: Simon Horman &lt;simon.horman@corigine.com&gt;
Acked-by: Jamal Hadi Salim &lt;jhs@mojatatu.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net: sched: Merge Qdisc::bstats and Qdisc::cpu_bstats data types</title>
<updated>2021-10-18T11:54:41Z</updated>
<author>
<name>Ahmed S. Darwish</name>
<email>a.darwish@linutronix.de</email>
</author>
<published>2021-10-16T08:49:09Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=50dc9a8572aa4d7cdc56670228fcde40289ed289'/>
<id>urn:sha1:50dc9a8572aa4d7cdc56670228fcde40289ed289</id>
<content type='text'>
The only factor differentiating per-CPU bstats data type (struct
gnet_stats_basic_cpu) from the packed non-per-CPU one (struct
gnet_stats_basic_packed) was a u64_stats sync point inside the former.
The two data types are now equivalent: earlier commits added a u64_stats
sync point to the latter.

Combine both data types into "struct gnet_stats_basic_sync". This
eliminates redundancy and simplifies the bstats read/write APIs.

Use u64_stats_t for bstats "packets" and "bytes" data types. On 64-bit
architectures, u64_stats sync points do not use sequence counter
protection.

Signed-off-by: Ahmed S. Darwish &lt;a.darwish@linutronix.de&gt;
Signed-off-by: Sebastian Andrzej Siewior &lt;bigeasy@linutronix.de&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net_sched: refactor TC action init API</title>
<updated>2021-08-02T09:24:38Z</updated>
<author>
<name>Cong Wang</name>
<email>cong.wang@bytedance.com</email>
</author>
<published>2021-07-29T23:12:14Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=695176bfe5dec2051f950bdac0ae0b21e29e6de3'/>
<id>urn:sha1:695176bfe5dec2051f950bdac0ae0b21e29e6de3</id>
<content type='text'>
TC action -&gt;init() API has 10 parameters, it becomes harder
to read. Some of them are just boolean and can be replaced
by flags. Similarly for the internal API tcf_action_init()
and tcf_exts_validate().

This patch converts them to flags and fold them into
the upper 16 bits of "flags", whose lower 16 bits are still
reserved for user-space. More specifically, the following
kernel flags are introduced:

TCA_ACT_FLAGS_POLICE replace 'name' in a few contexts, to
distinguish whether it is compatible with policer.

TCA_ACT_FLAGS_BIND replaces 'bind', to indicate whether
this action is bound to a filter.

TCA_ACT_FLAGS_REPLACE  replaces 'ovr' in most contexts,
means we are replacing an existing action.

TCA_ACT_FLAGS_NO_RTNL replaces 'rtnl_held' but has the
opposite meaning, because we still hold RTNL in most
cases.

The only user-space flag TCA_ACT_FLAGS_NO_PERCPU_STATS is
untouched and still stored as before.

I have tested this patch with tdc and I do not see any
failure related to this patch.

Tested-by: Vlad Buslov &lt;vladbu@nvidia.com&gt;
Acked-by: Jamal Hadi Salim&lt;jhs@mojatatu.com&gt;
Cc: Jiri Pirko &lt;jiri@resnulli.us&gt;
Signed-off-by: Cong Wang &lt;cong.wang@bytedance.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>treewide: rename nla_strlcpy to nla_strscpy.</title>
<updated>2020-11-16T16:08:54Z</updated>
<author>
<name>Francis Laniel</name>
<email>laniel_francis@privacyrequired.com</email>
</author>
<published>2020-11-15T17:08:06Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=872f690341948b502c93318f806d821c56772c42'/>
<id>urn:sha1:872f690341948b502c93318f806d821c56772c42</id>
<content type='text'>
Calls to nla_strlcpy are now replaced by calls to nla_strscpy which is the new
name of this function.

Signed-off-by: Francis Laniel &lt;laniel_francis@privacyrequired.com&gt;
Reviewed-by: Kees Cook &lt;keescook@chromium.org&gt;
Signed-off-by: Jakub Kicinski &lt;kuba@kernel.org&gt;
</content>
</entry>
<entry>
<title>net_sched: defer tcf_idr_insert() in tcf_action_init_1()</title>
<updated>2020-09-25T02:46:21Z</updated>
<author>
<name>Cong Wang</name>
<email>xiyou.wangcong@gmail.com</email>
</author>
<published>2020-09-23T03:56:23Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=e49d8c22f1261c43a986a7fdbf677ac309682a07'/>
<id>urn:sha1:e49d8c22f1261c43a986a7fdbf677ac309682a07</id>
<content type='text'>
All TC actions call tcf_idr_insert() for new action at the end
of their -&gt;init(), so we can actually move it to a central place
in tcf_action_init_1().

And once the action is inserted into the global IDR, other parallel
process could free it immediately as its refcnt is still 1, so we can
not fail after this, we need to move it after the goto action
validation to avoid handling the failure case after insertion.

This is found during code review, is not directly triggered by syzbot.
And this prepares for the next patch.

Cc: Vlad Buslov &lt;vladbu@mellanox.com&gt;
Cc: Jamal Hadi Salim &lt;jhs@mojatatu.com&gt;
Cc: Jiri Pirko &lt;jiri@resnulli.us&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 packet counter to 64bit</title>
<updated>2019-11-06T02:20:55Z</updated>
<author>
<name>Eric Dumazet</name>
<email>edumazet@google.com</email>
</author>
<published>2019-11-05T03:13:14Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=d0083d98f685b9f4fe810570f93cef0b0bb6b354'/>
<id>urn:sha1:d0083d98f685b9f4fe810570f93cef0b0bb6b354</id>
<content type='text'>
After this change, qdisc packet counter is no longer
a 32bit quantity. We still export 32bit values to user.

Signed-off-by: Eric Dumazet &lt;edumazet@google.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net: sched: update action implementations to support flags</title>
<updated>2019-10-31T01:07:51Z</updated>
<author>
<name>Vlad Buslov</name>
<email>vladbu@mellanox.com</email>
</author>
<published>2019-10-30T14:09:06Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=e38226786022d2d8e5876ab7bc37e82b0eb57e65'/>
<id>urn:sha1:e38226786022d2d8e5876ab7bc37e82b0eb57e65</id>
<content type='text'>
Extend struct tc_action with new "tcfa_flags" field. Set the field in
tcf_idr_create() function and provide new helper
tcf_idr_create_from_flags() that derives 'cpustats' boolean from flags
value. Update individual hardware-offloaded actions init() to pass their
"flags" argument to new helper in order to skip percpu stats allocation
when user requested it through flags.

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>net: sched: extend TCA_ACT space with TCA_ACT_FLAGS</title>
<updated>2019-10-31T01:07:50Z</updated>
<author>
<name>Vlad Buslov</name>
<email>vladbu@mellanox.com</email>
</author>
<published>2019-10-30T14:09:05Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=abbb0d33632ce931ca9c814813ee131351f6b92f'/>
<id>urn:sha1:abbb0d33632ce931ca9c814813ee131351f6b92f</id>
<content type='text'>
Extend TCA_ACT space with nla_bitfield32 flags. Add
TCA_ACT_FLAGS_NO_PERCPU_STATS as the only allowed flag. Parse the flags in
tcf_action_init_1() and pass resulting value as additional argument to
a_o-&gt;init().

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>net_sched: fix a NULL pointer deref in ipt action</title>
<updated>2019-08-27T22:05:58Z</updated>
<author>
<name>Cong Wang</name>
<email>xiyou.wangcong@gmail.com</email>
</author>
<published>2019-08-25T17:01:32Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=981471bd3abf4d572097645d765391533aac327d'/>
<id>urn:sha1:981471bd3abf4d572097645d765391533aac327d</id>
<content type='text'>
The net pointer in struct xt_tgdtor_param is not explicitly
initialized therefore is still NULL when dereferencing it.
So we have to find a way to pass the correct net pointer to
ipt_destroy_target().

The best way I find is just saving the net pointer inside the per
netns struct tcf_idrinfo, which could make this patch smaller.

Fixes: 0c66dc1ea3f0 ("netfilter: conntrack: register hooks in netns when needed by ruleset")
Reported-and-tested-by: itugrok@yahoo.com
Cc: Jamal Hadi Salim &lt;jhs@mojatatu.com&gt;
Cc: Jiri Pirko &lt;jiri@resnulli.us&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: use temporary variable for actions indexes</title>
<updated>2019-08-05T17:59:14Z</updated>
<author>
<name>Dmytro Linkin</name>
<email>dmitrolin@mellanox.com</email>
</author>
<published>2019-08-01T13:02:51Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=7be8ef2cdbfe41a2e524b7c6cc3f8e6cfaa906e4'/>
<id>urn:sha1:7be8ef2cdbfe41a2e524b7c6cc3f8e6cfaa906e4</id>
<content type='text'>
Currently init call of all actions (except ipt) init their 'parm'
structure as a direct pointer to nla data in skb. This leads to race
condition when some of the filter actions were initialized successfully
(and were assigned with idr action index that was written directly
into nla data), but then were deleted and retried (due to following
action module missing or classifier-initiated retry), in which case
action init code tries to insert action to idr with index that was
assigned on previous iteration. During retry the index can be reused
by another action that was inserted concurrently, which causes
unintended action sharing between filters.
To fix described race condition, save action idr index to temporary
stack-allocated variable instead on nla data.

Fixes: 0190c1d452a9 ("net: sched: atomically check-allocate action")
Signed-off-by: Dmytro Linkin &lt;dmitrolin@mellanox.com&gt;
Signed-off-by: Vlad Buslov &lt;vladbu@mellanox.com&gt;
Acked-by: Cong Wang &lt;xiyou.wangcong@gmail.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
</feed>
