netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] skge: fix broken driver
@ 2013-09-19 18:13 Mikulas Patocka
  2013-09-19 18:15 ` David Miller
  2013-09-20 14:36 ` Stephen Hemminger
  0 siblings, 2 replies; 3+ messages in thread
From: Mikulas Patocka @ 2013-09-19 18:13 UTC (permalink / raw)
  To: David Miller; +Cc: stephen, netdev, Vasiliy Glazov

The patch 136d8f377e1575463b47840bc5f1b22d94bf8f63 broke the skge driver.
Note this part of the patch:
+               if (skge_rx_setup(skge, e, nskb, skge->rx_buf_size) < 0) {
+                       dev_kfree_skb(nskb);
+                       goto resubmit;
+               }
+
                pci_unmap_single(skge->hw->pdev,
                                 dma_unmap_addr(e, mapaddr),
                                 dma_unmap_len(e, maplen),
                                 PCI_DMA_FROMDEVICE);
                skb = e->skb;
                prefetch(skb->data);
-               skge_rx_setup(skge, e, nskb, skge->rx_buf_size);

The function skge_rx_setup modifies e->skb to point to the new skb. Thus,
after this change, the new buffer, not the old, is returned to the
networking stack.

This bug is present in kernels 3.11, 3.11.1 and 3.12-rc1. The patch should 
be queued for 3.11-stable.

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Reported-by: Mikulas Patocka <mpatocka@redhat.com>
Reported-by: Vasiliy Glazov <vascom2@gmail.com>
Tested-by: Mikulas Patocka <mpatocka@redhat.com>

---
 drivers/net/ethernet/marvell/skge.c |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

Index: linux-3.11.1-fast/drivers/net/ethernet/marvell/skge.c
===================================================================
--- linux-3.11.1-fast.orig/drivers/net/ethernet/marvell/skge.c	2013-09-10 19:46:58.000000000 +0200
+++ linux-3.11.1-fast/drivers/net/ethernet/marvell/skge.c	2013-09-19 18:20:43.000000000 +0200
@@ -3092,6 +3092,9 @@ static struct sk_buff *skge_rx_get(struc
 		if (!nskb)
 			goto resubmit;
 
+		skb = e->skb;
+		prefetch(skb->data);
+
 		if (skge_rx_setup(skge, e, nskb, skge->rx_buf_size) < 0) {
 			dev_kfree_skb(nskb);
 			goto resubmit;
@@ -3101,8 +3104,6 @@ static struct sk_buff *skge_rx_get(struc
 				 dma_unmap_addr(e, mapaddr),
 				 dma_unmap_len(e, maplen),
 				 PCI_DMA_FROMDEVICE);
-		skb = e->skb;
-		prefetch(skb->data);
 	}
 
 	skb_put(skb, len);

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

* Re: [PATCH v2] skge: fix broken driver
  2013-09-19 18:13 [PATCH v2] skge: fix broken driver Mikulas Patocka
@ 2013-09-19 18:15 ` David Miller
  2013-09-20 14:36 ` Stephen Hemminger
  1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2013-09-19 18:15 UTC (permalink / raw)
  To: mpatocka; +Cc: stephen, netdev, vascom2

From: Mikulas Patocka <mpatocka@redhat.com>
Date: Thu, 19 Sep 2013 14:13:17 -0400 (EDT)

> The patch 136d8f377e1575463b47840bc5f1b22d94bf8f63 broke the skge driver.
> Note this part of the patch:
> +               if (skge_rx_setup(skge, e, nskb, skge->rx_buf_size) < 0) {
> +                       dev_kfree_skb(nskb);
> +                       goto resubmit;
> +               }
> +
>                 pci_unmap_single(skge->hw->pdev,
>                                  dma_unmap_addr(e, mapaddr),
>                                  dma_unmap_len(e, maplen),
>                                  PCI_DMA_FROMDEVICE);
>                 skb = e->skb;
>                 prefetch(skb->data);
> -               skge_rx_setup(skge, e, nskb, skge->rx_buf_size);
> 
> The function skge_rx_setup modifies e->skb to point to the new skb. Thus,
> after this change, the new buffer, not the old, is returned to the
> networking stack.
> 
> This bug is present in kernels 3.11, 3.11.1 and 3.12-rc1. The patch should 
> be queued for 3.11-stable.
> 
> Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
> Reported-by: Mikulas Patocka <mpatocka@redhat.com>
> Reported-by: Vasiliy Glazov <vascom2@gmail.com>
> Tested-by: Mikulas Patocka <mpatocka@redhat.com>

Applied and queued up for -stable, thanks.

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

* Re: [PATCH v2] skge: fix broken driver
  2013-09-19 18:13 [PATCH v2] skge: fix broken driver Mikulas Patocka
  2013-09-19 18:15 ` David Miller
@ 2013-09-20 14:36 ` Stephen Hemminger
  1 sibling, 0 replies; 3+ messages in thread
From: Stephen Hemminger @ 2013-09-20 14:36 UTC (permalink / raw)
  To: Mikulas Patocka; +Cc: David Miller, netdev, Vasiliy Glazov

On Thu, 19 Sep 2013 14:13:17 -0400 (EDT)
Mikulas Patocka <mpatocka@redhat.com> wrote:

> The patch 136d8f377e1575463b47840bc5f1b22d94bf8f63 broke the skge driver.
> Note this part of the patch:
> +               if (skge_rx_setup(skge, e, nskb, skge->rx_buf_size) < 0) {
> +                       dev_kfree_skb(nskb);
> +                       goto resubmit;
> +               }
> +
>                 pci_unmap_single(skge->hw->pdev,
>                                  dma_unmap_addr(e, mapaddr),
>                                  dma_unmap_len(e, maplen),
>                                  PCI_DMA_FROMDEVICE);
>                 skb = e->skb;
>                 prefetch(skb->data);
> -               skge_rx_setup(skge, e, nskb, skge->rx_buf_size);
> 
> The function skge_rx_setup modifies e->skb to point to the new skb. Thus,
> after this change, the new buffer, not the old, is returned to the
> networking stack.
> 
> This bug is present in kernels 3.11, 3.11.1 and 3.12-rc1. The patch should 
> be queued for 3.11-stable.
> 
> Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
> Reported-by: Mikulas Patocka <mpatocka@redhat.com>
> Reported-by: Vasiliy Glazov <vascom2@gmail.com>
> Tested-by: Mikulas Patocka <mpatocka@redhat.com>
> 

Thanks for fixing this. Maybe I should go on vacation more often.

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

end of thread, other threads:[~2013-09-20 14:36 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-19 18:13 [PATCH v2] skge: fix broken driver Mikulas Patocka
2013-09-19 18:15 ` David Miller
2013-09-20 14:36 ` Stephen Hemminger

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