All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alexei Starovoitov <alexei.starovoitov@gmail.com>
To: Eric Dumazet <eric.dumazet@gmail.com>
Cc: Nicolas Dichtel <nicolas.dichtel@6wind.com>,
	davem@davemloft.net, netdev@vger.kernel.org,
	roopa@cumulusnetworks.com, tgraf@suug.ch
Subject: Re: [PATCH net-next v2] route: allow to route in a peer netns via lwt framework
Date: Fri, 24 Jul 2015 09:27:25 -0700	[thread overview]
Message-ID: <20150724162723.GA32909@Alexeis-MBP.westell.com> (raw)
In-Reply-To: <1437752397.20182.8.camel@edumazet-glaptop2.roam.corp.google.com>

On Fri, Jul 24, 2015 at 05:39:57PM +0200, Eric Dumazet wrote:
> 
> On Fri, 2015-07-24 at 16:16 +0200, Nicolas Dichtel wrote:
> > This patch takes advantage of the newly added lwtunnel framework to
> > allow the user to set routes that point to a peer netns.
> > 
> > Packets are injected to the peer netns via the loopback device. It works
> > only when the output device is 'lo'.
> > 
> > Example:
> > ip route add 40.1.1.1/32 encap netns nsid 5 via dev lo
> > 
> 
> Is this feature so badly wanted to add complexity on lo device ?
...
> >  static netdev_tx_t loopback_xmit(struct sk_buff *skb,
> >  				 struct net_device *dev)
...
> > +	if (nsid != NETNSA_NSID_NOT_ASSIGNED) {
> > +		peernet = get_net_ns_by_id(dev_net(dev), nsid);
> > +		if (!peernet) {
> > +			kfree_skb(skb);
> > +			goto end;
> > +		}
> > +
> > +		/* it's OK to use per_cpu_ptr() because BHs are off */
> > +		lb_stats = this_cpu_ptr(peernet->loopback_dev->lstats);
> > +		ret = dev_forward_skb(peernet->loopback_dev, skb);

have the same concern as Eric.
Using loopback for this looks wrong.
netns suppose to look like host, but I cannot imagine a host
without NICs seeing packets on loopback from another world.
Then how the opposite direction suppose to work?
netns will setup a route to send packets to loopback of the host?!
The idea of using routing to forward packets to namespaces is great,
but I think we need something else instead of loopback.

  reply	other threads:[~2015-07-24 16:27 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-23 14:22 [PATCH net-next] route: allow to route in a peer netns via lwt framework Nicolas Dichtel
2015-07-23 15:01 ` roopa
2015-07-23 15:25   ` Nicolas Dichtel
2015-07-23 15:50     ` roopa
2015-07-24 12:24       ` Nicolas Dichtel
2015-07-24 13:50         ` roopa
2015-07-24 14:11           ` Nicolas Dichtel
2015-07-24 14:16     ` [PATCH net-next v2] " Nicolas Dichtel
2015-07-24 15:39       ` Eric Dumazet
2015-07-24 16:27         ` Alexei Starovoitov [this message]
2015-07-27 19:56         ` Nicolas Dichtel
2015-07-29 13:16           ` [PATCH net-next v3] " Nicolas Dichtel
2015-07-29 15:20             ` Eric Dumazet
2015-07-29 21:17               ` Nicolas Dichtel
2015-07-24 14:28 ` [PATCH net-next] " David Ahern
2015-07-24 14:32   ` Nicolas Dichtel
2015-07-24 15:19     ` David Ahern
2015-07-27 20:07       ` Nicolas Dichtel

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=20150724162723.GA32909@Alexeis-MBP.westell.com \
    --to=alexei.starovoitov@gmail.com \
    --cc=davem@davemloft.net \
    --cc=eric.dumazet@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=nicolas.dichtel@6wind.com \
    --cc=roopa@cumulusnetworks.com \
    --cc=tgraf@suug.ch \
    /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.