Patchwork vxlan: Update hard_header_len based on lowerdev when instantiating VXLAN

login
register
mail settings
Submitter Alexander Duyck
Date Nov. 13, 2012, 11:10 p.m.
Message ID <20121113230955.16102.62399.stgit@ahduyck-cp1.jf.intel.com>
Download mbox | patch
Permalink /patch/198797/
State Accepted
Delegated to: David Miller
Headers show

Comments

Alexander Duyck - Nov. 13, 2012, 11:10 p.m.
In the event of a VXLAN device being linked to a device that has a
hard_header_len greater than that of standard ethernet we could end up with
the hard_header_len not being large enough for outgoing frames.  In order to
prevent this we should update the length when a lowerdev is provided.

Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
---

 drivers/net/vxlan.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)


--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
stephen hemminger - Nov. 13, 2012, 11:12 p.m.
On Tue, 13 Nov 2012 15:10:59 -0800
Alexander Duyck <alexander.h.duyck@intel.com> wrote:

> In the event of a VXLAN device being linked to a device that has a
> hard_header_len greater than that of standard ethernet we could end up with
> the hard_header_len not being large enough for outgoing frames.  In order to
> prevent this we should update the length when a lowerdev is provided.
> 
> Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
> ---
> 
>  drivers/net/vxlan.c |    4 ++++
>  1 files changed, 4 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/net/vxlan.c b/drivers/net/vxlan.c
> index 44bcc20..6b666eb 100644
> --- a/drivers/net/vxlan.c
> +++ b/drivers/net/vxlan.c
> @@ -1110,6 +1110,10 @@ static int vxlan_newlink(struct net *net, struct net_device *dev,
>  
>  		if (!tb[IFLA_MTU])
>  			dev->mtu = lowerdev->mtu - VXLAN_HEADROOM;
> +
> +		/* update header length based on lower device */
> +		dev->hard_header_len = lowerdev->hard_header_len +
> +				       VXLAN_HEADROOM;
>  	}
>  
>  	if (data[IFLA_VXLAN_TOS])
> 

Acked-by: Stephen Hemminger <shemminger@vyatta.com>
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
David Miller - Nov. 13, 2012, 11:20 p.m.
From: Stephen Hemminger <shemminger@vyatta.com>
Date: Tue, 13 Nov 2012 15:12:00 -0800

> On Tue, 13 Nov 2012 15:10:59 -0800
> Alexander Duyck <alexander.h.duyck@intel.com> wrote:
> 
>> In the event of a VXLAN device being linked to a device that has a
>> hard_header_len greater than that of standard ethernet we could end up with
>> the hard_header_len not being large enough for outgoing frames.  In order to
>> prevent this we should update the length when a lowerdev is provided.
>> 
>> Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
 ...
> Acked-by: Stephen Hemminger <shemminger@vyatta.com>

Applied, thanks.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

diff --git a/drivers/net/vxlan.c b/drivers/net/vxlan.c
index 44bcc20..6b666eb 100644
--- a/drivers/net/vxlan.c
+++ b/drivers/net/vxlan.c
@@ -1110,6 +1110,10 @@  static int vxlan_newlink(struct net *net, struct net_device *dev,
 
 		if (!tb[IFLA_MTU])
 			dev->mtu = lowerdev->mtu - VXLAN_HEADROOM;
+
+		/* update header length based on lower device */
+		dev->hard_header_len = lowerdev->hard_header_len +
+				       VXLAN_HEADROOM;
 	}
 
 	if (data[IFLA_VXLAN_TOS])