diff mbox series

[13/13] dpaa_eth: fix SG frame cleanup

Message ID 20190329140014.8126-14-laurentiu.tudor@nxp.com (mailing list archive)
State New, archived
Headers show
Series Prerequisites for NXP LS104xA SMMU enablement | expand

Commit Message

Laurentiu Tudor March 29, 2019, 2 p.m. UTC
From: Laurentiu Tudor <laurentiu.tudor@nxp.com>

Fix issue with the entry indexing in the sg frame cleanup code being
off-by-1. This problem showed up when doing some basic iperf tests and
manifested in traffic coming to a halt.

Signed-off-by: Laurentiu Tudor <laurentiu.tudor@nxp.com>
Acked-by: Madalin Bucur <madalin.bucur@nxp.com>
---
 drivers/net/ethernet/freescale/dpaa/dpaa_eth.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Joakim Tjernlund March 29, 2019, 3:25 p.m. UTC | #1
Should this one go stable 4.14/4.19 too?

On Fri, 2019-03-29 at 16:00 +0200, laurentiu.tudor@nxp.com wrote:
> 
> From: Laurentiu Tudor <laurentiu.tudor@nxp.com>
> 
> Fix issue with the entry indexing in the sg frame cleanup code being
> off-by-1. This problem showed up when doing some basic iperf tests and
> manifested in traffic coming to a halt.
> 
> Signed-off-by: Laurentiu Tudor <laurentiu.tudor@nxp.com>
> Acked-by: Madalin Bucur <madalin.bucur@nxp.com>
> ---
>  drivers/net/ethernet/freescale/dpaa/dpaa_eth.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c b/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c
> index daede7272768..40420edc9ce6 100644
> --- a/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c
> +++ b/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c
> @@ -1663,7 +1663,7 @@ static struct sk_buff *dpaa_cleanup_tx_fd(const struct dpaa_priv *priv,
>                                  qm_sg_entry_get_len(&sgt[0]), dma_dir);
> 
>                 /* remaining pages were mapped with skb_frag_dma_map() */
> -               for (i = 1; i < nr_frags; i++) {
> +               for (i = 1; i <= nr_frags; i++) {
>                         WARN_ON(qm_sg_entry_is_ext(&sgt[i]));
> 
>                         dma_unmap_page(dev, qm_sg_addr(&sgt[i]),
> --
> 2.17.1
>
Laurentiu Tudor April 1, 2019, 10:41 a.m. UTC | #2
Hi Joakim,

> -----Original Message-----
> From: Joakim Tjernlund [mailto:Joakim.Tjernlund@infinera.com]
> Sent: Friday, March 29, 2019 5:25 PM> 
> 
> Should this one go stable 4.14/4.19 too?

Good point. I also think it makes sense to cc: stable.

---
Best Regards, Laurentiu

> On Fri, 2019-03-29 at 16:00 +0200, laurentiu.tudor@nxp.com wrote:
> >
> > From: Laurentiu Tudor <laurentiu.tudor@nxp.com>
> >
> > Fix issue with the entry indexing in the sg frame cleanup code being
> > off-by-1. This problem showed up when doing some basic iperf tests and
> > manifested in traffic coming to a halt.
> >
> > Signed-off-by: Laurentiu Tudor <laurentiu.tudor@nxp.com>
> > Acked-by: Madalin Bucur <madalin.bucur@nxp.com>
> > ---
> >  drivers/net/ethernet/freescale/dpaa/dpaa_eth.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c
> b/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c
> > index daede7272768..40420edc9ce6 100644
> > --- a/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c
> > +++ b/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c
> > @@ -1663,7 +1663,7 @@ static struct sk_buff *dpaa_cleanup_tx_fd(const
> struct dpaa_priv *priv,
> >                                  qm_sg_entry_get_len(&sgt[0]), dma_dir);
> >
> >                 /* remaining pages were mapped with skb_frag_dma_map()
> */
> > -               for (i = 1; i < nr_frags; i++) {
> > +               for (i = 1; i <= nr_frags; i++) {
> >                         WARN_ON(qm_sg_entry_is_ext(&sgt[i]));
> >
> >                         dma_unmap_page(dev, qm_sg_addr(&sgt[i]),
> > --
> > 2.17.1
> >
diff mbox series

Patch

diff --git a/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c b/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c
index daede7272768..40420edc9ce6 100644
--- a/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c
+++ b/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c
@@ -1663,7 +1663,7 @@  static struct sk_buff *dpaa_cleanup_tx_fd(const struct dpaa_priv *priv,
 				 qm_sg_entry_get_len(&sgt[0]), dma_dir);
 
 		/* remaining pages were mapped with skb_frag_dma_map() */
-		for (i = 1; i < nr_frags; i++) {
+		for (i = 1; i <= nr_frags; i++) {
 			WARN_ON(qm_sg_entry_is_ext(&sgt[i]));
 
 			dma_unmap_page(dev, qm_sg_addr(&sgt[i]),