From: David Ahern <dsa@cumulusnetworks•com>
To: Nicolas Dichtel <nicolas.dichtel@6wind•com>, davem@davemloft•net
Cc: netdev@vger•kernel.org, roopa@cumulusnetworks•com, tgraf@suug•ch
Subject: Re: [PATCH net-next] route: allow to route in a peer netns via lwt framework
Date: Fri, 24 Jul 2015 08:28:43 -0600 [thread overview]
Message-ID: <55B24B9B.4080001@cumulusnetworks.com> (raw)
In-Reply-To: <1437661349-17620-1-git-send-email-nicolas.dichtel@6wind.com>
On 7/23/15 8:22 AM, Nicolas Dichtel wrote:
> static netdev_tx_t loopback_xmit(struct sk_buff *skb,
> struct net_device *dev)
> {
> + int nsid = skb_lwt_netns_info(skb);
> struct pcpu_lstats *lb_stats;
> int len;
>
> + if (nsid >= 0) {
> + struct net *peernet = get_net_ns_by_id(dev_net(dev), nsid);
> +
> + if (!peernet) {
If nsid is > 0 then the peer namespace should exist right? So for this
failure path why not increment tx_error stat?
> + kfree_skb(skb);
> + goto end;
> + }
> +
> + dev_forward_skb(peernet->loopback_dev, skb);
> + put_net(peernet);
> + goto end;
> + }
> +
> skb_orphan(skb);
>
> /* Before queueing this packet to netif_rx(),
next prev parent reply other threads:[~2015-07-24 14:28 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
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 ` David Ahern [this message]
2015-07-24 14:32 ` [PATCH net-next] " 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=55B24B9B.4080001@cumulusnetworks.com \
--to=dsa@cumulusnetworks$(echo .)com \
--cc=davem@davemloft$(echo .)net \
--cc=netdev@vger$(echo .)kernel.org \
--cc=nicolas.dichtel@6wind$(echo .)com \
--cc=roopa@cumulusnetworks$(echo .)com \
--cc=tgraf@suug$(echo .)ch \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox