DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH 1/3] net/mlx5: fix leak when starvation occurs
@ 2016-11-17  9:49 Nelio Laranjeiro
  2016-11-17  9:49 ` [dpdk-dev] [PATCH 2/3] net/mlx5: fix wrong htons Nelio Laranjeiro
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Nelio Laranjeiro @ 2016-11-17  9:49 UTC (permalink / raw)
  To: dev; +Cc: Adrien Mazarguil, stable

The list of segments to free was wrongly manipulated ending by only freeing
the first segment instead of freeing all of them.  The last one still
belongs to the NIC and thus should not be freed.

Fixes: a1bdb71a32da ("net/mlx5: fix crash in Rx")

CC: stable@dpdk.org
Reported-by: Liming Sun <lsun@mellanox.com>
Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
---
 drivers/net/mlx5/mlx5_rxtx.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/mlx5/mlx5_rxtx.c b/drivers/net/mlx5/mlx5_rxtx.c
index beff580..9bd4d80 100644
--- a/drivers/net/mlx5/mlx5_rxtx.c
+++ b/drivers/net/mlx5/mlx5_rxtx.c
@@ -1312,10 +1312,10 @@ mlx5_rx_burst(void *dpdk_rxq, struct rte_mbuf **pkts, uint16_t pkts_n)
 			}
 			while (pkt != seg) {
 				assert(pkt != (*rxq->elts)[idx]);
-				seg = NEXT(pkt);
+				rep = NEXT(pkt);
 				rte_mbuf_refcnt_set(pkt, 0);
 				__rte_mbuf_raw_free(pkt);
-				pkt = seg;
+				pkt = rep;
 			}
 			break;
 		}
-- 
2.1.4

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

* [dpdk-dev] [PATCH 2/3] net/mlx5: fix wrong htons
  2016-11-17  9:49 [dpdk-dev] [PATCH 1/3] net/mlx5: fix leak when starvation occurs Nelio Laranjeiro
@ 2016-11-17  9:49 ` Nelio Laranjeiro
  2016-11-17 10:38   ` Adrien Mazarguil
  2016-11-17  9:49 ` [dpdk-dev] [PATCH 3/3] net/mlx5: do not invalidate title CQE Nelio Laranjeiro
  2016-11-17 10:37 ` [dpdk-dev] [PATCH 1/3] net/mlx5: fix leak when starvation occurs Adrien Mazarguil
  2 siblings, 1 reply; 9+ messages in thread
From: Nelio Laranjeiro @ 2016-11-17  9:49 UTC (permalink / raw)
  To: dev; +Cc: Adrien Mazarguil, stable

Completion queue entry data uses network endian, to access them we should use
ntoh*().

Fixes: c305090bbaf8 ("net/mlx5: replace countdown with threshold for Tx completions")

CC: stable@dpdk.org
Reported-by: Liming Sun <lsun@mellanox.com>
Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.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 9bd4d80..04860bb 100644
--- a/drivers/net/mlx5/mlx5_rxtx.c
+++ b/drivers/net/mlx5/mlx5_rxtx.c
@@ -201,7 +201,7 @@ txq_complete(struct txq *txq)
 	} while (1);
 	if (unlikely(cqe == NULL))
 		return;
-	wqe = &(*txq->wqes)[htons(cqe->wqe_counter) &
+	wqe = &(*txq->wqes)[ntohs(cqe->wqe_counter) &
 			    ((1 << txq->wqe_n) - 1)].hdr;
 	elts_tail = wqe->ctrl[3];
 	assert(elts_tail < (1 << txq->wqe_n));
-- 
2.1.4

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

* [dpdk-dev] [PATCH 3/3] net/mlx5: do not invalidate title CQE
  2016-11-17  9:49 [dpdk-dev] [PATCH 1/3] net/mlx5: fix leak when starvation occurs Nelio Laranjeiro
  2016-11-17  9:49 ` [dpdk-dev] [PATCH 2/3] net/mlx5: fix wrong htons Nelio Laranjeiro
