]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
net: s/dev_set_threaded/netif_set_threaded/
authorStanislav Fomichev <sdf@fomichev.me>
Thu, 17 Jul 2025 17:23:32 +0000 (10:23 -0700)
committerJakub Kicinski <kuba@kernel.org>
Sat, 19 Jul 2025 00:27:47 +0000 (17:27 -0700)
Commit cc34acd577f1 ("docs: net: document new locking reality")
introduced netif_ vs dev_ function semantics: the former expects locked
netdev, the latter takes care of the locking. We don't strictly
follow this semantics on either side, but there are more dev_xxx handlers
now that don't fit. Rename them to netif_xxx where appropriate.

Note that one dev_set_threaded call still remains in mt76 for debugfs file.

Signed-off-by: Stanislav Fomichev <sdf@fomichev.me>
Link: https://patch.msgid.link/20250717172333.1288349-7-sdf@fomichev.me
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Documentation/networking/net_cachelines/net_device.rst
drivers/net/ethernet/atheros/atl1c/atl1c_main.c
drivers/net/ethernet/mellanox/mlxsw/pci.c
drivers/net/ethernet/renesas/ravb_main.c
drivers/net/wireguard/device.c
drivers/net/wireless/ath/ath10k/snoc.c
include/linux/netdevice.h
net/core/dev.c
net/core/dev_api.c
net/core/net-sysfs.c

index c69cc89c958e01ea46e0727db6c0991b62279ab7..2d3dc4692d20dfae11319aac7ab45423eb374dcf 100644 (file)
@@ -165,7 +165,7 @@ struct sfp_bus*                     sfp_bus
 struct lock_class_key*              qdisc_tx_busylock
 bool                                proto_down
 unsigned:1                          wol_enabled
-unsigned:1                          threaded                                                            napi_poll(napi_enable,dev_set_threaded)
+unsigned:1                          threaded                                                            napi_poll(napi_enable,netif_set_threaded)
 unsigned_long:1                     see_all_hwtstamp_requests
 unsigned_long:1                     change_proto_down
 unsigned_long:1                     netns_immutable
index ef1a51347351bc734afd7ec9a5a3c23907bcc274..3a9ad4a9c1cbeb8e91531c6f27c398f0282517a8 100644 (file)
@@ -2688,7 +2688,7 @@ static int atl1c_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
        adapter->mii.mdio_write = atl1c_mdio_write;
        adapter->mii.phy_id_mask = 0x1f;
        adapter->mii.reg_num_mask = MDIO_CTRL_REG_MASK;
-       dev_set_threaded(netdev, true);
+       netif_set_threaded(netdev, true);
        for (i = 0; i < adapter->rx_queue_count; ++i)
                netif_napi_add(netdev, &adapter->rrd_ring[i].napi,
                               atl1c_clean_rx);
index 058dcabfaa2e4c93cd1bdc8a66a52e396eccd4e8..a2e97b712a3d7295825f9bcefaa5f72f4d54fe5c 100644 (file)
@@ -156,7 +156,7 @@ static int mlxsw_pci_napi_devs_init(struct mlxsw_pci *mlxsw_pci)
        }
        strscpy(mlxsw_pci->napi_dev_rx->name, "mlxsw_rx",
                sizeof(mlxsw_pci->napi_dev_rx->name));
-       dev_set_threaded(mlxsw_pci->napi_dev_rx, true);
+       netif_set_threaded(mlxsw_pci->napi_dev_rx, true);
 
        return 0;
 
index c9f4976a35275a29b7673d59b66e1e56a6adf683..4e79bf88688a9f43cd3769b98718bb07bf367a4c 100644 (file)
@@ -3075,7 +3075,7 @@ static int ravb_probe(struct platform_device *pdev)
        if (info->coalesce_irqs) {
                netdev_sw_irq_coalesce_default_on(ndev);
                if (num_present_cpus() == 1)
-                       dev_set_threaded(ndev, true);
+                       netif_set_threaded(ndev, true);
        }
 
        /* Network device register */
