05 Jan, 2012

2 commits

  • All implementations have been converted to implement set_rxnfc
    instead.

    Signed-off-by: Ben Hutchings
    Signed-off-by: David S. Miller

    Ben Hutchings
     
  • Define special location values for RX NFC that request the driver to
    select the actual rule location. This allows for implementation on
    devices that use hash-based filter lookup, whereas currently the API is
    more suited to devices with TCAM lookup or linear search.

    In ethtool_set_rxnfc() and the compat wrapper ethtool_ioctl(), copy
    the structure back to user-space after insertion so that the actual
    location is returned.

    Signed-off-by: Ben Hutchings
    Signed-off-by: David S. Miller

    Ben Hutchings
     

17 Dec, 2011

3 commits

  • All drivers that support modification of the RX flow hash indirection
    table initialise it in the same way: RX rings are assigned to table
    entries in rotation. Make that default policy explicit by having them
    call a ethtool_rxfh_indir_default() function.

    In the ethtool core, add support for a zero size value for
    ETHTOOL_SRXFHINDIR, which resets the table to this default.

    Partly-suggested-by: Matt Carlson
    Signed-off-by: Ben Hutchings
    Acked-by: Shreyas N Bhatewara
    Signed-off-by: David S. Miller

    Ben Hutchings
     
  • Add a new ethtool operation (get_rxfh_indir_size) to get the
    indirectional table size. Use this to validate the user buffer size
    before calling get_rxfh_indir or set_rxfh_indir. Use get_rxnfc to get
    the number of RX rings, and validate the contents of the new
    indirection table before calling set_rxfh_indir. Remove this
    validation from drivers.

    Signed-off-by: Ben Hutchings
    Acked-by: Dimitris Michailidis
    Signed-off-by: David S. Miller

    Ben Hutchings
     
  • In order to find out the device's RX flow hash table size, ethtool
    initially uses ETHTOOL_GRXFHINDIR with a buffer size of zero. This
    must be supported, but it is not necessary to support any other user
    buffer size less than the device table size.

    Signed-off-by: Ben Hutchings
    Signed-off-by: David S. Miller

    Ben Hutchings
     

17 Nov, 2011

1 commit


05 Nov, 2011

1 commit


17 Sep, 2011

4 commits

  • A user-space process must use ETHTOOL_GRXCLSRLCNT to find the number
    of classification rules, then allocate a buffer of the right size,
    then use ETHTOOL_GRXCLSRLALL to fill the buffer. If some other
    process inserts or deletes a rule between those two operations,
    the user buffer might turn out to be the wrong size.

    If it's too small, the return value will be -EMSGSIZE. But if it's
    too large, there is no indication of this. Fix this by updating
    the rule_cnt field on return.

    Signed-off-by: Ben Hutchings
    Signed-off-by: David S. Miller

    Ben Hutchings
     
  • Correct the description of ethtool_rxnfc::rule_locs; it is an array
    of currently used locations, not all possible valid locations.

    Add note that drivers must not use ethtool_rxnfc::rule_locs.

    The rule_locs argument to ethtool_ops::get_rxnfc is either NULL or a
    pointer to an array of u32, so change the parameter type accordingly.

    Signed-off-by: Ben Hutchings
    Signed-off-by: David S. Miller

    Ben Hutchings
     
  • The location of an RX flow classification rule is needed to identify
    it for retrieval, replacement or deletion. However it also defines
    the priority of the rule in the case that a flow is matched by
    multiple rules. This is what I intended to imply by referring to the
    use of a TCAM, commonly used to implement that behaviour.

    However there are other ways this can be done, and it is better to
    specify this explicitly. Further, I want to add the option for
    automatic selection of rule locations.

    Signed-off-by: Ben Hutchings
    Signed-off-by: David S. Miller

    Ben Hutchings
     
  • Refer consistently to 'classification rules' or just 'rules' rather
    than 'filter specifications' or 'filter rules'.

    Refer consistently to rule 'locations' and not 'indices'.

    Signed-off-by: Ben Hutchings
    Signed-off-by: David S. Miller

    Ben Hutchings
     

16 Sep, 2011

1 commit

  • This patch does several things:
    - introduces __ethtool_get_settings which is called from ethtool code and
    from drivers as well. Put ASSERT_RTNL there.
    - dev_ethtool_get_settings() is replaced by __ethtool_get_settings()
    - changes calling in drivers so rtnl locking is respected. In
    iboe_get_rate was previously ->get_settings() called unlocked. This
    fixes it. Also prb_calc_retire_blk_tmo() in af_packet.c had the same
    problem. Also fixed by calling __dev_get_by_index() instead of
    dev_get_by_index() and holding rtnl_lock for both calls.
    - introduces rtnl_lock in bnx2fc_vport_create() and fcoe_vport_create()
    so bnx2fc_if_create() and fcoe_if_create() are called locked as they
    are from other places.
    - use __ethtool_get_settings() in bonding code

    Signed-off-by: Jiri Pirko

    v2->v3:
    -removed dev_ethtool_get_settings()
    -added ASSERT_RTNL into __ethtool_get_settings()
    -prb_calc_retire_blk_tmo - use __dev_get_by_index() and lock
    around it and __ethtool_get_settings() call
    v1->v2:
    add missing export_symbol
    Reviewed-by: Ben Hutchings [except FCoE bits]
    Acked-by: Ralf Baechle
    Signed-off-by: David S. Miller

    Jiri Pirko
     