@ 2016-11-17  9:49 ` Nelio Laranjeiro
  2016-11-17 10:38   ` Adrien Mazarguil
  2016-11-17 10:37 ` [dpdk-dev] [PATCH 1/3] net/mlx5: fix leak when starvation occurs Adrien Mazarguil
  2 siblings, 1 reply; 9+ messages in thread
From: Nelio Laranjeiro @ 2016-11-17  9:49 UTC (permalink / raw)
  To: dev; +Cc: Adrien Mazarguil

We can leave the title completion queue entry untouched since its contents
are not modified.

Reported-by: Liming Sun <lsun@mellanox.com>
Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.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 04860bb..ffd09ac 100644
--- a/drivers/net/mlx5/mlx5_rxtx.c
+++ b/drivers/net/mlx5/mlx5_rxtx.c
@@ -1162,7 +1162,7 @@ mlx5_rx_poll_len(struct rxq *rxq, volatile struct mlx5_cqe *cqe,
 			zip->na += 8;
 		}
 		if (unlikely(rxq->zip.ai == rxq->zip.cqe_cnt)) {
-			uint16_t idx = rxq->cq_ci;
+			uint16_t idx = rxq->cq_ci + 1;
 			uint16_t end = zip->cq_ci;
 
 			while (idx != end) {
-- 
2.1.4

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

* Re: [dpdk-dev] [PATCH 1/3] net/mlx5: fix leak when starvation occurs
  2016-11-17  9:49 [dpdk-dev] [PATCH 1/3] net/mlx5: fix leak when starvation occurs Nelio Laranjeiro
  2016-11-17  9:49 ` [dpdk-dev] [PATCH 2/3] net/mlx5: fix wrong htons Nelio Laranjeiro
  2016-11-17  9:49 ` [dpdk-dev] [PATCH 3/3] net/mlx5: do not invalidate title CQE Nelio Laranjeiro
@ 2016-11-17 10:37 ` Adrien Mazarguil
  2016-11-18  9:55   ` [dpdk-dev] [dpdk-stable] " Ferruh Yigit
  2 siblings, 1 reply; 9+ messages in thread
From: Adrien Mazarguil @ 2016-11-17 10:37 UTC (permalink / raw)
  To: Nelio Laranjeiro; +Cc: dev, stable

On Thu, Nov 17, 2016 at 10:49:54AM +0100, Nelio Laranjeiro wrote:
> The list of segments to free was wrongly manipulated ending by only freeing
> the first segment instead of freeing all of them.  The last one still
> belongs to the NIC and thus should not be freed.
> 
> Fixes: a1bdb71a32da ("net/mlx5: fix crash in Rx")
> 
> CC: stable@dpdk.org
> Reported-by: Liming Sun <lsun@mellanox.com>
> Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
> ---
>  drivers/net/mlx5/mlx5_rxtx.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/mlx5/mlx5_rxtx.c b/drivers/net/mlx5/mlx5_rxtx.c
> index beff580..9bd4d80 100644
> --- a/drivers/net/mlx5/mlx5_rxtx.c
> +++ b/drivers/net/mlx5/mlx5_rxtx.c
> @@ -1312,10 +1312,10 @@ mlx5_rx_burst(void *dpdk_rxq, struct rte_mbuf **pkts, uint16_t pkts_n)
>  			}
>  			while (pkt != seg) {
>  				assert(pkt != (*rxq->elts)[idx]);
> -				seg = NEXT(pkt);
> +				rep = NEXT(pkt);
>  				rte_mbuf_refcnt_set(pkt, 0);
>  				__rte_mbuf_raw_free(pkt);
> -				pkt = seg;
> +				pkt = rep;
>  			}
>  			break;
>  		}
> -- 
> 2.1.4

Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>

-- 
Adrien Mazarguil
6WIND

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

* Re: [dpdk-dev] [PATCH 2/3] net/mlx5: fix wrong htons
  2016-11-17  9:49 ` [dpdk-dev] [PATCH 2/3] net/mlx5: fix wrong htons Nelio Laranjeiro
