1. 10 6月, 2021 1 次提交
    • M
      ice: add ndo_bpf callback for safe mode netdev ops · ebc5399e
      Maciej Fijalkowski 提交于
      ice driver requires a programmable pipeline firmware package in order to
      have a support for advanced features. Otherwise, driver falls back to so
      called 'safe mode'. For that mode, ndo_bpf callback is not exposed and
      when user tries to load XDP program, the following happens:
      
      $ sudo ./xdp1 enp179s0f1
      libbpf: Kernel error message: Underlying driver does not support XDP in native mode
      link set xdp fd failed
      
      which is sort of confusing, as there is a native XDP support, but not in
      the current mode. Improve the user experience by providing the specific
      ndo_bpf callback dedicated for safe mode which will make use of extack
      to explicitly let the user know that the DDP package is missing and
      that's the reason that the XDP can't be loaded onto interface currently.
      
      Cc: Jamal Hadi Salim <jhs@mojatatu.com>
      Fixes: efc2214b ("ice: Add support for XDP")
      Signed-off-by: NMaciej Fijalkowski <maciej.fijalkowski@intel.com>
      Tested-by: NKiran Bhandare <kiranx.bhandare@intel.com>
      Signed-off-by: NTony Nguyen <anthony.l.nguyen@intel.com>
      ebc5399e
  2. 04 6月, 2021 5 次提交
  3. 03 6月, 2021 2 次提交
    • M
      ice: track AF_XDP ZC enabled queues in bitmap · e102db78
      Maciej Fijalkowski 提交于
      Commit c7a21904 ("ice: Remove xsk_buff_pool from VSI structure")
      silently introduced a regression and broke the Tx side of AF_XDP in copy
      mode. xsk_pool on ice_ring is set only based on the existence of the XDP
      prog on the VSI which in turn picks ice_clean_tx_irq_zc to be executed.
      That is not something that should happen for copy mode as it should use
      the regular data path ice_clean_tx_irq.
      
      This results in a following splat when xdpsock is run in txonly or l2fwd
      scenarios in copy mode:
      
      <snip>
      [  106.050195] BUG: kernel NULL pointer dereference, address: 0000000000000030
      [  106.057269] #PF: supervisor read access in kernel mode
      [  106.062493] #PF: error_code(0x0000) - not-present page
      [  106.067709] PGD 0 P4D 0
      [  106.070293] Oops: 0000 [#1] PREEMPT SMP NOPTI
      [  106.074721] CPU: 61 PID: 0 Comm: swapper/61 Not tainted 5.12.0-rc2+ #45
      [  106.081436] Hardware name: Intel Corporation S2600WFT/S2600WFT, BIOS SE5C620.86B.02.01.0008.031920191559 03/19/2019
      [  106.092027] RIP: 0010:xp_raw_get_dma+0x36/0x50
      [  106.096551] Code: 74 14 48 b8 ff ff ff ff ff ff 00 00 48 21 f0 48 c1 ee 30 48 01 c6 48 8b 87 90 00 00 00 48 89 f2 81 e6 ff 0f 00 00 48 c1 ea 0c <48> 8b 04 d0 48 83 e0 fe 48 01 f0 c3 66 66 2e 0f 1f 84 00 00 00 00
      [  106.115588] RSP: 0018:ffffc9000d694e50 EFLAGS: 00010206
      [  106.120893] RAX: 0000000000000000 RBX: ffff88984b8c8a00 RCX: ffff889852581800
      [  106.128137] RDX: 0000000000000006 RSI: 0000000000000000 RDI: ffff88984cd8b800
      [  106.135383] RBP: ffff888123b50001 R08: ffff889896800000 R09: 0000000000000800
      [  106.142628] R10: 0000000000000000 R11: ffffffff826060c0 R12: 00000000000000ff
      [  106.149872] R13: 0000000000000000 R14: 0000000000000040 R15: ffff888123b50018
      [  106.157117] FS:  0000000000000000(0000) GS:ffff8897e0f40000(0000) knlGS:0000000000000000
      [  106.165332] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      [  106.171163] CR2: 0000000000000030 CR3: 000000000560a004 CR4: 00000000007706e0
      [  106.178408] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
      [  106.185653] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
      [  106.192898] PKRU: 55555554
      [  106.195653] Call Trace:
      [  106.198143]  <IRQ>
      [  106.200196]  ice_clean_tx_irq_zc+0x183/0x2a0 [ice]
      [  106.205087]  ice_napi_poll+0x3e/0x590 [ice]
      [  106.209356]  __napi_poll+0x2a/0x160
      [  106.212911]  net_rx_action+0xd6/0x200
      [  106.216634]  __do_softirq+0xbf/0x29b
      [  106.220274]  irq_exit_rcu+0x88/0xc0
      [  106.223819]  common_interrupt+0x7b/0xa0
      [  106.227719]  </IRQ>
      [  106.229857]  asm_common_interrupt+0x1e/0x40
      </snip>
      
      Fix this by introducing the bitmap of queues that are zero-copy enabled,
      where each bit, corresponding to a queue id that xsk pool is being
      configured on, will be set/cleared within ice_xsk_pool_{en,dis}able and
      checked within ice_xsk_pool(). The latter is a function used for
      deciding which napi poll routine is executed.
      Idea is being taken from our other drivers such as i40e and ixgbe.
      
      Fixes: c7a21904 ("ice: Remove xsk_buff_pool from VSI structure")
      Signed-off-by: NMaciej Fijalkowski <maciej.fijalkowski@intel.com>
      Tested-by: NKiran Bhandare <kiranx.bhandare@intel.com>
      Signed-off-by: NTony Nguyen <anthony.l.nguyen@intel.com>
      e102db78
    • M
      ice: add correct exception tracing for XDP · 89d65df0
      Magnus Karlsson 提交于
      Add missing exception tracing to XDP when a number of different
      errors can occur. The support was only partial. Several errors
      where not logged which would confuse the user quite a lot not
      knowing where and why the packets disappeared.
      
      Fixes: efc2214b ("ice: Add support for XDP")
      Fixes: 2d4238f5 ("ice: Add support for AF_XDP")
      Reported-by: NJesper Dangaard Brouer <brouer@redhat.com>
      Signed-off-by: NMagnus Karlsson <magnus.karlsson@intel.com>
      Tested-by: NKiran Bhandare <kiranx.bhandare@intel.com>
      Signed-off-by: NTony Nguyen <anthony.l.nguyen@intel.com>
      89d65df0
  4. 23 4月, 2021 7 次提交
  5. 15 4月, 2021 15 次提交
  6. 14 4月, 2021 1 次提交
  7. 09 4月, 2021 1 次提交
    • Y
      ice: fix memory leak of aRFS after resuming from suspend · 1831da7e
      Yongxin Liu 提交于
      In ice_suspend(), ice_clear_interrupt_scheme() is called, and then
      irq_free_descs() will be eventually called to free irq and its descriptor.
      
      In ice_resume(), ice_init_interrupt_scheme() is called to allocate new
      irqs. However, in ice_rebuild_arfs(), struct irq_glue and struct cpu_rmap
      maybe cannot be freed, if the irqs that released in ice_suspend() were
      reassigned to other devices, which makes irq descriptor's affinity_notify
      lost.
      
      So call ice_free_cpu_rx_rmap() before ice_clear_interrupt_scheme(), which
      can make sure all irq_glue and cpu_rmap can be correctly released before
      corresponding irq and descriptor are released.
      
      Fix the following memory leak.
      
      unreferenced object 0xffff95bd951afc00 (size 512):
        comm "kworker/0:1", pid 134, jiffies 4294684283 (age 13051.958s)
        hex dump (first 32 bytes):
          18 00 00 00 18 00 18 00 70 fc 1a 95 bd 95 ff ff  ........p.......
          00 00 ff ff 01 00 ff ff 02 00 ff ff 03 00 ff ff  ................
        backtrace:
          [<0000000072e4b914>] __kmalloc+0x336/0x540
          [<0000000054642a87>] alloc_cpu_rmap+0x3b/0xb0
          [<00000000f220deec>] ice_set_cpu_rx_rmap+0x6a/0x110 [ice]
          [<000000002370a632>] ice_probe+0x941/0x1180 [ice]
          [<00000000d692edba>] local_pci_probe+0x47/0xa0
          [<00000000503934f0>] work_for_cpu_fn+0x1a/0x30
          [<00000000555a9e4a>] process_one_work+0x1dd/0x410
          [<000000002c4b414a>] worker_thread+0x221/0x3f0
          [<00000000bb2b556b>] kthread+0x14c/0x170
          [<00000000ad2cf1cd>] ret_from_fork+0x1f/0x30
      unreferenced object 0xffff95bd81b0a2a0 (size 96):
        comm "kworker/0:1", pid 134, jiffies 4294684283 (age 13051.958s)
        hex dump (first 32 bytes):
          38 00 00 00 01 00 00 00 e0 ff ff ff 0f 00 00 00  8...............
          b0 a2 b0 81 bd 95 ff ff b0 a2 b0 81 bd 95 ff ff  ................
        backtrace:
          [<00000000582dd5c5>] kmem_cache_alloc_trace+0x31f/0x4c0
          [<000000002659850d>] irq_cpu_rmap_add+0x25/0xe0
          [<00000000495a3055>] ice_set_cpu_rx_rmap+0xb4/0x110 [ice]
          [<000000002370a632>] ice_probe+0x941/0x1180 [ice]
          [<00000000d692edba>] local_pci_probe+0x47/0xa0
          [<00000000503934f0>] work_for_cpu_fn+0x1a/0x30
          [<00000000555a9e4a>] process_one_work+0x1dd/0x410
          [<000000002c4b414a>] worker_thread+0x221/0x3f0
          [<00000000bb2b556b>] kthread+0x14c/0x170
          [<00000000ad2cf1cd>] ret_from_fork+0x1f/0x30
      
      Fixes: 769c500d ("ice: Add advanced power mgmt for WoL")
      Signed-off-by: NYongxin Liu <yongxin.liu@windriver.com>
      Tested-by: NTony Brelinski <tonyx.brelinski@intel.com>
      Signed-off-by: NTony Nguyen <anthony.l.nguyen@intel.com>
      1831da7e
  8. 08 4月, 2021 8 次提交