1. 25 8月, 2012 2 次提交
  2. 02 8月, 2012 1 次提交
    • B
      sfc: Fix maximum number of TSO segments and minimum TX queue size · 7e6d06f0
      Ben Hutchings 提交于
      Currently an skb requiring TSO may not fit within a minimum-size TX
      queue.  The TX queue selected for the skb may stall and trigger the TX
      watchdog repeatedly (since the problem skb will be retried after the
      TX reset).  This issue is designated as CVE-2012-3412.
      
      Set the maximum number of TSO segments for our devices to 100.  This
      should make no difference to behaviour unless the actual MSS is less
      than about 700.  Increase the minimum TX queue size accordingly to
      allow for 2 worst-case skbs, so that there will definitely be space
      to add an skb after we wake a queue.
      
      To avoid invalidating existing configurations, change
      efx_ethtool_set_ringparam() to fix up values that are too small rather
      than returning -EINVAL.
      Signed-off-by: NBen Hutchings <bhutchings@solarflare.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      7e6d06f0
  3. 17 7月, 2012 1 次提交
  4. 11 5月, 2012 1 次提交
    • J
      drivers/net: Convert compare_ether_addr to ether_addr_equal · 2e42e474
      Joe Perches 提交于
      Use the new bool function ether_addr_equal to add
      some clarity and reduce the likelihood for misuse
      of compare_ether_addr for sorting.
      
      Done via cocci script:
      
      $ cat compare_ether_addr.cocci
      @@
      expression a,b;
      @@
      -	!compare_ether_addr(a, b)
      +	ether_addr_equal(a, b)
      
      @@
      expression a,b;
      @@
      -	compare_ether_addr(a, b)
      +	!ether_addr_equal(a, b)
      
      @@
      expression a,b;
      @@
      -	!ether_addr_equal(a, b) == 0
      +	ether_addr_equal(a, b)
      
      @@
      expression a,b;
      @@
      -	!ether_addr_equal(a, b) != 0
      +	!ether_addr_equal(a, b)
      
      @@
      expression a,b;
      @@
      -	ether_addr_equal(a, b) == 0
      +	!ether_addr_equal(a, b)
      
      @@
      expression a,b;
      @@
      -	ether_addr_equal(a, b) != 0
      +	ether_addr_equal(a, b)
      
      @@
      expression a,b;
      @@
      -	!!ether_addr_equal(a, b)
      +	ether_addr_equal(a, b)
      Signed-off-by: NJoe Perches <joe@perches.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      2e42e474
  5. 10 5月, 2012 1 次提交
  6. 16 2月, 2012 2 次提交
    • B
      sfc: Add SR-IOV back-end support for SFC9000 family · cd2d5b52
      Ben Hutchings 提交于
      On the SFC9000 family, each port has 1024 Virtual Interfaces (VIs),
      each with an RX queue, a TX queue, an event queue and a mailbox
      register.  These may be assigned to up to 127 SR-IOV virtual functions
      per port, with up to 64 VIs per VF.
      
      We allocate an extra channel (IRQ and event queue only) to receive
      requests from VF drivers.
      
      There is a per-port limit of 4 concurrent RX queue flushes, and queue
      flushes may be initiated by the MC in response to a Function Level
      Reset (FLR) of a VF.  Therefore, when SR-IOV is in use, we submit all
      flush requests via the MC.
      
      The RSS indirection table is shared with VFs, so the number of RX
      queues used in the PF is limited to the number of VIs per VF.
      
      This is almost entirely the work of Steve Hodgson, formerly
      shodgson@solarflare.com.
      Signed-off-by: NBen Hutchings <bhutchings@solarflare.com>
      cd2d5b52
    • B
      sfc: Add support for configuring RX unicast/multicast default filters · c274d65c
      Ben Hutchings 提交于
      On Siena all received packets that don't match a more specific filter
      will match the unicast or multicast default filter.  Currently we
      leave these set to the default values (RSS with base queue number of
      0).  Allow them to be reconfigured to select a single RX queue.
      
      These default filters are programmed through the FILTER_CTL register,
      but we represent them internally as an additional table of size 2.
      Signed-off-by: NBen Hutchings <bhutchings@solarflare.com>
      c274d65c
  7. 27 1月, 2012 4 次提交
    • B
      sfc: Make all MAC statistics consistently 64 bits wide · f9c76250
      Ben Hutchings 提交于
      Currently we use type u64 for byte counts, which can very quickly
      exceed 2^32, and unsigned long for packet counts, which do not.  But
      it can still take only 20-something minutes to send or receive 2^32
      packets, and not all tools properly handle overflow even if they
      sample more often than this.
      
      The MAC statistics are all updated synchronously, so it costs very
      little to make them all 64-bit regardless of native word size.
      Signed-off-by: NBen Hutchings <bhutchings@solarflare.com>
      f9c76250
    • B
      sfc: Remove dependence on NAPI polling in efx_test_eventq_irq() · 0fb53faa
      Ben Hutchings 提交于
      We cannot safely assume that the NAPI handler will complete within the
      20 ms that we allow for the event self-test.  The handler may be
      deferred for longer than this, particularly on realtime kernels.
      
      Instead, check whether either an event has been handled or (as in the
      old failure path) whether an interrupt has been received and an event
      has been delivered but not yet handled.  Use napi_disable() to
      synchronize with the NAPI handler before checking, since it will
      clear events before updating eventq_read_ptr.
      
      Remove the test result chan.N.eventq.poll, since it is not an error
      if the NAPI handler does not run during the test.
      Signed-off-by: NBen Hutchings <bhutchings@solarflare.com>
      0fb53faa
    • B
      sfc: Merge efx_mac_operations into efx_nic_type · 710b208d
      Ben Hutchings 提交于
      No NICs need to switch efx_mac_operations at run-time, and the MAC
      operations are fairly closely bound to NIC types.
      
      Move efx_mac_operations::reconfigure to efx_nic_type::reconfigure_mac
      and efx_mac_operations::check_fault fo efx_nic_type::check_mac_fault.
      Change callers to call through efx->type or directly if the NIC type
      is known.
      
      Remove efx_mac_operations::update_stats.  The implementations for
      Falcon used to fetch MAC statistics synchronously and this was used by
      efx_register_netdev() to clear statistics after running self-tests.
      However, it now only converts statistics that have already been
      fetched (and that only for Falcon), and the call from
      efx_register_netdev() has no effect.
      Signed-off-by: NBen Hutchings <bhutchings@solarflare.com>
      710b208d
    • B
      sfc: Hold efx_nic::stats_lock while reading efx_nic::mac_stats · 1cb34522
      Ben Hutchings 提交于
      efx_nic::stats_lock is used to serialise stats updates, but each
      reader was dropping it before it finished reading efx_nic::mac_stats.
      
      If there were concurrent stats reads using procfs, or one using procfs
      and one using ethtool, an update could race with a read.  On a 32-bit
      system, the reader could see word-tearing of 64-bit stats (32 bits of
      the old value and 32 bits of the new).
      Signed-off-by: NBen Hutchings <bhutchings@solarflare.com>
      1cb34522
  8. 10 1月, 2012 1 次提交
  9. 06 1月, 2012 1 次提交
  10. 05 1月, 2012 1 次提交
  11. 17 12月, 2011 1 次提交
  12. 08 10月, 2011 1 次提交
  13. 17 9月, 2011 6 次提交
  14. 11 8月, 2011 1 次提交
  15. 25 6月, 2011 1 次提交
    • B
      sfc: Fix mapping of reset reasons and flags to methods · 0e2a9c7c
      Ben Hutchings 提交于
      There are certain hardware bugs that may occur on Falcon during normal
      operation, that require a reset to recover from.  We try to minimise
      disruption by keeping the PHY running, following a reset sequence
      labelled as 'invisible'.
      
      Siena does not suffer from these hardware bugs, so we have not
      implemented an 'invisible' reset sequence.  However, if a similar
      error does occur (due to a hardware fault or software bug) then the
      code shared with Falcon will wrongly assume that the PHY is not being
      reset.
      
      Since the mapping of reset reasons (internal) and flags (ethtool) to
      methods must differ significantly between NIC types, move it into
      per-NIC-type functions (replacing the insufficient reset_world_flags
      field).
      Signed-off-by: NBen Hutchings <bhutchings@solarflare.com>
      0e2a9c7c
  16. 18 5月, 2011 1 次提交
  17. 14 5月, 2011 1 次提交
  18. 30 4月, 2011 2 次提交
  19. 15 4月, 2011 1 次提交
    • A
      ethtool: allow custom interval for physical identification · fce55922
      Allan, Bruce W 提交于
      When physical identification of an adapter is done by toggling the
      mechanism on and off through software utilizing the set_phys_id operation,
      it is done with a fixed duration for both on and off states.  Some drivers
      may want to set a custom duration for the on/off intervals.  This patch
      changes the API so the return code from the driver's entry point when it
      is called with ETHTOOL_ID_ACTIVE can specify the frequency at which to
      cycle the on/off states, and updates the drivers that have already been
      converted to use the new set_phys_id and use the synchronous method for
      identifying an adapter.
      
      The physical identification frequency set in the updated drivers is based
      on how it was done prior to the introduction of set_phys_id.
      
      Compile tested only.  Also fixes a compiler warning in sfc.
      
      v2: drivers do not return -EINVAL for ETHOOL_ID_ACTIVE
      v3: fold patchset into single patch and cleanup per Ben's feedback
      Signed-off-by: NBruce Allan <bruce.w.allan@intel.com>
      Cc: Ben Hutchings <bhutchings@solarflare.com>
      Cc: Sathya Perla <sathya.perla@emulex.com>
      Cc: Subbu Seetharaman <subbu.seetharaman@emulex.com>
      Cc: Ajit Khaparde <ajit.khaparde@emulex.com>
      Cc: Michael Chan <mchan@broadcom.com>
      Cc: Eilon Greenstein <eilong@broadcom.com>
      Cc: Divy Le Ray <divy@chelsio.com>
      Cc: Don Fry <pcnet32@frontier.com>
      Cc: Jon Mason <jdmason@kudzu.us>
      Cc: Solarflare linux maintainers <linux-net-drivers@solarflare.com>
      Cc: Steve Hodgson <shodgson@solarflare.com>
      Cc: Stephen Hemminger <shemminger@linux-foundation.org>
      Cc: Matt Carlson <mcarlson@broadcom.com>
      Acked-by: NJon Mason <jdmason@kudzu.us>
      Acked-by: NBen Hutchings <bhutchings@solarflare.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      fce55922
  20. 05 4月, 2011 2 次提交
  21. 01 3月, 2011 3 次提交
  22. 23 2月, 2011 1 次提交
  23. 16 2月, 2011 1 次提交
    • B
      sfc: Distinguish queue lookup from test for queue existence · 525da907
      Ben Hutchings 提交于
      efx_channel_get_{rx,tx}_queue() currently return NULL if the channel
      isn't used for traffic in that direction.  In most cases this is a
      bug, but some callers rely on it as an existence test.
      
      Add existence test functions efx_channel_has_{rx_queue,tx_queues}()
      and use them as appropriate.
      
      Change efx_channel_get_{rx,tx}_queue() to assert that the requested
      queue exists.
      
      Remove now-redundant initialisation from efx_set_channels().
      Signed-off-by: NBen Hutchings <bhutchings@solarflare.com>
      525da907
  24. 25 1月, 2011 1 次提交
  25. 11 12月, 2010 1 次提交
  26. 08 12月, 2010 1 次提交
    • B
      sfc: Generalise filter spec initialisation · c39d35eb
      Ben Hutchings 提交于
      Move search_depth arrays into per-table state.
      
      Define initialisation function efx_filter_init_rx() which sets
      everything apart from the match fields.
      
      Define efx_filter_set_{ipv4_local,ipv4_full,eth_local}() to set the
      match fields.  This allows some simplification of callers and later
      support for additional protocols and more flexible matching using
      multiple calls to these functions.
      Signed-off-by: NBen Hutchings <bhutchings@solarflare.com>
      c39d35eb