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: [PATCH 2/2] net: verify GSO flag bits against netdev features
Date: Thu, 17 Nov 2011 00:35:18 +0000 [thread overview]
Message-ID: <1321490118.2709.87.camel@bwh-desktop> (raw)
In-Reply-To: <20111117001312.GB9596@rere.qmqm.pl>
On Thu, 2011-11-17 at 01:13 +0100, Michał Mirosław wrote:
> On Thu, Nov 17, 2011 at 12:09:56AM +0000, Ben Hutchings wrote:
> > On Thu, 2011-11-17 at 01:05 +0100, Michał Mirosław wrote:
> > > Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
> > > ---
> > > include/linux/netdevice.h | 9 +++++++++
> > > 1 files changed, 9 insertions(+), 0 deletions(-)
> > >
> > > diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
> > > index b35ffd7..31da3bb 100644
> > > --- a/include/linux/netdevice.h
> > > +++ b/include/linux/netdevice.h
> > > @@ -2492,6 +2492,15 @@ netdev_features_t netif_skb_features(struct sk_buff *skb);
> > > static inline int net_gso_ok(netdev_features_t features, int gso_type)
> > > {
> > > netdev_features_t feature = gso_type << NETIF_F_GSO_SHIFT;
> > > +
> > > + /* check flags correspondence */
> > > + BUILD_BUG_ON(SKB_GSO_TCPV4 != (NETIF_F_TSO >> NETIF_F_GSO_SHIFT));
> > > + BUILD_BUG_ON(SKB_GSO_UDP != (NETIF_F_UFO >> NETIF_F_GSO_SHIFT));
> > > + BUILD_BUG_ON(SKB_GSO_DODGY != (NETIF_F_GSO_ROBUST >> NETIF_F_GSO_SHIFT));
> > > + BUILD_BUG_ON(SKB_GSO_TCP_ECN != (NETIF_F_TSO_ECN >> NETIF_F_GSO_SHIFT));
> > > + BUILD_BUG_ON(SKB_GSO_TCPV6 != (NETIF_F_TSO6 >> NETIF_F_GSO_SHIFT));
> > > + BUILD_BUG_ON(SKB_GSO_FCOE != (NETIF_F_FSO >> NETIF_F_GSO_SHIFT));
> > > +
> > > return (features & feature) == feature;
> > > }
> > This is fine but should still be done at the same time as changing the
> > definitions.
>
> Agreed. But as Dave was quicker, we need to fix this in separate patch.
Sorry, I somehow failed to spot that.
Ben.
--
Ben Hutchings, Staff 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-11-17 0:35 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-11-17 0:05 [PATCH 1/2] net: drivers: use bool type instead of double negation Michał Mirosław
2011-11-17 0:05 ` [PATCH 2/2] net: verify GSO flag bits against netdev features Michał Mirosław
2011-11-17 0:09 ` Ben Hutchings
2011-11-17 0:13 ` Michał Mirosław
2011-11-17 0:35 ` Ben Hutchings [this message]
2011-11-17 1:41 ` David Miller
2011-11-17 1:40 ` [PATCH 1/2] net: drivers: use bool type instead of double negation David Miller
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=1321490118.2709.87.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).