All of lore.kernel.org
 help / color / mirror / Atom feed
From: John Fastabend <john.r.fastabend@intel.com>
To: Michal Kubecek <mkubecek@suse.cz>
Cc: netdev@vger.kernel.org, "David S. Miller" <davem@davemloft.net>,
	Patrick McHardy <kaber@trash.net>
Subject: Re: [PATCH net 1/2] macvlan: introduce IFF_MACVLAN flag and helper functions
Date: Fri, 08 Nov 2013 07:06:15 -0800	[thread overview]
Message-ID: <527CFDE7.4040405@intel.com> (raw)
In-Reply-To: <7ca53d743ffa48f671c35335473798c66d908d56.1383915401.git.mkubecek@suse.cz>

On 11/8/2013 5:41 AM, Michal Kubecek wrote:
> Introduce IFF_MACVLAN flag to recognize macvlan devices and two
> helper functions, is_macvlan_dev() and macvlan_dev_real_dev().
> These work like similar functions for 802.1q VLAN devices.
>
> Signed-off-by: Michal Kubecek <mkubecek@suse.cz>
> ---
>   drivers/net/macvlan.c      |  2 +-
>   include/linux/if_macvlan.h | 26 ++++++++++++++++++++++++++
>   include/uapi/linux/if.h    |  1 +
>   3 files changed, 28 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/net/macvlan.c b/drivers/net/macvlan.c
> index 9bf46bd..3bdac0a 100644
> --- a/drivers/net/macvlan.c
> +++ b/drivers/net/macvlan.c
> @@ -685,7 +685,7 @@ void macvlan_common_setup(struct net_device *dev)
>   	ether_setup(dev);
>
>   	dev->priv_flags	       &= ~(IFF_XMIT_DST_RELEASE | IFF_TX_SKB_SHARING);
> -	dev->priv_flags	       |= IFF_UNICAST_FLT;
> +	dev->priv_flags	       |= IFF_UNICAST_FLT | IFF_MACVLAN;
>   	dev->netdev_ops		= &macvlan_netdev_ops;
>   	dev->destructor		= free_netdev;
>   	dev->header_ops		= &macvlan_hard_header_ops;
> diff --git a/include/linux/if_macvlan.h b/include/linux/if_macvlan.h
> index ddd33fd..8f355f9 100644
> --- a/include/linux/if_macvlan.h
> +++ b/include/linux/if_macvlan.h
> @@ -118,4 +118,30 @@ extern int macvlan_link_register(struct rtnl_link_ops *ops);
>   extern netdev_tx_t macvlan_start_xmit(struct sk_buff *skb,
>   				      struct net_device *dev);
>
> +#if IS_ENABLED(CONFIG_MACVLAN)
> +static inline bool is_macvlan_dev(struct net_device *dev)
> +{
> +	return dev->priv_flags & IFF_MACVLAN;
> +}
> +

I just added this to netdevice.h here,

+static inline bool netif_is_macvlan(struct net_device *dev)
+{
+	return dev->priv_flags & IFF_MACVLAN;
+}
+

although I didn't wrap it in the IS_ENABLED if/else, but a
bitmask in slow path probably doesn't matter. As a precedent
none of the other netif_is_* bitmasks are wrapped like this.

The patch is

commit 2a47fa45d4dfbc54659d28de311a1f764b296a3c
Author: John Fastabend <john.r.fastabend@intel.com>
Date:   Wed Nov 6 09:54:52 2013 -0800

     ixgbe: enable l2 forwarding acceleration for macvlans


I think you need to respin the patch with just the
macvlan_dev_real_dev() part.

Thanks,
John

  reply	other threads:[~2013-11-08 15:06 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-08 13:40 [PATCH net 0/2] macvlan: disable LRO on lowerdev instead of a macvlan Michal Kubecek
2013-11-08 13:41 ` [PATCH net 1/2] macvlan: introduce IFF_MACVLAN flag and helper functions Michal Kubecek
2013-11-08 15:06   ` John Fastabend [this message]
2013-11-08 15:23     ` Michal Kubecek
2013-11-08 13:41 ` [PATCH net 2/2] macvlan: disable LRO on lower device instead of macvlan Michal Kubecek

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=527CFDE7.4040405@intel.com \
    --to=john.r.fastabend@intel.com \
    --cc=davem@davemloft.net \
    --cc=kaber@trash.net \
    --cc=mkubecek@suse.cz \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.