Skip to content
Snippets Groups Projects
Select Git revision
  • 44b034b406211fc103159f82b9e601e05675c739
  • vme-testing default
  • ci-test
  • master
  • remoteproc
  • am625-sk-ov5640
  • pcal6534-upstreaming
  • lps22df-upstreaming
  • msc-upstreaming
  • imx8mp
  • iio/noa1305
  • vme-next
  • vme-next-4.14-rc4
  • v4.14-rc4
  • v4.14-rc3
  • v4.14-rc2
  • v4.14-rc1
  • v4.13
  • vme-next-4.13-rc7
  • v4.13-rc7
  • v4.13-rc6
  • v4.13-rc5
  • v4.13-rc4
  • v4.13-rc3
  • v4.13-rc2
  • v4.13-rc1
  • v4.12
  • v4.12-rc7
  • v4.12-rc6
  • v4.12-rc5
  • v4.12-rc4
  • v4.12-rc3
32 results

i40evf_main.c

Blame
    • Jacob Keller's avatar
      44b034b4
      i40evf: don't rely on netif_running() outside rtnl_lock() · 44b034b4
      Jacob Keller authored
      
      In i40evf_reset_task we use netif_running() to determine whether or not
      the device is currently up. This allows us to properly free queue memory
      and shut down things before we request the hardware reset.
      
      It turns out that we cannot be guaranteed of netif_running() returning
      false until the device is fully up, as the kernel core code sets
      __LINK_STATE_START prior to calling .ndo_open. Since we're not holding
      the rtnl_lock(), it's possible that the driver's i40evf_open handler
      function is currently being called while we're resetting.
      
      We can't simply hold the rtnl_lock() while checking netif_running() as
      this could cause a deadlock with the i40evf_open() function.
      Additionally, we can't avoid the deadlock by holding the rtnl_lock()
      over the whole reset path, as this essentially serializes all resets,
      and can cause massive delays if we have multiple VFs on a system.
      
      Instead, lets just check our own internal state __I40EVF_RUNNING state
      field. This allows us to ensure that the state is correct and is only
      set after we've finished bringing the device up.
      
      Without this change we might free data structures about device queues
      and other memory before they've been fully allocated.
      
      Signed-off-by: default avatarJacob Keller <jacob.e.keller@intel.com>
      Tested-by: default avatarAndrew Bowers <andrewx.bowers@intel.com>
      Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
      44b034b4
      History
      i40evf: don't rely on netif_running() outside rtnl_lock()
      Jacob Keller authored
      
      In i40evf_reset_task we use netif_running() to determine whether or not
      the device is currently up. This allows us to properly free queue memory
      and shut down things before we request the hardware reset.
      
      It turns out that we cannot be guaranteed of netif_running() returning
      false until the device is fully up, as the kernel core code sets
      __LINK_STATE_START prior to calling .ndo_open. Since we're not holding
      the rtnl_lock(), it's possible that the driver's i40evf_open handler
      function is currently being called while we're resetting.
      
      We can't simply hold the rtnl_lock() while checking netif_running() as
      this could cause a deadlock with the i40evf_open() function.
      Additionally, we can't avoid the deadlock by holding the rtnl_lock()
      over the whole reset path, as this essentially serializes all resets,
      and can cause massive delays if we have multiple VFs on a system.
      
      Instead, lets just check our own internal state __I40EVF_RUNNING state
      field. This allows us to ensure that the state is correct and is only
      set after we've finished bringing the device up.
      
      Without this change we might free data structures about device queues
      and other memory before they've been fully allocated.
      
      Signed-off-by: default avatarJacob Keller <jacob.e.keller@intel.com>
      Tested-by: default avatarAndrew Bowers <andrewx.bowers@intel.com>
      Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
    ipip.c 15.15 KiB