1. 01 Sep, 2020 3 commits
  2. 31 Aug, 2020 6 commits
    • Grygorii Strashko's avatar
      net: ethernet: ti: am65-cpsw: fix rmii 100Mbit link mode · c2f89219
      Grygorii Strashko authored
      In RMII link mode it's required to set bit 15 IFCTL_A in MAC_SL MAC_CONTROL
      register to enable support for 100Mbit link speed.
      
      Fixes: 93a76530 ("net: ethernet: ti: introduce am65x/j721e gigabit eth subsystem driver")
      Signed-off-by: default avatarGrygorii Strashko <grygorii.strashko@ti.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      c2f89219
    • Potnuri Bharat Teja's avatar
      cxgb4: fix thermal zone device registration · 6b6382a8
      Potnuri Bharat Teja authored
      When multiple adapters are present in the system, pci hot-removing second
      adapter leads to the following warning as both the adapters registered
      thermal zone device with same thermal zone name/type.
      Therefore, use unique thermal zone name during thermal zone device
      initialization. Also mark thermal zone dev NULL once unregistered.
      
      [  414.370143] ------------[ cut here ]------------
      [  414.370944] sysfs group 'power' not found for kobject 'hwmon0'
      [  414.371747] WARNING: CPU: 9 PID: 2661 at fs/sysfs/group.c:281
       sysfs_remove_group+0x76/0x80
      [  414.382550] CPU: 9 PID: 2661 Comm: bash Not tainted 5.8.0-rc6+ #33
      [  414.383593] Hardware name: Supermicro X10SRA-F/X10SRA-F, BIOS 2.0a 06/23/2016
      [  414.384669] RIP: 0010:sysfs_remove_group+0x76/0x80
      [  414.385738] Code: 48 89 df 5b 5d 41 5c e9 d8 b5 ff ff 48 89 df e8 60 b0 ff ff
       eb cb 49 8b 14 24 48 8b 75 00 48 c7 c7 90 ae 13 bb e8 6a 27 d0 ff <0f> 0b 5b 5d
       41 5c c3 0f 1f 00 0f 1f 44 00 00 48 85 f6 74 31 41 54
      [  414.388404] RSP: 0018:ffffa22bc080fcb0 EFLAGS: 00010286
      [  414.389638] RAX: 0000000000000000 RBX: 0000000000000000 RCX: 0000000000000000
      [  414.390829] RDX: 0000000000000001 RSI: ffff8ee2de3e9510 RDI: ffff8ee2de3e9510
      [  414.392064] RBP: ffffffffbaef2ee0 R08: 0000000000000000 R09: 0000000000000000
      [  414.393224] R10: 0000000000000000 R11: 000000002b30006c R12: ffff8ee260720008
      [  414.394388] R13: ffff8ee25e0a40e8 R14: ffffa22bc080ff08 R15: ffff8ee2c3be5020
      [  414.395661] FS:  00007fd2a7171740(0000) GS:ffff8ee2de200000(0000)
       knlGS:0000000000000000
      [  414.396825] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      [  414.398011] CR2: 00007f178ffe5020 CR3: 000000084c5cc003 CR4: 00000000003606e0
      [  414.399172] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
      [  414.400352] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
      [  414.401473] Call Trace:
      [  414.402685]  device_del+0x89/0x400
      [  414.403819]  device_unregister+0x16/0x60
      [  414.405024]  hwmon_device_unregister+0x44/0xa0
      [  414.406112]  thermal_remove_hwmon_sysfs+0x196/0x200
      [  414.407256]  thermal_zone_device_unregister+0x1b5/0x1f0
      [  414.408415]  cxgb4_thermal_remove+0x3c/0x4f [cxgb4]
      [  414.409668]  remove_one+0x212/0x290 [cxgb4]
      [  414.410875]  pci_device_remove+0x36/0xb0
      [  414.412004]  device_release_driver_internal+0xe2/0x1c0
      [  414.413276]  pci_stop_bus_device+0x64/0x90
      [  414.414433]  pci_stop_and_remove_bus_device_locked+0x16/0x30
      [  414.415609]  remove_store+0x75/0x90
      [  414.416790]  kernfs_fop_write+0x114/0x1b0
      [  414.417930]  vfs_write+0xcf/0x210
      [  414.419059]  ksys_write+0xa7/0xe0
      [  414.420120]  do_syscall_64+0x4c/0xa0
      [  414.421278]  entry_SYSCALL_64_after_hwframe+0x44/0xa9
      [  414.422335] RIP: 0033:0x7fd2a686afd0
      [  414.423396] Code: Bad RIP value.
      [  414.424549] RSP: 002b:00007fffc1446148 EFLAGS: 00000246 ORIG_RAX:
       0000000000000001
      [  414.425638] RAX: ffffffffffffffda RBX: 0000000000000002 RCX: 00007fd2a686afd0
      [  414.426830] RDX: 0000000000000002 RSI: 00007fd2a7196000 RDI: 0000000000000001
      [  414.427927] RBP: 00007fd2a7196000 R08: 000000000000000a R09: 00007fd2a7171740
      [  414.428923] R10: 00007fd2a7171740 R11: 0000000000000246 R12: 00007fd2a6b43400
      [  414.430082] R13: 0000000000000002 R14: 0000000000000001 R15: 0000000000000000
      [  414.431027] irq event stamp: 76300
      [  414.435678] ---[ end trace 13865acb4d5ab00f ]---
      
      Fixes: b1871915 ("cxgb4: Add thermal zone support")
      Signed-off-by: default avatarPotnuri Bharat Teja <bharat@chelsio.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      6b6382a8
    • Xie He's avatar
      drivers/net/wan/hdlc_cisco: Add hard_header_len · 1a545ebe
      Xie He authored
      This driver didn't set hard_header_len. This patch sets hard_header_len
      for it according to its header_ops->create function.
      
      This driver's header_ops->create function (cisco_hard_header) creates
      a header of (struct hdlc_header), so hard_header_len should be set to
      sizeof(struct hdlc_header).
      
      Cc: Martin Schiller <ms@dev.tdt.de>
      Signed-off-by: default avatarXie He <xie.he.0141@gmail.com>
      Acked-by: default avatarKrzysztof Halasa <khc@pm.waw.pl>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      1a545ebe
    • Shannon Nelson's avatar
      ionic: fix txrx work accounting · 9dda5110
      Shannon Nelson authored
      Take the tx accounting out of the work_done calculation to
      prevent a possible duplicate napi_schedule call when under
      high Tx stress but low Rx traffic.
      
      Fixes: b14e4e95 ("ionic: tx separate servicing")
      Signed-off-by: default avatarShannon Nelson <snelson@pensando.io>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      9dda5110
    • David S. Miller's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/pablo/nf · e9d572d9
      David S. Miller authored
      Pablo Neira Ayuso says:
      
      ====================
      Netfilter fixes for net
      
      The following patchset contains Netfilter fixes for net:
      
      1) Do not delete clash entries on reply, let them expire instead,
         from Florian Westphal.
      
      2) Do not report EAGAIN to nfnetlink, otherwise this enters a busy loop.
         Update nfnetlink_unicast() to translate EAGAIN to ENOBUFS.
      
      3) Remove repeated words in code comments, from Randy Dunlap.
      
      4) Several patches for the flowtable selftests, from Fabian Frederick.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      e9d572d9
    • Tuong Lien's avatar
      tipc: fix using smp_processor_id() in preemptible · bb8872a1
      Tuong Lien authored
      The 'this_cpu_ptr()' is used to obtain the AEAD key' TFM on the current
      CPU for encryption, however the execution can be preemptible since it's
      actually user-space context, so the 'using smp_processor_id() in
      preemptible' has been observed.
      
      We fix the issue by using the 'get/put_cpu_ptr()' API which consists of
      a 'preempt_disable()' instead.
      
      Fixes: fc1b6d6d ("tipc: introduce TIPC encryption & authentication")
      Acked-by: default avatarJon Maloy <jmaloy@redhat.com>
      Signed-off-by: default avatarTuong Lien <tuong.t.lien@dektech.com.au>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      bb8872a1
  3. 29 Aug, 2020 1 commit
    • Florian Westphal's avatar
      netfilter: conntrack: do not auto-delete clash entries on reply · c4617214
      Florian Westphal authored
      Its possible that we have more than one packet with the same ct tuple
      simultaneously, e.g. when an application emits n packets on same UDP
      socket from multiple threads.
      
      NAT rules might be applied to those packets. With the right set of rules,
      n packets will be mapped to m destinations, where at least two packets end
      up with the same destination.
      
      When this happens, the existing clash resolution may merge the skb that
      is processed after the first has been received with the identical tuple
      already in hash table.
      
      However, its possible that this identical tuple is a NAT_CLASH tuple.
      In that case the second skb will be sent, but no reply can be received
      since the reply that is processed first removes the NAT_CLASH tuple.
      
      Do not auto-delete, this gives a 1 second window for replies to be passed
      back to originator.
      
      Packets that are coming later (udp stream case) will not be affected:
      they match the original ct entry, not a NAT_CLASH one.
      
      Also prevent NAT_CLASH entries from getting offloaded.
      
      Fixes: 6a757c07 ("netfilter: conntrack: allow insertion of clashing entries")
      Signed-off-by: default avatarFlorian Westphal <fw@strlen.de>
      Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
      c4617214
  4. 28 Aug, 2020 13 commits
  5. 27 Aug, 2020 12 commits
  6. 26 Aug, 2020 5 commits
    • David S. Miller's avatar
      Merge branch 'net-fix-netpoll-crash-with-bnxt' · 5875568a
      David S. Miller authored
      Jakub Kicinski says:
      
      ====================
      net: fix netpoll crash with bnxt
      
      Rob run into crashes when using XDP on bnxt. Upon investigation
      it turns out that during driver reconfig irq core produces
      a warning message when IRQs are requested. This triggers netpoll,
      which in turn accesses uninitialized driver state. Same crash can
      also be triggered on this platform by changing the number of rings.
      
      Looks like we have two missing pieces here, netif_napi_add() has
      to make sure we start out with netpoll blocked. The driver also
      has to be more careful about when napi gets enabled.
      
      Tested XDP and channel count changes, the warning message no longer
      causes a crash. Not sure if the memory barriers added in patch 1
      are necessary, but it seems we should have them.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      5875568a
    • Jakub Kicinski's avatar
      bnxt: don't enable NAPI until rings are ready · 96ecdcc9
      Jakub Kicinski authored
      Netpoll can try to poll napi as soon as napi_enable() is called.
      It crashes trying to access a doorbell which is still NULL:
      
       BUG: kernel NULL pointer dereference, address: 0000000000000000
       CPU: 59 PID: 6039 Comm: ethtool Kdump: loaded Tainted: G S                5.9.0-rc1-00469-g5fd99b5d-dirty #26
       RIP: 0010:bnxt_poll+0x121/0x1c0
       Code: c4 20 44 89 e0 5b 5d 41 5c 41 5d 41 5e 41 5f c3 41 8b 86 a0 01 00 00 41 23 85 18 01 00 00 49 8b 96 a8 01 00 00 0d 00 00 00 24 <89> 02
      41 f6 45 77 02 74 cb 49 8b ae d8 01 00 00 31 c0 c7 44 24 1a
        netpoll_poll_dev+0xbd/0x1a0
        __netpoll_send_skb+0x1b2/0x210
        netpoll_send_udp+0x2c9/0x406
        write_ext_msg+0x1d7/0x1f0
        console_unlock+0x23c/0x520
        vprintk_emit+0xe0/0x1d0
        printk+0x58/0x6f
        x86_vector_activate.cold+0xf/0x46
        __irq_domain_activate_irq+0x50/0x80
        __irq_domain_activate_irq+0x32/0x80
        __irq_domain_activate_irq+0x32/0x80
        irq_domain_activate_irq+0x25/0x40
        __setup_irq+0x2d2/0x700
        request_threaded_irq+0xfb/0x160
        __bnxt_open_nic+0x3b1/0x750
        bnxt_open_nic+0x19/0x30
        ethtool_set_channels+0x1ac/0x220
        dev_ethtool+0x11ba/0x2240
        dev_ioctl+0x1cf/0x390
        sock_do_ioctl+0x95/0x130
      Reported-by: default avatarRob Sherwood <rsher@fb.com>
      Fixes: c0c050c5 ("bnxt_en: New Broadcom ethernet driver.")
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      Reviewed-by: default avatarMichael Chan <michael.chan@broadcom.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      96ecdcc9
    • Jakub Kicinski's avatar
      net: disable netpoll on fresh napis · 96e97bc0
      Jakub Kicinski authored
      napi_disable() makes sure to set the NAPI_STATE_NPSVC bit to prevent
      netpoll from accessing rings before init is complete. However, the
      same is not done for fresh napi instances in netif_napi_add(),
      even though we expect NAPI instances to be added as disabled.
      
      This causes crashes during driver reconfiguration (enabling XDP,
      changing the channel count) - if there is any printk() after
      netif_napi_add() but before napi_enable().
      
      To ensure memory ordering is correct we need to use RCU accessors.
      Reported-by: default avatarRob Sherwood <rsher@fb.com>
      Fixes: 2d8bff12 ("netpoll: Close race condition between poll_one_napi and napi_disable")
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      96e97bc0
    • Ido Schimmel's avatar
      ipv4: Silence suspicious RCU usage warning · 7f6f32bb
      Ido Schimmel authored
      fib_info_notify_update() is always called with RTNL held, but not from
      an RCU read-side critical section. This leads to the following warning
      [1] when the FIB table list is traversed with
      hlist_for_each_entry_rcu(), but without a proper lockdep expression.
      
      Since modification of the list is protected by RTNL, silence the warning
      by adding a lockdep expression which verifies RTNL is held.
      
      [1]
       =============================
       WARNING: suspicious RCU usage
       5.9.0-rc1-custom-14233-g2f26e122d62f #129 Not tainted
       -----------------------------
       net/ipv4/fib_trie.c:2124 RCU-list traversed in non-reader section!!
      
       other info that might help us debug this:
      
       rcu_scheduler_active = 2, debug_locks = 1
       1 lock held by ip/834:
        #0: ffffffff85a3b6b0 (rtnl_mutex){+.+.}-{3:3}, at: rtnetlink_rcv_msg+0x49a/0xbd0
      
       stack backtrace:
       CPU: 0 PID: 834 Comm: ip Not tainted 5.9.0-rc1-custom-14233-g2f26e122d62f #129
       Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.13.0-2.fc32 04/01/2014
       Call Trace:
        dump_stack+0x100/0x184
        lockdep_rcu_suspicious+0x143/0x14d
        fib_info_notify_update+0x8d1/0xa60
        __nexthop_replace_notify+0xd2/0x290
        rtm_new_nexthop+0x35e2/0x5946
        rtnetlink_rcv_msg+0x4f7/0xbd0
        netlink_rcv_skb+0x17a/0x480
        rtnetlink_rcv+0x22/0x30
        netlink_unicast+0x5ae/0x890
        netlink_sendmsg+0x98a/0xf40
        ____sys_sendmsg+0x879/0xa00
        ___sys_sendmsg+0x122/0x190
        __sys_sendmsg+0x103/0x1d0
        __x64_sys_sendmsg+0x7d/0xb0
        do_syscall_64+0x32/0x50
        entry_SYSCALL_64_after_hwframe+0x44/0xa9
       RIP: 0033:0x7fde28c3be57
       Code: 0c 00 f7 d8 64 89 02 48 c7 c0 ff ff ff ff eb b7 0f 1f 00 f3 0f 1e fa 64 8b 04 25 18 00 00 00 85 c0 75 10 b8 2e 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 51
      c3 48 83 ec 28 89 54 24 1c 48 89 74 24 10
      RSP: 002b:00007ffc09330028 EFLAGS: 00000246 ORIG_RAX: 000000000000002e
      RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007fde28c3be57
      RDX: 0000000000000000 RSI: 00007ffc09330090 RDI: 0000000000000003
      RBP: 000000005f45f911 R08: 0000000000000001 R09: 00007ffc0933012c
      R10: 0000000000000076 R11: 0000000000000246 R12: 0000000000000001
      R13: 00007ffc09330290 R14: 00007ffc09330eee R15: 00005610e48ed020
      
      Fixes: 1bff1a0c ("ipv4: Add function to send route updates")
      Signed-off-by: default avatarIdo Schimmel <idosch@nvidia.com>
      Reviewed-by: default avatarDavid Ahern <dsahern@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      7f6f32bb
    • Xie He's avatar
      drivers/net/wan/lapbether: Set network_header before transmitting · 91244d10
      Xie He authored
      Set the skb's network_header before it is passed to the underlying
      Ethernet device for transmission.
      
      This patch fixes the following issue:
      
      When we use this driver with AF_PACKET sockets, there would be error
      messages of:
         protocol 0805 is buggy, dev (Ethernet interface name)
      printed in the system "dmesg" log.
      
      This is because skbs passed down to the Ethernet device for transmission
      don't have their network_header properly set, and the dev_queue_xmit_nit
      function in net/core/dev.c complains about this.
      
      Reason of setting the network_header to this place (at the end of the
      Ethernet header, and at the beginning of the Ethernet payload):
      
      Because when this driver receives an skb from the Ethernet device, the
      network_header is also set at this place.
      
      Cc: Martin Schiller <ms@dev.tdt.de>
      Signed-off-by: default avatarXie He <xie.he.0141@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      91244d10