* [PATCH 2.6.32] cxgb3: fix premature page unmap
@ 2009-11-18 2:38 Divy Le Ray
2009-11-18 13:11 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Divy Le Ray @ 2009-11-18 2:38 UTC (permalink / raw)
To: davem; +Cc: netdev, linux-kernel, swise
From: Divy Le Ray <divy@chelsio.com>
unmap Rx page only when guaranteed that this page won't be
used anymore to allocate rx page chunks.
Signed-off-by: Divy Le Ray <divy@chelsio.com>
---
drivers/net/cxgb3/sge.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/cxgb3/sge.c b/drivers/net/cxgb3/sge.c
index f866128..6366061 100644
--- a/drivers/net/cxgb3/sge.c
+++ b/drivers/net/cxgb3/sge.c
@@ -879,7 +879,7 @@ recycle:
pci_dma_sync_single_for_cpu(adap->pdev, dma_addr, len,
PCI_DMA_FROMDEVICE);
(*sd->pg_chunk.p_cnt)--;
- if (!*sd->pg_chunk.p_cnt)
+ if (!*sd->pg_chunk.p_cnt && sd->pg_chunk.page != fl->pg_chunk.page)
pci_unmap_page(adap->pdev,
sd->pg_chunk.mapping,
fl->alloc_size,
@@ -2088,7 +2088,7 @@ static void lro_add_page(struct adapter *adap, struct sge_qset *qs,
PCI_DMA_FROMDEVICE);
(*sd->pg_chunk.p_cnt)--;
- if (!*sd->pg_chunk.p_cnt)
+ if (!*sd->pg_chunk.p_cnt && sd->pg_chunk.page != fl->pg_chunk.page)
pci_unmap_page(adap->pdev,
sd->pg_chunk.mapping,
fl->alloc_size,
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH 2.6.32] cxgb3: fix premature page unmap
2009-11-18 2:38 [PATCH 2.6.32] cxgb3: fix premature page unmap Divy Le Ray
@ 2009-11-18 13:11 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2009-11-18 13:11 UTC (permalink / raw)
To: divy; +Cc: netdev, linux-kernel, swise
From: Divy Le Ray <divy@chelsio.com>
Date: Tue, 17 Nov 2009 18:38:28 -0800
> From: Divy Le Ray <divy@chelsio.com>
>
> unmap Rx page only when guaranteed that this page won't be
> used anymore to allocate rx page chunks.
>
> Signed-off-by: Divy Le Ray <divy@chelsio.com>
Applied to net-2.6, thanks.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2009-11-18 13:11 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-11-18 2:38 [PATCH 2.6.32] cxgb3: fix premature page unmap Divy Le Ray
2009-11-18 13:11 ` David Miller
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).