netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next v2 00/12] net: xps: improve the xps maps handling
@ 2021-02-08 17:19 Antoine Tenart
  2021-02-08 17:19 ` [PATCH net-next v2 01/12] net-sysfs: convert xps_cpus_show to bitmap_zalloc Antoine Tenart
                   ` (11 more replies)
  0 siblings, 12 replies; 20+ messages in thread
From: Antoine Tenart @ 2021-02-08 17:19 UTC (permalink / raw)
  To: davem, kuba, alexander.duyck; +Cc: Antoine Tenart, netdev

Hello,

A small series moving the xps cpus/rxqs retrieval logic in net-sysfs was
sent[1] and while there was no comments asking for modifications in the
patches themselves, we had discussions about other xps related reworks.
In addition to the patches sent in the previous series[1] (included),
this series has extra patches introducing the modifications we
discussed.

The main change is moving dev->num_tc and dev->nr_ids in the xps maps, to
avoid out-of-bound accesses as those two fields can be updated after the
maps have been allocated. This allows further reworks, to improve the
xps code readability and allow to stop taking the rtnl lock when
reading the maps in sysfs.

Finally, the maps are moved to an array in net_device, which simplifies
the code a lot.

One future improvement may be to remove the use of xps_map_mutex from
net/core/dev.c, but that may require extra care.

Thanks!
Antoine

[1] https://lore.kernel.org/netdev/20210106180428.722521-1-atenart@kernel.org/

Since v1:
  - Reordered the patches to improve readability and avoid introducing
    issues in between patches.
  - Use dev_maps->nr_ids to allocate the mask in xps_queue_show but
    still default to nr_cpu_ids/dev->num_rx_queues in xps_queue_show
    when dev_maps hasn't been allocated yet for backward compatibility.

Antoine Tenart (12):
  net-sysfs: convert xps_cpus_show to bitmap_zalloc
  net-sysfs: store the return of get_netdev_queue_index in an unsigned
    int
  net-sysfs: make xps_cpus_show and xps_rxqs_show consistent
  net: embed num_tc in the xps maps
  net: embed nr_ids in the xps maps
  net: assert the rtnl lock is held when calling __netif_set_xps_queue
  net: remove the xps possible_mask
  net: move the xps maps to an array
  net-sysfs: remove the rtnl lock when accessing the xps maps
  net: add an helper to copy xps maps to the new dev_maps
  net: improve queue removal readability in __netif_set_xps_queue
  net-sysfs: move the xps cpus/rxqs retrieval in a common function

 drivers/net/virtio_net.c  |   2 +-
 include/linux/netdevice.h |  27 ++++-
 net/core/dev.c            | 233 +++++++++++++++++++-------------------
 net/core/net-sysfs.c      | 165 +++++++++------------------
 4 files changed, 194 insertions(+), 233 deletions(-)

-- 
2.29.2


^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2021-02-23  6:13 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-08 17:19 [PATCH net-next v2 00/12] net: xps: improve the xps maps handling Antoine Tenart
2021-02-08 17:19 ` [PATCH net-next v2 01/12] net-sysfs: convert xps_cpus_show to bitmap_zalloc Antoine Tenart
2021-02-08 17:19 ` [PATCH net-next v2 02/12] net-sysfs: store the return of get_netdev_queue_index in an unsigned int Antoine Tenart
2021-02-08 17:19 ` [PATCH net-next v2 03/12] net-sysfs: make xps_cpus_show and xps_rxqs_show consistent Antoine Tenart
2021-02-08 17:19 ` [PATCH net-next v2 04/12] net: embed num_tc in the xps maps Antoine Tenart
2021-02-08 17:19 ` [PATCH net-next v2 05/12] net: embed nr_ids " Antoine Tenart
2021-02-08 17:19 ` [PATCH net-next v2 06/12] net: assert the rtnl lock is held when calling __netif_set_xps_queue Antoine Tenart
2021-02-23  6:27   ` [net] 81bb8ff453: assertion_failed kernel test robot
2021-02-08 17:19 ` [PATCH net-next v2 07/12] net: remove the xps possible_mask Antoine Tenart
2021-02-08 21:43   ` Alexander Duyck
2021-02-09  8:47     ` Antoine Tenart
2021-02-08 17:19 ` [PATCH net-next v2 08/12] net: move the xps maps to an array Antoine Tenart
2021-02-08 17:19 ` [PATCH net-next v2 09/12] net-sysfs: remove the rtnl lock when accessing the xps maps Antoine Tenart
2021-02-08 22:20   ` Alexander Duyck
2021-02-09  9:12     ` Antoine Tenart
2021-02-09  9:20       ` Antoine Tenart
2021-02-08 17:19 ` [PATCH net-next v2 10/12] net: add an helper to copy xps maps to the new dev_maps Antoine Tenart
2021-02-08 17:19 ` [PATCH net-next v2 11/12] net: improve queue removal readability in __netif_set_xps_queue Antoine Tenart
2021-02-08 17:19 ` [PATCH net-next v2 12/12] net-sysfs: move the xps cpus/rxqs retrieval in a common function Antoine Tenart
2021-02-08 22:45   ` Alexander Duyck

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).