1. 03 1月, 2017 2 次提交
  2. 30 11月, 2016 1 次提交
    • E
      sfc: separate out SFC4000 ("Falcon") support into new sfc-falcon driver · 5a6681e2
      Edward Cree 提交于
      Rationale: The differences between Falcon and Siena are in many ways larger
       than those between Siena and EF10 (despite Siena being nominally "Falcon-
       architecture"); for instance, Falcon has no MCPU, so there is no MCDI.
       Removing Falcon support from the sfc driver should simplify the latter,
       and avoid the possibility of Falcon support being broken by changes to sfc
       (which are rarely if ever tested on Falcon, it being end-of-lifed hardware).
      
      The sfc-falcon driver created in this changeset is essentially a copy of the
       sfc driver, but with Siena- and EF10-specific code, including MCDI, removed
       and with the "efx_" identifier prefix changed to "ef4_" (for "EFX 4000-
       series") to avoid collisions when both drivers are built-in.
      
      This changeset removes Falcon from the sfc driver's PCI ID table; then in
       sfc I've removed obvious Falcon-related code: I removed the Falcon NIC
       functions, Falcon PHY code, and EFX_REV_FALCON_*, then fixed up everything
       that referenced them.
      
      Also, increment minor version of both drivers (to 4.1).
      
      For now, CONFIG_SFC selects CONFIG_SFC_FALCON, so that updating old configs
       doesn't cause Falcon support to disappear; but that should be undone at
       some point in the future.
      Signed-off-by: NEdward Cree <ecree@solarflare.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      5a6681e2
  3. 19 11月, 2016 1 次提交
    • E
      sfc: remove Software TSO · 46d1efd8
      Edward Cree 提交于
      It gives no advantage over GSO now that xmit_more exists.  If we find
       ourselves unable to handle a TSO skb (because our TXQ doesn't have a
       TSOv2 context and the NIC doesn't support TSOv1), hand it back to GSO.
       Also do that if the TSO handler fails with EINVAL for any other reason.
      As Falcon-architecture NICs don't support any firmware-assisted TSO,
       they no longer advertise TSO feature flags at all.
      Signed-off-by: NEdward Cree <ecree@solarflare.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      46d1efd8
  4. 17 11月, 2016 1 次提交
  5. 14 11月, 2016 1 次提交
    • B
      sfc: clear napi_hash state when copying channels · 46d054f8
      Bert Kenward 提交于
      efx_copy_channel() doesn't correctly clear the napi_hash related state.
      This means that when napi_hash_add is called for that channel nothing is
      done, and we are left with a copy of the napi_hash_node from the old
      channel. When we later call napi_hash_del() on this channel we have a
      stale napi_hash_node.
      
      Corruption is only seen when there are multiple entries in one of the
      napi_hash lists. This is made more likely by having a very large number
      of channels. Testing was carried out with 512 channels - 32 channels on
      each of 16 ports.
      
      This failure typically appears as protection faults within napi_by_id()
      or napi_hash_add(). efx_copy_channel() is only used when tx or rx ring
      sizes are changed (ethtool -G).
      
      Fixes: 36763266 ("sfc: Add support for busy polling")
      Signed-off-by: NBert Kenward <bkenward@solarflare.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      46d054f8
  6. 19 10月, 2016 1 次提交
  7. 07 9月, 2016 1 次提交
  8. 13 8月, 2016 2 次提交
  9. 16 6月, 2016 4 次提交
  10. 01 6月, 2016 1 次提交
  11. 24 12月, 2015 1 次提交
  12. 16 12月, 2015 2 次提交
  13. 02 12月, 2015 1 次提交
  14. 19 11月, 2015 1 次提交
    • E
      net: provide generic busy polling to all NAPI drivers · 93d05d4a
      Eric Dumazet 提交于
      NAPI drivers no longer need to observe a particular protocol
      to benefit from busy polling (CONFIG_NET_RX_BUSY_POLL=y)
      
      napi_hash_add() and napi_hash_del() are automatically called
      from core networking stack, respectively from
      netif_napi_add() and netif_napi_del()
      
      This patch depends on free_netdev() and netif_napi_del() being
      called from process context, which seems to be the norm.
      
      Drivers might still prefer to call napi_hash_del() on their
      own, since they might combine all the rcu grace periods into
      a single one, knowing their NAPI structures lifetime, while
      core networking stack has no idea of a possible combining.
      
      Once this patch proves to not bring serious regressions,
      we will cleanup drivers to either remove napi_hash_del()
      or provide appropriate rcu grace periods combining.
      Signed-off-by: NEric Dumazet <edumazet@google.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      93d05d4a
  15. 17 11月, 2015 1 次提交
  16. 11 11月, 2015 1 次提交
  17. 28 10月, 2015 1 次提交
  18. 29 8月, 2015 1 次提交
    • S
      sfc: Allow driver to cope with a lower number of VIs than it needs for RSS · b0fbdae1
      Shradha Shah 提交于
      Previously, the driver would refuse to load if it couldn't secure
      enough VIs from the MC to fulfill its RSS requirements.
      This was causing probe to fail on later functions in
      configurations where we'd run out of VIs, such as having many
      VFs.
      
      This change allows the driver to load with fewer VIs, down to a
      minimum of 2. A warning will be printed saying that RSS
      requirements were not met, possibly affecting performance.
      
      efx->max_tx_channels needs to be set to avoid going down the
      failure path in efx_probe_nic() immediately in the loop after the
      probe() NIC-type function.
      Also, Set rc=ENOSPC when bombing out of efx_probe_nic due to lack
      of VIs.
      Signed-off-by: NShradha Shah <sshah@solarflare.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      b0fbdae1
  19. 09 7月, 2015 1 次提交
    • P
      sfc: Report TX completions to BQL after all TX events in interrupt · c936835c
      Peter Dunning 提交于
      The limit for BQL is updated each time we call
      netdev_tx_completed_queue.
      Without this patch the BQL limit was updated for every TX event we
      see.
      The issue was that this only updated the limit to handle the data
      we complete in two events as the first event wouldn't show that
      enough traffic had been processed between them.
      
      This was OK when interrupt moderation was off but not when it was
      on as more data had to be completed in a single interrupt.
      
      The patch changes this so that we do report the completion to BQL
      only when all the TX events in the interrupt have been processed.
      Signed-off-by: NShradha Shah <sshah@solarflare.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      c936835c
  20. 16 6月, 2015 1 次提交
  21. 03 6月, 2015 3 次提交
    • D
      sfc: leak vports if a VF is assigned during PF unload · 6598dad2
      Daniel Pieczko 提交于
      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: NShradha Shah <sshah@solarflare.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      6598dad2
    • D
      sfc: force removal of VF and vport on driver removal · 2a3fc311
      Daniel Pieczko 提交于
      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: NShradha Shah <sshah@solarflare.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      2a3fc311
    • S
      1d051e00
  22. 28 5月, 2015 1 次提交
  23. 27 5月, 2015 1 次提交
  24. 22 5月, 2015 6 次提交
    • S
      sfc: set the MAC address using MC_CMD_VADAPTOR_SET_MAC · 910c8789
      Shradha Shah 提交于
      Add a set_mac_address() NIC-type function for EF10 only, and
      use this to set the MAC address on the vadaptor. For Siena and
      earlier, the MAC address continues to be set by MC_CMD_SET_MAC;
      this is still called on EF10, and including a MAC address in
      this command has no effect.
      
      The sriov_mac_address_changed() NIC-type function is no longer
      needed on EF10, but it is needed for Siena where it is used to
      update the peer address of the PF for VFDI.  Change this to use
      the new set_mac_address function pointer.
      
      efx_ef10_sriov_mac_address_changed() is no longer called, as VFs
      will try to change the MAC address on their vadaptor rather than
      trying to change to the context of the PF to alter the vport.
      
      When a VF is running in direct passthrough mode with MAC spoofing
      enabled, it will be able to change the MAC address on its vadaptor.
      In this case, there is a link to the PF, so find the correct VF in
      its ef10_vf array and update the MAC address.
      
      ndo_set_mac_address() can be called during driver unload while
      bonding, and in this case the device has already been stopped, so
      don't call efx_net_open() to restart it after reconfiguration.
      
      efx->port_enabled is set to false in efx_stop_port(), so it is
      indicator of whether the device needs to be restarted.
      Signed-off-by: NShradha Shah <sshah@solarflare.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      910c8789
    • E
      sfc: add ndo_set_vf_link_state() function for EF10 · 4392dc69
      Edward Cree 提交于
      Exercised with
      "ip link set <PF intf> vf <vf_i> state {auto|enable|disable}"
      Sets the reporting policy for VF link state to either
       - mirror physical link state
       - always up
       - always down
      
      get VF link state mode in efx_ef10_sriov_get_vf_config
      
      Exercised by
      "ip link show <PF intf>";
      output will include a line like
      vf 0 MAC 12:34:56:78:9a:bc, link-state auto
      Signed-off-by: NShradha Shah <sshah@solarflare.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      4392dc69
    • J
      sfc: Change entity reset on MC reboot to a new datapath-only reset. · 087e9025
      Jon Cooper 提交于
      Currently we do an entity reset when we detect an MC reboot.
      This messes up SRIOV because it leaves VFs orphaned. The extra
      reset is rather redundant anyway, since the MC reboot will have
      basically reset everything.
      
      This change replaces the entity reset after MC reboot with a
      simpler datapath reset that reallocates resources but doesn't
      perform the entity reset.
      Signed-off-by: NShradha Shah <sshah@solarflare.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      087e9025
    • S
      sfc: add ndo_set_vf_mac() function for EF10 · e340be92
      Shradha Shah 提交于
      Implement a response to this entrypoint.
      The ndo_set_vf_mac() entrypoint is only exposed in the driver if
      CONFIG_SFC_SRIOV is defined.
      Signed-off-by: NShradha Shah <sshah@solarflare.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      e340be92
    • E
      sfc: protect filter table against use-after-free · 0d322413
      Edward Cree 提交于
      If MCDI timeouts are encountered during efx_ef10_filter_table_remove(),
      an FLR will be queued, but efx->filter_state will still be kfree()d.
      The queued FLR will then call efx_ef10_filter_table_restore(), which
      will try to use efx->filter_state. This previously caused a panic.
      This patch adds an rwsem to protect the existence of efx->filter_state,
      separately from the spinlock protecting its contents.  Users which can
      race against efx_ef10_filter_table_remove() should down_read this rwsem.
      Signed-off-by: NShradha Shah <sshah@solarflare.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      0d322413
    • S
      sfc: save old MAC address in case sriov_mac_address_changed fails · cfc77c2f
      Shradha Shah 提交于
      Otherwise the PF and VF can disagree on the VF's MAC address and
      this leads to strange behaviour, up to and including kernel panics.
      Signed-off-by: NShradha Shah <sshah@solarflare.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      cfc77c2f
  25. 10 5月, 2015 3 次提交
    • S
      sfc: Bind the sfc driver to any available VF's · 6f7f8aa6
      Shradha Shah 提交于
      Add the device ID of the VF to the PCI device ID table.
      
      Added a boolean flag is_vf in efx_nic_type to differentiate
      between a VF and PF at probe time. This flag is useful in later
      patches while setting MAC address specially in the
      PCI-passthrough case.
      Signed-off-by: NShradha Shah <sshah@solarflare.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      6f7f8aa6
    • J
      sfc: Add use of shared RSS contexts. · 267c0157
      Jon Cooper 提交于
      Allow PFs to allocate shared RSS contexts if we exhaust our
      exclusive RSS contexts. Make VFs use shared RSS contexts in
      all cases.
      Spruce up error handling so that the shadow copy of the RSS
      table is updated after successful update, rather than in all
      cases, so that we report the actual contents of the RSS table
      after a failure to set it, rather than what we'd like it to be.
      
      Populate context_size parameter when vacuously allocating RSS
      context of size 1.
      Signed-off-by: NShradha Shah <sshah@solarflare.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      267c0157
    • E
      sfc: Cope with permissions enforcement added to firmware for SR-IOV · 267d9d73
      Edward Cree 提交于
      * Accept EPERM in some simple cases, the following cases are handled:
      1) efx_mcdi_read_assertion()
      Unprivileged PCI functions aren't allowed to GET_ASSERTS.
      We return success as it's up to the primary PF to deal with asserts.
      2) efx_mcdi_mon_probe() in efx_ef10_probe()
      Unprivileged PCI functions aren't allowed to read sensor info, and
      worrying about sensor data is the primary PF's job.
      3) phy_op->reconfigure() in efx_init_port() and efx_reset_up()
      Unprivileged functions aren't allowed to MC_CMD_SET_LINK, they just have
      to accept the settings (including flow-control, which is what
      efx_init_port() is worried about) they've been given.
      4) Fallback to GET_WORKAROUNDS in efx_ef10_probe()
      Unprivileged PCI functions aren't allowed to set workarounds. So if
      efx_mcdi_set_workaround() fails EPERM, use efx_mcdi_get_workarounds()
      to find out if workaround_35388 is enabled.
      5) If DRV_ATTACH gets EPERM, try without specifying fw-variant
      Unprivileged PCI functions have to use a FIRMWARE_ID of 0xffffffff
      (MC_CMD_FW_DONT_CARE).
      6) Don't try to exit_assertion unless one had fired
      Previously we called efx_mcdi_exit_assertion even if
      efx_mcdi_read_assertion had received MC_CMD_GET_ASSERTS_FLAGS_NO_FAILS.
      This is unnecessary, and the resulting MC_CMD_REBOOT, even if the
      AFTER_ASSERTION flag made it a no-op, would fail EPERM for unprivileged
      PCI functions.
      So make efx_mcdi_read_assertion return whether an assert happened, and only
      call efx_mcdi_exit_assertion if it has.
      Signed-off-by: NShradha Shah <sshah@solarflare.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      267d9d73