Forum | Documentation | Website | Blog

Skip to content
Snippets Groups Projects
  1. Dec 15, 2021
  2. Dec 14, 2021
    • Jakub Kicinski's avatar
      Merge branch 'net-dsa-hellcreek-fix-handling-of-mgmt-protocols' · 6cf7a1ac
      Jakub Kicinski authored
      Kurt Kanzenbach says:
      
      ====================
      net: dsa: hellcreek: Fix handling of MGMT protocols
      
      this series fixes some minor issues with regards to management protocols
      such as PTP and STP in the hellcreek DSA driver. Configure static FDB
      for these protocols. The end result is:
      
      |root@tsn:~# mv88e6xxx_dump --atu
      |Using device <platform/ff240000.switch>
      |ATU:
      |FID  MAC               0123 Age OBT Pass Static Reprio Prio
      |   0 01:1b:19:00:00:00 1100   1               X       X    6
      |   1 01:00:5e:00:01:81 1100   1               X       X    6
      |   2 33:33:00:00:01:81 1100   1               X       X    6
      |   3 01:80:c2:00:00:0e 1100   1        X      X       X    6
      |   4 01:00:5e:00:00:6b 1100   1        X      X       X    6
      |   5 33:33:00:00:00:6b 1100   1        X      X       X    6
      |   6 01:80:c2:00:00:00 1100   1        X      X       X    6
      
      Previous version:
       * https://lore.kernel.org/r/20211213101810.121553-1-kurt@linutronix.de/
      
      Changes since v1:
       * Target net-next, as this never worked correctly and is not critical
       * Add STP and PTP over UDP rules
       * Use pass_blocked for PDelay messages only (Richard Cochran)
      ====================
      
      Link: https://lore.kernel.org/r/20211214134508.57806-1-kurt@linutronix.de
      
      
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      6cf7a1ac
    • Kurt Kanzenbach's avatar
      net: dsa: hellcreek: Add missing PTP via UDP rules · 6cf01e45
      Kurt Kanzenbach authored
      The switch supports PTP for UDP transport too. Therefore, add the missing static
      FDB entries to ensure correct forwarding of these packets.
      
      Fixes: ddd56dfe
      
       ("net: dsa: hellcreek: Add PTP clock support")
      Signed-off-by: default avatarKurt Kanzenbach <kurt@linutronix.de>
      Acked-by: default avatarRichard Cochran <richardcochran@gmail.com>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      6cf01e45
    • Kurt Kanzenbach's avatar
      net: dsa: hellcreek: Allow PTP P2P measurements on blocked ports · cad1798d
      Kurt Kanzenbach authored
      Allow PTP peer delay measurements on blocked ports by STP. In case of topology
      changes the PTP stack can directly start with the correct delays.
      
      Fixes: ddd56dfe
      
       ("net: dsa: hellcreek: Add PTP clock support")
      Signed-off-by: default avatarKurt Kanzenbach <kurt@linutronix.de>
      Reviewed-by: default avatarVladimir Oltean <olteanv@gmail.com>
      Acked-by: default avatarRichard Cochran <richardcochran@gmail.com>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      cad1798d
    • Kurt Kanzenbach's avatar
      net: dsa: hellcreek: Add STP forwarding rule · b7ade35e
      Kurt Kanzenbach authored
      Treat STP as management traffic. STP traffic is designated for the CPU port
      only. In addition, STP traffic has to pass blocked ports.
      
      Fixes: e4b27ebc
      
       ("net: dsa: Add DSA driver for Hirschmann Hellcreek switches")
      Signed-off-by: default avatarKurt Kanzenbach <kurt@linutronix.de>
      Reviewed-by: default avatarVladimir Oltean <olteanv@gmail.com>
      Acked-by: default avatarRichard Cochran <richardcochran@gmail.com>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      b7ade35e
    • Kurt Kanzenbach's avatar
      net: dsa: hellcreek: Fix insertion of static FDB entries · 4db4c3ea
      Kurt Kanzenbach authored
      The insertion of static FDB entries ignores the pass_blocked bit. That bit is
      evaluated with regards to STP. Add the missing functionality.
      
      Fixes: e4b27ebc
      
       ("net: dsa: Add DSA driver for Hirschmann Hellcreek switches")
      Signed-off-by: default avatarKurt Kanzenbach <kurt@linutronix.de>
      Reviewed-by: default avatarVladimir Oltean <olteanv@gmail.com>
      Acked-by: default avatarRichard Cochran <richardcochran@gmail.com>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      4db4c3ea
    • Eric Dumazet's avatar
      net: dev_replace_track() cleanup · 9280ac2e
      Eric Dumazet authored
      
      Use existing helpers (netdev_tracker_free()
      and netdev_tracker_alloc()) to remove ifdefery.
      
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Link: https://lore.kernel.org/r/20211214151515.312535-1-eric.dumazet@gmail.com
      
      
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      9280ac2e
    • Eric Dumazet's avatar
      net: linkwatch: be more careful about dev->linkwatch_dev_tracker · 123e495e
      Eric Dumazet authored
      Apparently a concurrent linkwatch_add_event() could
      run while we are in __linkwatch_run_queue().
      
      We need to free dev->linkwatch_dev_tracker tracker
      under lweventlist_lock protection to avoid this race.
      
      syzbot report:
      [   77.935949][ T3661] reference already released.
      [   77.941015][ T3661] allocated in:
      [   77.944482][ T3661]  linkwatch_fire_event+0x202/0x260
      [   77.950318][ T3661]  netif_carrier_on+0x9c/0x100
      [   77.955120][ T3661]  __ieee80211_sta_join_ibss+0xc52/0x1590
      [   77.960888][ T3661]  ieee80211_sta_create_ibss.cold+0xd2/0x11f
      [   77.966908][ T3661]  ieee80211_ibss_work.cold+0x30e/0x60f
      [   77.972483][ T3661]  ieee80211_iface_work+0xb70/0xd00
      [   77.977715][ T3661]  process_one_work+0x9ac/0x1680
      [   77.982671][ T3661]  worker_thread+0x652/0x11c0
      [   77.987371][ T3661]  kthread+0x405/0x4f0
      [   77.991465][ T3661]  ret_from_fork+0x1f/0x30
      [   77.995895][ T3661] freed in:
      [   77.999006][ T3661]  linkwatch_do_dev+0x96/0x160
      [   78.004...
      123e495e
    • Eric Dumazet's avatar
      mptcp: adjust to use netns refcount tracker · 1d2f3d3c
      Eric Dumazet authored
      MPTCP can change sk_net_refcnt after sock_create_kern() call.
      
      We need to change its corresponding get_net() to avoid
      a splat at release time, as in :
      
      refcount_t: decrement hit 0; leaking memory.
      WARNING: CPU: 0 PID: 3599 at lib/refcount.c:31 refcount_warn_saturate+0xbf/0x1e0 lib/refcount.c:31
      Modules linked in:
      CPU: 1 PID: 3599 Comm: syz-fuzzer Not tainted 5.16.0-rc4-syzkaller #0
      Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
      RIP: 0010:refcount_warn_saturate+0xbf/0x1e0 lib/refcount.c:31
      Code: 1d b1 99 a1 09 31 ff 89 de e8 5d 3a 9c fd 84 db 75 e0 e8 74 36 9c fd 48 c7 c7 60 00 05 8a c6 05 91 99 a1 09 01 e8 cc 4b 27 05 <0f> 0b eb c4 e8 58 36 9c fd 0f b6 1d 80 99 a1 09 31 ff 89 de e8 28
      RSP: 0018:ffffc90001f5fab0 EFLAGS: 00010286
      RAX: 0000000000000000 RBX: 0000000000000000 RCX: 0000000000000000
      RDX: ffff888021873a00 RSI: ffffffff815f1e28 RDI: fffff520003ebf48
      RBP: 0000000000000004 R08: 0000000000000000 R09: 0000000000000000
      R10: ffffffff815ebbce R11: 0000000000000000 R12: 1ffff920003ebf5b
      R13: 00000000ffffffef R14: ffffffff8d2fcd94 R15: ffffc90001f5fd10
      FS:  000000c00008a090(0000) GS:ffff8880b9d00000(0000) knlGS:0000000000000000
      CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      CR2: 00007f0a5b59e300 CR3: 000000001cbe6000 CR4: 00000000003506e0
      DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
      DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
      Call Trace:
       <TASK>
       __refcount_dec include/linux/refcount.h:344 [inline]
       refcount_dec include/linux/refcount.h:359 [inline]
       ref_tracker_free+0x4fe/0x610 lib/ref_tracker.c:101
       netns_tracker_free include/net/net_namespace.h:327 [inline]
       put_net_track include/net/net_namespace.h:341 [inline]
       __sk_destruct+0x4a6/0x920 net/core/sock.c:2042
       sk_destruct+0xbd/0xe0 net/core/sock.c:2058
       __sk_free+0xef/0x3d0 net/core/sock.c:2069
       sk_free+0x78/0xa0 net/core/sock.c:2080
       sock_put include/net/sock.h:1911 [inline]
       __mptcp_close_ssk+0x435/0x590 net/mptcp/protocol.c:2276
       __mptcp_destroy_sock+0x35f/0x830 net/mptcp/protocol.c:2702
       mptcp_close+0x5f8/0x7f0 net/mptcp/protocol.c:2750
       inet_release+0x12e/0x280 net/ipv4/af_inet.c:428
       inet6_release+0x4c/0x70 net/ipv6/af_inet6.c:476
       __sock_release+0xcd/0x280 net/socket.c:649
       sock_close+0x18/0x20 net/socket.c:1314
       __fput+0x286/0x9f0 fs/file_table.c:280
       task_work_run+0xdd/0x1a0 kernel/task_work.c:164
       tracehook_notify_resume include/linux/tracehook.h:189 [inline]
       exit_to_user_mode_loop kernel/entry/common.c:175 [inline]
       exit_to_user_mode_prepare+0x27e/0x290 kernel/entry/common.c:207
       __syscall_exit_to_user_mode_work kernel/entry/common.c:289 [inline]
       syscall_exit_to_user_mode+0x19/0x60 kernel/entry/common.c:300
       do_syscall_64+0x42/0xb0 arch/x86/entry/common.c:86
       entry_SYSCALL_64_after_hwframe+0x44/0xae
      
      Fixes: ffa84b5f
      
       ("net: add netns refcount tracker to struct sock")
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Reported-by: default avatarsyzbot <syzkaller@googlegroups.com>
      Cc: Mat Martineau <mathew.j.martineau@linux.intel.com>
      Cc: Florian Westphal <fw@strlen.de>
      Acked-by: default avatarPaolo Abeni <pabeni@redhat.com>
      Reviewed-by: default avatarMatthieu Baerts <matthieu.baerts@tessares.net>
      Link: https://lore.kernel.org/r/20211214043208.3543046-1-eric.dumazet@gmail.com
      
      
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      1d2f3d3c
    • Eric Dumazet's avatar
      ipv6: use GFP_ATOMIC in rt6_probe() · 8b40a9d5
      Eric Dumazet authored
      syzbot reminded me that rt6_probe() can run from
      atomic contexts.
      
      stack backtrace:
      
      CPU: 1 PID: 7461 Comm: syz-executor.2 Not tainted 5.16.0-rc4-next-20211210-syzkaller #0
      Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
      Call Trace:
       <IRQ>
       __dump_stack lib/dump_stack.c:88 [inline]
       dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:106
       print_usage_bug kernel/locking/lockdep.c:203 [inline]
       valid_state kernel/locking/lockdep.c:3945 [inline]
       mark_lock_irq kernel/locking/lockdep.c:4148 [inline]
       mark_lock.cold+0x61/0x8e kernel/locking/lockdep.c:4605
       mark_usage kernel/locking/lockdep.c:4500 [inline]
       __lock_acquire+0x11d5/0x54a0 kernel/locking/lockdep.c:4981
       lock_acquire kernel/locking/lockdep.c:5639 [inline]
       lock_acquire+0x1ab/0x510 kernel/locking/lockdep.c:5604
       __fs_reclaim_acquire mm/page_alloc.c:4550 [inline]
       fs_reclaim_acquire+0x115/0x160 mm/page_alloc.c:4564
       might_alloc include/linux/sched/mm.h:253 [inline]
       slab_pre_alloc_hook mm/slab.h:739 [inline]
       slab_alloc_node mm/slub.c:3145 [inline]
       slab_alloc mm/slub.c:3239 [inline]
       kmem_cache_alloc_trace+0x3b/0x2c0 mm/slub.c:3256
       kmalloc include/linux/slab.h:581 [inline]
       kzalloc include/linux/slab.h:715 [inline]
       ref_tracker_alloc+0xe1/0x430 lib/ref_tracker.c:74
       netdev_tracker_alloc include/linux/netdevice.h:3860 [inline]
       dev_hold_track include/linux/netdevice.h:3877 [inline]
       rt6_probe net/ipv6/route.c:661 [inline]
       find_match.part.0+0xac9/0xd00 net/ipv6/route.c:752
       find_match net/ipv6/route.c:825 [inline]
       __find_rr_leaf+0x17f/0xd20 net/ipv6/route.c:826
       find_rr_leaf net/ipv6/route.c:847 [inline]
       rt6_select net/ipv6/route.c:891 [inline]
       fib6_table_lookup+0x649/0xa20 net/ipv6/route.c:2185
       ip6_pol_route+0x1c5/0x11e0 net/ipv6/route.c:2221
       pol_lookup_func include/net/ip6_fib.h:580 [inline]
       fib6_rule_lookup+0x52a/0x6f0 net/ipv6/fib6_rules.c:120
       ip6_route_output_flags_noref+0x2e2/0x380 net/ipv6/route.c:2629
       ip6_route_output_flags+0x72/0x320 net/ipv6/route.c:2642
       ip6_route_output include/net/ip6_route.h:98 [inline]
       ip6_dst_lookup_tail+0x5ab/0x1620 net/ipv6/ip6_output.c:1070
       ip6_dst_lookup_flow+0x8c/0x1d0 net/ipv6/ip6_output.c:1200
       geneve_get_v6_dst+0x46f/0x9a0 drivers/net/geneve.c:858
       geneve6_xmit_skb drivers/net/geneve.c:991 [inline]
       geneve_xmit+0x520/0x3530 drivers/net/geneve.c:1074
       __netdev_start_xmit include/linux/netdevice.h:4685 [inline]
       netdev_start_xmit include/linux/netdevice.h:4699 [inline]
       xmit_one net/core/dev.c:3473 [inline]
       dev_hard_start_xmit+0x1eb/0x920 net/core/dev.c:3489
       __dev_queue_xmit+0x2983/0x3640 net/core/dev.c:4112
       neigh_resolve_output net/core/neighbour.c:1522 [inline]
       neigh_resolve_output+0x50e/0x820 net/core/neighbour.c:1502
       neigh_output include/net/neighbour.h:541 [inline]
       ip6_finish_output2+0x56e/0x14f0 net/ipv6/ip6_output.c:126
       __ip6_finish_output net/ipv6/ip6_output.c:191 [inline]
       __ip6_finish_output+0x61e/0xe80 net/ipv6/ip6_output.c:170
       ip6_finish_output+0x32/0x200 net/ipv6/ip6_output.c:201
       NF_HOOK_COND include/linux/netfilter.h:296 [inline]
       ip6_output+0x1e4/0x530 net/ipv6/ip6_output.c:224
       dst_output include/net/dst.h:451 [inline]
       NF_HOOK include/linux/netfilter.h:307 [inline]
       ndisc_send_skb+0xa99/0x17f0 net/ipv6/ndisc.c:508
       ndisc_send_rs+0x12e/0x6f0 net/ipv6/ndisc.c:702
       addrconf_rs_timer+0x3f2/0x820 net/ipv6/addrconf.c:3898
       call_timer_fn+0x1a5/0x6b0 kernel/time/timer.c:1421
       expire_timers kernel/time/timer.c:1466 [inline]
       __run_timers.part.0+0x675/0xa20 kernel/time/timer.c:1734
       __run_timers kernel/time/timer.c:1715 [inline]
       run_timer_softirq+0xb3/0x1d0 kernel/time/timer.c:1747
       __do_softirq+0x29b/0x9c2 kernel/softirq.c:558
       invoke_softirq kernel/softirq.c:432 [inline]
       __irq_exit_rcu+0x123/0x180 kernel/softirq.c:637
       irq_exit_rcu+0x5/0x20 kernel/softirq.c:649
       sysvec_apic_timer_interrupt+0x93/0xc0 arch/x86/kernel/apic/apic.c:1097
       </IRQ>
      
      Fixes: fb67510b
      
       ("ipv6: add net device refcount tracker to rt6_probe_deferred()")
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Reported-by: default avatarsyzbot <syzkaller@googlegroups.com>
      Link: https://lore.kernel.org/r/20211214025806.3456382-1-eric.dumazet@gmail.com
      
      
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      8b40a9d5
    • Dany Madden's avatar
      ibmvnic: remove unused defines · fe4c82a7
      Dany Madden authored
      
      IBMVNIC_STATS_TIMEOUT and IBMVNIC_INIT_FAILED are not used in the driver.
      Remove them.
      
      Suggested-by: default avatarSukadev Bhattiprolu <sukadev@linux.ibm.com>
      Signed-off-by: default avatarDany Madden <drt@linux.ibm.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      fe4c82a7
    • Dany Madden's avatar
      ibmvnic: Update driver return codes · b6ee566c
      Dany Madden authored
      
      Update return codes to be more informative.
      
      Signed-off-by: default avatarJacob Root <otis@otisroot.com>
      Signed-off-by: default avatarDany Madden <drt@linux.ibm.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      b6ee566c
    • David S. Miller's avatar
      Revert "pktgen: use min() to make code cleaner" · dc91e3be
      David S. Miller authored
      This reverts commit 13510fef
      
      .
      
      Causes build warnings.
      
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      dc91e3be
    • Changcheng Deng's avatar
      pktgen: use min() to make code cleaner · 13510fef
      Changcheng Deng authored
      
      Use min() in order to make code cleaner. Issue found by coccinelle.
      
      Reported-by: default avatarZeal Robot <zealci@zte.com.cn>
      Signed-off-by: default avatarChangcheng Deng <deng.changcheng@zte.com.cn>
      Reviewed-by: default avatarMuchun Song <songmuchun@bytedance.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      13510fef
    • David S. Miller's avatar
      Merge branch 'dsa-fixups' · 256f8d72
      David S. Miller authored
      
      Vladimir Oltean says:
      
      ====================
      DSA tagger-owned storage fixups
      
      It seems that the DSA tagger-owned storage changes were insufficiently
      tested and do not work in all cases. Specifically, the NXP Bluebox 3
      (arch/arm64/boot/dts/freescale/fsl-lx2160a-bluebox3.dts) got broken by
      these changes, because
      (a) I forgot that DSA_TAG_PROTO_SJA1110 exists and differs from
          DSA_TAG_PROTO_SJA1105
      (b) the Bluebox 3 uses a DSA switch tree with 2 switches, and the
          tagger-owned storage patches don't cover that use case well, it
          seems
      
      Therefore, I'm sorry to say that there needs to be an API fixup: tagging
      protocol drivers will from now on connect to individual switches from a
      tree, rather than to the tree as a whole. This is more robust against
      various ordering constraints in the DSA probe and teardown paths, and is
      also symmetrical with the connection API exposed to the switch drivers
      themselves, which is also per switch.
      
      With these changes, the Bluebox 3 also works fine.
      ====================
      
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      256f8d72
    • Vladimir Oltean's avatar
      net: dsa: make tagging protocols connect to individual switches from a tree · 7f297314
      Vladimir Oltean authored
      
      On the NXP Bluebox 3 board which uses a multi-switch setup with sja1105,
      the mechanism through which the tagger connects to the switch tree is
      broken, due to improper DSA code design. At the time when tag_ops->connect()
      is called in dsa_port_parse_cpu(), DSA hasn't finished "touching" all
      the ports, so it doesn't know how large the tree is and how many ports
      it has. It has just seen the first CPU port by this time. As a result,
      this function will call the tagger's ->connect method too early, and the
      tagger will connect only to the first switch from the tree.
      
      This could be perhaps addressed a bit more simply by just moving the
      tag_ops->connect(dst) call a bit later (for example in dsa_tree_setup),
      but there is already a design inconsistency at present: on the switch
      side, the notification is on a per-switch basis, but on the tagger side,
      it is on a per-tree basis. Furthermore, the persistent storage itself is
      per switch (ds->tagger_data). And the tagger connect and disconnect
      procedures (at least the ones that exist currently) could see a fair bit
      of simplification if they didn't have to iterate through the switches of
      a tree.
      
      To fix the issue, this change transforms tag_ops->connect(dst) into
      tag_ops->connect(ds) and moves it somewhere where we already iterate
      over all switches of a tree. That is in dsa_switch_setup_tag_protocol(),
      which is a good placement because we already have there the connection
      call to the switch side of things.
      
      As for the dsa_tree_bind_tag_proto() method (called from the code path
      that changes the tag protocol), things are a bit more complicated
      because we receive the tree as argument, yet when we unwind on errors,
      it would be nice to not call tag_ops->disconnect(ds) where we didn't
      previously call tag_ops->connect(ds). We didn't have this problem before
      because the tag_ops connection operations passed the entire dst before,
      and this is more fine grained now. To solve the error rewind case using
      the new API, we have to create yet one more cross-chip notifier for
      disconnection, and stay connected with the old tag protocol to all the
      switches in the tree until we've succeeded to connect with the new one
      as well. So if something fails half way, the whole tree is still
      connected to the old tagger. But there may still be leaks if the tagger
      fails to connect to the 2nd out of 3 switches in a tree: somebody needs
      to tell the tagger to disconnect from the first switch. Nothing comes
      for free, and this was previously handled privately by the tagging
      protocol driver before, but now we need to emit a disconnect cross-chip
      notifier for that, because DSA has to take care of the unwind path. We
      assume that the tagging protocol has connected to a switch if it has set
      ds->tagger_data to something, otherwise we avoid calling its
      disconnection method in the error rewind path.
      
      The rest of the changes are in the tagging protocol drivers, and have to
      do with the replacement of dst with ds. The iteration is removed and the
      error unwind path is simplified, as mentioned above.
      
      Signed-off-by: default avatarVladimir Oltean <vladimir.oltean@nxp.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      7f297314
    • Vladimir Oltean's avatar
      net: dsa: sja1105: fix broken connection with the sja1110 tagger · c8a2a011
      Vladimir Oltean authored
      The driver was incorrectly converted assuming that "sja1105" is the only
      tagger supported by this driver. This results in SJA1110 switches
      failing to probe:
      
      sja1105 spi1.0: Unable to connect to tag protocol "sja1110": -EPROTONOSUPPORT
      sja1105: probe of spi1.2 failed with error -93
      
      Add DSA_TAG_PROTO_SJA1110 to the list of supported taggers by the
      sja1105 driver. The sja1105_tagger_data structure format is common for
      the two tagging protocols.
      
      Fixes: c79e8486
      
       ("net: dsa: tag_sja1105: convert to tagger-owned data")
      Signed-off-by: default avatarVladimir Oltean <vladimir.oltean@nxp.com>
      Reviewed-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      c8a2a011
    • Vladimir Oltean's avatar
      net: dsa: tag_sja1105: fix zeroization of ds->priv on tag proto disconnect · e2f01bfe
      Vladimir Oltean authored
      The method was meant to zeroize ds->tagger_data but got the wrong
      pointer. Fix this.
      
      Fixes: c79e8486
      
       ("net: dsa: tag_sja1105: convert to tagger-owned data")
      Signed-off-by: default avatarVladimir Oltean <vladimir.oltean@nxp.com>
      Reviewed-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      e2f01bfe
    • Guillaume Nault's avatar
      bareudp: Add extack support to bareudp_configure() · b4bffa4c
      Guillaume Nault authored
      
      Add missing extacks for common configuration errors.
      
      Signed-off-by: default avatarGuillaume Nault <gnault@redhat.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      b4bffa4c
    • Jakub Kicinski's avatar
      ethtool: fix null-ptr-deref on ref tracker · 0976b888
      Jakub Kicinski authored
      dev can be a NULL here, not all requests set require_dev.
      
      Fixes: e4b89540
      
       ("netlink: add net device refcount tracker to struct ethnl_req_info")
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      Reviewed-by: default avatarEric Dumazet <edumazet@google.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      0976b888
    • Sebastian Andrzej Siewior's avatar
      net: dev: Change the order of the arguments for the contended condition. · a9aa5e33
      Sebastian Andrzej Siewior authored
      
      Change the order of arguments and make qdisc_is_running() appear first.
      This is more readable for the general case.
      
      Signed-off-by: default avatarSebastian Andrzej Siewior <bigeasy@linutronix.de>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      a9aa5e33
    • David S. Miller's avatar
      Merge branch 'hwtstamp_bonding' · d0c3e464
      David S. Miller authored
      
      Hangbin Liu says:
      
      ====================
      net: add new hwtstamp flag HWTSTAMP_FLAG_BONDED_PHC_INDEX
      
      This patchset add a new hwtstamp_config flag HWTSTAMP_FLAG_BONDED_PHC_INDEX.
      When user want to get bond active interface's PHC, they need to add this flag
      and aware the PHC index may changed.
      
      v3: Use bitwise test to check the flags validation
      v2: rename the flag to HWTSTAMP_FLAG_BONDED_PHC_INDEX
      ====================
      
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      d0c3e464
    • Hangbin Liu's avatar
      Bonding: force user to add HWTSTAMP_FLAG_BONDED_PHC_INDEX when get/set HWTSTAMP · 085d6100
      Hangbin Liu authored
      
      When there is a failover, the PHC index of bond active interface will be
      changed. This may break the user space program if the author didn't aware.
      
      By setting this flag, the user should aware that the PHC index get/set
      by syscall is not stable. And the user space is able to deal with it.
      Without this flag, the kernel will reject the request forwarding to
      bonding.
      
      Reported-by: default avatarJakub Kicinski <kuba@kernel.org>
      Fixes: 94dd016a
      
       ("bond: pass get_ts_info and SIOC[SG]HWTSTAMP ioctl to active device")
      Signed-off-by: default avatarHangbin Liu <liuhangbin@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      085d6100
    • Hangbin Liu's avatar
      net_tstamp: add new flag HWTSTAMP_FLAG_BONDED_PHC_INDEX · 9c9211a3
      Hangbin Liu authored
      Since commit 94dd016a
      
       ("bond: pass get_ts_info and SIOC[SG]HWTSTAMP
      ioctl to active device") the user could get bond active interface's
      PHC index directly. But when there is a failover, the bond active
      interface will change, thus the PHC index is also changed. This may
      break the user's program if they did not update the PHC timely.
      
      This patch adds a new hwtstamp_config flag HWTSTAMP_FLAG_BONDED_PHC_INDEX.
      When the user wants to get the bond active interface's PHC, they need to
      add this flag and be aware the PHC index may be changed.
      
      With the new flag. All flag checks in current drivers are removed. Only
      the checking in net_hwtstamp_validate() is kept.
      
      Suggested-by: default avatarJakub Kicinski <kuba@kernel.org>
      Signed-off-by: default avatarHangbin Liu <liuhangbin@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      9c9211a3
  3. Dec 13, 2021
    • Lorenzo Bianconi's avatar
      net: mtk_eth: add COMPILE_TEST support · a3c62a04
      Lorenzo Bianconi authored
      
      Improve the build testing of mtk_eth drivers by enabling them when
      COMPILE_TEST is selected. Moreover COMPILE_TEST will be useful
      for the driver development.
      
      Signed-off-by: default avatarLorenzo Bianconi <lorenzo@kernel.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      a3c62a04
    • Sebastian Andrzej Siewior's avatar
      net: dev: Always serialize on Qdisc::busylock in __dev_xmit_skb() on PREEMPT_RT. · 64445dda
      Sebastian Andrzej Siewior authored
      
      The root-lock is dropped before dev_hard_start_xmit() is invoked and after
      setting the __QDISC___STATE_RUNNING bit. If the Qdisc owner is preempted
      by another sender/task with a higher priority then this new sender won't
      be able to submit packets to the NIC directly instead they will be
      enqueued into the Qdisc. The NIC will remain idle until the Qdisc owner
      is scheduled again and finishes the job.
      
      By serializing every task on the ->busylock then the task will be
      preempted by a sender only after the Qdisc has no owner.
      
      Always serialize on the busylock on PREEMPT_RT.
      
      Signed-off-by: default avatarSebastian Andrzej Siewior <bigeasy@linutronix.de>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      64445dda
    • Yang Li's avatar
      mt76: remove variable set but not used · 93d576f5
      Yang Li authored
      
      The code that uses variable queued has been removed,
      and "mt76_is_usb(dev) ? q->ndesc - q->queued : q->queued"
      didn't do anything, so all they should be removed as well.
      
      Eliminate the following clang warnings:
      drivers/net/wireless/mediatek/mt76/debugfs.c:77:9: warning: variable
      ‘queued’ set but not used.
      
      Reported-by: default avatarAbaci Robot <abaci@linux.alibaba.com>
      Fixes: 2d8be76c
      
       ("mt76: debugfs: improve queue node readability")
      Signed-off-by: default avatarYang Li <yang.lee@linux.alibaba.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      93d576f5
    • Suresh Kumar's avatar
      net: bonding: debug: avoid printing debug logs when bond is not notifying peers · fee32de2
      Suresh Kumar authored
      
      Currently "bond_should_notify_peers: slave ..." messages are printed whenever
      "bond_should_notify_peers" function is called.
      
      +++
      Dec 12 12:33:26 node1 kernel: bond0: bond_should_notify_peers: slave enp0s25
      Dec 12 12:33:26 node1 kernel: bond0: bond_should_notify_peers: slave enp0s25
      Dec 12 12:33:26 node1 kernel: bond0: bond_should_notify_peers: slave enp0s25
      Dec 12 12:33:26 node1 kernel: bond0: (slave enp0s25): Received LACPDU on port 1
      Dec 12 12:33:26 node1 kernel: bond0: (slave enp0s25): Rx Machine: Port=1, Last State=6, Curr State=6
      Dec 12 12:33:26 node1 kernel: bond0: (slave enp0s25): partner sync=1
      Dec 12 12:33:26 node1 kernel: bond0: bond_should_notify_peers: slave enp0s25
      Dec 12 12:33:26 node1 kernel: bond0: bond_should_notify_peers: slave enp0s25
      Dec 12 12:33:26 node1 kernel: bond0: bond_should_notify_peers: slave enp0s25
      ...
      Dec 12 12:33:30 node1 kernel: bond0: bond_should_notify_peers: slave enp0s25
      Dec 12 12:33:30 node1 kernel: bond0: bond_should_notify_peers: slave enp0s25
      Dec 12 12:33:30 node1 kernel: bond0: (slave enp4s3): Received LACPDU on port 2
      Dec 12 12:33:30 node1 kernel: bond0: (slave enp4s3): Rx Machine: Port=2, Last State=6, Curr State=6
      Dec 12 12:33:30 node1 kernel: bond0: (slave enp4s3): partner sync=1
      Dec 12 12:33:30 node1 kernel: bond0: bond_should_notify_peers: slave enp0s25
      Dec 12 12:33:30 node1 kernel: bond0: bond_should_notify_peers: slave enp0s25
      Dec 12 12:33:30 node1 kernel: bond0: bond_should_notify_peers: slave enp0s25
      +++
      
      This is confusing and can also clutter up debug logs.
      Print logs only when the peer notification happens.
      
      Signed-off-by: default avatarSuresh Kumar <suresh2514@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      fee32de2
    • Clément Léger's avatar
      net: ocelot: use dma_unmap_addr to get tx buffer dma_addr · 3cfcda2a
      Clément Léger authored
      
      dma_addr was declared using DEFINE_DMA_UNMAP_ADDR() which requires to
      use dma_unmap_addr() to access it.
      
      Reported-by: default avatarkernel test robot <lkp@intel.com>
      Fixes: 753a026c
      
       ("net: ocelot: add FDMA support")
      Signed-off-by: default avatarClément Léger <clement.leger@bootlin.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      3cfcda2a