1. 27 11月, 2019 1 次提交
  2. 21 11月, 2019 2 次提交
  3. 14 10月, 2019 1 次提交
    • C
      net/ibmvnic: Fix EOI when running in XIVE mode. · 11d49ce9
      Cédric Le Goater 提交于
      pSeries machines on POWER9 processors can run with the XICS (legacy)
      interrupt mode or with the XIVE exploitation interrupt mode. These
      interrupt contollers have different interfaces for interrupt
      management : XICS uses hcalls and XIVE loads and stores on a page.
      H_EOI being a XICS interface the enable_scrq_irq() routine can fail
      when the machine runs in XIVE mode.
      
      Fix that by calling the EOI handler of the interrupt chip.
      
      Fixes: f23e0643 ("ibmvnic: Clear pending interrupt after device reset")
      Signed-off-by: NCédric Le Goater <clg@kaod.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      11d49ce9
  4. 25 9月, 2019 2 次提交
    • J
      net/ibmvnic: prevent more than one thread from running in reset · 7ed5b31f
      Juliet Kim 提交于
      The current code allows more than one thread to run in reset. This can
      corrupt struct adapter data. Check adapter->resetting before performing
      a reset, if there is another reset running delay (100 msec) before trying
      again.
      Signed-off-by: NJuliet Kim <julietk@linux.vnet.ibm.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      7ed5b31f
    • J
      net/ibmvnic: unlock rtnl_lock in reset so linkwatch_event can run · b27507bb
      Juliet Kim 提交于
      Commit a5681e20 ("net/ibmnvic: Fix deadlock problem in reset")
      made the change to hold the RTNL lock during a reset to avoid deadlock
      but linkwatch_event is fired during the reset and needs the RTNL lock.
      That keeps linkwatch_event process from proceeding until the reset
      is complete. The reset process cannot tolerate the linkwatch_event
      processing after reset completes, so release the RTNL lock during the
      process to allow a chance for linkwatch_event to run during reset.
      This does not guarantee that the linkwatch_event will be processed as
      soon as link state changes, but is an improvement over the current code
      where linkwatch_event processing is always delayed, which prevents
      transmissions on the device from being deactivated leading transmit
      watchdog timer to time-out.
      
      Release the RTNL lock before link state change and re-acquire after
      the link state change to allow linkwatch_event to grab the RTNL lock
      and run during the reset.
      
      Fixes: a5681e20 ("net/ibmnvic: Fix deadlock problem in reset")
      Signed-off-by: NJuliet Kim <julietk@linux.vnet.ibm.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      b27507bb
  5. 20 9月, 2019 1 次提交
  6. 10 9月, 2019 1 次提交
  7. 07 9月, 2019 1 次提交
  8. 29 8月, 2019 1 次提交
  9. 19 8月, 2019 1 次提交
  10. 31 7月, 2019 1 次提交
  11. 10 6月, 2019 3 次提交
  12. 24 5月, 2019 1 次提交
  13. 11 5月, 2019 2 次提交
  14. 28 4月, 2019 1 次提交
  15. 11 4月, 2019 2 次提交
  16. 05 4月, 2019 2 次提交
    • T
      ibmvnic: Fix completion structure initialization · bbd669a8
      Thomas Falcon 提交于
      Fix device initialization completion handling for vNIC adapters.
      Initialize the completion structure on probe and reinitialize when needed.
      This also fixes a race condition during kdump where the driver can attempt
      to access the completion struct before it is initialized:
      
      Unable to handle kernel paging request for data at address 0x00000000
      Faulting instruction address: 0xc0000000081acbe0
      Oops: Kernel access of bad area, sig: 11 [#1]
      LE SMP NR_CPUS=2048 NUMA pSeries
      Modules linked in: ibmvnic(+) ibmveth sunrpc overlay squashfs loop
      CPU: 19 PID: 301 Comm: systemd-udevd Not tainted 4.18.0-64.el8.ppc64le #1
      NIP:  c0000000081acbe0 LR: c0000000081ad964 CTR: c0000000081ad900
      REGS: c000000027f3f990 TRAP: 0300   Not tainted  (4.18.0-64.el8.ppc64le)
      MSR:  800000010280b033 <SF,VEC,VSX,EE,FP,ME,IR,DR,RI,LE,TM[E]> CR: 28228288  XER: 00000006
      CFAR: c000000008008934 DAR: 0000000000000000 DSISR: 40000000 IRQMASK: 1
      GPR00: c0000000081ad964 c000000027f3fc10 c0000000095b5800 c0000000221b4e58
      GPR04: 0000000000000003 0000000000000001 000049a086918581 00000000000000d4
      GPR08: 0000000000000007 0000000000000000 ffffffffffffffe8 d0000000014dde28
      GPR12: c0000000081ad900 c000000009a00c00 0000000000000001 0000000000000100
      GPR16: 0000000000000038 0000000000000007 c0000000095e2230 0000000000000006
      GPR20: 0000000000400140 0000000000000001 c00000000910c880 0000000000000000
      GPR24: 0000000000000000 0000000000000006 0000000000000000 0000000000000003
      GPR28: 0000000000000001 0000000000000001 c0000000221b4e60 c0000000221b4e58
      NIP [c0000000081acbe0] __wake_up_locked+0x50/0x100
      LR [c0000000081ad964] complete+0x64/0xa0
      Call Trace:
      [c000000027f3fc10] [c000000027f3fc60] 0xc000000027f3fc60 (unreliable)
      [c000000027f3fc60] [c0000000081ad964] complete+0x64/0xa0
      [c000000027f3fca0] [d0000000014dad58] ibmvnic_handle_crq+0xce0/0x1160 [ibmvnic]
      [c000000027f3fd50] [d0000000014db270] ibmvnic_tasklet+0x98/0x130 [ibmvnic]
      [c000000027f3fda0] [c00000000813f334] tasklet_action_common.isra.3+0xc4/0x1a0
      [c000000027f3fe00] [c000000008cd13f4] __do_softirq+0x164/0x400
      [c000000027f3fef0] [c00000000813ed64] irq_exit+0x184/0x1c0
      [c000000027f3ff20] [c0000000080188e8] __do_irq+0xb8/0x210
      [c000000027f3ff90] [c00000000802d0a4] call_do_irq+0x14/0x24
      [c000000026a5b010] [c000000008018adc] do_IRQ+0x9c/0x130
      [c000000026a5b060] [c000000008008ce4] hardware_interrupt_common+0x114/0x120
      Signed-off-by: NThomas Falcon <tlfalcon@linux.ibm.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      bbd669a8
    • Y
      ibmvnic: remove set but not used variable 'netdev' · 53a6b206
      YueHaibing 提交于
      Fixes gcc '-Wunused-but-set-variable' warning:
      
      drivers/net/ethernet/ibm/ibmvnic.c: In function '__ibmvnic_reset':
      drivers/net/ethernet/ibm/ibmvnic.c:1971:21: warning: variable 'netdev' set but not used [-Wunused-but-set-variable]
      
      It's never used since introduction in
      commit ed651a10 ("ibmvnic: Updated reset handling")
      Signed-off-by: NYueHaibing <yuehaibing@huawei.com>
      Reviewed-by: NMukesh Ojha <mojha@codeaurora.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      53a6b206
  17. 20 3月, 2019 1 次提交
  18. 15 12月, 2018 1 次提交
    • W
      net/ibmvnic: Remove tests of member address · 390de194
      Wen Yang 提交于
      The driver was checking for non-NULL address.
      - adapter->napi[i]
      
      This is pointless as these will be always non-NULL, since the
      'dapter->napi' is allocated in init_napi().
      It is safe to get rid of useless checks for addresses to fix the
      coccinelle warning:
      >>drivers/net/ethernet/ibm/ibmvnic.c: test of a variable/field address
      Since such statements always return true, they are redundant.
      Signed-off-by: NWen Yang <wen.yang99@zte.com.cn>
      CC: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      CC: Paul Mackerras <paulus@samba.org>
      CC: Michael Ellerman <mpe@ellerman.id.au>
      CC: Thomas Falcon <tlfalcon@linux.ibm.com>
      CC: John Allen <jallen@linux.ibm.com>
      CC: "David S. Miller" <davem@davemloft.net>
      CC: linuxppc-dev@lists.ozlabs.org
      CC: netdev@vger.kernel.org
      CC: linux-kernel@vger.kernel.org
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      390de194
  19. 11 12月, 2018 2 次提交
    • T
      ibmvnic: Fix non-atomic memory allocation in IRQ context · 1d1bbc37
      Thomas Falcon 提交于
      ibmvnic_reset allocated new reset work item objects in a non-atomic
      context. This can be called from a tasklet, generating the output below.
      Allocate work items with the GFP_ATOMIC flag instead.
      
      BUG: sleeping function called from invalid context at mm/slab.h:421
      in_atomic(): 1, irqs_disabled(): 1, pid: 93, name: kworker/0:2
      INFO: lockdep is turned off.
      irq event stamp: 66049
      hardirqs last  enabled at (66048): [<c000000000122468>] tasklet_action_common.isra.12+0x78/0x1c0
      hardirqs last disabled at (66049): [<c000000000befce8>] _raw_spin_lock_irqsave+0x48/0xf0
      softirqs last  enabled at (66044): [<c000000000a8ac78>] dev_deactivate_queue.constprop.28+0xc8/0x160
      softirqs last disabled at (66045): [<c0000000000306e0>] call_do_softirq+0x14/0x24
      CPU: 0 PID: 93 Comm: kworker/0:2 Kdump: loaded Not tainted 4.20.0-rc6-00001-g1b50a8f03706 #7
      Workqueue: events linkwatch_event
      Call Trace:
      [c0000003fffe7ae0] [c000000000bc83e4] dump_stack+0xe8/0x164 (unreliable)
      [c0000003fffe7b30] [c00000000015ba0c] ___might_sleep+0x2dc/0x320
      [c0000003fffe7bb0] [c000000000391514] kmem_cache_alloc_trace+0x3e4/0x440
      [c0000003fffe7c30] [d000000005b2309c] ibmvnic_reset+0x16c/0x360 [ibmvnic]
      [c0000003fffe7cc0] [d000000005b29834] ibmvnic_tasklet+0x1054/0x2010 [ibmvnic]
      [c0000003fffe7e00] [c0000000001224c8] tasklet_action_common.isra.12+0xd8/0x1c0
      [c0000003fffe7e60] [c000000000bf1238] __do_softirq+0x1a8/0x64c
      [c0000003fffe7f90] [c0000000000306e0] call_do_softirq+0x14/0x24
      [c0000003f3967980] [c00000000001ba50] do_softirq_own_stack+0x60/0xb0
      [c0000003f39679c0] [c0000000001218a8] do_softirq+0xa8/0x100
      [c0000003f39679f0] [c000000000121a74] __local_bh_enable_ip+0x174/0x180
      [c0000003f3967a60] [c000000000bf003c] _raw_spin_unlock_bh+0x5c/0x80
      [c0000003f3967a90] [c000000000a8ac78] dev_deactivate_queue.constprop.28+0xc8/0x160
      [c0000003f3967ad0] [c000000000a8c8b0] dev_deactivate_many+0xd0/0x520
      [c0000003f3967b70] [c000000000a8cd40] dev_deactivate+0x40/0x60
      [c0000003f3967ba0] [c000000000a5e0c4] linkwatch_do_dev+0x74/0xd0
      [c0000003f3967bd0] [c000000000a5e694] __linkwatch_run_queue+0x1a4/0x1f0
      [c0000003f3967c30] [c000000000a5e728] linkwatch_event+0x48/0x60
      [c0000003f3967c50] [c0000000001444e8] process_one_work+0x238/0x710
      [c0000003f3967d20] [c000000000144a48] worker_thread+0x88/0x4e0
      [c0000003f3967db0] [c00000000014e3a8] kthread+0x178/0x1c0
      [c0000003f3967e20] [c00000000000bfd0] ret_from_kernel_thread+0x5c/0x6c
      Signed-off-by: NThomas Falcon <tlfalcon@linux.ibm.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      1d1bbc37
    • T
      ibmvnic: Convert reset work item mutex to spin lock · 6c5c7489
      Thomas Falcon 提交于
      ibmvnic_reset can create and schedule a reset work item from
      an IRQ context, so do not use a mutex, which can sleep. Convert
      the reset work item mutex to a spin lock. Locking debugger generated
      the trace output below.
      
      BUG: sleeping function called from invalid context at kernel/locking/mutex.c:908
      in_atomic(): 1, irqs_disabled(): 1, pid: 120, name: kworker/8:1
      4 locks held by kworker/8:1/120:
       #0: 0000000017c05720 ((wq_completion)"events"){+.+.}, at: process_one_work+0x188/0x710
       #1: 00000000ace90706 ((linkwatch_work).work){+.+.}, at: process_one_work+0x188/0x710
       #2: 000000007632871f (rtnl_mutex){+.+.}, at: rtnl_lock+0x30/0x50
       #3: 00000000fc36813a (&(&crq->lock)->rlock){..-.}, at: ibmvnic_tasklet+0x88/0x2010 [ibmvnic]
      irq event stamp: 26293
      hardirqs last  enabled at (26292): [<c000000000122468>] tasklet_action_common.isra.12+0x78/0x1c0
      hardirqs last disabled at (26293): [<c000000000befce8>] _raw_spin_lock_irqsave+0x48/0xf0
      softirqs last  enabled at (26288): [<c000000000a8ac78>] dev_deactivate_queue.constprop.28+0xc8/0x160
      softirqs last disabled at (26289): [<c0000000000306e0>] call_do_softirq+0x14/0x24
      CPU: 8 PID: 120 Comm: kworker/8:1 Kdump: loaded Not tainted 4.20.0-rc6 #6
      Workqueue: events linkwatch_event
      Call Trace:
      [c0000003fffa7a50] [c000000000bc83e4] dump_stack+0xe8/0x164 (unreliable)
      [c0000003fffa7aa0] [c00000000015ba0c] ___might_sleep+0x2dc/0x320
      [c0000003fffa7b20] [c000000000be960c] __mutex_lock+0x8c/0xb40
      [c0000003fffa7c30] [d000000006202ac8] ibmvnic_reset+0x78/0x330 [ibmvnic]
      [c0000003fffa7cc0] [d0000000062097f4] ibmvnic_tasklet+0x1054/0x2010 [ibmvnic]
      [c0000003fffa7e00] [c0000000001224c8] tasklet_action_common.isra.12+0xd8/0x1c0
      [c0000003fffa7e60] [c000000000bf1238] __do_softirq+0x1a8/0x64c
      [c0000003fffa7f90] [c0000000000306e0] call_do_softirq+0x14/0x24
      [c0000003f3f87980] [c00000000001ba50] do_softirq_own_stack+0x60/0xb0
      [c0000003f3f879c0] [c0000000001218a8] do_softirq+0xa8/0x100
      [c0000003f3f879f0] [c000000000121a74] __local_bh_enable_ip+0x174/0x180
      [c0000003f3f87a60] [c000000000bf003c] _raw_spin_unlock_bh+0x5c/0x80
      [c0000003f3f87a90] [c000000000a8ac78] dev_deactivate_queue.constprop.28+0xc8/0x160
      [c0000003f3f87ad0] [c000000000a8c8b0] dev_deactivate_many+0xd0/0x520
      [c0000003f3f87b70] [c000000000a8cd40] dev_deactivate+0x40/0x60
      [c0000003f3f87ba0] [c000000000a5e0c4] linkwatch_do_dev+0x74/0xd0
      [c0000003f3f87bd0] [c000000000a5e694] __linkwatch_run_queue+0x1a4/0x1f0
      [c0000003f3f87c30] [c000000000a5e728] linkwatch_event+0x48/0x60
      [c0000003f3f87c50] [c0000000001444e8] process_one_work+0x238/0x710
      [c0000003f3f87d20] [c000000000144a48] worker_thread+0x88/0x4e0
      [c0000003f3f87db0] [c00000000014e3a8] kthread+0x178/0x1c0
      [c0000003f3f87e20] [c00000000000bfd0] ret_from_kernel_thread+0x5c/0x6c
      Signed-off-by: NThomas Falcon <tlfalcon@linux.ibm.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      6c5c7489
  20. 04 12月, 2018 1 次提交
  21. 23 11月, 2018 2 次提交
  22. 20 11月, 2018 1 次提交
  23. 08 11月, 2018 1 次提交
  24. 02 10月, 2018 1 次提交
    • T
      ibmvnic: Add ethtool private flag for driver-defined queue limits · 723ad916
      Thomas Falcon 提交于
      When choosing channel amounts and ring sizes, the maximums in the
      ibmvnic driver are defined by the virtual i/o server management
      partition. Even though they are defined as maximums, the client
      driver may in fact successfully request resources that exceed
      these limits, which are mostly dependent on a user's hardware
      
      With this in mind, provide an ethtool flag that when enabled will
      allow the user to request resources limited by driver-defined
      maximums instead of limits defined by the management partition.
      The driver will try to honor the user's request but may not allowed
      by the management partition. In this case, the driver requests
      as close as it can get to the desired amount until it succeeds.
      Signed-off-by: NThomas Falcon <tlfalcon@linux.ibm.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      723ad916
  25. 29 9月, 2018 1 次提交
    • E
      ibmvnic: remove ndo_poll_controller · 0c3b9d1b
      Eric Dumazet 提交于
      As diagnosed by Song Liu, ndo_poll_controller() can
      be very dangerous on loaded hosts, since the cpu
      calling ndo_poll_controller() might steal all NAPI
      contexts (for all RX/TX queues of the NIC). This capture
      can last for unlimited amount of time, since one
      cpu is generally not able to drain all the queues under load.
      
      ibmvnic uses NAPI for TX completions, so we better let core
      networking stack call the napi->poll() to avoid the capture.
      
      ibmvnic_netpoll_controller() was completely wrong anyway,
      as it was scheduling NAPI to service RX queues (instead of TX),
      so I doubt netpoll ever worked on this driver.
      Signed-off-by: NEric Dumazet <edumazet@google.com>
      Cc: Thomas Falcon <tlfalcon@linux.vnet.ibm.com>
      Cc: John Allen <jallen@linux.vnet.ibm.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      0c3b9d1b
  26. 19 9月, 2018 1 次提交
  27. 01 9月, 2018 1 次提交
  28. 08 8月, 2018 2 次提交
  29. 17 7月, 2018 2 次提交
    • J
      ibmvnic: Fix error recovery on login failure · 3578a7ec
      John Allen 提交于
      Testing has uncovered a failure case that is not handled properly. In the
      event that a login fails and we are not able to recover on the spot, we
      return 0 from do_reset, preventing any error recovery code from being
      triggered.  Additionally, the state is set to "probed" meaning that when we
      are able to trigger the error recovery, the driver always comes up in the
      probed state. To handle the case properly, we need to return a failure code
      here and set the adapter state to the state that we entered the reset in
      indicating the state that we would like to come out of the recovery reset
      in.
      Signed-off-by: NJohn Allen <jallen@linux.vnet.ibm.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      3578a7ec
    • T
      ibmvnic: Revise RX/TX queue error messages · 2d14d379
      Thomas Falcon 提交于
      During a device failover, there may be latency between the loss
      of the current backing device and a notification from firmware that
      a failover has occurred. This latency can result in a large amount of
      error printouts as firmware returns outgoing traffic with a generic
      error code. These are not necessarily errors in this case as the
      firmware is busy swapping in a new backing adapter and is not ready
      to send packets yet. This patch reclassifies those error codes as
      warnings with an explanation that a failover may be pending. All
      other return codes will be considered errors.
      Signed-off-by: NThomas Falcon <tlfalcon@linux.vnet.ibm.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      2d14d379