All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] net/mlx4: fix rx not working after mbuf alloc failure
       [not found] <1492069426-123358-1-git-send-email-Charles.Myers@spirent.com>
@ 2017-04-13  7:52 ` Myers, Charles
  2017-04-13 12:05   ` Adrien Mazarguil
  2017-04-13 22:15   ` Charles Myers
  0 siblings, 2 replies; 6+ messages in thread
From: Myers, Charles @ 2017-04-13  7:52 UTC (permalink / raw)
  To: adrien.mazarguil, nelio.laranjeiro; +Cc: dev

I ran into an issue where the mlx4 driver stops receiving packets when mbuf allocation fails in mlx4_rx_burst().

This issue appears to be caused because the code doesn't recycle the existing mbuf to the sges array
when mbuf allocation fails as is done in the code right above it which handles the
(wc.status != IBV_WC_SUCCESS) case.

Copying the code from the above case before jumping to repost fixes the issue for me.

Signed-off-by: Charles Myers <Charles.Myers@spirent.com>
---
 drivers/net/mlx4/mlx4.c |    3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/net/mlx4/mlx4.c b/drivers/net/mlx4/mlx4.c index aff9155..59d26fe 100644
--- a/drivers/net/mlx4/mlx4.c
+++ b/drivers/net/mlx4/mlx4.c
@@ -3169,6 +3169,9 @@ struct txq_mp2mr_mbuf_check_data {
 			/* Increase out of memory counters. */
 			++rxq->stats.rx_nombuf;
 			++rxq->priv->dev->data->rx_mbuf_alloc_failed;
+
+			/* Add SGE to array for repost. */
+			sges[i] = elt->sge;
 			goto repost;
 		}
 
--
1.7.9.5

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

* Re: [PATCH] net/mlx4: fix rx not working after mbuf alloc failure
  2017-04-13  7:52 ` [PATCH] net/mlx4: fix rx not working after mbuf alloc failure Myers, Charles
@ 2017-04-13 12:05   ` Adrien Mazarguil
  2017-04-13 12:22     ` Ferruh Yigit
  2017-04-13 22:15   ` Charles Myers
  1 sibling, 1 reply; 6+ messages in thread
From: Adrien Mazarguil @ 2017-04-13 12:05 UTC (permalink / raw)
  To: Myers, Charles; +Cc: nelio.laranjeiro, dev

Hi Charles,

On Thu, Apr 13, 2017 at 07:52:34AM +0000, Myers, Charles wrote:
> I ran into an issue where the mlx4 driver stops receiving packets when mbuf allocation fails in mlx4_rx_burst().
> 
> This issue appears to be caused because the code doesn't recycle the existing mbuf to the sges array
> when mbuf allocation fails as is done in the code right above it which handles the
> (wc.status != IBV_WC_SUCCESS) case.
> 
> Copying the code from the above case before jumping to repost fixes the issue for me.
> 
> Signed-off-by: Charles Myers <Charles.Myers@spirent.com>

Thanks, this addresses a very old bug present since v2.1.0. As a fix, the
subject line should contain the word "fix", something like:

 net/mlx4: fix Rx after mbuf allocation failure

And since it's a fix:

 Fixes: acac55f16412 ("mlx4: use MOFED 3.0 fast verbs interface for Rx operations")
 Cc: stable@dpdk.org

Please also make sure the commit log is formatted according to the
submission guidelines (50 chars max for subject line, 75 chars for the rest
(except for the Fixes line), yada yada - see check-git-log.sh).

> ---
>  drivers/net/mlx4/mlx4.c |    3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/net/mlx4/mlx4.c b/drivers/net/mlx4/mlx4.c index aff9155..59d26fe 100644
> --- a/drivers/net/mlx4/mlx4.c
> +++ b/drivers/net/mlx4/mlx4.c
> @@ -3169,6 +3169,9 @@ struct txq_mp2mr_mbuf_check_data {
>  			/* Increase out of memory counters. */
>  			++rxq->stats.rx_nombuf;
>  			++rxq->priv->dev->data->rx_mbuf_alloc_failed;
> +

Another nit here, the above blank line is unnecessary.

> +			/* Add SGE to array for repost. */
> +			sges[i] = elt->sge;
>  			goto repost;
>  		}
>  
> --
> 1.7.9.5
> 

Otherwise,

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

-- 
Adrien Mazarguil
6WIND

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

* Re: [PATCH] net/mlx4: fix rx not working after mbuf alloc failure
  2017-04-13 12:05   ` Adrien Mazarguil
@ 2017-04-13 12:22     ` Ferruh Yigit
  2017-04-13 12:28       ` Adrien Mazarguil
  0 siblings, 1 reply; 6+ messages in thread
From: Ferruh Yigit @ 2017-04-13 12:22 UTC (permalink / raw)
  To: Adrien Mazarguil, Myers, Charles; +Cc: nelio.laranjeiro, dev

On 4/13/2017 1:05 PM, Adrien Mazarguil wrote:
> Hi Charles,
> 
> On Thu, Apr 13, 2017 at 07:52:34AM +0000, Myers, Charles wrote:
>> I ran into an issue where the mlx4 driver stops receiving packets when mbuf allocation fails in mlx4_rx_burst().
>>
>> This issue appears to be caused because the code doesn't recycle the existing mbuf to the sges array
>> when mbuf allocation fails as is done in the code right above it which handles the
>> (wc.status != IBV_WC_SUCCESS) case.
>>
>> Copying the code from the above case before jumping to repost fixes the issue for me.
>>
>> Signed-off-by: Charles Myers <Charles.Myers@spirent.com>
> 
> Thanks, this addresses a very old bug present since v2.1.0. As a fix, the
> subject line should contain the word "fix", something like:

Hi Adrien, Charles,

I can't see this patch, any chance that it doesn't hit the mail list? Is
there a patchwork link for patch?

> 
>  net/mlx4: fix Rx after mbuf allocation failure
> 
> And since it's a fix:
> 
>  Fixes: acac55f16412 ("mlx4: use MOFED 3.0 fast verbs interface for Rx operations")
>  Cc: stable@dpdk.org
> 
> Please also make sure the commit log is formatted according to the
> submission guidelines (50 chars max for subject line, 75 chars for the rest
> (except for the Fixes line), yada yada - see check-git-log.sh).
> 
>> ---
>>  drivers/net/mlx4/mlx4.c |    3 +++
>>  1 file changed, 3 insertions(+)
>>
>> diff --git a/drivers/net/mlx4/mlx4.c b/drivers/net/mlx4/mlx4.c index aff9155..59d26fe 100644
>> --- a/drivers/net/mlx4/mlx4.c
>> +++ b/drivers/net/mlx4/mlx4.c
>> @@ -3169,6 +3169,9 @@ struct txq_mp2mr_mbuf_check_data {
>>  			/* Increase out of memory counters. */
>>  			++rxq->stats.rx_nombuf;
>>  			++rxq->priv->dev->data->rx_mbuf_alloc_failed;
>> +
> 
> Another nit here, the above blank line is unnecessary.
> 
>> +			/* Add SGE to array for repost. */
>> +			sges[i] = elt->sge;
>>  			goto repost;
>>  		}
>>  
>> --
>> 1.7.9.5
>>
> 
> Otherwise,
> 
> Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
> 

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

* Re: [PATCH] net/mlx4: fix rx not working after mbuf alloc failure
  2017-04-13 12:22     ` Ferruh Yigit
@ 2017-04-13 12:28       ` Adrien Mazarguil
  0 siblings, 0 replies; 6+ messages in thread
From: Adrien Mazarguil @ 2017-04-13 12:28 UTC (permalink / raw)
  To: Ferruh Yigit; +Cc: Myers, Charles, nelio.laranjeiro, dev

On Thu, Apr 13, 2017 at 01:22:39PM +0100, Ferruh Yigit wrote:
> On 4/13/2017 1:05 PM, Adrien Mazarguil wrote:
> > Hi Charles,
> > 
> > On Thu, Apr 13, 2017 at 07:52:34AM +0000, Myers, Charles wrote:
> >> I ran into an issue where the mlx4 driver stops receiving packets when mbuf allocation fails in mlx4_rx_burst().
> >>
> >> This issue appears to be caused because the code doesn't recycle the existing mbuf to the sges array
> >> when mbuf allocation fails as is done in the code right above it which handles the
> >> (wc.status != IBV_WC_SUCCESS) case.
> >>
> >> Copying the code from the above case before jumping to repost fixes the issue for me.
> >>
> >> Signed-off-by: Charles Myers <Charles.Myers@spirent.com>
> > 
> > Thanks, this addresses a very old bug present since v2.1.0. As a fix, the
> > subject line should contain the word "fix", something like:
> 
> Hi Adrien, Charles,
> 
> I can't see this patch, any chance that it doesn't hit the mail list? Is
> there a patchwork link for patch?

Ah, I probably only got it because I was also a recipient. Charles, have you
subscribed to dev@dpdk.org?