17 Aug, 2011

5 commits


01 Jul, 2011

1 commit

  • External loopback test can be performed by application without any driver
    support on normal Ethernet cards.
    But on CNA devices, where multiple functions share same physical port.
    Here internal loopback test and external loopback test can be initiated by
    multiple functions at same time. To co exist all functions, firmware need
    to regulate what test can be run by which function. So before performing external
    loopback test, command need to send to firmware, which will quiescent other functions.

    User may not want to run external loopback test always. As special cable need to be
    connected for this test.
    So adding explicit flag in ethtool self test, which will specify interface
    to perform external loopback test.
    ETH_TEST_FL_EXTERNAL_LB: Application set to request external loopback test
    ETH_TEST_FL_EXTERNAL_LB_DONE: Driver ack if test performed

    Signed-off-by: Amit Kumar Salecha
    Reviewed-by: Ben Hutchings
    Signed-off-by: David S. Miller

    Amit Kumar Salecha
     

21 Jun, 2011

1 commit


10 Jun, 2011

1 commit


09 Jun, 2011

1 commit

  • This change is meant to remove all support for displaying an ntuple as
    strings via ETHTOOL_GRXNTUPLE. The reason for this change is due to the
    fact that multiple issues have been found including:
    - Multiple buffer overruns for strings being displayed.
    - Incorrect filters displayed, cleared filters with ring of -2 are displayed
    - Setting get_rx_ntuple displays no rules if defined.
    - Endianess wrong on displayed values.
    - Hard limit of 1024 filters makes display functionality extremely limited

    The only driver that had supported this interface was ixgbe. Since it no
    longer uses the interface and due to the issues mentioned above I am
    submitting this patch to remove it.

    v2:
    Updated based on comments from Ben Hutchings
    - Left ETH_SS_NTUPLE_FILTERS in code but commented on it being deprecated
    - Removed ethtool_rx_ntuple_list and ethtool_rx_ntuple_flow_spec_container
    - Left ETHTOOL_GRXNTUPLE but commented it as deprecated

    Also cleaned up set_rx_ntuple since there is no flow spec container to
    maintain we can drop all the code for the alloc and free of it and just
    return ops->set_rx_ntuple().
    Signed-off-by: Alexander Duyck
    Acked-by: Ben Hutchings
    Signed-off-by: David S. Miller

    Alexander Duyck
     

14 May, 2011

1 commit

  • Added code to take FW dump via ethtool. Dump level can be controlled via setting the
    dump flag. A get function is provided to query the current setting of the dump flag.
    Dump data is obtained from the driver via a separate get function.

    Changes from v3:
    Fixed buffer length issue in ethtool_get_dump_data function.
    Updated kernel doc for ethtool_dump struct and get_dump_flag function.

    Changes from v2:
    Provided separate commands for get flag and data.
    Check for minimum of the two buffer length obtained via ethtool and driver and
    use that for dump buffer
    Pass up the driver return error codes up to the caller.
    Added kernel doc comments.

    Signed-off-by: Anirban Chakraborty
    Reviewed-by: Ben Hutchings
    Signed-off-by: David S. Miller

    Anirban Chakraborty
     

09 May, 2011

2 commits


30 Apr, 2011

2 commits

  • This makes sure that when a driver calls the ethtool's
    get/set_settings() callback of another driver, the data passed to it
    is clean. This guarantees that speed_hi will be zeroed correctly if
    the called callback doesn't explicitely set it: we are sure we don't
    get a corrupted speed from the underlying driver. We also take care of
    setting the cmd field appropriately (ETHTOOL_GSET/SSET).

    This applies to dev_ethtool_get_settings(), which now makes sure it
    sets up that ethtool command parameter correctly before passing it to
    drivers. This also means that whoever calls dev_ethtool_get_settings()
    does not have to clean the ethtool command parameter. This function
    also becomes an exported symbol instead of an inline.

    All drivers visible to make allyesconfig under x86_64 have been
    updated.

    Signed-off-by: David Decotigny
    Signed-off-by: David S. Miller

    David Decotigny
     
  • The 'ep' argument of ethtool_cmd_speed is not altered: advertise it in
    protoype. +Indentation fix. Also add comments to advise using the
    ethtool_cmd_speed API to get/set the link speed.

    Signed-off-by: David Decotigny
    Signed-off-by: David S. Miller

    David Decotigny
     

15 Apr, 2011

1 commit

  • 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: Bruce Allan
    Cc: Ben Hutchings
    Cc: Sathya Perla
    Cc: Subbu Seetharaman
    Cc: Ajit Khaparde
    Cc: Michael Chan
    Cc: Eilon Greenstein
    Cc: Divy Le Ray
    Cc: Don Fry
    Cc: Jon Mason
    Cc: Solarflare linux maintainers
    Cc: Steve Hodgson
    Cc: Stephen Hemminger
    Cc: Matt Carlson
    Acked-by: Jon Mason
    Acked-by: Ben Hutchings
    Signed-off-by: David S. Miller

    Allan, Bruce W
     

14 Apr, 2011

1 commit

  • Ethtool support to configure RX, TX and other channels. combined field
    in struct ethtool_channels to reflect set of channel (RX, TX or other).
    Other channel can be link interrupts, SR-IOV coordination etc.

    ETHTOOL_GCHANNELS will report max and current number of RX channels,
    max and current number of TX channels, max and current number of other channel
    or max and current number of combined channel.

    Number of channel can be modify upto max number of channel through
    ETHTOOL_SCHANNELS command.

    Ben Hutchings:
    o define 'combined' and 'other' types. Most multiqueue drivers pair up RX and TX
    queues so that most channels combine RX and TX work.
    o Please could you use a kernel-doc comment to describe the structure.

    Signed-off-by: Amit Kumar Salecha
    Reviewed-by: Ben Hutchings
    Signed-off-by: David S. Miller

    amit salecha
     

12 Apr, 2011

2 commits


05 Apr, 2011

3 commits

  • The ethtool ETHTOOL_PHYS_ID command runs for an arbitrarily long
    period of time, holding the RTNL lock. This blocks routing updates,
    device enumeration, and various important operations that one might
    want to keep running while hunting for the flashing LED.

    We need to drop the RTNL lock during this operation, but currently the
    core implementation is a thin wrapper around a driver operation and
    drivers may well depend upon holding the lock.

    Define a new driver operation 'set_phys_id' with an argument that sets
    the ID indicator on/off/inactive/active (the last optional, for any
    driver or firmware that prefers to handle blinking asynchronously).
    When this is defined, the ethtool core drops the lock while waiting
    and only acquires it around calls to this operation.

    Deprecate the 'phys_id' operation in favour of this. It can be
    removed once all in-tree drivers are converted.

    Signed-off-by: Ben Hutchings

    Ben Hutchings
     
  • Briefly document all operations (except get_rx_ntuple), including
    whether they may return an error code and whether they are deprecated.
    Also mention some things that should be handled by the ethtool core
    rather than by drivers.

    Briefly document general requirements for callers.

    Signed-off-by: Ben Hutchings

    Ben Hutchings
     
  • Signed-off-by: Ben Hutchings

    Ben Hutchings
     

31 Mar, 2011

1 commit


28 Mar, 2011

1 commit

  • After commit d5dbda23804156ae6f35025ade5307a49d1db6d7 "ethtool: Add
    support for vlan accleration.", drivers that have NETIF_F_HW_VLAN_TX,
    and/or NETIF_F_HW_VLAN_RX feature, but do not allow enable/disable vlan
    acceleration via ethtool set_flags, always return -EINVAL from that
    function. Fix by returning -EINVAL only if requested features do not
    match current settings and can not be changed by driver.

    Change any driver that define ethtool->set_flags to use
    ethtool_invalid_flags() to avoid similar problems in the future
    (also on drivers that do not have the problem).

    Tested with modified (to reproduce this bug) myri10ge driver.

    Cc: stable@kernel.org # 2.6.37+
    Signed-off-by: Stanislaw Gruszka
    Signed-off-by: David S. Miller

    Stanislaw Gruszka
     

22 Mar, 2011

1 commit


19 Mar, 2011

1 commit

  • This structure was accidentally defined such that its layout can
    differ between 32-bit and 64-bit processes. Add compat structure
    definitions and an ioctl wrapper function.

    Signed-off-by: Ben Hutchings
    Acked-by: Alexander Duyck
    Cc: stable@kernel.org [2.6.30+]
    Signed-off-by: David S. Miller

    Ben Hutchings
     

24 Feb, 2011

1 commit


18 Feb, 2011

2 commits

  • Introduce NETIF_F_RXCSUM to replace device-private flags for RX checksum
    offload. Integrate it with ndo_fix_features.

    ethtool_op_get_rx_csum() is removed altogether as nothing in-tree uses it.

    Signed-off-by: Michał Mirosław
    Signed-off-by: David S. Miller

    Michał Mirosław
     
  • This introduces a new framework to handle device features setting.
    It consists of:
    - new fields in struct net_device:
    + hw_features - features that hw/driver supports toggling
    + wanted_features - features that user wants enabled, when possible
    - new netdev_ops:
    + feat = ndo_fix_features(dev, feat) - API checking constraints for
    enabling features or their combinations
    + ndo_set_features(dev) - API updating hardware state to match
    changed dev->features
    - new ethtool commands:
    + ETHTOOL_GFEATURES/ETHTOOL_SFEATURES: get/set dev->wanted_features
    and trigger device reconfiguration if resulting dev->features
    changed
    + ETHTOOL_GSTRINGS(ETH_SS_FEATURES): get feature bits names (meaning)

    Signed-off-by: Michał Mirosław
    Signed-off-by: David S. Miller

    Michał Mirosław