From: Nicolas Dichtel <nicolas.dichtel@6wind.com>
To: Eric Dumazet <eric.dumazet@gmail.com>,
Cong Wang <cwang@twopensource.com>
Cc: Hannes Frederic Sowa <hannes@stressinduktion.org>,
Cong Wang <xiyou.wangcong@gmail.com>,
netdev <netdev@vger.kernel.org>,
Patrick McHardy <kaber@trash.net>,
"David S. Miller" <davem@davemloft.net>
Subject: Re: [Patch net] macvlan: add NETIF_F_NETNS_LOCAL flag
Date: Wed, 12 Feb 2014 11:03:37 +0100 [thread overview]
Message-ID: <52FB46F9.5050304@6wind.com> (raw)
In-Reply-To: <1392097099.6615.74.camel@edumazet-glaptop2.roam.corp.google.com>
Le 11/02/2014 06:38, Eric Dumazet a écrit :
> On Mon, 2014-02-10 at 21:37 -0800, Eric Dumazet wrote:
>
>>
>> Simple patch would be :
>>
>> diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c
>> index 048dc8d183aa..31bbba34fd1e 100644
>> --- a/net/core/rtnetlink.c
>> +++ b/net/core/rtnetlink.c
>> @@ -963,6 +963,7 @@ static int rtnl_fill_ifinfo(struct sk_buff *skb, struct net_device *dev,
>> nla_put_u32(skb, IFLA_NUM_RX_QUEUES, dev->num_rx_queues) ||
>> #endif
>> (dev->ifindex != dev->iflink &&
>> + __dev_get_by_index(dev_net(dev), dev->iflink) &&
>> nla_put_u32(skb, IFLA_LINK, dev->iflink)) ||
>> (upper_dev &&
>> nla_put_u32(skb, IFLA_MASTER, upper_dev->ifindex)) ||
>>
>
> Hmm, not enough.
>
> We probably need to keep a pointer to iflink net structure.
This is also used in ip tunnels, but when i/o device is not in the same netns
that the tunnel device, the userland can not interpret that IFLA_LINK attribute
(userland don't have necessary information to access another netns, maybe they
will be able to do it in the future ;-)).
The goal of your patch was to avoid filling this attribute when iflink is
into a netns != from dev_net(dev)?
If yes, I agree that we need to keep a pointer to the net structure of iflink.
This information is already available in ip tunnels (struct ip_tunnel->net,
struct ip6_tnl->net) but is not generic. Maybe we can move it to struct
net_device?
next prev parent reply other threads:[~2014-02-12 10:03 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-11 1:36 [Patch net] macvlan: add NETIF_F_NETNS_LOCAL flag Cong Wang
2014-02-11 1:45 ` Hannes Frederic Sowa
2014-02-11 2:25 ` Cong Wang
2014-02-11 2:40 ` Hannes Frederic Sowa
2014-02-11 4:15 ` Eric Dumazet
2014-02-11 4:41 ` Cong Wang
2014-02-11 5:21 ` Eric Dumazet
2014-02-11 5:37 ` Eric Dumazet
2014-02-11 5:38 ` Eric Dumazet
2014-02-12 10:03 ` Nicolas Dichtel [this message]
2014-02-12 9:47 ` Nicolas Dichtel
2014-02-11 4:14 ` Eric Dumazet
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=52FB46F9.5050304@6wind.com \
--to=nicolas.dichtel@6wind.com \
--cc=cwang@twopensource.com \
--cc=davem@davemloft.net \
--cc=eric.dumazet@gmail.com \
--cc=hannes@stressinduktion.org \
--cc=kaber@trash.net \
--cc=netdev@vger.kernel.org \
--cc=xiyou.wangcong@gmail.com \
/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.