DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] net/mlx5: fix asserts for multi-segment Tx offload misconfig
@ 2019-11-07 13:18 Viacheslav Ovsiienko
  2019-11-08  6:18 ` Matan Azrad
  2019-11-08 14:33 ` Raslan Darawsheh
  0 siblings, 2 replies; 3+ messages in thread
From: Viacheslav Ovsiienko @ 2019-11-07 13:18 UTC (permalink / raw)
  To: dev; +Cc: matan, rasland, orika

To support multi-segment packet sending the Tx datapath
DEV_TX_OFFLOAD_MULTI_SEGS offload must be configured.
In debug configuration the asserts arise if the multi-segment
packet is being sent and no DEV_TX_OFFLOAD_MULTI_SEGS is set.
It was found that in some execution paths asserts were missed,
this patch adds ones.

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

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

diff --git a/drivers/net/mlx5/mlx5_rxtx.c b/drivers/net/mlx5/mlx5_rxtx.c
index 887e283..ecebd72 100644
--- a/drivers/net/mlx5/mlx5_rxtx.c
+++ b/drivers/net/mlx5/mlx5_rxtx.c
@@ -3870,6 +3870,7 @@ enum mlx5_txcmp_code {
 		unsigned int slen = 0;
 
 next_empw:
+		assert(NB_SEGS(loc->mbuf) == 1);
 		part = RTE_MIN(pkts_n, MLX5_EMPW_MAX_PACKETS);
 		if (unlikely(loc->elts_free < part)) {
 			/* We have no enough elts to save all mbufs. */
@@ -3929,6 +3930,7 @@ enum mlx5_txcmp_code {
 					return MLX5_TXCMP_CODE_EXIT;
 				return MLX5_TXCMP_CODE_MULTI;
 			}
+			assert(NB_SEGS(loc->mbuf) == 1);
 			if (ret == MLX5_TXCMP_CODE_TSO) {
 				part -= loop;
 				mlx5_tx_sdone_empw(txq, loc, part, slen, olx);
@@ -4028,6 +4030,7 @@ enum mlx5_txcmp_code {
 		unsigned int room, part, nlim;
 		unsigned int slen = 0;
 
+		assert(NB_SEGS(loc->mbuf) == 1);
 		/*
 		 * Limits the amount of packets in one WQE
 		 * to improve CQE latency generation.
@@ -4168,6 +4171,7 @@ enum mlx5_txcmp_code {
 					return MLX5_TXCMP_CODE_EXIT;
 				return MLX5_TXCMP_CODE_MULTI;
 			}
+			assert(NB_SEGS(loc->mbuf) == 1);
 			if (ret == MLX5_TXCMP_CODE_TSO) {
 				part -= room;
 				mlx5_tx_idone_empw(txq, loc, part, slen, olx);
-- 
1.8.3.1


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

* Re: [dpdk-dev] [PATCH] net/mlx5: fix asserts for multi-segment Tx offload misconfig
  2019-11-07 13:18 [dpdk-dev] [PATCH] net/mlx5: fix asserts for multi-segment Tx offload misconfig Viacheslav Ovsiienko
@ 2019-11-08  6:18 ` Matan Azrad
  2019-11-08 14:33 ` Raslan Darawsheh
  1 sibling, 0 replies; 3+ messages in thread
From: Matan Azrad @ 2019-11-08  6:18 UTC (permalink / raw)
  To: Slava Ovsiienko, dev; +Cc: Raslan Darawsheh, Ori Kam



From: Viacheslav Ovsiienko
> To support multi-segment packet sending the Tx datapath
> DEV_TX_OFFLOAD_MULTI_SEGS offload must be configured.
> In debug configuration the asserts arise if the multi-segment packet is being
> sent and no DEV_TX_OFFLOAD_MULTI_SEGS is set.
> It was found that in some execution paths asserts were missed, this patch
> adds ones.
> 
> Fixes: 18a1c20044c0 ("net/mlx5: implement Tx burst template")
> 
> Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>

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

* Re: [dpdk-dev] [PATCH] net/mlx5: fix asserts for multi-segment Tx offload misconfig
  2019-11-07 13:18 [dpdk-dev] [PATCH] net/mlx5: fix asserts for multi-segment Tx offload misconfig Viacheslav Ovsiienko
  2019-11-08  6:18 ` Matan Azrad
@ 2019-11-08 14:33 ` Raslan Darawsheh
  1 sibling, 0 replies; 3+ messages in thread
From: Raslan Darawsheh @ 2019-11-08 14:33 UTC (permalink / raw)
  To: Slava Ovsiienko, dev; +Cc: Matan Azrad, Ori Kam

Hi,

> -----Original Message-----
> From: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
> Sent: Thursday, November 7, 2019 3:18 PM
> To: dev@dpdk.org
> Cc: Matan Azrad <matan@mellanox.com>; Raslan Darawsheh
> <rasland@mellanox.com>; Ori Kam <orika@mellanox.com>
> Subject: [PATCH] net/mlx5: fix asserts for multi-segment Tx offload misconfig
> 
> To support multi-segment packet sending the Tx datapath
> DEV_TX_OFFLOAD_MULTI_SEGS offload must be configured.
> In debug configuration the asserts arise if the multi-segment
> packet is being sent and no DEV_TX_OFFLOAD_MULTI_SEGS is set.
> It was found that in some execution paths asserts were missed,
> this patch adds ones.
> 
> Fixes: 18a1c20044c0 ("net/mlx5: implement Tx burst template")
> 
> Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
> ---
>  drivers/net/mlx5/mlx5_rxtx.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/drivers/net/mlx5/mlx5_rxtx.c b/drivers/net/mlx5/mlx5_rxtx.c
> index 887e283..ecebd72 100644
> --- a/drivers/net/mlx5/mlx5_rxtx.c
> +++ b/drivers/net/mlx5/mlx5_rxtx.c
> @@ -3870,6 +3870,7 @@ enum mlx5_txcmp_code {
>  		unsigned int slen = 0;
> 
>  next_empw:
> +		assert(NB_SEGS(loc->mbuf) == 1);
>  		part = RTE_MIN(pkts_n, MLX5_EMPW_MAX_PACKETS);
>  		if (unlikely(loc->elts_free < part)) {
>  			/* We have no enough elts to save all mbufs. */
> @@ -3929,6 +3930,7 @@ enum mlx5_txcmp_code {
>  					return MLX5_TXCMP_CODE_EXIT;
>  				return MLX5_TXCMP_CODE_MULTI;
>  			}
> +			assert(NB_SEGS(loc->mbuf) == 1);
>  			if (ret == MLX5_TXCMP_CODE_TSO) {
>  				part -= loop;
>  				mlx5_tx_sdone_empw(txq, loc, part, slen,
> olx);
> @@ -4028,6 +4030,7 @@ enum mlx5_txcmp_code {
>  		unsigned int room, part, nlim;
>  		unsigned int slen = 0;
> 
> +		assert(NB_SEGS(loc->mbuf) == 1);
>  		/*
>  		 * Limits the amount of packets in one WQE
>  		 * to improve CQE latency generation.
> @@ -4168,6 +4171,7 @@ enum mlx5_txcmp_code {
>  					return MLX5_TXCMP_CODE_EXIT;
>  				return MLX5_TXCMP_CODE_MULTI;
>  			}
> +			assert(NB_SEGS(loc->mbuf) == 1);
>  			if (ret == MLX5_TXCMP_CODE_TSO) {
>  				part -= room;
>  				mlx5_tx_idone_empw(txq, loc, part, slen,
> olx);
> --
> 1.8.3.1


Patch applied to next-net-mlx,

Kindest regards,
Raslan Darawsheh

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

end of thread, other threads:[~2019-11-08 14:33 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-07 13:18 [dpdk-dev] [PATCH] net/mlx5: fix asserts for multi-segment Tx offload misconfig Viacheslav Ovsiienko
2019-11-08  6:18 ` Matan Azrad
2019-11-08 14:33 ` Raslan Darawsheh

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).