1. 04 Jun, 2015 12 commits
  2. 03 Jun, 2015 21 commits
  3. 02 Jun, 2015 7 commits
    • David S. Miller's avatar
      Merge branch 'sfc-next' · df905cea
      David S. Miller authored
      Shradha Shah says:
      
      ====================
      sfc: ndo_get_phys_port_id, vadaptor stats and PF unload when Vf's assigned to guest
      
      This is the third and last instalment of SRIOV for EF10 patches.
      
      This patch set includes implementation of ndo_get_phys_port_id
      and changes to the MAC statistics code in order to support
      vadaptor statistics.
      
      It also includes code to deal with PF unload when Vf's are still
      assigned to the guest.
      
      The first couple of patches create sysfs files for physical port
      and link control flags which are particularly useful when we have
      enabled a large number of VF's.
      
      These patches have been tested with and without CONFIG_SFC_SRIOV.
      The creation and content of the sysfs files has been tested.
      The statistics are tested using ethtool for monitoring.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      df905cea
    • Daniel Pieczko's avatar
      sfc: leak vports if a VF is assigned during PF unload · 6598dad2
      Daniel Pieczko authored
      If any VF is assigned as the PF is unloaded, do not attempt to
      remove its vport or the vswitch.  These will be removed if the
      driver binds to the PF again, as an entity reset occurs during
      probe.
      
      A 'force' flag is added to efx_ef10_pci_sriov_disable() to
      distinguish between disabling SR-IOV and driver unload.
      SR-IOV cannot be disabled if VFs are assigned to guests.
      
      If the PF driver is unloaded while VFs are assigned, the driver
      may try to bind to the VF again at a later point if the driver
      has been reloaded and the VF returns to the same domain as the PF.
      In this case, the PF will not have a VF data structure, so the VF
      can check this and drop out of probe early.
      
      In this case, efx->vf_count will be zero but VFs will be present.
      The user is advised to remove the VF and re-create it. The check
      at the beginning of efx_ef10_pci_sriov_disable() that
      efx->vf_count is non-zero is removed to allow SR-IOV to be
      disabled in this case. Also, if the PF driver is unloaded, it
      will disable SR-IOV to remove these unknown VFs.
      
      By not disabling bus-mastering if VFs are still assigned, the VF
      will continue to pass traffic after the PF has been removed.
      
      When using the max_vfs module parameter, if VFs are already
      present do not try to initialise any more.
      Signed-off-by: default avatarShradha Shah <sshah@solarflare.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      6598dad2
    • Daniel Pieczko's avatar
      sfc: force removal of VF and vport on driver removal · 2a3fc311
      Daniel Pieczko authored
      When the driver unloads, force the unbind and removal of any
      VFs in the host with the PF.  The PF cannot remove vports and
      vswitches if they are still being used by a VF driver, and when
      unloading the sfc driver the removal order is not guaranteed,
      so the instruction from the PF to the VF to unbind enforces a
      suitable ordering so that vswitches and vports can be removed.
      
      As a result of this, manually unbinding the driver from a single
      PF will result in all of its VFs in the host also being removed.
      Signed-off-by: default avatarShradha Shah <sshah@solarflare.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      2a3fc311
    • Daniel Pieczko's avatar
    • Daniel Pieczko's avatar
      sfc: don't update stats on VF when called in atomic context · f00bf230
      Daniel Pieczko authored
      The ifenslave command to set up a bond runs in an atomic
      context, and it queries the stats on the devices that are
      being enslaved. A VF needs to make an MCDI call to update
      its stats, which is not allowed in atomic context.
      
      The releasing of the stats_lock is moved to the beginning of
      the VF stats update function so that in_interrupt() can be
      used; it must be taken again before returning from this
      function.
      Signed-off-by: default avatarShradha Shah <sshah@solarflare.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      f00bf230
    • Daniel Pieczko's avatar
      sfc: suppress vadaptor stats when EVB is not present · d94619cd
      Daniel Pieczko authored
      The raw_mask array is not initialised, so it needs to be
      explicitly set to zero in the 'else' branch.
      
      If the EVB capability is not present, a port cannot have multiple
      functions so the per-port MAC stats are correct and should match
      the corresponding vadaptor stats, so this redundancy can be
      removed from the ethtool stats output.
      Signed-off-by: default avatarShradha Shah <sshah@solarflare.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      d94619cd
    • Daniel Pieczko's avatar
      sfc: suppress ENOENT error messages from MC_CMD_MAC_STATS · 6dd4859b
      Daniel Pieczko authored
      MC_CMD_MAC_STATS can be called on a function before a
      vadaptor has been created, as the kernel can call into this
      through ndo_get_stats/ndo_get_stats64.
      
      If MC_CMD_MAC_STATS is called before the DMA queues have been
      setup, so that a vadaptor has not been created yet, firmware
      will return ENOENT. This is expected, so suppress the MCDI
      error message in this case.
      Signed-off-by: default avatarShradha Shah <sshah@solarflare.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      6dd4859b