[v2] gso: fix VxLAN/GRE tunnel checks

Message ID 1548052079-19045-1-git-send-email-arybchenko@solarflare.com
State Superseded, archived
Delegated to: Thomas Monjalon
Headers show
Series
  • [v2] gso: fix VxLAN/GRE tunnel checks
Related show

Checks

Context Check Description
ci/Intel-compilation success Compilation OK
ci/checkpatch success coding style OK

Commit Message

Andrew Rybchenko Jan. 21, 2019, 6:27 a.m.
Tunnel type is an enum in PKT_TX_TUNNEL_MASK bits.
As the result, for example, IPIP or MPLSinUDP tunnel packets may be
incorrected treated internally as VXLAN.

Fixes: b058d92ea95d ("gso: support VxLAN GSO")
Fixes: 70e737e448c7 ("gso: support GRE GSO")
Cc: stable@dpdk.org

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
 lib/librte_gso/gso_common.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Hu, Jiayu Jan. 21, 2019, 6:40 a.m. | #1
> -----Original Message-----
> From: Andrew Rybchenko [mailto:arybchenko@solarflare.com]
> Sent: Monday, January 21, 2019 2:28 PM
> To: Hu, Jiayu <jiayu.hu@intel.com>
> Cc: dev@dpdk.org; stable@dpdk.org
> Subject: [PATCH v2] gso: fix VxLAN/GRE tunnel checks
> 
> Tunnel type is an enum in PKT_TX_TUNNEL_MASK bits.
> As the result, for example, IPIP or MPLSinUDP tunnel packets may be
> incorrected treated internally as VXLAN.

There is a typo: 'incorrected' -> 'incorrectly'.

Thanks,
Jiayu
> 
> Fixes: b058d92ea95d ("gso: support VxLAN GSO")
> Fixes: 70e737e448c7 ("gso: support GRE GSO")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
> ---
>  lib/librte_gso/gso_common.h | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/lib/librte_gso/gso_common.h b/lib/librte_gso/gso_common.h
> index 6cd764ff5..b6ff1b886 100644
> --- a/lib/librte_gso/gso_common.h
> +++ b/lib/librte_gso/gso_common.h
> @@ -22,12 +22,12 @@
>  		(PKT_TX_TCP_SEG | PKT_TX_IPV4))
> 
>  #define IS_IPV4_VXLAN_TCP4(flag) (((flag) & (PKT_TX_TCP_SEG |
> PKT_TX_IPV4 | \
> -				PKT_TX_OUTER_IPV4 |
> PKT_TX_TUNNEL_VXLAN)) == \
> +				PKT_TX_OUTER_IPV4 |
> PKT_TX_TUNNEL_MASK)) == \
>  		(PKT_TX_TCP_SEG | PKT_TX_IPV4 | PKT_TX_OUTER_IPV4 |
> \
>  		 PKT_TX_TUNNEL_VXLAN))
> 
>  #define IS_IPV4_GRE_TCP4(flag) (((flag) & (PKT_TX_TCP_SEG |
> PKT_TX_IPV4 | \
> -				PKT_TX_OUTER_IPV4 |
> PKT_TX_TUNNEL_GRE)) == \
> +				PKT_TX_OUTER_IPV4 |
> PKT_TX_TUNNEL_MASK)) == \
>  		(PKT_TX_TCP_SEG | PKT_TX_IPV4 | PKT_TX_OUTER_IPV4 |
> \
>  		 PKT_TX_TUNNEL_GRE))
> 
> --
> 2.17.1

Patch

diff --git a/lib/librte_gso/gso_common.h b/lib/librte_gso/gso_common.h
index 6cd764ff5..b6ff1b886 100644
--- a/lib/librte_gso/gso_common.h
+++ b/lib/librte_gso/gso_common.h
@@ -22,12 +22,12 @@ 
 		(PKT_TX_TCP_SEG | PKT_TX_IPV4))
 
 #define IS_IPV4_VXLAN_TCP4(flag) (((flag) & (PKT_TX_TCP_SEG | PKT_TX_IPV4 | \
-				PKT_TX_OUTER_IPV4 | PKT_TX_TUNNEL_VXLAN)) == \
+				PKT_TX_OUTER_IPV4 | PKT_TX_TUNNEL_MASK)) == \
 		(PKT_TX_TCP_SEG | PKT_TX_IPV4 | PKT_TX_OUTER_IPV4 | \
 		 PKT_TX_TUNNEL_VXLAN))
 
 #define IS_IPV4_GRE_TCP4(flag) (((flag) & (PKT_TX_TCP_SEG | PKT_TX_IPV4 | \
-				PKT_TX_OUTER_IPV4 | PKT_TX_TUNNEL_GRE)) == \
+				PKT_TX_OUTER_IPV4 | PKT_TX_TUNNEL_MASK)) == \
 		(PKT_TX_TCP_SEG | PKT_TX_IPV4 | PKT_TX_OUTER_IPV4 | \
 		 PKT_TX_TUNNEL_GRE))