netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] cxgb4vf: remove obsolete DECLARE_PCI_UNMAP_ADDR usage
@ 2010-07-08  9:52 FUJITA Tomonori
  2010-07-08 10:01 ` FUJITA Tomonori
  2010-07-09  6:08 ` David Miller
  0 siblings, 2 replies; 5+ messages in thread
From: FUJITA Tomonori @ 2010-07-08  9:52 UTC (permalink / raw)
  To: netdev; +Cc: leedom

We could use DEFINE_DMA_UNMAP_ADDR instead but using
CONFIG_NEED_DMA_MAP_STATE is a simpler way to see if a platform does
real DMA unmapping.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
---
 drivers/net/cxgb4vf/sge.c |   14 +++++---------
 1 files changed, 5 insertions(+), 9 deletions(-)

diff --git a/drivers/net/cxgb4vf/sge.c b/drivers/net/cxgb4vf/sge.c
index 3a7c02f..4bc1858 100644
--- a/drivers/net/cxgb4vf/sge.c
+++ b/drivers/net/cxgb4vf/sge.c
@@ -228,15 +228,11 @@ static inline bool is_buf_mapped(const struct rx_sw_desc *sdesc)
  */
 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;
+#ifdef CONFIG_NEED_DMA_MAP_STATE
+	return 1;
+#else
+	return 0;
+#endif
 }
 
 /**
-- 
1.6.5


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

* Re: [PATCH] cxgb4vf: remove obsolete DECLARE_PCI_UNMAP_ADDR usage
  2010-07-08  9:52 [PATCH] cxgb4vf: remove obsolete DECLARE_PCI_UNMAP_ADDR usage FUJITA Tomonori
@ 2010-07-08 10:01 ` FUJITA Tomonori
  2010-07-09  6:09   ` David Miller
  2010-07-09  6:08 ` David Miller
  1 sibling, 1 reply; 5+ messages in thread
From: FUJITA Tomonori @ 2010-07-08 10:01 UTC (permalink / raw)
  To: leedom; +Cc: netdev

On Thu, 8 Jul 2010 18:52:37 +0900
FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> wrote:

> We could use DEFINE_DMA_UNMAP_ADDR instead but using
> CONFIG_NEED_DMA_MAP_STATE is a simpler way to see if a platform does
> real DMA unmapping.
> 
> Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
> ---
>  drivers/net/cxgb4vf/sge.c |   14 +++++---------
>  1 files changed, 5 insertions(+), 9 deletions(-)

btw, I'm not sure that seeing if a platform does real DMA unmapping in
a driver is a good thing. But I suppose that we need to accept it if
this leads to big performance boost.

Both can be applied to net-next.

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

* Re: [PATCH] cxgb4vf: remove obsolete DECLARE_PCI_UNMAP_ADDR usage
  2010-07-08  9:52 [PATCH] cxgb4vf: remove obsolete DECLARE_PCI_UNMAP_ADDR usage FUJITA Tomonori
  2010-07-08 10:01 ` FUJITA Tomonori
@ 2010-07-09  6:08 ` David Miller
  1 sibling, 0 replies; 5+ messages in thread
From: David Miller @ 2010-07-09  6:08 UTC (permalink / raw)
  To: fujita.tomonori; +Cc: netdev, leedom

From: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Date: Thu, 8 Jul 2010 18:52:37 +0900

> We could use DEFINE_DMA_UNMAP_ADDR instead but using
> CONFIG_NEED_DMA_MAP_STATE is a simpler way to see if a platform does
> real DMA unmapping.
> 
> Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>

Applied.

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

* Re: [PATCH] cxgb4vf: remove obsolete DECLARE_PCI_UNMAP_ADDR usage
  2010-07-08 10:01 ` FUJITA Tomonori
@ 2010-07-09  6:09   ` David Miller
  2010-07-09  6:12     ` FUJITA Tomonori
  0 siblings, 1 reply; 5+ messages in thread
From: David Miller @ 2010-07-09  6:09 UTC (permalink / raw)
  To: fujita.tomonori; +Cc: leedom, netdev

From: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Date: Thu, 08 Jul 2010 19:01:26 +0900

> On Thu, 8 Jul 2010 18:52:37 +0900
> FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> wrote:
> 
>> We could use DEFINE_DMA_UNMAP_ADDR instead but using
>> CONFIG_NEED_DMA_MAP_STATE is a simpler way to see if a platform does
>> real DMA unmapping.
>> 
>> Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
>> ---
>>  drivers/net/cxgb4vf/sge.c |   14 +++++---------
>>  1 files changed, 5 insertions(+), 9 deletions(-)
> 
> btw, I'm not sure that seeing if a platform does real DMA unmapping in
> a driver is a good thing. But I suppose that we need to accept it if
> this leads to big performance boost.
> 
> Both can be applied to net-next.

I think the value of these "optimizations" is rapidly decreasing to
zero.  And I believe I've told the authors of either this driver or
another one that they should just remove this stuff completely.

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

* Re: [PATCH] cxgb4vf: remove obsolete DECLARE_PCI_UNMAP_ADDR usage
  2010-07-09  6:09   ` David Miller
@ 2010-07-09  6:12     ` FUJITA Tomonori
  0 siblings, 0 replies; 5+ messages in thread
From: FUJITA Tomonori @ 2010-07-09  6:12 UTC (permalink / raw)
  To: davem; +Cc: fujita.tomonori, leedom, netdev

On Thu, 08 Jul 2010 23:09:39 -0700 (PDT)
David Miller <davem@davemloft.net> wrote:

> > btw, I'm not sure that seeing if a platform does real DMA unmapping in
> > a driver is a good thing. But I suppose that we need to accept it if
> > this leads to big performance boost.
> > 
> > Both can be applied to net-next.
> 
> I think the value of these "optimizations" is rapidly decreasing to
> zero.  And I believe I've told the authors of either this driver or
> another one that they should just remove this stuff completely.

I prefer to remove this stuff completely too.

If this trick improves the performance greatly, we could add this to
the DMA API (that's better than adding such ifdef hack to drivers).

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

end of thread, other threads:[~2010-07-09  6:15 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-07-08  9:52 [PATCH] cxgb4vf: remove obsolete DECLARE_PCI_UNMAP_ADDR usage FUJITA Tomonori
2010-07-08 10:01 ` FUJITA Tomonori
2010-07-09  6:09   ` David Miller
2010-07-09  6:12     ` FUJITA Tomonori
2010-07-09  6:08 ` 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).