Re: [PATCH net-next] route: allow to route in a peer netns via lwt framework

2015-07-27 Thread Nicolas Dichtel
Le 24/07/2015 17:19, David Ahern a écrit : In this case you are knowingly dropping packets. Would be nice to have a counter showing that. Ok. -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majord...@vger.kernel.org More majordomo info at http://

Re: [PATCH net-next] route: allow to route in a peer netns via lwt framework

2015-07-24 Thread David Ahern
On 7/24/15 8:32 AM, Nicolas Dichtel wrote: Le 24/07/2015 16:28, David Ahern a écrit : 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_lsta

Re: [PATCH net-next] route: allow to route in a peer netns via lwt framework

2015-07-24 Thread Nicolas Dichtel
Le 24/07/2015 16:28, David Ahern a écrit : 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

Re: [PATCH net-next] route: allow to route in a peer netns via lwt framework

2015-07-24 Thread David Ahern
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) { +

Re: [PATCH net-next] route: allow to route in a peer netns via lwt framework

2015-07-24 Thread Nicolas Dichtel
Le 24/07/2015 15:50, roopa a écrit : On 7/24/15, 5:24 AM, Nicolas Dichtel wrote: Sure, but my goal was to not create a new .h file just for these two helpers. It's related to lwtunnel, thus I was thinking they can go here. ok..., since your lwt namespace functions went into net_namespace.c, I w

Re: [PATCH net-next] route: allow to route in a peer netns via lwt framework

2015-07-24 Thread roopa
On 7/24/15, 5:24 AM, Nicolas Dichtel wrote: Sure, but my goal was to not create a new .h file just for these two helpers. It's related to lwtunnel, thus I was thinking they can go here. ok..., since your lwt namespace functions went into net_namespace.c, I was thinking these should really go i

Re: [PATCH net-next] route: allow to route in a peer netns via lwt framework

2015-07-24 Thread Nicolas Dichtel
Le 23/07/2015 17:50, roopa a écrit : On 7/23/15, 8:25 AM, Nicolas Dichtel wrote: Le 23/07/2015 17:01, roopa a écrit : On 7/23/15, 7:22 AM, Nicolas Dichtel wrote: [snip] +static inline u32 *lwt_netns_info(struct lwtunnel_state *lwtstate) +{ +return (u32 *)lwtstate->data; +} + +static inlin

Re: [PATCH net-next] route: allow to route in a peer netns via lwt framework

2015-07-23 Thread roopa
On 7/23/15, 8:25 AM, Nicolas Dichtel wrote: Le 23/07/2015 17:01, roopa a écrit : On 7/23/15, 7:22 AM, Nicolas Dichtel wrote: [snip] +static inline u32 *lwt_netns_info(struct lwtunnel_state *lwtstate) +{ +return (u32 *)lwtstate->data; +} + +static inline int skb_lwt_netns_info(struct sk_buf

Re: [PATCH net-next] route: allow to route in a peer netns via lwt framework

2015-07-23 Thread Nicolas Dichtel
Le 23/07/2015 17:01, roopa a écrit : On 7/23/15, 7:22 AM, Nicolas Dichtel wrote: [snip] +static inline u32 *lwt_netns_info(struct lwtunnel_state *lwtstate) +{ +return (u32 *)lwtstate->data; +} + +static inline int skb_lwt_netns_info(struct sk_buff *skb) +{ +if (skb->protocol == htons(ET

Re: [PATCH net-next] route: allow to route in a peer netns via lwt framework

2015-07-23 Thread roopa
On 7/23/15, 7:22 AM, Nicolas Dichtel wrote: This patch takes advantage of the newly added lwtunnel framework to allow the user to set routes that points 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 rou

[PATCH net-next] route: allow to route in a peer netns via lwt framework

2015-07-23 Thread Nicolas Dichtel
This patch takes advantage of the newly added lwtunnel framework to allow the user to set routes that points 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