Re: [PATCH net-next] ip_gre: check packet length and mtu correctly in erspan_fb_xmit

2017-10-06 Thread William Tu
On Fri, Oct 6, 2017 at 3:22 PM, David Miller wrote: > From: William Tu > Date: Fri, 6 Oct 2017 15:09:29 -0700 > >> Yes, adding another field in the struct net_device can avoid the >> arithmetic operation. I'm not sure it's a good idea to add new field >> since there are already a lot in net_devic

Re: [PATCH net-next] ip_gre: check packet length and mtu correctly in erspan_fb_xmit

2017-10-06 Thread David Miller
From: William Tu Date: Fri, 6 Oct 2017 15:09:29 -0700 > Yes, adding another field in the struct net_device can avoid the > arithmetic operation. I'm not sure it's a good idea to add new field > since there are already a lot in net_device. Let's wait to see how > others think. Why would you add

Re: [PATCH net-next] ip_gre: check packet length and mtu correctly in erspan_fb_xmit

2017-10-06 Thread William Tu
On Fri, Oct 6, 2017 at 2:38 AM, David Laight wrote: > From: William Tu >> Sent: 05 October 2017 22:21 > ... >> >> - if (skb->len > dev->mtu) { >> >> + if (skb->len - dev->hard_header_len > dev->mtu) { >> > >> > Can you guarantee that skb->len > dev_hard_header_len? >> > It is probably safe

RE: [PATCH net-next] ip_gre: check packet length and mtu correctly in erspan_fb_xmit

2017-10-06 Thread David Laight
From: William Tu > Sent: 05 October 2017 22:21 ... > >> - if (skb->len > dev->mtu) { > >> + if (skb->len - dev->hard_header_len > dev->mtu) { > > > > Can you guarantee that skb->len > dev_hard_header_len? > > It is probably safer to check skb->len > dev->hard_header_len + dev->mtu > > since

Re: [PATCH net-next] ip_gre: check packet length and mtu correctly in erspan_fb_xmit

2017-10-05 Thread William Tu
On Thu, Oct 5, 2017 at 6:59 AM, David Laight wrote: > From: William Tu >> Sent: 05 October 2017 01:14 >> Similarly to early patch for erspan_xmit(), the ARPHDR_ETHER device >> is the length of the whole ether packet. So skb->len should subtract >> the dev->hard_header_len. >> >> Fixes: 1a66a836da

RE: [PATCH net-next] ip_gre: check packet length and mtu correctly in erspan_fb_xmit

2017-10-05 Thread David Laight
From: William Tu > Sent: 05 October 2017 01:14 > Similarly to early patch for erspan_xmit(), the ARPHDR_ETHER device > is the length of the whole ether packet. So skb->len should subtract > the dev->hard_header_len. > > Fixes: 1a66a836da63 ("gre: add collect_md mode to ERSPAN tunnel") > Signed-of

[PATCH net-next] ip_gre: check packet length and mtu correctly in erspan_fb_xmit

2017-10-04 Thread William Tu
Similarly to early patch for erspan_xmit(), the ARPHDR_ETHER device is the length of the whole ether packet. So skb->len should subtract the dev->hard_header_len. Fixes: 1a66a836da63 ("gre: add collect_md mode to ERSPAN tunnel") Signed-off-by: William Tu Cc: Xin Long --- net/ipv4/ip_gre.c | 2