<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/net/core/net-sysfs.c, branch linux-5.13.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-5.13.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-5.13.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2021-03-22T20:28:13Z</updated>
<entry>
<title>net-sysfs: remove possible sleep from an RCU read-side critical section</title>
<updated>2021-03-22T20:28:13Z</updated>
<author>
<name>Antoine Tenart</name>
</author>
<published>2021-03-22T15:43:29Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=7f08ec6e04269ce53b664761c9108b44ed2f54ab'/>
<id>urn:sha1:7f08ec6e04269ce53b664761c9108b44ed2f54ab</id>
<content type='text'>
xps_queue_show is mostly made of an RCU read-side critical section and
calls bitmap_zalloc with GFP_KERNEL in the middle of it. That is not
allowed as this call may sleep and such behaviours aren't allowed in RCU
read-side critical sections. Fix this by using GFP_NOWAIT instead.

Fixes: 5478fcd0f483 ("net: embed nr_ids in the xps maps")
Reported-by: kernel test robot &lt;oliver.sang@intel.com&gt;
Suggested-by: Matthew Wilcox &lt;willy@infradead.org&gt;
Signed-off-by: Antoine Tenart &lt;atenart@kernel.org&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net-sysfs: move the xps cpus/rxqs retrieval in a common function</title>
<updated>2021-03-18T21:56:22Z</updated>
<author>
<name>Antoine Tenart</name>
</author>
<published>2021-03-18T18:37:50Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=2db6cdaebac83c13acb165594b09282fa03cec89'/>
<id>urn:sha1:2db6cdaebac83c13acb165594b09282fa03cec89</id>
<content type='text'>
Most of the xps_cpus_show and xps_rxqs_show functions share the same
logic. Having it in two different functions does not help maintenance.
This patch moves their common logic into a new function, xps_queue_show,
to improve this.

Signed-off-by: Antoine Tenart &lt;atenart@kernel.org&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net-sysfs: move the rtnl unlock up in the xps show helpers</title>
<updated>2021-03-18T21:56:22Z</updated>
<author>
<name>Antoine Tenart</name>
</author>
<published>2021-03-18T18:37:49Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=d7be87a687cc261d663dcf97c01056f71398f9f9'/>
<id>urn:sha1:d7be87a687cc261d663dcf97c01056f71398f9f9</id>
<content type='text'>
Now that nr_ids and num_tc are stored in the xps dev_maps, which are RCU
protected, we do not have the need to protect the maps in the rtnl lock.
Move the rtnl unlock up so we reduce the rtnl locking section.

We also increase the reference count on the subordinate device if any,
as we don't want this device to be freed while we use it (now that the
rtnl lock isn't protecting it in the whole function).

Signed-off-by: Antoine Tenart &lt;atenart@kernel.org&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net: move the xps maps to an array</title>
<updated>2021-03-18T21:56:22Z</updated>
<author>
<name>Antoine Tenart</name>
</author>
<published>2021-03-18T18:37:46Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=044ab86d431b59b88966457dbb62679f274ec442'/>
<id>urn:sha1:044ab86d431b59b88966457dbb62679f274ec442</id>
<content type='text'>
Move the xps maps (xps_cpus_map and xps_rxqs_map) to an array in
net_device. That will simplify a lot the code removing the need for lots
of if/else conditionals as the correct map will be available using its
offset in the array.

This should not modify the xps maps behaviour in any way.

Suggested-by: Alexander Duyck &lt;alexander.duyck@gmail.com&gt;
Signed-off-by: Antoine Tenart &lt;atenart@kernel.org&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net: remove the xps possible_mask</title>
<updated>2021-03-18T21:56:22Z</updated>
<author>
<name>Antoine Tenart</name>
</author>
<published>2021-03-18T18:37:45Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=6f36158e058409ec5ceb4290541e77ae2648fc86'/>
<id>urn:sha1:6f36158e058409ec5ceb4290541e77ae2648fc86</id>
<content type='text'>
Remove the xps possible_mask. It was an optimization but we can just
loop from 0 to nr_ids now that it is embedded in the xps dev_maps. That
simplifies the code a bit.

