Re: [net-next 2/3] ip_gre: fix erspan tunnel mtu calculation

2017-10-11 Thread Xin Long
On Tue, Oct 10, 2017 at 8:59 PM, William Tu wrote: >>> @@ -1242,14 +1241,14 @@ static int erspan_tunnel_init(struct net_device >>> *dev) >>> struct ip_tunnel *tunnel = netdev_priv(dev); >>> int t_hlen; >>> >>> - tunnel->tun_hlen = 8; >>> +

Re: [net-next 2/3] ip_gre: fix erspan tunnel mtu calculation

2017-10-10 Thread William Tu
>> @@ -1242,14 +1241,14 @@ static int erspan_tunnel_init(struct net_device *dev) >> struct ip_tunnel *tunnel = netdev_priv(dev); >> int t_hlen; >> >> - tunnel->tun_hlen = 8; >> + tunnel->tun_hlen = ERSPAN_GREHDR_LEN; >> tunnel->parms.iph.protocol = IPPROTO_GRE;

Re: [net-next 2/3] ip_gre: fix erspan tunnel mtu calculation

2017-10-09 Thread Xin Long
On Tue, Oct 10, 2017 at 4:47 AM, William Tu wrote: > Remove the unnecessary -4 and +4 bytes at mtu and headroom calculation. > In addition, erspan uses fixed 8-byte gre header, so add ERSPAN_GREHDR_LEN > macro for better readability. > > Now tunnel->hlen = grehdr(8) +

[net-next 2/3] ip_gre: fix erspan tunnel mtu calculation

2017-10-09 Thread William Tu
Remove the unnecessary -4 and +4 bytes at mtu and headroom calculation. In addition, erspan uses fixed 8-byte gre header, so add ERSPAN_GREHDR_LEN macro for better readability. Now tunnel->hlen = grehdr(8) + erspanhdr(8) = 16 byte. The mtu should be ETH_DATA_LEN - 16 - iph(20) = 1464. After the