1. 05 4月, 2011 1 次提交
  2. 28 3月, 2011 1 次提交
    • S
      net: fix ethtool->set_flags not intended -EINVAL return value · 673e63c6
      Stanislaw Gruszka 提交于
      After commit d5dbda23 "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: NStanislaw Gruszka <sgruszka@redhat.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      673e63c6
  3. 22 3月, 2011 1 次提交
  4. 19 3月, 2011 1 次提交
  5. 24 2月, 2011 1 次提交
  6. 18 2月, 2011 2 次提交
    • M
      net: introduce NETIF_F_RXCSUM · e83d360d
      Michał Mirosław 提交于
      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: NMichał Mirosław <mirq-linux@rere.qmqm.pl>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      e83d360d
    • M
      net: Introduce new feature setting ops · 5455c699
      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: NMichał Mirosław <mirq-linux@rere.qmqm.pl>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      5455c699
  7. 11 12月, 2010 1 次提交
  8. 21 10月, 2010 1 次提交
  9. 22 9月, 2010 2 次提交
  10. 18 9月, 2010 2 次提交
  11. 16 9月, 2010 2 次提交
  12. 01 7月, 2010 2 次提交
  13. 29 6月, 2010 1 次提交
    • B
      ethtool: Fix potential user buffer overflow for ETHTOOL_{G, S}RXFH · bf988435
      Ben Hutchings 提交于
      struct ethtool_rxnfc was originally defined in 2.6.27 for the
      ETHTOOL_{G,S}RXFH command with only the cmd, flow_type and data
      fields.  It was then extended in 2.6.30 to support various additional
      commands.  These commands should have been defined to use a new
      structure, but it is too late to change that now.
      
      Since user-space may still be using the old structure definition
      for the ETHTOOL_{G,S}RXFH commands, and since they do not need the
      additional fields, only copy the originally defined fields to and
      from user-space.
      Signed-off-by: NBen Hutchings <bhutchings@solarflare.com>
      Cc: stable@kernel.org
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      bf988435
  14. 15 6月, 2010 1 次提交
  15. 08 4月, 2010 1 次提交
  16. 31 3月, 2010 1 次提交
  17. 06 3月, 2010 2 次提交
    • J
      ethtool: Add direct access to ops->get_sset_count · d17792eb
      Jeff Garzik 提交于
      On 03/04/2010 09:26 AM, Ben Hutchings wrote:
      > On Thu, 2010-03-04 at 00:51 -0800, Jeff Kirsher wrote:
      >> From: Jeff Garzik<jgarzik@redhat.com>
      >>
      >> This patch is an alternative approach for accessing string
      >> counts, vs. the drvinfo indirect approach.  This way the drvinfo
      >> space doesn't run out, and we don't break ABI later.
      > [...]
      >> --- a/net/core/ethtool.c
      >> +++ b/net/core/ethtool.c
      >> @@ -214,6 +214,10 @@ static noinline int ethtool_get_drvinfo(struct net_device *dev, void __user *use
      >>   	info.cmd = ETHTOOL_GDRVINFO;
      >>   	ops->get_drvinfo(dev,&info);
      >>
      >> +	/*
      >> +	 * this method of obtaining string set info is deprecated;
      >> +	 * consider using ETHTOOL_GSSET_INFO instead
      >> +	 */
      >
      > This comment belongs on the interface (ethtool.h) not the
      > implementation.
      
      Debatable -- the current comment is located at the callsite of
      ops->get_sset_count(), which is where an implementor might think to add
      a new call.  Not all the numeric fields in ethtool_drvinfo are obtained
      from ->get_sset_count().
      
      Hence the "some" in the attached patch to include/linux/ethtool.h,
      addressing your comment.
      
      > [...]
      >> +static noinline int ethtool_get_sset_info(struct net_device *dev,
      >> +                                          void __user *useraddr)
      >> +{
      > [...]
      >> +	/* calculate size of return buffer */
      >> +	for (i = 0; i<  64; i++)
      >> +		if (sset_mask&  (1ULL<<  i))
      >> +			n_bits++;
      > [...]
      >
      > We have a function for this:
      >
      > 	n_bits = hweight64(sset_mask);
      
      Agreed.
      
      I've attached a follow-up patch, which should enable my/Jeff's kernel
      patch to be applied, followed by this one.
      Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      d17792eb
    • J
      ethtool: Add direct access to ops->get_sset_count · 723b2f57
      Jeff Garzik 提交于
      This patch is an alternative approach for accessing string
      counts, vs. the drvinfo indirect approach.  This way the drvinfo
      space doesn't run out, and we don't break ABI later.
      Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
      Signed-off-by: NPeter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
      Signed-off-by: NJeff Kirsher <jeffrey.t.kirsher@intel.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      723b2f57
  18. 26 2月, 2010 2 次提交
  19. 15 2月, 2010 1 次提交
  20. 11 2月, 2010 1 次提交
  21. 04 12月, 2009 1 次提交
  22. 29 11月, 2009 1 次提交
  23. 03 11月, 2009 1 次提交
  24. 07 10月, 2009 1 次提交
    • B
      ethtool: Add reset operation · d73d3a8c
      Ben Hutchings 提交于
      After updating firmware stored in flash, users may wish to reset the
      relevant hardware and start the new firmware immediately.  This should
      not be completely automatic as it may be disruptive.
      
      A selective reset may also be useful for debugging or diagnostics.
      
      This adds a separate reset operation which takes flags indicating the
      components to be reset.  Drivers are allowed to reset only a subset of
      those requested, and must indicate the actual subset.  This allows the
      use of generic component masks and some future expansion.
      Signed-off-by: NBen Hutchings <bhutchings@solarflare.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      d73d3a8c
  25. 05 10月, 2009 1 次提交
  26. 03 9月, 2009 1 次提交
  27. 28 7月, 2009 1 次提交
  28. 09 6月, 2009 1 次提交
  29. 30 4月, 2009 3 次提交
  30. 20 2月, 2009 1 次提交
  31. 16 12月, 2008 1 次提交