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;
>>> +
>> @@ -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;
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) +
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