[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1427370936.25985.133.camel@edumazet-glaptop2.roam.corp.google.com>
Date: Thu, 26 Mar 2015 04:55:36 -0700
From: Eric Dumazet <eric.dumazet@...il.com>
To: Toshiaki Makita <makita.toshiaki@....ntt.co.jp>
Cc: "David S . Miller" <davem@...emloft.net>,
Patrick McHardy <kaber@...sh.net>,
Ariel Elior <ariel.elior@...gic.com>,
Amir Vadai <amirv@...lanox.com>,
Shahed Shaikh <shahed.shaikh@...gic.com>,
Dept-GELinuxNICDev@...gic.com, Jay Vosburgh <j.vosburgh@...il.com>,
Veaceslav Falico <vfalico@...il.com>,
Andy Gospodarek <gospo@...ulusnetworks.com>,
Jiri Pirko <jiri@...nulli.us>,
Linux NICS <linux.nics@...el.com>,
Vlad Yasevich <vyasevic@...hat.com>, netdev@...r.kernel.org,
e1000-devel@...ts.sourceforge.net
Subject: Re: [PATCH net-next 3/7] net: Move check for multiple vlans to
drivers
On Thu, 2015-03-26 at 14:01 +0900, Toshiaki Makita wrote:
> To allow drivers to handle the features check for multiple tags,
> move the check to ndo_features_check().
> As no drivers currently handle multiple tagged TSO, introduce
> dflt_features_check() and call it if the driver does not have
> ndo_features_check().
>
> Signed-off-by: Toshiaki Makita <makita.toshiaki@....ntt.co.jp>
> ---
> diff --git a/include/linux/if_vlan.h b/include/linux/if_vlan.h
> index bc649dd..5ceb38f 100644
> --- a/include/linux/if_vlan.h
> +++ b/include/linux/if_vlan.h
> @@ -606,4 +606,26 @@ static inline bool skb_vlan_tagged_multi(struct sk_buff *skb)
> return true;
> }
>
> +/**
> + * vlan_features_check - drop unsafe features for skb with multiple tags.
> + * @skb: skbuff to query
> + * @features: features to be checked
> + *
> + * Returns features without unsafe ones if the skb has multiple tags.
> + */
> +static inline netdev_features_t vlan_features_check(struct sk_buff *skb,
const struct sk_buff *skb
> + netdev_features_t features)
> +{
> + if (skb_vlan_tagged_multi(skb))
> + features = netdev_intersect_features(features,
> + NETIF_F_SG |
> + NETIF_F_HIGHDMA |
> + NETIF_F_FRAGLIST |
> + NETIF_F_GEN_CSUM |
> + NETIF_F_HW_VLAN_CTAG_TX |
> + NETIF_F_HW_VLAN_STAG_TX);
> +
> + return features;
> +}
> +
> #endif /* !(_LINUX_IF_VLAN_H_) */
> diff --git a/net/core/dev.c b/net/core/dev.c
> index 04bffcd..41d0db55 100644
> --- a/net/core/dev.c
> +++ b/net/core/dev.c
> @@ -2562,6 +2562,13 @@ static netdev_features_t harmonize_features(struct sk_buff *skb,
> return features;
> }
>
> +static netdev_features_t dflt_features_check(struct sk_buff *skb,
const struct sk_buff *skb
> + struct net_device *dev,
> + netdev_features_t features)
> +{
> + return vlan_features_check(skb, features);
> +}
> +
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists