net/mlx5: fix inline data len assert condition

Message ID 1564645437-13264-1-git-send-email-viacheslavo@mellanox.com (mailing list archive)
State Changes Requested, archived
Delegated to: Raslan Darawsheh
Headers
Series net/mlx5: fix inline data len assert condition |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/iol-Compile-Testing success Compile Testing PASS
ci/intel-Performance-Testing success Performance Testing PASS
ci/Intel-compilation success Compilation OK
ci/mellanox-Performance-Testing success Performance Testing PASS

Commit Message

Slava Ovsiienko Aug. 1, 2019, 7:43 a.m. UTC
  The debug assert wrongly triggers on the inline data 18B,
this should be passed successfully.

Fixes: 18a1c20044c0 ("net/mlx5: implement Tx burst template")

Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
---
 drivers/net/mlx5/mlx5_rxtx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Matan Azrad Aug. 1, 2019, 9:18 p.m. UTC | #1
From: Viacheslav Ovsiienko
> The debug assert wrongly triggers on the inline data 18B, this should be
> passed successfully.
> 
> Fixes: 18a1c20044c0 ("net/mlx5: implement Tx burst template")
> 
> Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>

> ---
>  drivers/net/mlx5/mlx5_rxtx.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/mlx5/mlx5_rxtx.c b/drivers/net/mlx5/mlx5_rxtx.c
> index 7a2e153..7110946 100644
> --- a/drivers/net/mlx5/mlx5_rxtx.c
> +++ b/drivers/net/mlx5/mlx5_rxtx.c
> @@ -2626,7 +2626,7 @@ enum mlx5_txcmp_code {
>  				 sizeof(struct rte_vlan_hdr) +
>  				 2 * RTE_ETHER_ADDR_LEN),
>  		      "invalid Ethernet Segment data size");
> -	assert(inlen > MLX5_ESEG_MIN_INLINE_SIZE);
> +	assert(inlen >= MLX5_ESEG_MIN_INLINE_SIZE);
>  	es->inline_hdr_sz = rte_cpu_to_be_16(inlen);
>  	pdst = (uint8_t *)&es->inline_data;
>  	if (MLX5_TXOFF_CONFIG(VLAN) && vlan) {
> --
> 1.8.3.1
  

Patch

diff --git a/drivers/net/mlx5/mlx5_rxtx.c b/drivers/net/mlx5/mlx5_rxtx.c
index 7a2e153..7110946 100644
--- a/drivers/net/mlx5/mlx5_rxtx.c
+++ b/drivers/net/mlx5/mlx5_rxtx.c
@@ -2626,7 +2626,7 @@  enum mlx5_txcmp_code {
 				 sizeof(struct rte_vlan_hdr) +
 				 2 * RTE_ETHER_ADDR_LEN),
 		      "invalid Ethernet Segment data size");
-	assert(inlen > MLX5_ESEG_MIN_INLINE_SIZE);
+	assert(inlen >= MLX5_ESEG_MIN_INLINE_SIZE);
 	es->inline_hdr_sz = rte_cpu_to_be_16(inlen);
 	pdst = (uint8_t *)&es->inline_data;
 	if (MLX5_TXOFF_CONFIG(VLAN) && vlan) {