1. 05 10月, 2020 10 次提交
  2. 28 9月, 2020 7 次提交
  3. 21 9月, 2020 4 次提交
  4. 11 9月, 2020 1 次提交
    • J
      net: remove napi_hash_del() from driver-facing API · 5198d545
      Jakub Kicinski 提交于
      We allow drivers to call napi_hash_del() before calling
      netif_napi_del() to batch RCU grace periods. This makes
      the API asymmetric and leaks internal implementation details.
      Soon we will want the grace period to protect more than just
      the NAPI hash table.
      
      Restructure the API and have drivers call a new function -
      __netif_napi_del() if they want to take care of RCU waits.
      
      Note that only core was checking the return status from
      napi_hash_del() so the new helper does not report if the
      NAPI was actually deleted.
      
      Some notes on driver oddness:
       - veth observed the grace period before calling netif_napi_del()
         but that should not matter
       - myri10ge observed normal RCU flavor
       - bnx2x and enic did not actually observe the grace period
         (unless they did so implicitly)
       - virtio_net and enic only unhashed Rx NAPIs
      
      The last two points seem to indicate that the calls to
      napi_hash_del() were a left over rather than an optimization.
      Regardless, it's easy enough to correct them.
      
      This patch may introduce extra synchronize_net() calls for
      interfaces which set NAPI_STATE_NO_BUSY_POLL and depend on
      free_netdev() to call netif_napi_del(). This seems inevitable
      since we want to use RCU for netpoll dev->napi_list traversal,
      and almost no drivers set IFF_DISABLE_NETPOLL.
      Signed-off-by: NJakub Kicinski <kuba@kernel.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      5198d545
  5. 08 9月, 2020 2 次提交
  6. 27 8月, 2020 1 次提交
    • J
      bnxt: don't enable NAPI until rings are ready · 96ecdcc9
      Jakub Kicinski 提交于
      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: NRob Sherwood <rsher@fb.com>
      Fixes: c0c050c5 ("bnxt_en: New Broadcom ethernet driver.")
      Signed-off-by: NJakub Kicinski <kuba@kernel.org>
      Reviewed-by: NMichael Chan <michael.chan@broadcom.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      96ecdcc9
  7. 26 8月, 2020 5 次提交
  8. 24 8月, 2020 1 次提交
  9. 31 7月, 2020 1 次提交
  10. 28 7月, 2020 8 次提交