netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC PATCH 00/12] net: Unified offload configuration
@ 2010-12-15 22:24 Michał Mirosław
  2010-12-15 22:24 ` [RFC PATCH 06/12] bridge: convert br_features_recompute() to ndo_fix_features Michał Mirosław
                   ` (11 more replies)
  0 siblings, 12 replies; 25+ messages in thread
From: Michał Mirosław @ 2010-12-15 22:24 UTC (permalink / raw)
  To: netdev

This is a second attempt at defining a unified offload-setting interface
for network drivers. The changes are influenced by comments on the original
proposal and deeper look into what drivers do.

The idea:

Introduce two new fields to struct net_device to hold toggable and
user-requested feature sets. Offload features can be in:

  hw_features
	features user can toggle (e.g., via ethtool)

  wanted_features
	features requested by user - his/her wish if you prefer
	(subset of .hw_features + software-only features)

  features
	features currently active; if some offloads depend
	on other conditions, the set in .features & .hw_features
	might be not equal to .wanted_features & .hw_features

To check and transfer offload settings from .wanted_features to
.features, there are two new hooks in struct net_device_ops:

  features = ndo_fix_features(netdev, features);
	modifies passed feature set according to device-specific
	conditions

  err = ndo_set_features(netdev, features);
	should reconfigure the hardware for a new feature set

Core code:

  netdev_update_features(netdev);
	should be called after feature conditions changed, i.e.
	after MTU change, or slave device reconfiguration

  features = netdev_get_wanted_features(netdev);
	convenience function: replaces bits from .hw_features 
	(plus software-only features) in .features with .wanted_features

Other things added:
  - a compatibility layer for old ethtool ops for drivers converted
    to new offload setting API
  - transitional calls to old ethtool_ops for not-yet-converted drivers
  - a new flag for RX checksumming to replace driver-private fields/flags
  - request software offloads (GSO and GRO) by default
  - example conversions of a few drivers

Things to do after:
  - convert all drivers
  - remove redundant offload state in drivers
  - remove old ethtool_ops hooks (set_tso, set_flags, set_hw_csum, etc.)

This is only build-tested on x86 allyesconfig, so probably not for general
use, yet.

Best Regards,
Michał Mirosław

Michał Mirosław (12):
  net: Move check of checksum features to netdev_fix_features()
  net: Introduce new feature setting ops
  net: ethtool: use ndo_fix_features for offload setting
  net: introduce NETIF_F_RXCSUM
  net: ethtool: use ndo_fix_features for ethtool_ops->set_flags
  bridge: convert br_features_recompute() to ndo_fix_features
  vlan: convert VLAN devices to use ndo_fix_features()
  jme: convert offload constraints to ndo_fix_features
  virtio_net: convert to ndo_fix_features
  Intel net drivers: convert to ndo_fix_features
  veth: convert to hw_features
  skge: convert to hw_features

 drivers/net/e1000/e1000_ethtool.c  |   69 -------
 drivers/net/e1000/e1000_main.c     |   31 +++-
 drivers/net/e1000e/ethtool.c       |   62 ------
 drivers/net/e1000e/netdev.c        |   31 +++-
 drivers/net/igb/igb_ethtool.c      |   67 -------
 drivers/net/igb/igb_main.c         |   34 +++-
 drivers/net/igbvf/ethtool.c        |   57 ------
 drivers/net/igbvf/netdev.c         |   26 ++-
 drivers/net/ixgb/ixgb.h            |    2 +
 drivers/net/ixgb/ixgb_ethtool.c    |   59 +------
 drivers/net/ixgb/ixgb_main.c       |   31 +++-
 drivers/net/ixgbe/ixgbe_ethtool.c  |   65 -------
 drivers/net/ixgbe/ixgbe_main.c     |   32 +++-
 drivers/net/ixgbevf/ethtool.c      |   46 -----
 drivers/net/ixgbevf/ixgbevf_main.c |   27 +++-
 drivers/net/jme.c                  |   79 ++------
 drivers/net/jme.h                  |    2 -
 drivers/net/skge.c                 |   53 +-----
 drivers/net/skge.h                 |    1 -
 drivers/net/veth.c                 |   45 +----
 drivers/net/virtio_net.c           |   46 ++---
 include/linux/ethtool.h            |   29 +++-
 include/linux/netdevice.h          |   34 ++++
 net/8021q/vlan.c                   |    3 +-
 net/8021q/vlan_dev.c               |   51 ++----
 net/bridge/br_device.c             |   57 +-----
 net/bridge/br_if.c                 |   17 +-
 net/bridge/br_notify.c             |    2 +-
 net/bridge/br_private.h            |    4 +-
 net/core/dev.c                     |   80 ++++++--
 net/core/ethtool.c                 |  364 +++++++++++++++++++-----------------
 31 files changed, 579 insertions(+), 927 deletions(-)

-- 
1.7.2.3


^ permalink raw reply	[flat|nested] 25+ messages in thread

end of thread, other threads:[~2011-01-04 18:33 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-12-15 22:24 [RFC PATCH 00/12] net: Unified offload configuration Michał Mirosław
2010-12-15 22:24 ` [RFC PATCH 06/12] bridge: convert br_features_recompute() to ndo_fix_features Michał Mirosław
2010-12-15 22:24 ` [RFC PATCH 07/12] vlan: convert VLAN devices to use ndo_fix_features() Michał Mirosław
2010-12-16 23:36   ` Ben Hutchings
2010-12-19  1:01     ` Michał Mirosław
2010-12-15 22:24 ` [RFC PATCH 01/12] net: Move check of checksum features to netdev_fix_features() Michał Mirosław
2010-12-15 22:24 ` [RFC PATCH 02/12] net: Introduce new feature setting ops Michał Mirosław
2010-12-16 23:13   ` Ben Hutchings
2010-12-19  0:49     ` Michał Mirosław
2010-12-19 21:22       ` Ben Hutchings
2010-12-19 23:43         ` Michał Mirosław
2010-12-20 16:41           ` Ben Hutchings
2010-12-15 22:24 ` [RFC PATCH 05/12] net: ethtool: use ndo_fix_features for ethtool_ops->set_flags Michał Mirosław
2010-12-15 22:24 ` [RFC PATCH 03/12] net: ethtool: use ndo_fix_features for offload setting Michał Mirosław
2010-12-16 23:23   ` Ben Hutchings
2010-12-19  0:54     ` Michał Mirosław
2010-12-15 22:24 ` [RFC PATCH 04/12] net: introduce NETIF_F_RXCSUM Michał Mirosław
2010-12-16 23:27   ` Ben Hutchings
2010-12-19  0:57     ` Michał Mirosław
2011-01-04 18:33       ` Michał Mirosław
2010-12-15 22:24 ` [RFC PATCH 09/12] virtio_net: convert to ndo_fix_features Michał Mirosław
2010-12-15 22:24 ` [RFC PATCH 08/12] jme: convert offload constraints " Michał Mirosław
2010-12-15 22:24 ` [RFC PATCH 11/12] veth: convert to hw_features Michał Mirosław
2010-12-15 22:24 ` [RFC PATCH 12/12] skge: " Michał Mirosław
2010-12-15 22:24 ` [RFC PATCH 10/12] Intel net drivers: convert to ndo_fix_features Michał Mirosław

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).