1. 21 8月, 2023 1 次提交
    • A
      ice: Do not use WQ_MEM_RECLAIM flag for workqueue · ec5359ca
      Anirudh Venkataramanan 提交于
      stable inclusion
      from stable-v5.10.168
      commit 1ad4112c9fcf0bc08222b2b1614fba52ffd12255
      category: bugfix
      bugzilla: https://gitee.com/openeuler/kernel/issues/I7URR4
      
      Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=1ad4112c9fcf0bc08222b2b1614fba52ffd12255
      
      ----------------------------------------------------
      
      [ Upstream commit 4d159f78 ]
      
      When both ice and the irdma driver are loaded, a warning in
      check_flush_dependency is being triggered. This is due to ice driver
      workqueue being allocated with the WQ_MEM_RECLAIM flag and the irdma one
      is not.
      
      According to kernel documentation, this flag should be set if the
      workqueue will be involved in the kernel's memory reclamation flow.
      Since it is not, there is no need for the ice driver's WQ to have this
      flag set so remove it.
      
      Example trace:
      
      [  +0.000004] workqueue: WQ_MEM_RECLAIM ice:ice_service_task [ice] is flushing !WQ_MEM_RECLAIM infiniband:0x0
      [  +0.000139] WARNING: CPU: 0 PID: 728 at kernel/workqueue.c:2632 check_flush_dependency+0x178/0x1a0
      [  +0.000011] Modules linked in: bonding tls xt_CHECKSUM xt_MASQUERADE xt_conntrack ipt_REJECT nf_reject_ipv4 nft_compat nft_cha
      in_nat nf_nat nf_conntrack nf_defrag_ipv6 nf_defrag_ipv4 nf_tables nfnetlink bridge stp llc rfkill vfat fat intel_rapl_msr intel
      _rapl_common isst_if_common skx_edac nfit libnvdimm x86_pkg_temp_thermal intel_powerclamp coretemp kvm_intel kvm irqbypass crct1
      0dif_pclmul crc32_pclmul ghash_clmulni_intel rapl intel_cstate rpcrdma sunrpc rdma_ucm ib_srpt ib_isert iscsi_target_mod target_
      core_mod ib_iser libiscsi scsi_transport_iscsi rdma_cm ib_cm iw_cm iTCO_wdt iTCO_vendor_support ipmi_ssif irdma mei_me ib_uverbs
      ib_core intel_uncore joydev pcspkr i2c_i801 acpi_ipmi mei lpc_ich i2c_smbus intel_pch_thermal ioatdma ipmi_si acpi_power_meter
      acpi_pad xfs libcrc32c sd_mod t10_pi crc64_rocksoft crc64 sg ahci ixgbe libahci ice i40e igb crc32c_intel mdio i2c_algo_bit liba
      ta dca wmi dm_mirror dm_region_hash dm_log dm_mod ipmi_devintf ipmi_msghandler fuse
      [  +0.000161]  [last unloaded: bonding]
      [  +0.000006] CPU: 0 PID: 728 Comm: kworker/0:2 Tainted: G S                 6.2.0-rc2_next-queue-13jan-00458-gc20aabd57164 #1
      [  +0.000006] Hardware name: Intel Corporation S2600WFT/S2600WFT, BIOS SE5C620.86B.02.01.0010.010620200716 01/06/2020
      [  +0.000003] Workqueue: ice ice_service_task [ice]
      [  +0.000127] RIP: 0010:check_flush_dependency+0x178/0x1a0
      [  +0.000005] Code: 89 8e 02 01 e8 49 3d 40 00 49 8b 55 18 48 8d 8d d0 00 00 00 48 8d b3 d0 00 00 00 4d 89 e0 48 c7 c7 e0 3b 08
      9f e8 bb d3 07 01 <0f> 0b e9 be fe ff ff 80 3d 24 89 8e 02 00 0f 85 6b ff ff ff e9 06
      [  +0.000004] RSP: 0018:ffff88810a39f990 EFLAGS: 00010282
      [  +0.000005] RAX: 0000000000000000 RBX: ffff888141bc2400 RCX: 0000000000000000
      [  +0.000004] RDX: 0000000000000001 RSI: dffffc0000000000 RDI: ffffffffa1213a80
      [  +0.000003] RBP: ffff888194bf3400 R08: ffffed117b306112 R09: ffffed117b306112
      [  +0.000003] R10: ffff888bd983088b R11: ffffed117b306111 R12: 0000000000000000
      [  +0.000003] R13: ffff888111f84d00 R14: ffff88810a3943ac R15: ffff888194bf3400
      [  +0.000004] FS:  0000000000000000(0000) GS:ffff888bd9800000(0000) knlGS:0000000000000000
      [  +0.000003] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      [  +0.000003] CR2: 000056035b208b60 CR3: 000000017795e005 CR4: 00000000007706f0
      [  +0.000003] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
      [  +0.000003] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
      [  +0.000002] PKRU: 55555554
      [  +0.000003] Call Trace:
      [  +0.000002]  <TASK>
      [  +0.000003]  __flush_workqueue+0x203/0x840
      [  +0.000006]  ? mutex_unlock+0x84/0xd0
      [  +0.000008]  ? __pfx_mutex_unlock+0x10/0x10
      [  +0.000004]  ? __pfx___flush_workqueue+0x10/0x10
      [  +0.000006]  ? mutex_lock+0xa3/0xf0
      [  +0.000005]  ib_cache_cleanup_one+0x39/0x190 [ib_core]
      [  +0.000174]  __ib_unregister_device+0x84/0xf0 [ib_core]
      [  +0.000094]  ib_unregister_device+0x25/0x30 [ib_core]
      [  +0.000093]  irdma_ib_unregister_device+0x97/0xc0 [irdma]
      [  +0.000064]  ? __pfx_irdma_ib_unregister_device+0x10/0x10 [irdma]
      [  +0.000059]  ? up_write+0x5c/0x90
      [  +0.000005]  irdma_remove+0x36/0x90 [irdma]
      [  +0.000062]  auxiliary_bus_remove+0x32/0x50
      [  +0.000007]  device_release_driver_internal+0xfa/0x1c0
      [  +0.000005]  bus_remove_device+0x18a/0x260
      [  +0.000007]  device_del+0x2e5/0x650
      [  +0.000005]  ? __pfx_device_del+0x10/0x10
      [  +0.000003]  ? mutex_unlock+0x84/0xd0
      [  +0.000004]  ? __pfx_mutex_unlock+0x10/0x10
      [  +0.000004]  ? _raw_spin_unlock+0x18/0x40
      [  +0.000005]  ice_unplug_aux_dev+0x52/0x70 [ice]
      [  +0.000160]  ice_service_task+0x1309/0x14f0 [ice]
      [  +0.000134]  ? __pfx___schedule+0x10/0x10
      [  +0.000006]  process_one_work+0x3b1/0x6c0
      [  +0.000008]  worker_thread+0x69/0x670
      [  +0.000005]  ? __kthread_parkme+0xec/0x110
      [  +0.000007]  ? __pfx_worker_thread+0x10/0x10
      [  +0.000005]  kthread+0x17f/0x1b0
      [  +0.000005]  ? __pfx_kthread+0x10/0x10
      [  +0.000004]  ret_from_fork+0x29/0x50
      [  +0.000009]  </TASK>
      
      Fixes: 940b61af ("ice: Initialize PF and setup miscellaneous interrupt")
      Signed-off-by: NAnirudh Venkataramanan <anirudh.venkataramanan@intel.com>
      Signed-off-by: NMarcin Szycik <marcin.szycik@linux.intel.com>
      Tested-by: NJakub Andrysiak <jakub.andrysiak@intel.com>
      Signed-off-by: NTony Nguyen <anthony.l.nguyen@intel.com>
      Reviewed-by: NLeon Romanovsky <leonro@nvidia.com>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      Signed-off-by: Nzhaoxiaoqiang11 <zhaoxiaoqiang11@jd.com>
      ec5359ca
  2. 13 2月, 2023 1 次提交
  3. 10 11月, 2022 1 次提交
  4. 17 8月, 2022 1 次提交
  5. 18 7月, 2022 1 次提交
  6. 07 6月, 2022 1 次提交
  7. 28 5月, 2022 1 次提交
  8. 19 5月, 2022 1 次提交
  9. 14 1月, 2022 3 次提交
    • J
      ice: ignore dropped packets during init · 1cb3036f
      Jesse Brandeburg 提交于
      stable inclusion
      from stable-v5.10.85
      commit a59df4ea7155a34e6ed1b590cace91a3e0c19cf0
      bugzilla: 186032 https://gitee.com/openeuler/kernel/issues/I4QVI4
      
      Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=a59df4ea7155a34e6ed1b590cace91a3e0c19cf0
      
      --------------------------------
      
      commit 28dc1b86 upstream.
      
      If the hardware is constantly receiving unicast or broadcast packets
      during driver load, the device previously counted many GLV_RDPC (VSI
      dropped packets) events during init. This causes confusing dropped
      packet statistics during driver load. The dropped packets counter
      incrementing does stop once the driver finishes loading.
      
      Avoid this problem by baselining our statistics at the end of driver
      open instead of the end of probe.
      
      Fixes: cdedef59 ("ice: Configure VSIs for Tx/Rx")
      Signed-off-by: NJesse Brandeburg <jesse.brandeburg@intel.com>
      Tested-by: NGurucharan G <gurucharanx.g@intel.com>
      Signed-off-by: NTony Nguyen <anthony.l.nguyen@intel.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      Signed-off-by: NChen Jun <chenjun102@huawei.com>
      Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
      1cb3036f
    • M
      ice: avoid bpf_prog refcount underflow · cb0055a8
      Marta Plantykow 提交于
      stable inclusion
      from stable-v5.10.83
      commit e65a8707b4cd756d26d246bb2b9fab06eebafac1
      bugzilla: 185879 https://gitee.com/openeuler/kernel/issues/I4QUVG
      
      Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=e65a8707b4cd756d26d246bb2b9fab06eebafac1
      
      --------------------------------
      
      [ Upstream commit f65ee535 ]
      
      Ice driver has the routines for managing XDP resources that are shared
      between ndo_bpf op and VSI rebuild flow. The latter takes place for
      example when user changes queue count on an interface via ethtool's
      set_channels().
      
      There is an issue around the bpf_prog refcounting when VSI is being
      rebuilt - since ice_prepare_xdp_rings() is called with vsi->xdp_prog as
      an argument that is used later on by ice_vsi_assign_bpf_prog(), same
      bpf_prog pointers are swapped with each other. Then it is also
      interpreted as an 'old_prog' which in turn causes us to call
      bpf_prog_put on it that will decrement its refcount.
      
      Below splat can be interpreted in a way that due to zero refcount of a
      bpf_prog it is wiped out from the system while kernel still tries to
      refer to it:
      
      [  481.069429] BUG: unable to handle page fault for address: ffffc9000640f038
      [  481.077390] #PF: supervisor read access in kernel mode
      [  481.083335] #PF: error_code(0x0000) - not-present page
      [  481.089276] PGD 100000067 P4D 100000067 PUD 1001cb067 PMD 106d2b067 PTE 0
      [  481.097141] Oops: 0000 [#1] PREEMPT SMP PTI
      [  481.101980] CPU: 12 PID: 3339 Comm: sudo Tainted: G           OE     5.15.0-rc5+ #1
      [  481.110840] Hardware name: Intel Corp. GRANTLEY/GRANTLEY, BIOS GRRFCRB1.86B.0276.D07.1605190235 05/19/2016
      [  481.122021] RIP: 0010:dev_xdp_prog_id+0x25/0x40
      [  481.127265] Code: 80 00 00 00 00 0f 1f 44 00 00 89 f6 48 c1 e6 04 48 01 fe 48 8b 86 98 08 00 00 48 85 c0 74 13 48 8b 50 18 31 c0 48 85 d2 74 07 <48> 8b 42 38 8b 40 20 c3 48 8b 96 90 08 00 00 eb e8 66 2e 0f 1f 84
      [  481.148991] RSP: 0018:ffffc90007b63868 EFLAGS: 00010286
      [  481.155034] RAX: 0000000000000000 RBX: ffff889080824000 RCX: 0000000000000000
      [  481.163278] RDX: ffffc9000640f000 RSI: ffff889080824010 RDI: ffff889080824000
      [  481.171527] RBP: ffff888107af7d00 R08: 0000000000000000 R09: ffff88810db5f6e0
      [  481.179776] R10: 0000000000000000 R11: ffff8890885b9988 R12: ffff88810db5f4bc
      [  481.188026] R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000
      [  481.196276] FS:  00007f5466d5bec0(0000) GS:ffff88903fb00000(0000) knlGS:0000000000000000
      [  481.205633] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      [  481.212279] CR2: ffffc9000640f038 CR3: 000000014429c006 CR4: 00000000003706e0
      [  481.220530] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
      [  481.228771] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
      [  481.237029] Call Trace:
      [  481.239856]  rtnl_fill_ifinfo+0x768/0x12e0
      [  481.244602]  rtnl_dump_ifinfo+0x525/0x650
      [  481.249246]  ? __alloc_skb+0xa5/0x280
      [  481.253484]  netlink_dump+0x168/0x3c0
      [  481.257725]  netlink_recvmsg+0x21e/0x3e0
      [  481.262263]  ____sys_recvmsg+0x87/0x170
      [  481.266707]  ? __might_fault+0x20/0x30
      [  481.271046]  ? _copy_from_user+0x66/0xa0
      [  481.275591]  ? iovec_from_user+0xf6/0x1c0
      [  481.280226]  ___sys_recvmsg+0x82/0x100
      [  481.284566]  ? sock_sendmsg+0x5e/0x60
      [  481.288791]  ? __sys_sendto+0xee/0x150
      [  481.293129]  __sys_recvmsg+0x56/0xa0
      [  481.297267]  do_syscall_64+0x3b/0xc0
      [  481.301395]  entry_SYSCALL_64_after_hwframe+0x44/0xae
      [  481.307238] RIP: 0033:0x7f5466f39617
      [  481.311373] Code: 0c 00 f7 d8 64 89 02 48 c7 c0 ff ff ff ff eb bd 0f 1f 00 f3 0f 1e fa 64 8b 04 25 18 00 00 00 85 c0 75 10 b8 2f 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
      [  481.342944] RSP: 002b:00007ffedc7f4308 EFLAGS: 00000246 ORIG_RAX: 000000000000002f
      [  481.361783] RAX: ffffffffffffffda RBX: 00007ffedc7f5460 RCX: 00007f5466f39617
      [  481.380278] RDX: 0000000000000000 RSI: 00007ffedc7f5360 RDI: 0000000000000003
      [  481.398500] RBP: 00007ffedc7f53f0 R08: 0000000000000000 R09: 000055d556f04d50
      [  481.416463] R10: 0000000000000077 R11: 0000000000000246 R12: 00007ffedc7f5360
      [  481.434131] R13: 00007ffedc7f5350 R14: 00007ffedc7f5344 R15: 0000000000000e98
      [  481.451520] Modules linked in: ice(OE) af_packet binfmt_misc nls_iso8859_1 ipmi_ssif intel_rapl_msr intel_rapl_common x86_pkg_temp_thermal intel_powerclamp mxm_wmi mei_me coretemp mei ipmi_si ipmi_msghandler wmi acpi_pad acpi_power_meter ip_tables x_tables autofs4 crct10dif_pclmul crc32_pclmul ghash_clmulni_intel aesni_intel ahci crypto_simd cryptd libahci lpc_ich [last unloaded: ice]
      [  481.528558] CR2: ffffc9000640f038
      [  481.542041] ---[ end trace d1f24c9ecf5b61c1 ]---
      
      Fix this by only calling ice_vsi_assign_bpf_prog() inside
      ice_prepare_xdp_rings() when current vsi->xdp_prog pointer is NULL.
      This way set_channels() flow will not attempt to swap the vsi->xdp_prog
      pointers with itself.
      
      Also, sprinkle around some comments that provide a reasoning about
      correlation between driver and kernel in terms of bpf_prog refcount.
      
      Fixes: efc2214b ("ice: Add support for XDP")
      Reviewed-by: NAlexander Lobakin <alexandr.lobakin@intel.com>
      Signed-off-by: NMarta Plantykow <marta.a.plantykow@intel.com>
      Co-developed-by: NMaciej Fijalkowski <maciej.fijalkowski@intel.com>
      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>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      Signed-off-by: NChen Jun <chenjun102@huawei.com>
      Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
      cb0055a8
    • L
      ice: Delete always true check of PF pointer · c97cc2a5
      Leon Romanovsky 提交于
      stable inclusion
      form stable-v5.10.82
      commit cade5d7a28037d8f36dab275163575613dd42af3
      bugzilla: 185877 https://gitee.com/openeuler/kernel/issues/I4QU6V
      
      Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=cade5d7a28037d8f36dab275163575613dd42af3
      
      --------------------------------
      
      commit 2ff04286 upstream.
      
      PF pointer is always valid when PCI core calls its .shutdown() and
      .remove() callbacks. There is no need to check it again.
      
      Fixes: 837f08fd ("ice: Add basic driver framework for Intel(R) E800 Series")
      Signed-off-by: NLeon Romanovsky <leonro@nvidia.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      Signed-off-by: NChen Jun <chenjun102@huawei.com>
      Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
      c97cc2a5
  10. 15 11月, 2021 1 次提交
  11. 19 10月, 2021 3 次提交
    • B
      ice: Only lock to update netdev dev_addr · 16961e8a
      Brett Creeley 提交于
      stable inclusion
      from stable-5.10.65
      commit baecab8c469f45e0b56695a2921eb908cc446052
      bugzilla: 182361 https://gitee.com/openeuler/kernel/issues/I4EH3U
      
      Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=baecab8c469f45e0b56695a2921eb908cc446052
      
      --------------------------------
      
      [ Upstream commit b357d971 ]
      
      commit 3ba7f53f ("ice: don't remove netdev->dev_addr from uc sync
      list") introduced calls to netif_addr_lock_bh() and
      netif_addr_unlock_bh() in the driver's ndo_set_mac() callback. This is
      fine since the driver is updated the netdev's dev_addr, but since this
      is a spinlock, the driver cannot sleep when the lock is held.
      Unfortunately the functions to add/delete MAC filters depend on a mutex.
      This was causing a trace with the lock debug kernel config options
      enabled when changing the mac address via iproute.
      
      [  203.273059] BUG: sleeping function called from invalid context at kernel/locking/mutex.c:281
      [  203.273065] in_atomic(): 1, irqs_disabled(): 0, non_block: 0, pid: 6698, name: ip
      [  203.273068] Preemption disabled at:
      [  203.273068] [<ffffffffc04aaeab>] ice_set_mac_address+0x8b/0x1c0 [ice]
      [  203.273097] CPU: 31 PID: 6698 Comm: ip Tainted: G S      W I       5.14.0-rc4 #2
      [  203.273100] Hardware name: Intel Corporation S2600WFT/S2600WFT, BIOS SE5C620.86B.02.01.0010.010620200716 01/06/2020
      [  203.273102] Call Trace:
      [  203.273107]  dump_stack_lvl+0x33/0x42
      [  203.273113]  ? ice_set_mac_address+0x8b/0x1c0 [ice]
      [  203.273124]  ___might_sleep.cold.150+0xda/0xea
      [  203.273131]  mutex_lock+0x1c/0x40
      [  203.273136]  ice_remove_mac+0xe3/0x180 [ice]
      [  203.273155]  ? ice_fltr_add_mac_list+0x20/0x20 [ice]
      [  203.273175]  ice_fltr_prepare_mac+0x43/0xa0 [ice]
      [  203.273194]  ice_set_mac_address+0xab/0x1c0 [ice]
      [  203.273206]  dev_set_mac_address+0xb8/0x120
      [  203.273210]  dev_set_mac_address_user+0x2c/0x50
      [  203.273212]  do_setlink+0x1dd/0x10e0
      [  203.273217]  ? __nla_validate_parse+0x12d/0x1a0
      [  203.273221]  __rtnl_newlink+0x530/0x910
      [  203.273224]  ? __kmalloc_node_track_caller+0x17f/0x380
      [  203.273230]  ? preempt_count_add+0x68/0xa0
      [  203.273236]  ? _raw_spin_lock_irqsave+0x1f/0x30
      [  203.273241]  ? kmem_cache_alloc_trace+0x4d/0x440
      [  203.273244]  rtnl_newlink+0x43/0x60
      [  203.273245]  rtnetlink_rcv_msg+0x13a/0x380
      [  203.273248]  ? rtnl_calcit.isra.40+0x130/0x130
      [  203.273250]  netlink_rcv_skb+0x4e/0x100
      [  203.273256]  netlink_unicast+0x1a2/0x280
      [  203.273258]  netlink_sendmsg+0x242/0x490
      [  203.273260]  sock_sendmsg+0x58/0x60
      [  203.273263]  ____sys_sendmsg+0x1ef/0x260
      [  203.273265]  ? copy_msghdr_from_user+0x5c/0x90
      [  203.273268]  ? ____sys_recvmsg+0xe6/0x170
      [  203.273270]  ___sys_sendmsg+0x7c/0xc0
      [  203.273272]  ? copy_msghdr_from_user+0x5c/0x90
      [  203.273274]  ? ___sys_recvmsg+0x89/0xc0
      [  203.273276]  ? __netlink_sendskb+0x50/0x50
      [  203.273278]  ? mod_objcg_state+0xee/0x310
      [  203.273282]  ? __dentry_kill+0x114/0x170
      [  203.273286]  ? get_max_files+0x10/0x10
      [  203.273288]  __sys_sendmsg+0x57/0xa0
      [  203.273290]  do_syscall_64+0x37/0x80
      [  203.273295]  entry_SYSCALL_64_after_hwframe+0x44/0xae
      [  203.273296] RIP: 0033:0x7f8edf96e278
      [  203.273298] Code: 89 02 48 c7 c0 ff ff ff ff eb b5 0f 1f 80 00 00 00 00 f3 0f 1e fa 48 8d 05 25 63 2c 00 8b 00 85 c0 75 17 b8 2e 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 58 c3 0f 1f 80 00 00 00 00 41 54 41 89 d4 55
      [  203.273300] RSP: 002b:00007ffcb8bdac08 EFLAGS: 00000246 ORIG_RAX: 000000000000002e
      [  203.273303] RAX: ffffffffffffffda RBX: 000000006115e0ae RCX: 00007f8edf96e278
      [  203.273304] RDX: 0000000000000000 RSI: 00007ffcb8bdac70 RDI: 0000000000000003
      [  203.273305] RBP: 0000000000000000 R08: 0000000000000001 R09: 00007ffcb8bda5b0
      [  203.273306] R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001
      [  203.273306] R13: 0000555e10092020 R14: 0000000000000000 R15: 0000000000000005
      
      Fix this by only locking when changing the netdev->dev_addr. Also, make
      sure to restore the old netdev->dev_addr on any failures.
      
      Fixes: 3ba7f53f ("ice: don't remove netdev->dev_addr from uc sync list")
      Signed-off-by: NBrett Creeley <brett.creeley@intel.com>
      Tested-by: NGurucharan G <gurucharanx.g@intel.com>
      Signed-off-by: NTony Nguyen <anthony.l.nguyen@intel.com>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      Signed-off-by: NChen Jun <chenjun102@huawei.com>
      Acked-by: NWeilong Chen <chenweilong@huawei.com>
      Signed-off-by: NChen Jun <chenjun102@huawei.com>
      Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
      16961e8a
    • B
      ice: don't remove netdev->dev_addr from uc sync list · ca29ca36
      Brett Creeley 提交于
      stable inclusion
      from stable-5.10.60
      commit a6192bae12e40e5f6d9e104691ae491a501cf1cd
      bugzilla: 177018 https://gitee.com/openeuler/kernel/issues/I4EAUG
      
      Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=a6192bae12e40e5f6d9e104691ae491a501cf1cd
      
      --------------------------------
      
      [ Upstream commit 3ba7f53f ]
      
      In some circumstances, such as with bridging, it's possible that the
      stack will add the device's own MAC address to its unicast address list.
      
      If, later, the stack deletes this address, the driver will receive a
      request to remove this address.
      
      The driver stores its current MAC address as part of the VSI MAC filter
      list instead of separately. So, this causes a problem when the device's
      MAC address is deleted unexpectedly, which results in traffic failure in
      some cases.
      
      The following configuration steps will reproduce the previously
      mentioned problem:
      
      > ip link set eth0 up
      > ip link add dev br0 type bridge
      > ip link set br0 up
      > ip addr flush dev eth0
      > ip link set eth0 master br0
      > echo 1 > /sys/class/net/br0/bridge/vlan_filtering
      > modprobe -r veth
      > modprobe -r bridge
      > ip addr add 192.168.1.100/24 dev eth0
      
      The following ping command fails due to the netdev->dev_addr being
      deleted when removing the bridge module.
      > ping <link partner>
      
      Fix this by making sure to not delete the netdev->dev_addr during MAC
      address sync. After fixing this issue it was noticed that the
      netdev_warn() in .set_mac was overly verbose, so make it at
      netdev_dbg().
      
      Also, there is a possibility of a race condition between .set_mac and
      .set_rx_mode. Fix this by calling netif_addr_lock_bh() and
      netif_addr_unlock_bh() on the device's netdev when the netdev->dev_addr
      is going to be updated in .set_mac.
      
      Fixes: e94d4478 ("ice: Implement filter sync, NDO operations and bump version")
      Signed-off-by: NBrett Creeley <brett.creeley@intel.com>
      Tested-by: NLiang Li <liali@redhat.com>
      Tested-by: NGurucharan G <gurucharanx.g@intel.com>
      Signed-off-by: NTony Nguyen <anthony.l.nguyen@intel.com>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      Signed-off-by: NChen Jun <chenjun102@huawei.com>
      Acked-by: NWeilong Chen <chenweilong@huawei.com>
      Signed-off-by: NChen Jun <chenjun102@huawei.com>
      Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
      ca29ca36
    • A
      ice: Prevent probing virtual functions · 32146f17
      Anirudh Venkataramanan 提交于
      stable inclusion
      from stable-5.10.60
      commit bae5b521feaa9ce08d7cf0a60c9c955ca76b2cf1
      bugzilla: 177018 https://gitee.com/openeuler/kernel/issues/I4EAUG
      
      Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=bae5b521feaa9ce08d7cf0a60c9c955ca76b2cf1
      
      --------------------------------
      
      [ Upstream commit 50ac7479 ]
      
      The userspace utility "driverctl" can be used to change/override the
      system's default driver choices. This is useful in some situations
      (buggy driver, old driver missing a device ID, trying a workaround,
      etc.) where the user needs to load a different driver.
      
      However, this is also prone to user error, where a driver is mapped
      to a device it's not designed to drive. For example, if the ice driver
      is mapped to driver iavf devices, the ice driver crashes.
      
      Add a check to return an error if the ice driver is being used to
      probe a virtual function.
      
      Fixes: 837f08fd ("ice: Add basic driver framework for Intel(R) E800 Series")
      Signed-off-by: NAnirudh Venkataramanan <anirudh.venkataramanan@intel.com>
      Tested-by: NGurucharan G <gurucharanx.g@intel.com>
      Tested-by: NKonrad Jankowski <konrad0.jankowski@intel.com>
      Signed-off-by: NTony Nguyen <anthony.l.nguyen@intel.com>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      Signed-off-by: NChen Jun <chenjun102@huawei.com>
      Acked-by: NWeilong Chen <chenweilong@huawei.com>
      Signed-off-by: NChen Jun <chenjun102@huawei.com>
      Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
      32146f17
  12. 06 7月, 2021 1 次提交
  13. 26 4月, 2021 4 次提交
  14. 09 2月, 2021 2 次提交
    • B
      ice: Fix MSI-X vector fallback logic · 5aaffab4
      Brett Creeley 提交于
      stable inclusion
      from stable-5.10.13
      commit b2a76ea0479ead146dd77f32feaac469182ebd94
      bugzilla: 47995
      
      --------------------------------
      
      [ Upstream commit f3fe97f6 ]
      
      The current MSI-X enablement logic tries to enable best-case MSI-X
      vectors and if that fails we only support a bare-minimum set. This
      includes a single MSI-X for 1 Tx and 1 Rx queue and a single MSI-X
      for the OICR interrupt. Unfortunately, the driver fails to load when we
      don't get as many MSI-X as requested for a couple reasons.
      
      First, the code to allocate MSI-X in the driver tries to allocate
      num_online_cpus() MSI-X for LAN traffic without caring about the number
      of MSI-X actually enabled/requested from the kernel for LAN traffic.
      So, when calling ice_get_res() for the PF VSI, it returns failure
      because the number of available vectors is less than requested. Fix
      this by not allowing the PF VSI to allocation  more than
      pf->num_lan_msix MSI-X vectors and pf->num_lan_msix Rx/Tx queues.
      Limiting the number of queues is done because we don't want more than
      1 Tx/Rx queue per interrupt due to performance conerns.
      
      Second, the driver assigns pf->num_lan_msix = 2, to account for LAN
      traffic and the OICR. However, pf->num_lan_msix is only meant for LAN
      MSI-X. This is causing a failure when the PF VSI tries to
      allocate/reserve the minimum pf->num_lan_msix because the OICR MSI-X has
      already been reserved, so there may not be enough MSI-X vectors left.
      Fix this by setting pf->num_lan_msix = 1 for the failure case. Then the
      ICE_MIN_MSIX accounts for the LAN MSI-X and the OICR MSI-X needed for
      the failure case.
      
      Update the related defines used in ice_ena_msix_range() to align with
      the above behavior and remove the unused RDMA defines because RDMA is
      currently not supported. Also, remove the now incorrect comment.
      
      Fixes: 152b978a ("ice: Rework ice_ena_msix_range")
      Signed-off-by: NBrett Creeley <brett.creeley@intel.com>
      Tested-by: NTony Brelinski <tonyx.brelinski@intel.com>
      Signed-off-by: NTony Nguyen <anthony.l.nguyen@intel.com>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
      Acked-by: NXie XiuQi <xiexiuqi@huawei.com>
      5aaffab4
    • N
      ice: update dev_addr in ice_set_mac_address even if HW filter exists · fcbdd770
      Nick Nunley 提交于
      stable inclusion
      from stable-5.10.13
      commit 55717a10a6b837355bf0dc3346346782f9302869
      bugzilla: 47995
      
      --------------------------------
      
      [ Upstream commit 13ed5e8a ]
      
      Fix the driver to copy the MAC address configured in ndo_set_mac_address
      into dev_addr, even if the MAC filter already exists in HW. In some
      situations (e.g. bonding) the netdev's dev_addr could have been modified
      outside of the driver, with no change to the HW filter, so the driver
      cannot assume that they match.
      
      Fixes: 757976ab ("ice: Fix check for removing/adding mac filters")
      Signed-off-by: NNick Nunley <nicholas.d.nunley@intel.com>
      Tested-by: NTony Brelinski <tonyx.brelinski@intel.com>
      Signed-off-by: NTony Nguyen <anthony.l.nguyen@intel.com>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
      Acked-by: NXie XiuQi <xiexiuqi@huawei.com>
      fcbdd770
  15. 10 10月, 2020 3 次提交
    • J
      ice: add additional debug logging for firmware update · 1e8249cc
      Jacob Keller 提交于
      While debugging a recent failure to update the flash of an ice device,
      I found it helpful to add additional logging which helped determine the
      root cause of the problem being a timeout issue.
      
      Add some extra dev_dbg() logging messages which can be enabled using the
      dynamic debug facility, including one for ice_aq_wait_for_event that
      will use jiffies to capture a rough estimate of how long we waited for
      the completion of a firmware command.
      Signed-off-by: NJacob Keller <jacob.e.keller@intel.com>
      Tested-by: NBrijesh Behera <brijeshx.behera@intel.com>
      Signed-off-by: NTony Nguyen <anthony.l.nguyen@intel.com>
      Signed-off-by: NJakub Kicinski <kuba@kernel.org>
      1e8249cc
    • J
      ice: refactor devlink_port to be per-VSI · 48d40025
      Jacob Keller 提交于
      Currently, the devlink_port structure is stored within the ice_pf. This
      made sense because we create a single devlink_port for each PF. This
      setup does not mesh with the abstractions in the driver very well, and
      led to a flow where we accidentally call devlink_port_unregister twice
      during error cleanup.
      
      In particular, if devlink_port_register or devlink_port_unregister are
      called twice, this leads to a kernel panic. This appears to occur during
      some possible flows while cleaning up from a failure during driver
      probe.
      
      If register_netdev fails, then we will call devlink_port_unregister in
      ice_cfg_netdev as it cleans up. Later, we again call
      devlink_port_unregister since we assume that we must cleanup the port
      that is associated with the PF structure.
      
      This occurs because we cleanup the devlink_port for the main PF even
      though it was not allocated. We allocated the port within a per-VSI
      function for managing the main netdev, but did not release the port when
      cleaning up that VSI, the allocation and destruction are not aligned.
      
      Instead of attempting to manage the devlink_port as part of the PF
      structure, manage it as part of the PF VSI. Doing this has advantages,
      as we can match the de-allocation of the devlink_port with the
      unregister_netdev associated with the main PF VSI.
      
      Moving the port to the VSI is preferable as it paves the way for
      handling devlink ports allocated for other purposes such as SR-IOV VFs.
      
      Since we're changing up how we allocate the devlink_port, also change
      the indexing. Originally, we indexed the port using the PF id number.
      This came from an old goal of sharing a devlink for each physical
      function. Managing devlink instances across multiple function drivers is
      not workable. Instead, lets set the port number to the logical port
      number returned by firmware and set the index using the VSI index
      (sometimes referred to as VSI handle).
      Signed-off-by: NJacob Keller <jacob.e.keller@intel.com>
      Tested-by: NAaron Brown <aaron.f.brown@intel.com>
      Signed-off-by: NTony Nguyen <anthony.l.nguyen@intel.com>
      Signed-off-by: NJakub Kicinski <kuba@kernel.org>
      48d40025
    • B
      ice: remove repeated words · ac382a09
      Bruce Allan 提交于
      A new test in checkpatch detects repeated words; cleanup all pre-existing
      occurrences of those now.
      Signed-off-by: NBruce Allan <bruce.w.allan@intel.com>
      Tested-by: NAaron Brown <aaron.f.brown@intel.com>
      Co-developed-by: NTony Nguyen <anthony.l.nguyen@intel.com>
      Signed-off-by: NTony Nguyen <anthony.l.nguyen@intel.com>
      Signed-off-by: NJakub Kicinski <kuba@kernel.org>
      ac382a09
  16. 30 9月, 2020 1 次提交
  17. 29 9月, 2020 1 次提交
  18. 25 9月, 2020 2 次提交
  19. 01 9月, 2020 1 次提交
  20. 01 8月, 2020 3 次提交
  21. 29 7月, 2020 7 次提交
    • M
      ice: cleanup VSI on probe fail · 78116e97
      Marcin Szycik 提交于
      As part of ice_setup_pf_sw() a PF VSI is setup; release the VSI in case of
      failure.
      Signed-off-by: NMarcin Szycik <marcin.szycik@intel.com>
      Tested-by: NAndrew Bowers <andrewx.bowers@intel.com>
      Signed-off-by: NTony Nguyen <anthony.l.nguyen@intel.com>
      78116e97
    • B
      ice: Allow all VLANs in safe mode · cd1f56f4
      Brett Creeley 提交于
      Currently the PF VSI's context parameters are left in a bad state when
      going into safe mode. This is causing VLAN traffic to not pass. Fix this
      by configuring the PF VSI to allow all VLAN tagged traffic.
      
      Also, remove redundant comment explaining the safe mode flow in
      ice_probe().
      Signed-off-by: NBrett Creeley <brett.creeley@intel.com>
      Tested-by: NAndrew Bowers <andrewx.bowers@intel.com>
      Signed-off-by: NTony Nguyen <anthony.l.nguyen@intel.com>
      cd1f56f4
    • N
      ice: restore VF MSI-X state during PCI reset · a54a0b24
      Nick Nunley 提交于
      During a PCI FLR the MSI-X Enable flag in the VF PCI MSI-X capability
      register will be cleared. This can lead to issues when a VF is
      assigned to a VM because in these cases the VF driver receives no
      indication of the PF PCI error/reset and additionally it is incapable
      of restoring the cleared flag in the hypervisor configuration space
      without fully reinitializing the driver interrupt functionality.
      
      Since the VF driver is unable to easily resolve this condition on its own,
      restore the VF MSI-X flag during the PF PCI reset handling.
      Signed-off-by: NNick Nunley <nicholas.d.nunley@intel.com>
      Tested-by: NAndrew Bowers <andrewx.bowers@intel.com>
      Signed-off-by: NTony Nguyen <anthony.l.nguyen@intel.com>
      a54a0b24
    • D
      ice: fix link event handling timing · 0ce6c34a
      Dave Ertman 提交于
      When the driver experiences a link event (especially link up)
      there can be multiple events generated. Some of these are
      link fault and still have a state of DOWN set.  The problem
      happens when the link comes UP during the PF driver handling
      one of the LINK DOWN events.  The status of the link is updated
      and is now seen as UP, so when the actual LINK UP event comes,
      the port information has already been updated to be seen as UP,
      even though none of the UP activities have been completed.
      
      After the link information has been updated in the link
      handler and evaluated for MEDIA PRESENT, if the state
      of the link has been changed to UP, treat the DOWN event
      as an UP event since the link is now UP.
      Signed-off-by: NDave Ertman <david.m.ertman@intel.com>
      Tested-by: NAndrew Bowers <andrewx.bowers@intel.com>
      Signed-off-by: NTony Nguyen <anthony.l.nguyen@intel.com>
      0ce6c34a
    • D
      ice: Fix link broken after GLOBR reset · b767ca65
      Dave Ertman 提交于
      After a GLOBR, the link was broken so that a link
      up situation was being seen as a link down.
      
      The problem was that the rebuild process was updating
      the port_info link status without doing any of the
      other things that need to be done when link changes.
      
      This was causing the port_info struct to have current
      "UP" information so that any further UP interrupts
      were skipped as redundant.
      
      The rebuild flow should *not* be updating the port_info
      struct link information, so eliminate this and leave
      it to the link event handling code.
      Signed-off-by: NDave Ertman <david.m.ertman@intel.com>
      Tested-by: NAndrew Bowers <andrewx.bowers@intel.com>
      Signed-off-by: NTony Nguyen <anthony.l.nguyen@intel.com>
      b767ca65
    • D
      ice: Implement LFC workaround · 7d9c9b79
      Dave Ertman 提交于
      There is a bug where the LFC settings are not being preserved
      through a link event.  The registers in question are the ones
      that are touched (and restored) when a set_local_mib AQ command
      is performed.
      
      On a link-up event, make sure that a set_local_mib is being
      performed.
      
      Move the function ice_aq_set_lldp_mib() from the DCB specific
      ice_dcb.c to ice_common.c so that the driver always has access
      to this AQ command.
      Signed-off-by: NDave Ertman <david.m.ertman@intel.com>
      Tested-by: NAndrew Bowers <andrewx.bowers@intel.com>
      Signed-off-by: NTony Nguyen <anthony.l.nguyen@intel.com>
      7d9c9b79
    • J
      ice: implement device flash update via devlink · d69ea414
      Jacob Keller 提交于
      Use the newly added pldmfw library to implement device flash update for
      the Intel ice networking device driver. This support uses the devlink
      flash update interface.
      
      The main parts of the flash include the Option ROM, the netlist module,
      and the main NVM data. The PLDM firmware file contains modules for each
      of these components.
      
      Using the pldmfw library, the provided firmware file will be scanned for
      the three major components, "fw.undi" for the Option ROM, "fw.mgmt" for
      the main NVM module containing the primary device firmware, and
      "fw.netlist" containing the netlist module.
      
      The flash is separated into two banks, the active bank containing the
      running firmware, and the inactive bank which we use for update. Each
      module is updated in a staged process. First, the inactive bank is
      erased, preparing the device for update. Second, the contents of the
      component are copied to the inactive portion of the flash. After all
      components are updated, the driver signals the device to switch the
      active bank during the next EMP reset (which would usually occur during
      the next reboot).
      
      Although the firmware AdminQ interface does report an immediate status
      for each command, the NVM erase and NVM write commands receive status
      asynchronously. The driver must not continue writing until previous
      erase and write commands have finished. The real status of the NVM
      commands is returned over the receive AdminQ. Implement a simple
      interface that uses a wait queue so that the main update thread can
      sleep until the completion status is reported by firmware. For erasing
      the inactive banks, this can take quite a while in practice.
      
      To help visualize the process to the devlink application and other
      applications based on the devlink netlink interface, status is reported
      via the devlink_flash_update_status_notify. While we do report status
      after each 4k block when writing, there is no real status we can report
      during erasing. We simply must wait for the complete module erasure to
      finish.
      
      With this implementation, basic flash update for the ice hardware is
      supported.
      Signed-off-by: NJacob Keller <jacob.e.keller@intel.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      d69ea414