An error occurred fetching the project authors.
  1. 27 Aug, 2024 1 commit
  2. 13 Aug, 2024 1 commit
    • Long Li's avatar
      net: mana: Fix doorbell out of order violation and avoid unnecessary doorbell rings · 58a63729
      Long Li authored
      After napi_complete_done() is called when NAPI is polling in the current
      process context, another NAPI may be scheduled and start running in
      softirq on another CPU and may ring the doorbell before the current CPU
      does. When combined with unnecessary rings when there is no need to arm
      the CQ, it triggers error paths in the hardware.
      
      This patch fixes this by calling napi_complete_done() after doorbell
      rings. It limits the number of unnecessary rings when there is
      no need to arm. MANA hardware specifies that there must be one doorbell
      ring every 8 CQ wraparounds. This driver guarantees one doorbell ring as
      soon as the number of consumed CQEs exceeds 4 CQ wraparounds. In practical
      workloads, the 4 CQ wraparounds proves to be big enough that it rarely
      exceeds this limit before all the napi weight is consumed.
      
      To implement this, add a per-CQ counter cq->work_done_since_doorbell,
      and make sure the CQ is armed as soon as passing 4 wraparounds of the CQ.
      
      Cc: stable@vger.kernel.org
      Fixes: e1b5683f ("net: mana: Move NAPI from EQ to CQ")
      Reviewed-by: default avatarHaiyang Zhang <haiyangz@microsoft.com>
      Signed-off-by: default avatarLong Li <longli@microsoft.com>
      Link: https://patch.msgid.link/1723219138-29887-1-git-send-email-longli@linuxonhyperv.comSigned-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      58a63729
  3. 12 Aug, 2024 1 commit
    • Haiyang Zhang's avatar
      net: mana: Fix RX buf alloc_size alignment and atomic op panic · 32316f67
      Haiyang Zhang authored
      The MANA driver's RX buffer alloc_size is passed into napi_build_skb() to
      create SKB. skb_shinfo(skb) is located at the end of skb, and its alignment
      is affected by the alloc_size passed into napi_build_skb(). The size needs
      to be aligned properly for better performance and atomic operations.
      Otherwise, on ARM64 CPU, for certain MTU settings like 4000, atomic
      operations may panic on the skb_shinfo(skb)->dataref due to alignment fault.
      
      To fix this bug, add proper alignment to the alloc_size calculation.
      
      Sample panic info:
      [  253.298819] Unable to handle kernel paging request at virtual address ffff000129ba5cce
      [  253.300900] Mem abort info:
      [  253.301760]   ESR = 0x0000000096000021
      [  253.302825]   EC = 0x25: DABT (current EL), IL = 32 bits
      [  253.304268]   SET = 0, FnV = 0
      [  253.305172]   EA = 0, S1PTW = 0
      [  253.306103]   FSC = 0x21: alignment fault
      Call trace:
       __skb_clone+0xfc/0x198
       skb_clone+0x78/0xe0
       raw6_local_deliver+0xfc/0x228
       ip6_protocol_deliver_rcu+0x80/0x500
       ip6_input_finish+0x48/0x80
       ip6_input+0x48/0xc0
       ip6_sublist_rcv_finish+0x50/0x78
       ip6_sublist_rcv+0x1cc/0x2b8
       ipv6_list_rcv+0x100/0x150
       __netif_receive_skb_list_core+0x180/0x220
       netif_receive_skb_list_internal+0x198/0x2a8
       __napi_poll+0x138/0x250
       net_rx_action+0x148/0x330
       handle_softirqs+0x12c/0x3a0
      
      Cc: stable@vger.kernel.org
      Fixes: 80f6215b ("net: mana: Add support for jumbo frame")
      Signed-off-by: default avatarHaiyang Zhang <haiyangz@microsoft.com>
      Reviewed-by: default avatarLong Li <longli@microsoft.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      32316f67
  4. 14 Jul, 2024 1 commit
  5. 27 Jun, 2024 1 commit
  6. 19 Jun, 2024 1 commit
  7. 18 Jun, 2024 1 commit
  8. 12 Jun, 2024 1 commit
  9. 07 May, 2024 1 commit
  10. 11 Apr, 2024 1 commit
  11. 04 Apr, 2024 1 commit
    • Haiyang Zhang's avatar
      net: mana: Fix Rx DMA datasize and skb_over_panic · c0de6ab9
      Haiyang Zhang authored
      mana_get_rxbuf_cfg() aligns the RX buffer's DMA datasize to be
      multiple of 64. So a packet slightly bigger than mtu+14, say 1536,
      can be received and cause skb_over_panic.
      
      Sample dmesg:
      [ 5325.237162] skbuff: skb_over_panic: text:ffffffffc043277a len:1536 put:1536 head:ff1100018b517000 data:ff1100018b517100 tail:0x700 end:0x6ea dev:<NULL>
      [ 5325.243689] ------------[ cut here ]------------
      [ 5325.245748] kernel BUG at net/core/skbuff.c:192!
      [ 5325.247838] invalid opcode: 0000 [#1] PREEMPT SMP NOPTI
      [ 5325.258374] RIP: 0010:skb_panic+0x4f/0x60
      [ 5325.302941] Call Trace:
      [ 5325.304389]  <IRQ>
      [ 5325.315794]  ? skb_panic+0x4f/0x60
      [ 5325.317457]  ? asm_exc_invalid_op+0x1f/0x30
      [ 5325.319490]  ? skb_panic+0x4f/0x60
      [ 5325.321161]  skb_put+0x4e/0x50
      [ 5325.322670]  mana_poll+0x6fa/0xb50 [mana]
      [ 5325.324578]  __napi_poll+0x33/0x1e0
      [ 5325.326328]  net_rx_action+0x12e/0x280
      
      As discussed internally, this alignment is not necessary. To fix
      this bug, remove it from the code. So oversized packets will be
      marked as CQE_RX_TRUNCATED by NIC, and dropped.
      
      Cc: stable@vger.kernel.org
      Fixes: 2fbbd712 ("net: mana: Enable RX path to handle various MTU sizes")
      Signed-off-by: default avatarHaiyang Zhang <haiyangz@microsoft.com>
      Reviewed-by: default avatarDexuan Cui <decui@microsoft.com>
      Link: https://lore.kernel.org/r/1712087316-20886-1-git-send-email-haiyangz@microsoft.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      c0de6ab9
  12. 15 Dec, 2023 1 commit
  13. 30 Nov, 2023 1 commit
  14. 28 Nov, 2023 1 commit
  15. 27 Nov, 2023 1 commit
  16. 27 Oct, 2023 1 commit
  17. 05 Oct, 2023 3 commits
  18. 11 Aug, 2023 1 commit
  19. 10 Aug, 2023 1 commit
  20. 07 Aug, 2023 1 commit
  21. 06 Aug, 2023 1 commit
  22. 03 Aug, 2023 1 commit
  23. 19 Jul, 2023 1 commit
  24. 12 Jun, 2023 1 commit
  25. 01 Jun, 2023 1 commit
  26. 30 May, 2023 1 commit
  27. 25 Apr, 2023 2 commits
  28. 14 Apr, 2023 4 commits
  29. 17 Mar, 2023 1 commit
  30. 03 Feb, 2023 1 commit
  31. 06 Dec, 2022 1 commit
  32. 10 Nov, 2022 3 commits