1. 03 4月, 2023 1 次提交
    • V
      net: create a netdev notifier for DSA to reject PTP on DSA master · 88c0a6b5
      Vladimir Oltean 提交于
      The fact that PTP 2-step TX timestamping is broken on DSA switches if
      the master also timestamps the same packets is documented by commit
      f685e609 ("net: dsa: Deny PTP on master if switch supports it").
      We attempt to help the users avoid shooting themselves in the foot by
      making DSA reject the timestamping ioctls on an interface that is a DSA
      master, and the switch tree beneath it contains switches which are aware
      of PTP.
      
      The only problem is that there isn't an established way of intercepting
      ndo_eth_ioctl calls, so DSA creates avoidable burden upon the network
      stack by creating a struct dsa_netdevice_ops with overlaid function
      pointers that are manually checked from the relevant call sites. There
      used to be 2 such dsa_netdevice_ops, but now, ndo_eth_ioctl is the only
      one left.
      
      There is an ongoing effort to migrate driver-visible hardware timestamping
      control from the ndo_eth_ioctl() based API to a new ndo_hwtstamp_set()
      model, but DSA actively prevents that migration, since dsa_master_ioctl()
      is currently coded to manually call the master's legacy ndo_eth_ioctl(),
      and so, whenever a network device driver would be converted to the new
      API, DSA's restrictions would be circumvented, because any device could
      be used as a DSA master.
      
      The established way for unrelated modules to react on a net device event
      is via netdevice notifiers. So we create a new notifier which gets
      called whenever there is an attempt to change hardware timestamping
      settings on a device.
      
      Finally, there is another reason why a netdev notifier will be a good
      idea, besides strictly DSA, and this has to do with PHY timestamping.
      
      With ndo_eth_ioctl(), all MAC drivers must manually call
      phy_has_hwtstamp() before deciding whether to act upon SIOCSHWTSTAMP,
      otherwise they must pass this ioctl to the PHY driver via
      phy_mii_ioctl().
      
      With the new ndo_hwtstamp_set() API, it will be desirable to simply not
      make any calls into the MAC device driver when timestamping should be
      performed at the PHY level.
      
      But there exist drivers, such as the lan966x switch, which need to
      install packet traps for PTP regardless of whether they are the layer
      that provides the hardware timestamps, or the PHY is. That would be
      impossible to support with the new API.
      
      The proposal there, too, is to introduce a netdev notifier which acts as
      a better cue for switching drivers to add or remove PTP packet traps,
      than ndo_hwtstamp_set(). The one introduced here "almost" works there as
      well, except for the fact that packet traps should only be installed if
      the PHY driver succeeded to enable hardware timestamping, whereas here,
      we need to deny hardware timestamping on the DSA master before it
      actually gets enabled. This is why this notifier is called "PRE_", and
      the notifier that would get used for PHY timestamping and packet traps
      would be called NETDEV_CHANGE_HWTSTAMP. This isn't a new concept, for
      example NETDEV_CHANGEUPPER and NETDEV_PRECHANGEUPPER do the same thing.
      
      In expectation of future netlink UAPI, we also pass a non-NULL extack
      pointer to the netdev notifier, and we make DSA populate it with an
      informative reason for the rejection. To avoid making it go to waste, we
      make the ioctl-based dev_set_hwtstamp() create a fake extack and print
      the message to the kernel log.
      
      Link: https://lore.kernel.org/netdev/20230401191215.tvveoi3lkawgg6g4@skbuf/
      Link: https://lore.kernel.org/netdev/20230310164451.ls7bbs6pdzs4m6pw@skbuf/Signed-off-by: NVladimir Oltean <vladimir.oltean@nxp.com>
      Reviewed-by: NFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      88c0a6b5
  2. 02 4月, 2023 1 次提交
    • J
      net: minor reshuffle of napi_struct · dd2d6604
      Jakub Kicinski 提交于
      napi_id is read by GRO and drivers to mark skbs, and it currently
      sits at the end of the structure, in a mostly unused cache line.
      Move it up into a hole, and separate the clearly control path
      fields from the important ones.
      
      Before:
      
      struct napi_struct {
      	struct list_head           poll_list;            /*     0    16 */
      	long unsigned int          state;                /*    16     8 */
      	int                        weight;               /*    24     4 */
      	int                        defer_hard_irqs_count; /*    28     4 */
      	long unsigned int          gro_bitmask;          /*    32     8 */
      	int                        (*poll)(struct napi_struct *, int); /*    40     8 */
      	int                        poll_owner;           /*    48     4 */
      
      	/* XXX 4 bytes hole, try to pack */
      
      	struct net_device *        dev;                  /*    56     8 */
      	/* --- cacheline 1 boundary (64 bytes) --- */
      	struct gro_list            gro_hash[8];          /*    64   192 */
      	/* --- cacheline 4 boundary (256 bytes) --- */
      	struct sk_buff *           skb;                  /*   256     8 */
      	struct list_head           rx_list;              /*   264    16 */
      	int                        rx_count;             /*   280     4 */
      
      	/* XXX 4 bytes hole, try to pack */
      
      	struct hrtimer             timer;                /*   288    64 */
      
      	/* XXX last struct has 4 bytes of padding */
      
      	/* --- cacheline 5 boundary (320 bytes) was 32 bytes ago --- */
      	struct list_head           dev_list;             /*   352    16 */
      	struct hlist_node          napi_hash_node;       /*   368    16 */
      	/* --- cacheline 6 boundary (384 bytes) --- */
      	unsigned int               napi_id;              /*   384     4 */
      
      	/* XXX 4 bytes hole, try to pack */
      
      	struct task_struct *       thread;               /*   392     8 */
      
      	/* size: 400, cachelines: 7, members: 17 */
      	/* sum members: 388, holes: 3, sum holes: 12 */
      	/* paddings: 1, sum paddings: 4 */
      	/* last cacheline: 16 bytes */
      };
      
      After:
      
      struct napi_struct {
      	struct list_head           poll_list;            /*     0    16 */
      	long unsigned int          state;                /*    16     8 */
      	int                        weight;               /*    24     4 */
      	int                        defer_hard_irqs_count; /*    28     4 */
      	long unsigned int          gro_bitmask;          /*    32     8 */
      	int                        (*poll)(struct napi_struct *, int); /*    40     8 */
      	int                        poll_owner;           /*    48     4 */
      
      	/* XXX 4 bytes hole, try to pack */
      
      	struct net_device *        dev;                  /*    56     8 */
      	/* --- cacheline 1 boundary (64 bytes) --- */
      	struct gro_list            gro_hash[8];          /*    64   192 */
      	/* --- cacheline 4 boundary (256 bytes) --- */
      	struct sk_buff *           skb;                  /*   256     8 */
      	struct list_head           rx_list;              /*   264    16 */
      	int                        rx_count;             /*   280     4 */
      	unsigned int               napi_id;              /*   284     4 */
      	struct hrtimer             timer;                /*   288    64 */
      
      	/* XXX last struct has 4 bytes of padding */
      
      	/* --- cacheline 5 boundary (320 bytes) was 32 bytes ago --- */
      	struct task_struct *       thread;               /*   352     8 */
      	struct list_head           dev_list;             /*   360    16 */
      	struct hlist_node          napi_hash_node;       /*   376    16 */
      
      	/* size: 392, cachelines: 7, members: 17 */
      	/* sum members: 388, holes: 1, sum holes: 4 */
      	/* paddings: 1, sum paddings: 4 */
      	/* forced alignments: 1 */
      	/* last cacheline: 8 bytes */
      } __attribute__((__aligned__(8)));
      Signed-off-by: NJakub Kicinski <kuba@kernel.org>
      Reviewed-by: NEric Dumazet <edumazet@google.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      dd2d6604
  3. 30 3月, 2023 1 次提交
  4. 24 3月, 2023 1 次提交
  5. 23 3月, 2023 1 次提交
  6. 17 3月, 2023 1 次提交
  7. 15 3月, 2023 1 次提交
    • E
      net: tunnels: annotate lockless accesses to dev->needed_headroom · 4b397c06
      Eric Dumazet 提交于
      IP tunnels can apparently update dev->needed_headroom
      in their xmit path.
      
      This patch takes care of three tunnels xmit, and also the
      core LL_RESERVED_SPACE() and LL_RESERVED_SPACE_EXTRA()
      helpers.
      
      More changes might be needed for completeness.
      
      BUG: KCSAN: data-race in ip_tunnel_xmit / ip_tunnel_xmit
      
      read to 0xffff88815b9da0ec of 2 bytes by task 888 on cpu 1:
      ip_tunnel_xmit+0x1270/0x1730 net/ipv4/ip_tunnel.c:803
      __gre_xmit net/ipv4/ip_gre.c:469 [inline]
      ipgre_xmit+0x516/0x570 net/ipv4/ip_gre.c:661
      __netdev_start_xmit include/linux/netdevice.h:4881 [inline]
      netdev_start_xmit include/linux/netdevice.h:4895 [inline]
      xmit_one net/core/dev.c:3580 [inline]
      dev_hard_start_xmit+0x127/0x400 net/core/dev.c:3596
      __dev_queue_xmit+0x1007/0x1eb0 net/core/dev.c:4246
      dev_queue_xmit include/linux/netdevice.h:3051 [inline]
      neigh_direct_output+0x17/0x20 net/core/neighbour.c:1623
      neigh_output include/net/neighbour.h:546 [inline]
      ip_finish_output2+0x740/0x840 net/ipv4/ip_output.c:228
      ip_finish_output+0xf4/0x240 net/ipv4/ip_output.c:316
      NF_HOOK_COND include/linux/netfilter.h:291 [inline]
      ip_output+0xe5/0x1b0 net/ipv4/ip_output.c:430
      dst_output include/net/dst.h:444 [inline]
      ip_local_out+0x64/0x80 net/ipv4/ip_output.c:126
      iptunnel_xmit+0x34a/0x4b0 net/ipv4/ip_tunnel_core.c:82
      ip_tunnel_xmit+0x1451/0x1730 net/ipv4/ip_tunnel.c:813
      __gre_xmit net/ipv4/ip_gre.c:469 [inline]
      ipgre_xmit+0x516/0x570 net/ipv4/ip_gre.c:661
      __netdev_start_xmit include/linux/netdevice.h:4881 [inline]
      netdev_start_xmit include/linux/netdevice.h:4895 [inline]
      xmit_one net/core/dev.c:3580 [inline]
      dev_hard_start_xmit+0x127/0x400 net/core/dev.c:3596
      __dev_queue_xmit+0x1007/0x1eb0 net/core/dev.c:4246
      dev_queue_xmit include/linux/netdevice.h:3051 [inline]
      neigh_direct_output+0x17/0x20 net/core/neighbour.c:1623
      neigh_output include/net/neighbour.h:546 [inline]
      ip_finish_output2+0x740/0x840 net/ipv4/ip_output.c:228
      ip_finish_output+0xf4/0x240 net/ipv4/ip_output.c:316
      NF_HOOK_COND include/linux/netfilter.h:291 [inline]
      ip_output+0xe5/0x1b0 net/ipv4/ip_output.c:430
      dst_output include/net/dst.h:444 [inline]
      ip_local_out+0x64/0x80 net/ipv4/ip_output.c:126
      iptunnel_xmit+0x34a/0x4b0 net/ipv4/ip_tunnel_core.c:82
      ip_tunnel_xmit+0x1451/0x1730 net/ipv4/ip_tunnel.c:813
      __gre_xmit net/ipv4/ip_gre.c:469 [inline]
      ipgre_xmit+0x516/0x570 net/ipv4/ip_gre.c:661
      __netdev_start_xmit include/linux/netdevice.h:4881 [inline]
      netdev_start_xmit include/linux/netdevice.h:4895 [inline]
      xmit_one net/core/dev.c:3580 [inline]
      dev_hard_start_xmit+0x127/0x400 net/core/dev.c:3596
      __dev_queue_xmit+0x1007/0x1eb0 net/core/dev.c:4246
      dev_queue_xmit include/linux/netdevice.h:3051 [inline]
      neigh_direct_output+0x17/0x20 net/core/neighbour.c:1623
      neigh_output include/net/neighbour.h:546 [inline]
      ip_finish_output2+0x740/0x840 net/ipv4/ip_output.c:228
      ip_finish_output+0xf4/0x240 net/ipv4/ip_output.c:316
      NF_HOOK_COND include/linux/netfilter.h:291 [inline]
      ip_output+0xe5/0x1b0 net/ipv4/ip_output.c:430
      dst_output include/net/dst.h:444 [inline]
      ip_local_out+0x64/0x80 net/ipv4/ip_output.c:126
      iptunnel_xmit+0x34a/0x4b0 net/ipv4/ip_tunnel_core.c:82
      ip_tunnel_xmit+0x1451/0x1730 net/ipv4/ip_tunnel.c:813
      __gre_xmit net/ipv4/ip_gre.c:469 [inline]
      ipgre_xmit+0x516/0x570 net/ipv4/ip_gre.c:661
      __netdev_start_xmit include/linux/netdevice.h:4881 [inline]
      netdev_start_xmit include/linux/netdevice.h:4895 [inline]
      xmit_one net/core/dev.c:3580 [inline]
      dev_hard_start_xmit+0x127/0x400 net/core/dev.c:3596
      __dev_queue_xmit+0x1007/0x1eb0 net/core/dev.c:4246
      dev_queue_xmit include/linux/netdevice.h:3051 [inline]
      neigh_direct_output+0x17/0x20 net/core/neighbour.c:1623
      neigh_output include/net/neighbour.h:546 [inline]
      ip_finish_output2+0x740/0x840 net/ipv4/ip_output.c:228
      ip_finish_output+0xf4/0x240 net/ipv4/ip_output.c:316
      NF_HOOK_COND include/linux/netfilter.h:291 [inline]
      ip_output+0xe5/0x1b0 net/ipv4/ip_output.c:430
      dst_output include/net/dst.h:444 [inline]
      ip_local_out+0x64/0x80 net/ipv4/ip_output.c:126
      iptunnel_xmit+0x34a/0x4b0 net/ipv4/ip_tunnel_core.c:82
      ip_tunnel_xmit+0x1451/0x1730 net/ipv4/ip_tunnel.c:813
      __gre_xmit net/ipv4/ip_gre.c:469 [inline]
      ipgre_xmit+0x516/0x570 net/ipv4/ip_gre.c:661
      __netdev_start_xmit include/linux/netdevice.h:4881 [inline]
      netdev_start_xmit include/linux/netdevice.h:4895 [inline]
      xmit_one net/core/dev.c:3580 [inline]
      dev_hard_start_xmit+0x127/0x400 net/core/dev.c:3596
      __dev_queue_xmit+0x1007/0x1eb0 net/core/dev.c:4246
      dev_queue_xmit include/linux/netdevice.h:3051 [inline]
      neigh_direct_output+0x17/0x20 net/core/neighbour.c:1623
      neigh_output include/net/neighbour.h:546 [inline]
      ip_finish_output2+0x740/0x840 net/ipv4/ip_output.c:228
      ip_finish_output+0xf4/0x240 net/ipv4/ip_output.c:316
      NF_HOOK_COND include/linux/netfilter.h:291 [inline]
      ip_output+0xe5/0x1b0 net/ipv4/ip_output.c:430
      dst_output include/net/dst.h:444 [inline]
      ip_local_out+0x64/0x80 net/ipv4/ip_output.c:126
      iptunnel_xmit+0x34a/0x4b0 net/ipv4/ip_tunnel_core.c:82
      ip_tunnel_xmit+0x1451/0x1730 net/ipv4/ip_tunnel.c:813
      __gre_xmit net/ipv4/ip_gre.c:469 [inline]
      ipgre_xmit+0x516/0x570 net/ipv4/ip_gre.c:661
      __netdev_start_xmit include/linux/netdevice.h:4881 [inline]
      netdev_start_xmit include/linux/netdevice.h:4895 [inline]
      xmit_one net/core/dev.c:3580 [inline]
      dev_hard_start_xmit+0x127/0x400 net/core/dev.c:3596
      __dev_queue_xmit+0x1007/0x1eb0 net/core/dev.c:4246
      dev_queue_xmit include/linux/netdevice.h:3051 [inline]
      neigh_direct_output+0x17/0x20 net/core/neighbour.c:1623
      neigh_output include/net/neighbour.h:546 [inline]
      ip_finish_output2+0x740/0x840 net/ipv4/ip_output.c:228
      ip_finish_output+0xf4/0x240 net/ipv4/ip_output.c:316
      NF_HOOK_COND include/linux/netfilter.h:291 [inline]
      ip_output+0xe5/0x1b0 net/ipv4/ip_output.c:430
      dst_output include/net/dst.h:444 [inline]
      ip_local_out+0x64/0x80 net/ipv4/ip_output.c:126
      iptunnel_xmit+0x34a/0x4b0 net/ipv4/ip_tunnel_core.c:82
      ip_tunnel_xmit+0x1451/0x1730 net/ipv4/ip_tunnel.c:813
      __gre_xmit net/ipv4/ip_gre.c:469 [inline]
      ipgre_xmit+0x516/0x570 net/ipv4/ip_gre.c:661
      __netdev_start_xmit include/linux/netdevice.h:4881 [inline]
      netdev_start_xmit include/linux/netdevice.h:4895 [inline]
      xmit_one net/core/dev.c:3580 [inline]
      dev_hard_start_xmit+0x127/0x400 net/core/dev.c:3596
      __dev_queue_xmit+0x1007/0x1eb0 net/core/dev.c:4246
      
      write to 0xffff88815b9da0ec of 2 bytes by task 2379 on cpu 0:
      ip_tunnel_xmit+0x1294/0x1730 net/ipv4/ip_tunnel.c:804
      __gre_xmit net/ipv4/ip_gre.c:469 [inline]
      ipgre_xmit+0x516/0x570 net/ipv4/ip_gre.c:661
      __netdev_start_xmit include/linux/netdevice.h:4881 [inline]
      netdev_start_xmit include/linux/netdevice.h:4895 [inline]
      xmit_one net/core/dev.c:3580 [inline]
      dev_hard_start_xmit+0x127/0x400 net/core/dev.c:3596
      __dev_queue_xmit+0x1007/0x1eb0 net/core/dev.c:4246
      dev_queue_xmit include/linux/netdevice.h:3051 [inline]
      neigh_direct_output+0x17/0x20 net/core/neighbour.c:1623
      neigh_output include/net/neighbour.h:546 [inline]
      ip6_finish_output2+0x9bc/0xc50 net/ipv6/ip6_output.c:134
      __ip6_finish_output net/ipv6/ip6_output.c:195 [inline]
      ip6_finish_output+0x39a/0x4e0 net/ipv6/ip6_output.c:206
      NF_HOOK_COND include/linux/netfilter.h:291 [inline]
      ip6_output+0xeb/0x220 net/ipv6/ip6_output.c:227
      dst_output include/net/dst.h:444 [inline]
      NF_HOOK include/linux/netfilter.h:302 [inline]
      mld_sendpack+0x438/0x6a0 net/ipv6/mcast.c:1820
      mld_send_cr net/ipv6/mcast.c:2121 [inline]
      mld_ifc_work+0x519/0x7b0 net/ipv6/mcast.c:2653
      process_one_work+0x3e6/0x750 kernel/workqueue.c:2390
      worker_thread+0x5f2/0xa10 kernel/workqueue.c:2537
      kthread+0x1ac/0x1e0 kernel/kthread.c:376
      ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:308
      
      value changed: 0x0dd4 -> 0x0e14
      
      Reported by Kernel Concurrency Sanitizer on:
      CPU: 0 PID: 2379 Comm: kworker/0:0 Not tainted 6.3.0-rc1-syzkaller-00002-g8ca09d5f-dirty #0
      Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/02/2023
      Workqueue: mld mld_ifc_work
      
      Fixes: 8eb30be0 ("ipv6: Create ip6_tnl_xmit")
      Reported-by: Nsyzbot <syzkaller@googlegroups.com>
      Signed-off-by: NEric Dumazet <edumazet@google.com>
      Link: https://lore.kernel.org/r/20230310191109.2384387-1-edumazet@google.comSigned-off-by: NJakub Kicinski <kuba@kernel.org>
      4b397c06
  8. 08 3月, 2023 1 次提交
  9. 20 2月, 2023 1 次提交
  10. 16 2月, 2023 1 次提交
    • I
      devlink: Fix netdev notifier chain corruption · b20b8aec
      Ido Schimmel 提交于
      Cited commit changed devlink to register its netdev notifier block on
      the global netdev notifier chain instead of on the per network namespace
      one.
      
      However, when changing the network namespace of the devlink instance,
      devlink still tries to unregister its notifier block from the chain of
      the old namespace and register it on the chain of the new namespace.
      This results in corruption of the notifier chains, as the same notifier
      block is registered on two different chains: The global one and the per
      network namespace one. In turn, this causes other problems such as the
      inability to dismantle namespaces due to netdev reference count issues.
      
      Fix by preventing devlink from moving its notifier block between
      namespaces.
      
      Reproducer:
      
       # echo "10 1" > /sys/bus/netdevsim/new_device
       # ip netns add test123
       # devlink dev reload netdevsim/netdevsim10 netns test123
       # ip netns del test123
       [   71.935619] unregister_netdevice: waiting for lo to become free. Usage count = 2
       [   71.938348] leaked reference.
      
      Fixes: 565b4824 ("devlink: change port event netdev notifier from per-net to global")
      Signed-off-by: NIdo Schimmel <idosch@nvidia.com>
      Reviewed-by: NJiri Pirko <jiri@nvidia.com>
      Reviewed-by: NJacob Keller <jacob.e.keller@intel.com>
      Reviewed-by: NJakub Kicinski <kuba@kernel.org>
      Link: https://lore.kernel.org/r/20230215073139.1360108-1-idosch@nvidia.comSigned-off-by: NPaolo Abeni <pabeni@redhat.com>
      b20b8aec
  11. 10 2月, 2023 1 次提交
  12. 08 2月, 2023 1 次提交
  13. 03 2月, 2023 1 次提交
  14. 02 2月, 2023 1 次提交
  15. 27 1月, 2023 2 次提交
  16. 24 1月, 2023 1 次提交
    • S
      bpf: XDP metadata RX kfuncs · 3d76a4d3
      Stanislav Fomichev 提交于
      Define a new kfunc set (xdp_metadata_kfunc_ids) which implements all possible
      XDP metatada kfuncs. Not all devices have to implement them. If kfunc is not
      supported by the target device, the default implementation is called instead.
      The verifier, at load time, replaces a call to the generic kfunc with a call
      to the per-device one. Per-device kfunc pointers are stored in separate
      struct xdp_metadata_ops.
      
      Cc: John Fastabend <john.fastabend@gmail.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Martin KaFai Lau <martin.lau@linux.dev>
      Cc: Jakub Kicinski <kuba@kernel.org>
      Cc: Willem de Bruijn <willemb@google.com>
      Cc: Jesper Dangaard Brouer <brouer@redhat.com>
      Cc: Anatoly Burakov <anatoly.burakov@intel.com>
      Cc: Alexander Lobakin <alexandr.lobakin@intel.com>
      Cc: Magnus Karlsson <magnus.karlsson@gmail.com>
      Cc: Maryam Tahhan <mtahhan@redhat.com>
      Cc: xdp-hints@xdp-project.net
      Cc: netdev@vger.kernel.org
      Signed-off-by: NStanislav Fomichev <sdf@google.com>
      Link: https://lore.kernel.org/r/20230119221536.3349901-8-sdf@google.comSigned-off-by: NMartin KaFai Lau <martin.lau@kernel.org>
      3d76a4d3
  17. 13 12月, 2022 1 次提交
    • X
      net: add IFF_NO_ADDRCONF and use it in bonding to prevent ipv6 addrconf · 8a321cf7
      Xin Long 提交于
      Currently, in bonding it reused the IFF_SLAVE flag and checked it
      in ipv6 addrconf to prevent ipv6 addrconf.
      
      However, it is not a proper flag to use for no ipv6 addrconf, for
      bonding it has to move IFF_SLAVE flag setting ahead of dev_open()
      in bond_enslave(). Also, IFF_MASTER/SLAVE are historical flags
      used in bonding and eql, as Jiri mentioned, the new devices like
      Team, Failover do not use this flag.
      
      So as Jiri suggested, this patch adds IFF_NO_ADDRCONF in priv_flags
      of the device to indicate no ipv6 addconf, and uses it in bonding
      and moves IFF_SLAVE flag setting back to its original place.
      Signed-off-by: NXin Long <lucien.xin@gmail.com>
      Signed-off-by: NJakub Kicinski <kuba@kernel.org>
      8a321cf7
  18. 05 12月, 2022 2 次提交
  19. 04 12月, 2022 1 次提交
  20. 16 11月, 2022 2 次提交
  21. 10 11月, 2022 1 次提交
  22. 09 11月, 2022 1 次提交
    • A
      net/core: Allow live renaming when an interface is up · bd039b5e
      Andy Ren 提交于
      Allow a network interface to be renamed when the interface
      is up.
      
      As described in the netconsole documentation [1], when netconsole is
      used as a built-in, it will bring up the specified interface as soon as
      possible. As a result, user space will not be able to rename the
      interface since the kernel disallows renaming of interfaces that are
      administratively up unless the 'IFF_LIVE_RENAME_OK' private flag was set
      by the kernel.
      
      The original solution [2] to this problem was to add a new parameter to
      the netconsole configuration parameters that allows renaming of
      the interface used by netconsole while it is administratively up.
      However, during the discussion that followed, it became apparent that we
      have no reason to keep the current restriction and instead we should
      allow user space to rename interfaces regardless of their administrative
      state:
      
      1. The restriction was put in place over 20 years ago when renaming was
      only possible via IOCTL and before rtnetlink started notifying user
      space about such changes like it does today.
      
      2. The 'IFF_LIVE_RENAME_OK' flag was added over 3 years ago in version
      5.2 and no regressions were reported.
      
      3. In-kernel listeners to 'NETDEV_CHANGENAME' do not seem to care about
      the administrative state of interface.
      
      Therefore, allow user space to rename running interfaces by removing the
      restriction and the associated 'IFF_LIVE_RENAME_OK' flag. Help in
      possible triage by emitting a message to the kernel log that an
      interface was renamed while UP.
      
      [1] https://www.kernel.org/doc/Documentation/networking/netconsole.rst
      [2] https://lore.kernel.org/netdev/20221102002420.2613004-1-andy.ren@getcruise.com/Signed-off-by: NAndy Ren <andy.ren@getcruise.com>
      Reviewed-by: NIdo Schimmel <idosch@nvidia.com>
      Reviewed-by: NDavid Ahern <dsahern@kernel.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      bd039b5e
  23. 04 11月, 2022 2 次提交
  24. 01 11月, 2022 1 次提交
  25. 31 10月, 2022 1 次提交
  26. 15 10月, 2022 1 次提交
  27. 02 10月, 2022 1 次提交
  28. 30 9月, 2022 2 次提交
  29. 29 9月, 2022 1 次提交
  30. 20 9月, 2022 1 次提交
    • V
      net: introduce iterators over synced hw addresses · db01868b
      Vladimir Oltean 提交于
      Some network drivers use __dev_mc_sync()/__dev_uc_sync() and therefore
      program the hardware only with addresses with a non-zero sync_cnt.
      
      Some of the above drivers also need to save/restore the address
      filtering lists when certain events happen, and they need to walk
      through the struct net_device :: uc and struct net_device :: mc lists.
      But these lists contain unsynced addresses too.
      
      To keep the appearance of an elementary form of data encapsulation,
      provide iterators through these lists that only look at entries with a
      non-zero sync_cnt, instead of filtering entries out from device drivers.
      Signed-off-by: NVladimir Oltean <vladimir.oltean@nxp.com>
      Reviewed-by: NFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: NPaolo Abeni <pabeni@redhat.com>
      db01868b
  31. 02 9月, 2022 2 次提交
  32. 26 8月, 2022 1 次提交
  33. 24 8月, 2022 2 次提交