From: Dimitris Michailidis <dm@chelsio.com>
To: netdev@vger.kernel.org
Subject: [PATCH] cxgb4: Remove need_skb_unmap and adjust its callers.
Date: Sat, 27 Feb 2010 19:00:24 -0800 [thread overview]
Message-ID: <1267326024-3610-1-git-send-email-dm@chelsio.com> (raw)
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
next reply other threads:[~2010-02-28 3:00 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-02-28 3:00 Dimitris Michailidis [this message]
2010-02-28 8:27 ` [PATCH] cxgb4: Remove need_skb_unmap and adjust its callers David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1267326024-3610-1-git-send-email-dm@chelsio.com \
--to=dm@chelsio.com \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).