1. 25 2月, 2021 1 次提交
    • S
      ibmvnic: fix a race between open and reset · 8f1c0fd2
      Sukadev Bhattiprolu 提交于
      __ibmvnic_reset() currently reads the adapter->state before getting the
      rtnl and saves that state as the "target state" for the reset. If this
      read occurs when adapter is in PROBED state, the target state would be
      PROBED.
      
      Just after the target state is saved, and before the actual reset process
      is started (i.e before rtnl is acquired) if we get an ibmvnic_open() call
      we would move the adapter to OPEN state.
      
      But when the reset is processed (after ibmvnic_open()) drops the rtnl),
      it will leave the adapter in PROBED state even though we already moved
      it to OPEN.
      
      To fix this, use the RTNL to improve serialization when reading/updating
      the adapter state. i.e determine the target state of a reset only after
      getting the RTNL. And if a reset is in progress during an open, simply
      set the target state of the adapter and let the reset code finish the
      open (like we currently do if failover is pending).
      
      One twist to this serialization is if the adapter state changes when we
      drop the RTNL to update the link state. Account for this by checking if
      there was an intervening open and update the target state for the reset
      accordingly (see new comments in the code). Note that only the reset
      functions and ibmvnic_open() can set the adapter to OPEN state and this
      must happen under rtnl.
      
      Fixes: 7d7195a0 ("ibmvnic: Do not process device remove during device reset")
      Signed-off-by: NSukadev Bhattiprolu <sukadev@linux.ibm.com>
      Reviewed-by: NDany Madden <drt@linux.ibm.com>
      Link: https://lore.kernel.org/r/20210224050229.1155468-1-sukadev@linux.ibm.comSigned-off-by: NJakub Kicinski <kuba@kernel.org>
      8f1c0fd2
  2. 17 2月, 2021 1 次提交
  3. 16 2月, 2021 5 次提交
  4. 12 2月, 2021 8 次提交
  5. 07 2月, 2021 1 次提交
  6. 02 2月, 2021 3 次提交
  7. 28 1月, 2021 1 次提交
  8. 17 1月, 2021 1 次提交
    • L
      net: ethernet: ibm: ibmvnic: Fix some kernel-doc misdemeanours · 80708602
      Lee Jones 提交于
      Fixes the following W=1 kernel build warning(s):
      
       from drivers/net/ethernet/ibm/ibmvnic.c:35:
       inlined from ‘handle_vpd_rsp’ at drivers/net/ethernet/ibm/ibmvnic.c:4124:3:
       drivers/net/ethernet/ibm/ibmvnic.c:1362: warning: Function parameter or member 'hdr_field' not described in 'build_hdr_data'
       drivers/net/ethernet/ibm/ibmvnic.c:1362: warning: Function parameter or member 'skb' not described in 'build_hdr_data'
       drivers/net/ethernet/ibm/ibmvnic.c:1362: warning: Function parameter or member 'hdr_len' not described in 'build_hdr_data'
       drivers/net/ethernet/ibm/ibmvnic.c:1362: warning: Function parameter or member 'hdr_data' not described in 'build_hdr_data'
       drivers/net/ethernet/ibm/ibmvnic.c:1423: warning: Function parameter or member 'hdr_field' not described in 'create_hdr_descs'
       drivers/net/ethernet/ibm/ibmvnic.c:1423: warning: Function parameter or member 'hdr_data' not described in 'create_hdr_descs'
       drivers/net/ethernet/ibm/ibmvnic.c:1423: warning: Function parameter or member 'len' not described in 'create_hdr_descs'
       drivers/net/ethernet/ibm/ibmvnic.c:1423: warning: Function parameter or member 'hdr_len' not described in 'create_hdr_descs'
       drivers/net/ethernet/ibm/ibmvnic.c:1423: warning: Function parameter or member 'scrq_arr' not described in 'create_hdr_descs'
       drivers/net/ethernet/ibm/ibmvnic.c:1474: warning: Function parameter or member 'txbuff' not described in 'build_hdr_descs_arr'
       drivers/net/ethernet/ibm/ibmvnic.c:1474: warning: Function parameter or member 'num_entries' not described in 'build_hdr_descs_arr'
       drivers/net/ethernet/ibm/ibmvnic.c:1474: warning: Function parameter or member 'hdr_field' not described in 'build_hdr_descs_arr'
       drivers/net/ethernet/ibm/ibmvnic.c:1832: warning: Function parameter or member 'adapter' not described in 'do_change_param_reset'
       drivers/net/ethernet/ibm/ibmvnic.c:1832: warning: Function parameter or member 'rwi' not described in 'do_change_param_reset'
       drivers/net/ethernet/ibm/ibmvnic.c:1832: warning: Function parameter or member 'reset_state' not described in 'do_change_param_reset'
       drivers/net/ethernet/ibm/ibmvnic.c:1911: warning: Function parameter or member 'adapter' not described in 'do_reset'
       drivers/net/ethernet/ibm/ibmvnic.c:1911: warning: Function parameter or member 'rwi' not described in 'do_reset'
       drivers/net/ethernet/ibm/ibmvnic.c:1911: warning: Function parameter or member 'reset_state' not described in 'do_reset'
      Signed-off-by: NLee Jones <lee.jones@linaro.org>
      Signed-off-by: NJakub Kicinski <kuba@kernel.org>
      80708602
  9. 10 1月, 2021 1 次提交
  10. 05 1月, 2021 1 次提交
  11. 24 12月, 2020 1 次提交
    • L
      ibmvnic: continue fatal error reset after passive init · 1f45dc22
      Lijun Pan 提交于
      Commit f9c6cea0 ("ibmvnic: Skip fatal error reset after passive init")
      says "If the passive
      CRQ initialization occurs before the FATAL reset task is processed,
      the FATAL error reset task would try to access a CRQ message queue
      that was freed, causing an oops. The problem may be most likely to
      occur during DLPAR add vNIC with a non-default MTU, because the DLPAR
      process will automatically issue a change MTU request.
      Fix this by not processing fatal error reset if CRQ is passively
      initialized after client-driven CRQ initialization fails."
      
      The original commit skips a specific reset condition, but that does
      not fix the problem it claims to fix, and misses a reset condition.
      The effective fix is commit 0e435bef ("ibmvnic: fix NULL pointer
      dereference in ibmvic_reset_crq") and commit a0faaa27 ("ibmvnic:
      fix NULL pointer dereference in reset_sub_crq_queues"). With above
      two fixes, there are no more crashes seen as described even without
      the original commit, so I would like to revert the original commit.
      
      Fixes: f9c6cea0 ("ibmvnic: Skip fatal error reset after passive init")
      Signed-off-by: NLijun Pan <ljp@linux.ibm.com>
      Link: https://lore.kernel.org/r/20201223204904.12677-1-ljp@linux.ibm.comSigned-off-by: NJakub Kicinski <kuba@kernel.org>
      1f45dc22
  12. 23 12月, 2020 1 次提交
    • L
      ibmvnic: fix login buffer memory leak · a0c8be56
      Lijun Pan 提交于
      Commit 34f0f4e3 ("ibmvnic: Fix login buffer memory leaks") frees
      login_rsp_buffer in release_resources() and send_login()
      because handle_login_rsp() does not free it.
      Commit f3ae59c0 ("ibmvnic: store RX and TX subCRQ handle array in
      ibmvnic_adapter struct") frees login_rsp_buffer in handle_login_rsp().
      It seems unnecessary to free it in release_resources() and send_login().
      There are chances that handle_login_rsp returns earlier without freeing
      buffers. Double-checking the buffer is harmless since
      release_login_buffer and release_login_rsp_buffer will
      do nothing if buffer is already freed.
      
      Fixes: f3ae59c0 ("ibmvnic: store RX and TX subCRQ handle array in ibmvnic_adapter struct")
      Fixes: 34f0f4e3 ("ibmvnic: Fix login buffer memory leaks")
      Signed-off-by: NLijun Pan <ljp@linux.ibm.com>
      Link: https://lore.kernel.org/r/20201219213919.21045-1-ljp@linux.ibm.comSigned-off-by: NJakub Kicinski <kuba@kernel.org>
      a0c8be56
  13. 17 12月, 2020 1 次提交
  14. 10 12月, 2020 1 次提交
  15. 08 12月, 2020 1 次提交
  16. 02 12月, 2020 2 次提交
  17. 29 11月, 2020 9 次提交
  18. 25 11月, 2020 1 次提交