Suggested-by: Alexander Duyck &lt;alexander.duyck@gmail.com&gt;
Signed-off-by: Antoine Tenart &lt;atenart@kernel.org&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net: embed nr_ids in the xps maps</title>
<updated>2021-03-18T21:56:22Z</updated>
<author>
<name>Antoine Tenart</name>
</author>
<published>2021-03-18T18:37:44Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=5478fcd0f48322e04ae6c173ad3a1959e066dc83'/>
<id>urn:sha1:5478fcd0f48322e04ae6c173ad3a1959e066dc83</id>
<content type='text'>
Embed nr_ids (the number of cpu for the xps cpus map, and the number of
rxqs for the xps cpus map) in dev_maps. That will help not accessing out
of bound memory if those values change after dev_maps was allocated.

Suggested-by: Alexander Duyck &lt;alexander.duyck@gmail.com&gt;
Signed-off-by: Antoine Tenart &lt;atenart@kernel.org&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net: embed num_tc in the xps maps</title>
<updated>2021-03-18T21:56:22Z</updated>
<author>
<name>Antoine Tenart</name>
</author>
<published>2021-03-18T18:37:43Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=255c04a87f4381849fce9ed81e5efabf78a71a30'/>
<id>urn:sha1:255c04a87f4381849fce9ed81e5efabf78a71a30</id>
<content type='text'>
The xps cpus/rxqs map is accessed using dev-&gt;num_tc, which is used when
allocating the map. But later updates of dev-&gt;num_tc can lead to having
a mismatch between the maps and how they're accessed. In such cases the
map values do not make any sense and out of bound accesses can occur
(that can be easily seen using KASAN).

This patch aims at fixing this by embedding num_tc into the maps, using
the value at the time the map is created. This brings two improvements:
- The maps can be accessed using the embedded num_tc, so we know for
  sure we won't have out of bound accesses.
- Checks can be made before accessing the maps so we know the values
  retrieved will make sense.

We also update __netif_set_xps_queue to conditionally copy old maps from
dev_maps in the new one only if the number of traffic classes from both
maps match.

Signed-off-by: Antoine Tenart &lt;atenart@kernel.org&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net-sysfs: make xps_cpus_show and xps_rxqs_show consistent</title>
<updated>2021-03-18T21:56:22Z</updated>
<author>
<name>Antoine Tenart</name>
</author>
<published>2021-03-18T18:37:42Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=73f5e52b15e3aa4ef641264228cd9069b1948149'/>
<id>urn:sha1:73f5e52b15e3aa4ef641264228cd9069b1948149</id>
<content type='text'>
Make the implementations of xps_cpus_show and xps_rxqs_show to converge,
as the two share the same logic but diverted over time. This should not
modify their behaviour but will help future changes and improve
maintenance.

Signed-off-by: Antoine Tenart &lt;atenart@kernel.org&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net-sysfs: store the return of get_netdev_queue_index in an unsigned int</title>
<updated>2021-03-18T21:56:22Z</updated>
<author>
<name>Antoine Tenart</name>
</author>
<published>2021-03-18T18:37:41Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=d9a063d207f0e538b0f5aa8b04a6c14f88906a6d'/>
<id>urn:sha1:d9a063d207f0e538b0f5aa8b04a6c14f88906a6d</id>
<content type='text'>
In net-sysfs, get_netdev_queue_index returns an unsigned int. Some of
its callers use an unsigned long to store the returned value. Update the
code to be consistent, this should only be cosmetic.

Signed-off-by: Antoine Tenart &lt;atenart@kernel.org&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net-sysfs: convert xps_cpus_show to bitmap_zalloc</title>
<updated>2021-03-18T21:56:22Z</updated>
<author>
<name>Antoine Tenart</name>
</author>
<published>2021-03-18T18:37:40Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=ea4fe7e842f6c7f972d795a8efc167c4bb33b62f'/>
<id>urn:sha1:ea4fe7e842f6c7f972d795a8efc167c4bb33b62f</id>
<content type='text'>
Use bitmap_zalloc instead of zalloc_cpumask_var in xps_cpus_show to
align with xps_rxqs_show. This will improve maintenance and allow us to
factorize the two functions. The function should behave the same.

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