Skip to contentSkip to conversation

mlx4_en: Fixed incorrect unmapping on RX flow.

PATCH In review Yevgeny Petrilin 2 participants 4 messages Aug 24, 2010 – Aug 25, 2010

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/14 mlx4_en: Fixed incorrect unmapping on RX flow.

When allocating new fragments to replace the ones that would be passed to the stack, The fragments that should be replaced, are the ones that were already used.

---
 drivers/net/mlx4/en_rx.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/net/mlx4/en_rx.c +1 -1
index 8e2fcb7..1ee4fd5 100644
@@ -459,7 +459,7 @@ static int mlx4_en_complete_rx_desc(struct mlx4_en_priv *priv,
 			goto fail;
 
 		/* Unmap buffer */
-		pci_unmap_single(mdev->pdev, dma, skb_frags[nr].size,
+		pci_unmap_single(mdev->pdev, dma, skb_frags_rx[nr].size,
 				 PCI_DMA_FROMDEVICE);
 	}
 	/* Adjust size of last fragment to match actual length */
Signature · 1 line
1.6.1.3
maintainer
#1 lore raw

All 14 patches applied, but patches #12 and #13 had a lot of conflicts because the LRO options were already deleted by the patch I applied last week from Amerigo Wang:

commit f3c58aceaa3f237ba43735805f4677950327b8ee

Author: Amerigo Wang <[email protected]>
Date:   Tue Aug 17 21:51:18 2010 +0000

mlx4: remove num_lro parameter

As suggested by David, this parameter can die, we can use ethtool to turn LRO on/off. Compile tests only.

I fixed up the conflicts but please generate your patches against the correct tree in the future.

I also had to add the following build warning fix after applying your patches, do you look at the build output at allwhen you make changes to this driver?

--------------------
mlx4_en: Fix build warning in mlx4_en_create_rx_ring.

drivers/net/mlx4/en_rx.c: In function ‘mlx4_en_create_rx_ring’:
drivers/net/mlx4/en_rx.c:305: warning: label ‘err_map’ defined but not used

---
 drivers/net/mlx4/en_rx.c |    2 --
 1 files changed, 0 insertions(+), 2 deletions(-)
drivers/net/mlx4/en_rx.c +0 -2
index cb7ff00..c4aad7f 100644
@@ -302,8 +302,6 @@ int mlx4_en_create_rx_ring(struct mlx4_en_priv *priv,
 
 	return 0;
 
-err_map:
-	mlx4_en_unmap_buffer(&ring->wqres.buf);
 err_hwq:
 	mlx4_free_hwq_res(mdev->dev, &ring->wqres, ring->buf_size);
 err_ring:
Signature · 1 line
1.7.2.2
#2 lore raw
Quoted 4 lines

All 14 patches applied, but patches #12 and #13 had a lot of conflicts because the LRO options were already deleted by the patch I applied last week from Amerigo Wang:

I fixed up the conflicts but please generate your patches against the correct tree in the future.

Apologize for this, I generated the patches against tree that was pulled a week ago.

Quoted 4 lines

I also had to add the following build warning fix after applying your patches, do you look at the build output at allwhen you make changes to this driver?

I suspect that these warnings were caused by the merge with the patch you mentioned, The patches I sent remove this label:

@@ -312,28 +300,8 @@ int mlx4_en_create_rx_ring(struct mlx4_en_priv *priv,

        }
        ring->buf = ring->wqres.buf.direct.buf;
-       /* Configure lro mngr */
-       memset(&ring->lro, 0, sizeof(struct net_lro_mgr));
-       ring->lro.dev = priv->dev;
-       ring->lro.features = LRO_F_NAPI;
-       ring->lro.frag_align_pad = NET_IP_ALIGN;
-       ring->lro.ip_summed = CHECKSUM_UNNECESSARY;
-       ring->lro.ip_summed_aggr = CHECKSUM_UNNECESSARY;
-       ring->lro.max_desc = mdev->profile.num_lro;
-       ring->lro.max_aggr = MAX_SKB_FRAGS;
-       ring->lro.lro_arr = kzalloc(mdev->profile.num_lro *

- sizeof(struct net_lro_desc),
- GFP_KERNEL);
- if (!ring->lro.lro_arr) {
- en_err(priv, "Failed to allocate lro array\n");
- goto err_map;
- }
- ring->lro.get_frag_header = mlx4_en_get_frag_header;
-

        return 0;

-err_map:
- mlx4_en_unmap_buffer(&ring->wqres.buf);
err_hwq:

        mlx4_free_hwq_res(mdev->dev, &ring->wqres, ring->buf_size);

err_ring:

Thanks,
Yevgeny

maintainer
#3 lore raw

From: Yevgeny Petrilin <[email protected]>
Date: Wed, 25 Aug 2010 11:55:55 +0300

Quoted 2 lines

I suspect that these warnings were caused by the merge with the patch you mentioned, The patches I sent remove this label:

Yes that seems to be the case, my bad :-)