]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
authorJakub Kicinski <kuba@kernel.org>
Thu, 10 Apr 2025 23:49:17 +0000 (16:49 -0700)
committerJakub Kicinski <kuba@kernel.org>
Thu, 10 Apr 2025 23:51:07 +0000 (16:51 -0700)
Cross-merge networking fixes after downstream PR (net-6.15-rc2).

Conflict:

Documentation/networking/netdevices.rst
net/core/lock_debug.c
  04efcee6ef8d ("net: hold instance lock during NETDEV_CHANGE")
  03df156dd3a6 ("xdp: double protect netdev->xdp_flags with netdev->lock")

No adjacent changes.

Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1  2 
Documentation/networking/netdevices.rst
drivers/net/ethernet/amazon/ena/ena_netdev.c
drivers/net/ethernet/amd/xgbe/xgbe-drv.c
drivers/net/ethernet/google/gve/gve_main.c
drivers/net/ethernet/rocker/rocker_ofdpa.c
drivers/net/ethernet/wangxun/libwx/wx_lib.c
drivers/net/ethernet/wangxun/libwx/wx_type.h
include/linux/netdevice.h
net/core/dev.c
net/core/lock_debug.c

index 0ccc7dcf4390c9f8bc775dc996ca711fc2e31ea6,eab601ab2db0b70eb1d1948a52bc2f7e4449acd8..f87bb55b4afea3eff2f0c5e806ee3c1442c37fbb
@@@ -336,51 -338,14 +336,52 @@@ operations directly under the netdev in
  Devices drivers are encouraged to rely on the instance lock where possible.
  
  For the (mostly software) drivers that need to interact with the core stack,
- there are two sets of interfaces: ``dev_xxx`` and ``netif_xxx`` (e.g.,
- ``dev_set_mtu`` and ``netif_set_mtu``). The ``dev_xxx`` functions handle
- acquiring the instance lock themselves, while the ``netif_xxx`` functions
- assume that the driver has already acquired the instance lock.
+ there are two sets of interfaces: ``dev_xxx``/``netdev_xxx`` and ``netif_xxx``
+ (e.g., ``dev_set_mtu`` and ``netif_set_mtu``). The ``dev_xxx``/``netdev_xxx``
+ functions handle acquiring the instance lock themselves, while the
+ ``netif_xxx`` functions assume that the driver has already acquired
+ the instance lock.
  
 +struct net_device_ops
 +---------------------
 +
 +``ndos`` are called without holding the instance lock for most drivers.
 +
 +"Ops locked" drivers will have most of the ``ndos`` invoked under
 +the instance lock.
 +
 +struct ethtool_ops
 +------------------
 +
 +Similarly to ``ndos`` the instance lock is only held for select drivers.
 +For "ops locked" drivers all ethtool ops without exceptions should
 +be called under the instance lock.
 +
 +struct netdev_stat_ops
 +----------------------
 +
 +"qstat" ops are invoked under the instance lock for "ops locked" drivers,
 +and under rtnl_lock for all other drivers.
 +
 +struct net_shaper_ops
 +---------------------
 +
 +All net shaper callbacks are invoked while holding the netdev instance
 +lock. ``rtnl_lock`` may or may not be held.
 +
 +Note that supporting net shapers automatically enables "ops locking".
 +
 +struct netdev_queue_mgmt_ops
 +----------------------------
 +
 +All queue management callbacks are invoked while holding the netdev instance
 +lock. ``rtnl_lock`` may or may not be held.
 +
 +Note that supporting struct netdev_queue_mgmt_ops automatically enables
 +"ops locking".
 +
  Notifiers and netdev instance lock
 -==================================
 +----------------------------------
  
  For device drivers that implement shaping or queue management APIs,
  some of the notifiers (``enum netdev_cmd``) are running under the netdev
@@@ -388,9 -353,9 +389,10 @@@ instance lock
  
  For devices with locked ops, currently only the following notifiers are
  running under the lock:
++* ``NETDEV_CHANGE``
  * ``NETDEV_REGISTER``
  * ``NETDEV_UP``
 -* ``NETDEV_CHANGE``
 +* ``NETDEV_XDP_FEAT_CHANGE``
  
  The following notifiers are running without the lock:
  * ``NETDEV_UNREGISTER``
Simple merge
diff --cc net/core/dev.c
Simple merge
index 598c443ef2f39ba30feb01e097e87c62275ecda5,941e26c1343de49a113488c1c9b4a2c483c19c44..6fade574bc2a9edfebd3af40e278dd75f53545b9
@@@ -18,9 -18,9 +18,10 @@@ int netdev_debug_event(struct notifier_
  
        /* Keep enum and don't add default to trigger -Werror=switch */
        switch (cmd) {
++      case NETDEV_CHANGE:
        case NETDEV_REGISTER:
        case NETDEV_UP:
 -      case NETDEV_CHANGE:
 +      case NETDEV_XDP_FEAT_CHANGE:
                netdev_ops_assert_locked(dev);
                fallthrough;
        case NETDEV_DOWN: