* [PATCH] cxgb4: Remove need_skb_unmap and adjust its callers.
@ 2010-02-28 3:00 Dimitris Michailidis
2010-02-28 8:27 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Dimitris Michailidis @ 2010-02-28 3:00 UTC (permalink / raw)
To: netdev
Applies on top of the V3 patches.
Signed-off-by: Dimitris Michailidis <dm@chelsio.com>
---
drivers/net/cxgb4/sge.c | 29 +++--------------------------
1 files changed, 3 insertions(+), 26 deletions(-)
diff --git a/drivers/net/cxgb4/sge.c b/drivers/net/cxgb4/sge.c
index 34617f8..eb81d73 100644
--- a/drivers/net/cxgb4/sge.c
+++ b/drivers/net/cxgb4/sge.c
@@ -298,25 +298,6 @@ unmap: dma_unmap_page(dev, be64_to_cpu(p->addr[0]),
}
/**
- * need_skb_unmap - does the platform need unmapping of sk_buffs?
- *
- * Returns true if the platfrom needs sk_buff unmapping. The compiler
- * optimizes away unecessary code if this returns true.
- */
-static inline int need_skb_unmap(void)
-{
- /*
- * This structure is used to tell if the platfrom needs buffer
- * unmapping by checking if DECLARE_PCI_UNMAP_ADDR defines anything.
- */
- struct dummy {
- DECLARE_PCI_UNMAP_ADDR(addr);
- };
-
- return sizeof(struct dummy) != 0;
-}
-
-/**
* free_tx_desc - reclaims Tx descriptors and their buffers
* @adapter: the adapter
* @q: the Tx queue to reclaim descriptors from
@@ -333,12 +314,10 @@ static void free_tx_desc(struct adapter *adap, struct sge_txq *q,
unsigned int cidx = q->cidx;
struct device *dev = adap->pdev_dev;
- const int need_unmap = need_skb_unmap() && unmap;
-
d = &q->sdesc[cidx];
while (n--) {
if (d->skb) { /* an SGL is present */
- if (need_unmap)
+ if (unmap)
unmap_sgl(dev, d->skb, d->sgl, q);
kfree_skb(d->skb);
d->skb = NULL;
@@ -1300,10 +1279,8 @@ static void service_ofldq(struct sge_ofld_txq *q)
pos + flits, hdr_len,
(dma_addr_t *)skb->head);
- if (need_skb_unmap()) {
- skb->dev = q->adap->port[0];
- skb->destructor = deferred_unmap_destructor;
- }
+ skb->dev = q->adap->port[0];
+ skb->destructor = deferred_unmap_destructor;
last_desc = q->q.pidx + ndesc - 1;
if (last_desc >= q->q.size)
--
1.5.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] cxgb4: Remove need_skb_unmap and adjust its callers.
2010-02-28 3:00 [PATCH] cxgb4: Remove need_skb_unmap and adjust its callers Dimitris Michailidis
@ 2010-02-28 8:27 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2010-02-28 8:27 UTC (permalink / raw)
To: dm; +Cc: netdev
From: Dimitris Michailidis <dm@chelsio.com>
Date: Sat, 27 Feb 2010 19:00:24 -0800
> Applies on top of the V3 patches.
>
> Signed-off-by: Dimitris Michailidis <dm@chelsio.com>
Please just post a V4 that doesn't have this code in it.
Thanks.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-02-28 8:27 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-02-28 3:00 [PATCH] cxgb4: Remove need_skb_unmap and adjust its callers Dimitris Michailidis
2010-02-28 8:27 ` 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).