From: Ben Hutchings <bhutchings@solarflare.com>
To: "Michał Mirosław" <mirq-linux@rere.qmqm.pl>
Cc: netdev@vger.kernel.org, "David S. Miller" <davem@davemloft.net>
Subject: Re: [RFT PATCH 4/9] net: introduce and use netdev_features_t for device features sets
Date: Mon, 20 Jun 2011 22:01:36 +0100 [thread overview]
Message-ID: <1308603696.2701.185.camel@bwh-desktop> (raw)
In-Reply-To: <24e8026de1130f193dc82315f83ad64fcce771d8.1308596963.git.mirq-linux@rere.qmqm.pl>
On Mon, 2011-06-20 at 21:14 +0200, Michał Mirosław wrote:
> The type and bits definitions are moved to separate header so that
> linux/skbuff.h won't need to include linux/netdevice.h.
[...]
> diff --git a/drivers/net/sfc/efx.c b/drivers/net/sfc/efx.c
> index c914729..ca869c0 100644
> --- a/drivers/net/sfc/efx.c
> +++ b/drivers/net/sfc/efx.c
> @@ -1883,7 +1883,7 @@ static void efx_set_multicast_list(struct net_device *net_dev)
> /* Otherwise efx_start_port() will do this */
> }
>
> -static int efx_set_features(struct net_device *net_dev, u32 data)
> +static int efx_set_features(struct net_device *net_dev, netdev_features_t data)
> {
> struct efx_nic *efx = netdev_priv(net_dev);
>
The type of efx_nic_type::offload_features, defined in
drivers/net/sfc/net_driver.h, will also need to be changed.
[...]
> --- /dev/null
> +++ b/include/linux/netdev_features.h
[...]
> + /* Segmentation offload features */
[...]
> + /* Features valid for ethtool to change */
> + /* = all defined minus driver/device-class-related */
[...]
> + /* List of features with software fallbacks. */
[...]
> + /*
> + * If one device supports one of these features, then enable them
> + * for all in netdev_increment_features.
> + */
[...]
> + /*
> + * If one device doesn't support one of these features, then disable it
> + * for all in netdev_increment_features.
> + */
[...]
> + /* changeable features with no special hardware requirements */
[...]
A cosmetic detail: these comments should no longer be indented.
[...]
> diff --git a/net/core/dev.c b/net/core/dev.c
> index 3041b6ae..a5a0e76 100644
> --- a/net/core/dev.c
> +++ b/net/core/dev.c
[...]
> @@ -1872,8 +1872,8 @@ struct sk_buff *skb_gso_segment(struct sk_buff *skb, u32 features)
> if (dev && dev->ethtool_ops && dev->ethtool_ops->get_drvinfo)
> dev->ethtool_ops->get_drvinfo(dev, &info);
>
> - WARN(1, "%s: caps=(0x%lx, 0x%lx) len=%d data_len=%d ip_summed=%d\n",
> - info.driver, dev ? dev->features : 0L,
> + WARN(1, "%s: caps=(0x%llx, 0x%lx) len=%d data_len=%d ip_summed=%d\n",
> + info.driver, dev ? (long long)dev->features : 0LL,
> skb->sk ? skb->sk->sk_route_caps : 0L,
> skb->len, skb->data_len, skb->ip_summed);
The types of sock::sk_route_caps and sock::sk_route_nocaps also need to
be fixed (they are still int and not even unsigned!).
[...]
> @@ -5250,11 +5252,10 @@ u32 netdev_fix_features(struct net_device *dev, u32 features)
>
> return features;
> }
> -EXPORT_SYMBOL(netdev_fix_features);
I don't think that change belongs in this patch!
[...]
> @@ -5270,8 +5271,10 @@ int __netdev_update_features(struct net_device *dev)
> if (dev->features == features)
> return 0;
>
> + BUILD_BUG_ON(sizeof(features) != sizeof(u32)); /* XXX: need: %Fx */
> +
> netdev_dbg(dev, "Features changed: 0x%08x -> 0x%08x\n",
> - dev->features, features);
> + (u32)dev->features, (u32)features);
[...]
You could either define macros for this:
#define NETDEV_FEATURES_FMT "0x%08x"
#define NETDEV_FEATURES_FMT_ARG(features) features
or follow the current trend of extending %p and passing a pointer to the
value.
Ben.
--
Ben Hutchings, Senior Software Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.
next prev parent reply other threads:[~2011-06-20 21:01 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-20 19:14 [RFT PATCH 0/9] Cleanup and extension of netdev features Michał Mirosław
2011-06-20 19:14 ` [RFT PATCH 5/9] net: Define enum for net device features Michał Mirosław
2011-06-20 19:14 ` [RFT PATCH 2/9] net: remove legacy ethtool ops Michał Mirosław
2011-06-20 19:14 ` [RFT PATCH 4/9] net: introduce and use netdev_features_t for device features sets Michał Mirosław
2011-06-20 21:01 ` Ben Hutchings [this message]
2011-06-20 19:14 ` [RFT PATCH 3/9] net: ethtool: break association of ETH_FLAG_* with NETIF_F_* Michał Mirosław
2011-06-20 20:11 ` Ben Hutchings
2011-06-20 20:27 ` David Miller
2011-06-20 20:51 ` Stephen Hemminger
2011-06-20 20:52 ` David Miller
2011-06-20 21:30 ` Ben Hutchings
2011-06-20 19:14 ` [RFT PATCH 6/9] net: ethtool: use C99 array initialization for feature-names table Michał Mirosław
2011-06-20 19:14 ` [RFT PATCH 8/9] net: extend netdev_features_t to 64 bits Michał Mirosław
2011-06-20 19:14 ` [RFT PATCH 9/9] net: move NOCACHE_COPY checks to netdev_fix_features() Michał Mirosław
2011-06-20 19:14 ` [RFT PATCH 7/9] ethtool: prepare for larger netdev_features_t type Michał Mirosław
2011-06-20 21:16 ` Ben Hutchings
2011-06-23 17:50 ` Mahesh Bandewar
2011-06-23 18:03 ` Ben Hutchings
2011-06-23 18:21 ` Mahesh Bandewar
2011-06-23 18:55 ` Ben Hutchings
2011-06-23 20:38 ` Mahesh Bandewar
2011-06-20 19:35 ` [RFT PATCH 0/9] Cleanup and extension of netdev features David Miller
2011-06-20 19:47 ` Michał Mirosław
2011-06-20 19:55 ` [IGNORE PATCH 1/9] Intel net drivers: convert to ndo_fix_features Michał Mirosław
2011-06-21 21:43 ` [RFT PATCH 0/9] Cleanup and extension of netdev features Ben Greear
2011-06-21 21:52 ` Ben Hutchings
2011-06-21 23:27 ` Jeff Kirsher
2011-06-23 17:42 ` Mahesh Bandewar
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=1308603696.2701.185.camel@bwh-desktop \
--to=bhutchings@solarflare.com \
--cc=davem@davemloft.net \
--cc=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).