Re: [PATCH net-next v2 1/2] net: l3mdev: Add hook in ip and ipv6

2016-05-07 Thread Shmulik Ladkani
Hi, On Sat, 7 May 2016 20:25:40 -0600 David Ahern wrote: > > - On which circumstances we end up entering > > l3mdev_ip_rcv/l3mdev_ip6_rcv where skb->dev is the master? > > If I got it right, we enter 'ip_rcv_finish' on a slave device, > > the callback is invoked and eventually sets

Re: [PATCH net-next v2 1/2] net: l3mdev: Add hook in ip and ipv6

2016-05-07 Thread David Ahern
On 5/7/16 12:32 PM, Shmulik Ladkani wrote: Hi David, On Sat, 7 May 2016 08:50:49 -0600 David Ahern wrote: +static inline +struct sk_buff *l3mdev_l3_rcv(struct sk_buff *skb, u16 proto) +{ + struct net_device *master = NULL; + + if (netif_is_l3_slave(skb->dev)) + master

Re: [PATCH net-next v2 1/2] net: l3mdev: Add hook in ip and ipv6

2016-05-07 Thread Shmulik Ladkani
Hi David, On Sat, 7 May 2016 08:50:49 -0600 David Ahern wrote: > >> +static inline > >> +struct sk_buff *l3mdev_l3_rcv(struct sk_buff *skb, u16 proto) > >> +{ > >> + struct net_device *master = NULL; > >> + > >> + if (netif_is_l3_slave(skb->dev)) > >> + master = netdev_master_upper_dev

Re: [PATCH net-next v2 1/2] net: l3mdev: Add hook in ip and ipv6

2016-05-07 Thread David Ahern
On 5/7/16 2:30 AM, Shmulik Ladkani wrote: Hi David, On Fri, 6 May 2016 18:49:40 -0700 David Ahern wrote: +static bool ipv6_ndisc_frame(const struct sk_buff *skb) +{ + const struct ipv6hdr *ipv6h = (struct ipv6hdr *)skb->data; + size_t hlen = sizeof(*ipv6h); + bool rc = false

Re: [PATCH net-next v2 1/2] net: l3mdev: Add hook in ip and ipv6

2016-05-07 Thread Shmulik Ladkani
Hi David, On Fri, 6 May 2016 18:49:40 -0700 David Ahern wrote: > +static bool ipv6_ndisc_frame(const struct sk_buff *skb) > +{ > + const struct ipv6hdr *ipv6h = (struct ipv6hdr *)skb->data; > + size_t hlen = sizeof(*ipv6h); > + bool rc = false; > + > + if (ipv6h->nexthdr == NEXTH

[PATCH net-next v2 1/2] net: l3mdev: Add hook in ip and ipv6

2016-05-06 Thread David Ahern
Currently the VRF driver uses the rx_handler to switch the skb device to the VRF device. Switching the dev prior to the ip / ipv6 layer means the VRF driver has to duplicate IP/IPv6 processing which adds overhead and makes features such as retaining the ingress device index more complicated than ne