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 xps_queue_show
function with the rtnl lock.

Signed-off-by: Antoine Tenart <aten...@kernel.org>
---
 net/core/net-sysfs.c | 15 ---------------
 1 file changed, 15 deletions(-)

diff --git a/net/core/net-sysfs.c b/net/core/net-sysfs.c
index 0c564f288460..08c7a494d0e1 100644
--- a/net/core/net-sysfs.c
+++ b/net/core/net-sysfs.c
@@ -1314,7 +1314,6 @@ static const struct attribute_group dql_group = {
 #endif /* CONFIG_BQL */
 
 #ifdef CONFIG_XPS
-/* Should be called with the rtnl lock held. */
 static int xps_queue_show(struct net_device *dev, unsigned long **mask,
                          unsigned int index, bool is_rxqs_map)
 {
@@ -1375,14 +1374,7 @@ static ssize_t xps_cpus_show(struct netdev_queue *queue, 
char *buf)
        if (!mask)
                return -ENOMEM;
 
-       if (!rtnl_trylock()) {
-               bitmap_free(mask);
-               return restart_syscall();
-       }
-
        ret = xps_queue_show(dev, &mask, index, false);
-       rtnl_unlock();
-
        if (ret) {
                bitmap_free(mask);
                return ret;
@@ -1447,14 +1439,7 @@ static ssize_t xps_rxqs_show(struct netdev_queue *queue, 
char *buf)
        if (!mask)
                return -ENOMEM;
 
-       if (!rtnl_trylock()) {
-               bitmap_free(mask);
-               return restart_syscall();
-       }
-
        ret = xps_queue_show(dev, &mask, index, true);
-       rtnl_unlock();
-
        if (ret) {
                bitmap_free(mask);
                return ret;
-- 
2.29.2

Reply via email to