netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net] geneve: fix needed_headroom and max_mtu for collect_metadata
@ 2017-06-02 18:54 Eric Garver
  2017-06-04  5:34 ` Pravin Shelar
  2017-06-05  0:04 ` David Miller
  0 siblings, 2 replies; 3+ messages in thread
From: Eric Garver @ 2017-06-02 18:54 UTC (permalink / raw)
  To: David Miller, pravin shelar; +Cc: netdev

Since commit 9b4437a5b870 ("geneve: Unify LWT and netdev handling.")
when using COLLECT_METADATA geneve devices are created with too small of
a needed_headroom and too large of a max_mtu. This is because
ip_tunnel_info_af() is not valid with the device level info when using
COLLECT_METADATA and we mistakenly fall into the IPv4 case.

For COLLECT_METADATA, always use the worst case of ipv6 since both
sockets are created.

Fixes: 9b4437a5b870 ("geneve: Unify LWT and netdev handling.")
Signed-off-by: Eric Garver <e@erig.me>
---
 drivers/net/geneve.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/geneve.c b/drivers/net/geneve.c
index 959fd12d2e67..6ebb0f559a42 100644
--- a/drivers/net/geneve.c
+++ b/drivers/net/geneve.c
@@ -1133,7 +1133,7 @@ static int geneve_configure(struct net *net, struct net_device *dev,
 
 	/* make enough headroom for basic scenario */
 	encap_len = GENEVE_BASE_HLEN + ETH_HLEN;
-	if (ip_tunnel_info_af(info) == AF_INET) {
+	if (!metadata && ip_tunnel_info_af(info) == AF_INET) {
 		encap_len += sizeof(struct iphdr);
 		dev->max_mtu -= sizeof(struct iphdr);
 	} else {
-- 
2.12.0

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH net] geneve: fix needed_headroom and max_mtu for collect_metadata
  2017-06-02 18:54 [PATCH net] geneve: fix needed_headroom and max_mtu for collect_metadata Eric Garver
@ 2017-06-04  5:34 ` Pravin Shelar
  2017-06-05  0:04 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: Pravin Shelar @ 2017-06-04  5:34 UTC (permalink / raw)
  To: Eric Garver; +Cc: David Miller, Linux Kernel Network Developers

On Fri, Jun 2, 2017 at 11:54 AM, Eric Garver <e@erig.me> wrote:
> Since commit 9b4437a5b870 ("geneve: Unify LWT and netdev handling.")
> when using COLLECT_METADATA geneve devices are created with too small of
> a needed_headroom and too large of a max_mtu. This is because
> ip_tunnel_info_af() is not valid with the device level info when using
> COLLECT_METADATA and we mistakenly fall into the IPv4 case.
>
> For COLLECT_METADATA, always use the worst case of ipv6 since both
> sockets are created.
>
> Fixes: 9b4437a5b870 ("geneve: Unify LWT and netdev handling.")
> Signed-off-by: Eric Garver <e@erig.me>

Acked-by: Pravin B Shelar <pshelar@ovn.org>

Thanks.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH net] geneve: fix needed_headroom and max_mtu for collect_metadata
  2017-06-02 18:54 [PATCH net] geneve: fix needed_headroom and max_mtu for collect_metadata Eric Garver
  2017-06-04  5:34 ` Pravin Shelar
@ 2017-06-05  0:04 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2017-06-05  0:04 UTC (permalink / raw)
  To: e; +Cc: pshelar, netdev

From: Eric Garver <e@erig.me>
Date: Fri,  2 Jun 2017 14:54:10 -0400

> Since commit 9b4437a5b870 ("geneve: Unify LWT and netdev handling.")
> when using COLLECT_METADATA geneve devices are created with too small of
> a needed_headroom and too large of a max_mtu. This is because
> ip_tunnel_info_af() is not valid with the device level info when using
> COLLECT_METADATA and we mistakenly fall into the IPv4 case.
> 
> For COLLECT_METADATA, always use the worst case of ipv6 since both
> sockets are created.
> 
> Fixes: 9b4437a5b870 ("geneve: Unify LWT and netdev handling.")
> Signed-off-by: Eric Garver <e@erig.me>

Applied and queued up for -stable, thanks.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-06-05  0:04 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-06-02 18:54 [PATCH net] geneve: fix needed_headroom and max_mtu for collect_metadata Eric Garver
2017-06-04  5:34 ` Pravin Shelar
2017-06-05  0:04 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).