[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CALnjE+odj6GdO97n4NBLQhP4egMzuNHMjxVqMwC7fSC5C=hT-g@mail.gmail.com>
Date: Tue, 6 Jan 2015 13:16:11 -0800
From: Pravin Shelar <pshelar@...ira.com>
To: Daniele Di Proietto <daniele.di.proietto@...il.com>
Cc: netdev <netdev@...r.kernel.org>
Subject: Re: [PATCH net-next] openvswitch: Do not use private netdev_vport fields
On Tue, Jan 6, 2015 at 12:51 PM, Daniele Di Proietto
<daniele.di.proietto@...il.com> wrote:
> This commit introduces netdev_vport_index() to prevent datapath.c from directly accessing the 'dev' member of 'struct netdev_vport'.
> This fix is needed to allow possible alternative netdev_vport implementations.
>
> Signed-off-by: Daniele Di Proietto <daniele.di.proietto@...il.com>
> ---
> net/openvswitch/datapath.c | 2 +-
> net/openvswitch/vport-netdev.h | 6 ++++++
> 2 files changed, 7 insertions(+), 1 deletion(-)
>
...
>
> diff --git a/net/openvswitch/vport-netdev.h b/net/openvswitch/vport-netdev.h
> index 6f7038e..ecfcbd5 100644
> --- a/net/openvswitch/vport-netdev.h
> +++ b/net/openvswitch/vport-netdev.h
> @@ -38,6 +38,12 @@ netdev_vport_priv(const struct vport *vport)
> return vport_priv(vport);
> }
>
> +static inline int
> +netdev_vport_index(const struct vport *vport)
> +{
> + return netdev_vport_priv(vport)->dev->ifindex;
> +}
> +
Function return type and function name should be on same line,
otherwise looks good.
> const char *ovs_netdev_get_name(const struct vport *);
> void ovs_netdev_detach_dev(struct vport *);
>
> --
> 2.1.4
>
--
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