@ 2016-11-17 10:38   ` Adrien Mazarguil
  2016-11-18  9:55     ` [dpdk-dev] [dpdk-stable] " Ferruh Yigit
  0 siblings, 1 reply; 9+ messages in thread
From: Adrien Mazarguil @ 2016-11-17 10:38 UTC (permalink / raw)
  To: Nelio Laranjeiro; +Cc: dev, stable

On Thu, Nov 17, 2016 at 10:49:55AM +0100, Nelio Laranjeiro wrote:
> Completion queue entry data uses network endian, to access them we should use
> ntoh*().
> 
> Fixes: c305090bbaf8 ("net/mlx5: replace countdown with threshold for Tx completions")
> 
> CC: stable@dpdk.org
> Reported-by: Liming Sun <lsun@mellanox.com>
> Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.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 9bd4d80..04860bb 100644
> --- a/drivers/net/mlx5/mlx5_rxtx.c
> +++ b/drivers/net/mlx5/mlx5_rxtx.c
> @@ -201,7 +201,7 @@ txq_complete(struct txq *txq)
>  	} while (1);
>  	if (unlikely(cqe == NULL))
>  		return;
> -	wqe = &(*txq->wqes)[htons(cqe->wqe_counter) &
> +	wqe = &(*txq->wqes)[ntohs(cqe->wqe_counter) &
>  			    ((1 << txq->wqe_n) - 1)].hdr;
>  	elts_tail = wqe->ctrl[3];
>  	assert(elts_tail < (1 << txq->wqe_n));
> -- 
> 2.1.4

Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>

-- 
Adrien Mazarguil
6WIND

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

* Re: [dpdk-dev] [PATCH 3/3] net/mlx5: do not invalidate title CQE
  2016-11-17  9:49 ` [dpdk-dev] [PATCH 3/3] net/mlx5: do not invalidate title CQE Nelio Laranjeiro
@ 2016-11-17 10:38   ` Adrien Mazarguil
  2016-11-18  9:55     ` Ferruh Yigit
  0 siblings, 1 reply; 9+ messages in thread
From: Adrien Mazarguil @ 2016-11-17 10:38 UTC (permalink / raw)
  To: Nelio Laranjeiro; +Cc: dev

On Thu, Nov 17, 2016 at 10:49:56AM +0100, Nelio Laranjeiro wrote:
> We can leave the title completion queue entry untouched since its contents
> are not modified.
> 
> Reported-by: Liming Sun <lsun@mellanox.com>
> Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.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 04860bb..ffd09ac 100644
> --- a/drivers/net/mlx5/mlx5_rxtx.c
> +++ b/drivers/net/mlx5/mlx5_rxtx.c
> @@ -1162,7 +1162,7 @@ mlx5_rx_poll_len(struct rxq *rxq, volatile struct mlx5_cqe *cqe,
>  			zip->na += 8;
>  		}
>  		if (unlikely(rxq->zip.ai == rxq->zip.cqe_cnt)) {
> -			uint16_t idx = rxq->cq_ci;
> +			uint16_t idx = rxq->cq_ci + 1;
>  			uint16_t end = zip->cq_ci;
>  
>  			while (idx != end) {
> -- 
> 2.1.4

Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>

-- 
Adrien Mazarguil
6WIND

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

* Re: [dpdk-dev] [dpdk-stable] [PATCH 1/3] net/mlx5: fix leak when starvation occurs
  2016-11-17 10:37 ` [dpdk-dev] [PATCH 1/3] net/mlx5: fix leak when starvation occurs Adrien Mazarguil
@ 2016-11-18  9:55   ` Ferruh Yigit
  0 siblings, 0 replies; 9+ messages in thread
From: Ferruh Yigit @ 2016-11-18  9:55 UTC (permalink / raw)
  To: Adrien Mazarguil, Nelio Laranjeiro; +Cc: dev, stable

On 11/17/2016 10:37 AM, Adrien Mazarguil wrote:
> On Thu, Nov 17, 2016 at 10:49:54AM +0100, Nelio Laranjeiro wrote:
>> The list of segments to free was wrongly manipulated ending by only freeing
>> the first segment instead of freeing all of them.  The last one still
>> belongs to the NIC and thus should not be freed.
>>
>> Fixes: a1bdb71a32da ("net/mlx5: fix crash in Rx")
>>
>> CC: stable@dpdk.org
>> Reported-by: Liming Sun <lsun@mellanox.com>
>> Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
<...>
> Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>

Applied to dpdk-next-net/master, thanks.

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

* Re: [dpdk-dev] [dpdk-stable] [PATCH 2/3] net/mlx5: fix wrong htons
  2016-11-17 10:38   ` Adrien Mazarguil
@ 2016-11-18  9:55     ` Ferruh Yigit
  0 siblings, 0 replies; 9+ messages in thread
From: Ferruh Yigit @ 2016-11-18  9:55 UTC (permalink / raw)
  To: Adrien Mazarguil, Nelio Laranjeiro; +Cc: dev, stable

On 11/17/2016 10:38 AM, Adrien Mazarguil wrote:
> On Thu, Nov 17, 2016 at 10:49:55AM +0100, Nelio Laranjeiro wrote:
>> Completion queue entry data uses network endian, to access them we should use
>> ntoh*().
>>
>> Fixes: c305090bbaf8 ("net/mlx5: replace countdown with threshold for Tx completions")
>>
>> CC: stable@dpdk.org
>> Reported-by: Liming Sun <lsun@mellanox.com>
>> Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
<...>
> Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>

Applied to dpdk-next-net/master, thanks.

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

* Re: [dpdk-dev] [PATCH 3/3] net/mlx5: do not invalidate title CQE
  2016-11-17 10:38   ` Adrien Mazarguil
@ 2016-11-18  9:55     ` Ferruh Yigit
  0 siblings, 0 replies; 9+ messages in thread
From: Ferruh Yigit @ 2016-11-18  9:55 UTC (permalink / raw)
  To: Adrien Mazarguil, Nelio Laranjeiro; +Cc: dev

On 11/17/2016 10:38 AM, Adrien Mazarguil wrote:
> On Thu, Nov 17, 2016 at 10:49:56AM +0100, Nelio Laranjeiro wrote:
>> We can leave the title completion queue entry untouched since its contents
>> are not modified.
>>
>> Reported-by: Liming Sun <lsun@mellanox.com>
>> Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
<...>
> Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>

Applied to dpdk-next-net/master, thanks.

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

end of thread, other threads:[~2016-11-18  9:55 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-11-17  9:49 [dpdk-dev] [PATCH 1/3] net/mlx5: fix leak when starvation occurs Nelio Laranjeiro
2016-11-17  9:49 ` [dpdk-dev] [PATCH 2/3] net/mlx5: fix wrong htons Nelio Laranjeiro
2016-11-17 10:38   ` Adrien Mazarguil
2016-11-18  9:55     ` [dpdk-dev] [dpdk-stable] " Ferruh Yigit
2016-11-17  9:49 ` [dpdk-dev] [PATCH 3/3] net/mlx5: do not invalidate title CQE Nelio Laranjeiro
2016-11-17 10:38   ` Adrien Mazarguil
2016-11-18  9:55     ` Ferruh Yigit
2016-11-17 10:37 ` [dpdk-dev] [PATCH 1/3] net/mlx5: fix leak when starvation occurs Adrien Mazarguil
2016-11-18  9:55   ` [dpdk-dev] [dpdk-stable] " Ferruh Yigit

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