index 4a529f1f9beab61ab508bca473c89228dd6eb848..5afec5a865f475773f0da136160b6224a691cd0a 100644 (file)
@@ -366,7 +366,7 @@ static int wg_newlink(struct net_device *dev,
        if (ret < 0)
                goto err_free_handshake_queue;
 
-       dev_set_threaded(dev, true);
+       netif_set_threaded(dev, true);
        ret = register_netdevice(dev);
        if (ret < 0)
                goto err_uninit_ratelimiter;
index d51f2e5a79a401e0e3821a1a9f251e2569a1d7b1..0ee68d3dad1296ccfface2ab4acb053dbbe7d0f2 100644 (file)
@@ -936,7 +936,7 @@ static int ath10k_snoc_hif_start(struct ath10k *ar)
 
        bitmap_clear(ar_snoc->pending_ce_irqs, 0, CE_COUNT_MAX);
 
-       dev_set_threaded(ar->napi_dev, true);
+       netif_set_threaded(ar->napi_dev, true);
        ath10k_core_napi_enable(ar);
        /* IRQs are left enabled when we restart due to a firmware crash */
        if (!test_bit(ATH10K_SNOC_FLAG_RECOVERY, &ar_snoc->flags))
index 8370cd0f8f6b4a5b5d375f807854268f09395e4a..7929ddfd4433345f5c8a9e09a2dab431fe71d347 100644 (file)
@@ -589,6 +589,7 @@ static inline bool napi_complete(struct napi_struct *n)
        return napi_complete_done(n, 0);
 }
 
+int netif_set_threaded(struct net_device *dev, bool threaded);
 int dev_set_threaded(struct net_device *dev, bool threaded);
 
 void napi_disable(struct napi_struct *n);
index 25905bbf1972434b82634c5a95fe9722c336bec4..a22f26997b942a8e587654c91e8550ac80f7d1ab 100644 (file)
@@ -4798,7 +4798,7 @@ static inline void ____napi_schedule(struct softnet_data *sd,
 
        if (test_bit(NAPI_STATE_THREADED, &napi->state)) {
                /* Paired with smp_mb__before_atomic() in
-                * napi_enable()/dev_set_threaded().
+                * napi_enable()/netif_set_threaded().
                 * Use READ_ONCE() to guarantee a complete
                 * read on napi->thread. Only call
                 * wake_up_process() when it's not NULL.
@@ -6990,7 +6990,7 @@ int napi_set_threaded(struct napi_struct *napi, bool threaded)
        return 0;
 }
 
-int dev_set_threaded(struct net_device *dev, bool threaded)
+int netif_set_threaded(struct net_device *dev, bool threaded)
 {
        struct napi_struct *napi;
        int err = 0;
@@ -7031,7 +7031,7 @@ int dev_set_threaded(struct net_device *dev, bool threaded)
 
        return err;
 }
-EXPORT_SYMBOL(dev_set_threaded);
+EXPORT_SYMBOL(netif_set_threaded);
 
 /**
  * netif_queue_set_napi - Associate queue with the napi
index 1bf0153195f26b41584b312812b650da80369113..dd7f57013ce5de9b04c640dc34df909ed23f2af7 100644 (file)
@@ -367,3 +367,15 @@ void netdev_state_change(struct net_device *dev)
        netdev_unlock_ops(dev);
 }
 EXPORT_SYMBOL(netdev_state_change);
+
+int dev_set_threaded(struct net_device *dev, bool threaded)
+{
+       int ret;
+
+       netdev_lock(dev);
+       ret = netif_set_threaded(dev, threaded);
+       netdev_unlock(dev);
+
+       return ret;
+}
+EXPORT_SYMBOL(dev_set_threaded);
index e41ad1890e49119ec7bed34c0e25a0a48eabb396..c28cd66654447dfcba1286c2c465d137270b5159 100644 (file)
@@ -757,7 +757,7 @@ static int modify_napi_threaded(struct net_device *dev, unsigned long val)
        if (val != 0 && val != 1)
                return -EOPNOTSUPP;
 
-       ret = dev_set_threaded(dev, val);
+       ret = netif_set_threaded(dev, val);
 
        return ret;
 }