Re: [PATCH net-next v2 2/7] vxlan: simplify exception handling

2016-11-11 Thread Pravin Shelar
On Fri, Nov 11, 2016 at 3:14 AM, Jiri Benc wrote: > On Thu, 10 Nov 2016 11:21:19 -0800, Pravin Shelar wrote: >> One additional variable is not bad but look at what has happened in >> vxlan_xmit_one(). There are already more than 20 variables defined. It >> is hard to read code in this case. > > I

Re: [PATCH net-next v2 2/7] vxlan: simplify exception handling

2016-11-11 Thread Jiri Benc
On Thu, 10 Nov 2016 11:21:19 -0800, Pravin Shelar wrote: > One additional variable is not bad but look at what has happened in > vxlan_xmit_one(). There are already more than 20 variables defined. It > is hard to read code in this case. I agree that the function is horrible. What I was thinking a

Re: [PATCH net-next v2 2/7] vxlan: simplify exception handling

2016-11-10 Thread Pravin Shelar
On Thu, Nov 10, 2016 at 10:33 AM, Jiri Benc wrote: > On Thu, 10 Nov 2016 10:10:09 -0800, Pravin Shelar wrote: >> I wanted to do same, that is free dst and skb in caller function. But >> that would need more changes due to discrepancy in IPv4 udp-tunnel and >> IPv6 udp-tunnel api. IPv4 works on rou

Re: [PATCH net-next v2 2/7] vxlan: simplify exception handling

2016-11-10 Thread Jiri Benc
On Thu, 10 Nov 2016 10:10:09 -0800, Pravin Shelar wrote: > I wanted to do same, that is free dst and skb in caller function. But > that would need more changes due to discrepancy in IPv4 udp-tunnel and > IPv6 udp-tunnel api. IPv4 works on route entry and IPv6 needs dst > entry. so If caller frees d

Re: [PATCH net-next v2 2/7] vxlan: simplify exception handling

2016-11-10 Thread Pravin Shelar
On Thu, Nov 10, 2016 at 1:47 AM, Jiri Benc wrote: > On Wed, 9 Nov 2016 19:33:24 -0800, Pravin Shelar wrote: >> I have moved the dst error handling to vxlan_build_skb(), which is >> releasing the dst entry. > > Hmm, right, I missed that. But it's weird. The previous logic was > confusing (skb is fr

Re: [PATCH net-next v2 2/7] vxlan: simplify exception handling

2016-11-10 Thread Jiri Benc
On Wed, 9 Nov 2016 19:33:24 -0800, Pravin Shelar wrote: > I have moved the dst error handling to vxlan_build_skb(), which is > releasing the dst entry. Hmm, right, I missed that. But it's weird. The previous logic was confusing (skb is freed in case of error but not otherwise), I'm with you on thi

Re: [PATCH net-next v2 2/7] vxlan: simplify exception handling

2016-11-09 Thread Pravin Shelar
On Wed, Nov 9, 2016 at 8:10 AM, Jiri Benc wrote: > On Sat, 5 Nov 2016 11:45:52 -0700, Pravin B Shelar wrote: >> @@ -2058,7 +2059,7 @@ static void vxlan_xmit_one(struct sk_buff *skb, struct >> net_device *dev, >> err = vxlan_build_skb(skb, &rt->dst, sizeof(struct iphdr), >>

Re: [PATCH net-next v2 2/7] vxlan: simplify exception handling

2016-11-09 Thread Jiri Benc
On Sat, 5 Nov 2016 11:45:52 -0700, Pravin B Shelar wrote: > @@ -2058,7 +2059,7 @@ static void vxlan_xmit_one(struct sk_buff *skb, struct > net_device *dev, > err = vxlan_build_skb(skb, &rt->dst, sizeof(struct iphdr), > vni, md, flags, udp_sum); >

[PATCH net-next v2 2/7] vxlan: simplify exception handling

2016-11-05 Thread Pravin B Shelar
vxlan egress path error handling has became complicated, it need to handle IPv4 and IPv6 tunnel cases. Earlier patch removes vlan handling from vxlan_build_skb(), so vxlan_build_skb does not need to free skb and we can simplify the xmit path by having single error handling for both type of tunnels.