1. Oct 09, 2021
    • David S. Miller's avatar
      Merge branch 'netdev-name-in-use' · 9653e613
      David S. Miller authored
      Antoine Tenart says:
      
      ====================
      net: introduce a function to check if a netdev name is in use
      
      This was initially part of an RFC series[1] but has value on its own;
      hence the standalone report. (It will also help in not having a series
      too large).
      
      From patch 1:
      
      """
      __dev_get_by_name is currently used to either retrieve a net device
      reference using its name or to check if a name is already used by a
      registered net device (per ns). In the later case there is no need to
      return a reference to a net device.
      
      Introduce a new helper, netdev_name_in_use, to check if a name is
      currently used by a registered net device without leaking a reference
      the corresponding net device. This helper uses netdev_name_node_lookup
      instead of __dev_get_by_name as we don't need the extra logic retrieving
      a reference to the corresponding net device.
      """
      
      Two uses[2] of __dev_get_by_name weren't converted to this new function,
      as they are really looking for a net device, not only checking if a net
      device name is in use. While checking one or the other currently has
      the same result, that might change if the initial RFC series moves
      forward. I'll convert them later depending on the outcome of the initial
      series.
      
      Thanks,
      Antoine
      
      [1] https://lore.kernel.org/all/20210928125500.167943-1-atenart@kernel.org/
      
      
      [2] drivers/net/Space.c:130 & drivers/nvme/host/tcp.c:2550
      ====================
      
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      9653e613
    • Antoine Tenart's avatar
      ppp: use the correct function to check if a netdev name is in use · d03eb978
      Antoine Tenart authored
      
      
      A new helper to detect if a net device name is in use was added. Use it
      here as the return reference from __dev_get_by_name was discarded.
      
      Signed-off-by: default avatarAntoine Tenart <atenart@kernel.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      d03eb978
    • Antoine Tenart's avatar
      bonding: use the correct function to check for netdev name collision · caa9b35f
      Antoine Tenart authored
      
      
      A new helper to detect if a net device name is in use was added. Use it
      here as the return reference from __dev_get_by_name was discarded.
      
      Signed-off-by: default avatarAntoine Tenart <atenart@kernel.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      caa9b35f
    • Antoine Tenart's avatar
      net: introduce a function to check if a netdev name is in use · 75ea27d0
      Antoine Tenart authored
      
      
      __dev_get_by_name is currently used to either retrieve a net device
      reference using its name or to check if a name is already used by a
      registered net device (per ns). In the later case there is no need to
      return a reference to a net device.
      
      Introduce a new helper, netdev_name_in_use, to check if a name is
      currently used by a registered net device without leaking a reference
      the corresponding net device. This helper uses netdev_name_node_lookup
      instead of __dev_get_by_name as we don't need the extra logic retrieving
      a reference to the corresponding net device.
      
      Signed-off-by: default avatarAntoine Tenart <atenart@kernel.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      75ea27d0
  2. Oct 08, 2021