> > 
> >  net/mlx4: fix Rx after mbuf allocation failure
> > 
> > And since it's a fix:
> > 
> >  Fixes: acac55f16412 ("mlx4: use MOFED 3.0 fast verbs interface for Rx operations")
> >  Cc: stable@dpdk.org
> > 
> > Please also make sure the commit log is formatted according to the
> > submission guidelines (50 chars max for subject line, 75 chars for the rest
> > (except for the Fixes line), yada yada - see check-git-log.sh).
> > 
> >> ---
> >>  drivers/net/mlx4/mlx4.c |    3 +++
> >>  1 file changed, 3 insertions(+)
> >>
> >> diff --git a/drivers/net/mlx4/mlx4.c b/drivers/net/mlx4/mlx4.c index aff9155..59d26fe 100644
> >> --- a/drivers/net/mlx4/mlx4.c
> >> +++ b/drivers/net/mlx4/mlx4.c
> >> @@ -3169,6 +3169,9 @@ struct txq_mp2mr_mbuf_check_data {
> >>  			/* Increase out of memory counters. */
> >>  			++rxq->stats.rx_nombuf;
> >>  			++rxq->priv->dev->data->rx_mbuf_alloc_failed;
> >> +
> > 
> > Another nit here, the above blank line is unnecessary.
> > 
> >> +			/* Add SGE to array for repost. */
> >> +			sges[i] = elt->sge;
> >>  			goto repost;
> >>  		}
> >>  
> >> --
> >> 1.7.9.5
> >>
> > 
> > Otherwise,
> > 
> > Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
> > 
> 

-- 
Adrien Mazarguil
6WIND

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

* [PATCH] net/mlx4: fix rx not working after mbuf alloc failure
  2017-04-13  7:52 ` [PATCH] net/mlx4: fix rx not working after mbuf alloc failure Myers, Charles
  2017-04-13 12:05   ` Adrien Mazarguil
@ 2017-04-13 22:15   ` Charles Myers
  2017-04-14  9:58     ` Ferruh Yigit
  1 sibling, 1 reply; 6+ messages in thread
From: Charles Myers @ 2017-04-13 22:15 UTC (permalink / raw)
  To: dev; +Cc: Charles

From: Charles <Charles.Myers@spirent.com>

Fixes issue where mlx4 driver stops receiving packets when mbuf
allocation fails in mlx4_rx_burst().

This issue appears to be caused because the code doesn't recycle the
existing mbuf to the sges array when mbuf allocation fails as is done
in the code right above it which handles (wc.status != IBV_WC_SUCCESS).

Copying the code from the above case fixes the issue.

Fixes: acac55f16412 ("mlx4: use MOFED 3.0 fast verbs interface for Rx
operations")

Signed-off-by: Charles Myers <Charles.Myers@spirent.com>
---
 drivers/net/mlx4/mlx4.c |    3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/net/mlx4/mlx4.c b/drivers/net/mlx4/mlx4.c
index aff9155..59d26fe 100644
--- a/drivers/net/mlx4/mlx4.c
+++ b/drivers/net/mlx4/mlx4.c
@@ -3169,6 +3169,8 @@ struct txq_mp2mr_mbuf_check_data {
 			/* Increase out of memory counters. */
 			++rxq->stats.rx_nombuf;
 			++rxq->priv->dev->data->rx_mbuf_alloc_failed;
+			/* Add SGE to array for repost. */
+			sges[i] = elt->sge;
 			goto repost;
 		}
 
-- 
1.7.9.5

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

* Re: [PATCH] net/mlx4: fix rx not working after mbuf alloc failure
  2017-04-13 22:15   ` Charles Myers
@ 2017-04-14  9:58     ` Ferruh Yigit
  0 siblings, 0 replies; 6+ messages in thread
From: Ferruh Yigit @ 2017-04-14  9:58 UTC (permalink / raw)
  To: Charles Myers, dev; +Cc: Adrien Mazarguil

On 4/13/2017 11:15 PM, Charles Myers wrote:
> From: Charles <Charles.Myers@spirent.com>
> 
> Fixes issue where mlx4 driver stops receiving packets when mbuf
> allocation fails in mlx4_rx_burst().
> 
> This issue appears to be caused because the code doesn't recycle the
> existing mbuf to the sges array when mbuf allocation fails as is done
> in the code right above it which handles (wc.status != IBV_WC_SUCCESS).
> 
> Copying the code from the above case fixes the issue.
> 
> Fixes: acac55f16412 ("mlx4: use MOFED 3.0 fast verbs interface for Rx
> operations")

Cc: stable@dpdk.org

> 
> Signed-off-by: Charles Myers <Charles.Myers@spirent.com>

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

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

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

end of thread, other threads:[~2017-04-14  9:58 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <1492069426-123358-1-git-send-email-Charles.Myers@spirent.com>
2017-04-13  7:52 ` [PATCH] net/mlx4: fix rx not working after mbuf alloc failure Myers, Charles
2017-04-13 12:05   ` Adrien Mazarguil
2017-04-13 12:22     ` Ferruh Yigit
2017-04-13 12:28       ` Adrien Mazarguil
2017-04-13 22:15   ` Charles Myers
2017-04-14  9:58     ` Ferruh Yigit

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.