From: "Michał Mirosław" <mirq-linux@rere.qmqm.pl>
To: netdev@vger.kernel.org
Subject: [RFC PATCH 00/12] net: Unified offload configuration
Date: Wed, 15 Dec 2010 23:24:29 +0100 (CET) [thread overview]
Message-ID: <cover.1292451559.git.mirq-linux@rere.qmqm.pl> (raw)
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
next reply other threads:[~2010-12-15 22:24 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-12-15 22:24 Michał Mirosław [this message]
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 01/12] net: Move check of checksum features to netdev_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 06/12] bridge: convert br_features_recompute() to ndo_fix_features 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 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 05/12] net: ethtool: use ndo_fix_features for ethtool_ops->set_flags Michał Mirosław
2010-12-15 22:24 ` [RFC PATCH 10/12] Intel net drivers: convert to ndo_fix_features Michał Mirosław
2010-12-15 22:24 ` [RFC PATCH 12/12] skge: convert to hw_features Michał Mirosław
2010-12-15 22:24 ` [RFC PATCH 11/12] veth: " Michał Mirosław
2010-12-15 22:24 ` [RFC PATCH 08/12] jme: convert offload constraints to ndo_fix_features Michał Mirosław
2010-12-15 22:24 ` [RFC PATCH 09/12] virtio_net: convert " Michał Mirosław
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=cover.1292451559.git.mirq-linux@rere.qmqm.pl \
--to=mirq-linux@rere.qmqm.pl \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).