From: David Miller <davem@davemloft.net>
To: dan.j.williams@intel.com
Cc: anemo@mba.ocn.ne.jp, maciej.sosnowski@intel.com,
linux-kernel@vger.kernel.org, netdev@vger.kernel.org
Subject: Re: [PATCH] net_dma: call dmaengine_get only if NET_DMA enabled
Date: Fri, 06 Feb 2009 21:55:33 -0800 (PST) [thread overview]
Message-ID: <20090206.215533.166740686.davem@davemloft.net> (raw)
In-Reply-To: <20090206.192910.42610645.davem@davemloft.net>
From: David Miller <davem@davemloft.net>
Date: Fri, 06 Feb 2009 19:29:10 -0800 (PST)
> From: Dan Williams <dan.j.williams@intel.com>
> Date: Fri, 6 Feb 2009 15:52:35 -0700
>
> > Yes, it has been on the todo list for a while, but I eventually want
> > the net case to look more like the raid case. I.e. have one code path
> > that picks async versus sync at runtime, with the option to compile
> > out async support with header file ifdefs only.
>
> And how does any of that get us any closer to a fix right now
> for this problem that doesn't require an ifdef?
>
> Someone please work on this.
I guess that'd end up being me....
How about something like this?
diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h
index 3e0f64c..3e68469 100644
--- a/include/linux/dmaengine.h
+++ b/include/linux/dmaengine.h
@@ -282,6 +282,18 @@ static inline void dmaengine_put(void)
}
#endif
+#ifdef CONFIG_NET_DMA
+#define net_dmaengine_get() dmaengine_get()
+#define net_dmaengine_put() dmaengine_put()
+#else
+static inline void net_dmaengine_get(void)
+{
+}
+static inline void net_dmaengine_put(void)
+{
+}
+#endif
+
dma_cookie_t dma_async_memcpy_buf_to_buf(struct dma_chan *chan,
void *dest, void *src, size_t len);
dma_cookie_t dma_async_memcpy_buf_to_pg(struct dma_chan *chan,
diff --git a/net/core/dev.c b/net/core/dev.c
index 5379b0c..a17e006 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -1090,7 +1090,7 @@ int dev_open(struct net_device *dev)
/*
* Enable NET_DMA
*/
- dmaengine_get();
+ net_dmaengine_get();
/*
* Initialize multicasting status
@@ -1172,7 +1172,7 @@ int dev_close(struct net_device *dev)
/*
* Shutdown NET_DMA
*/
- dmaengine_put();
+ net_dmaengine_put();
return 0;
}
next prev parent reply other threads:[~2009-02-07 5:55 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1233936169-5243-1-git-send-email-anemo@mba.ocn.ne.jp>
2009-02-06 21:15 ` [PATCH] net_dma: call dmaengine_get only if NET_DMA enabled Dan Williams
2009-02-06 22:09 ` David Miller
2009-02-06 22:52 ` Dan Williams
2009-02-07 3:29 ` David Miller
2009-02-07 5:55 ` David Miller [this message]
2009-02-07 6:03 ` Dan Williams
2009-02-07 6:05 ` 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=20090206.215533.166740686.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=anemo@mba.ocn.ne.jp \
--cc=dan.j.williams@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=maciej.sosnowski@intel.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).