LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* Re: [PATCH] modify the IO_TLB_SEGSIZE to configtable as flexible requirement about IOMMU/SW-IOMMU.
2015-01-26 19:30 [PATCH] modify the IO_TLB_SEGSIZE to configtable as flexible requirement about IOMMU/SW-IOMMU xiaomin1
@ 2015-01-26 11:15 ` Paul Bolle
0 siblings, 0 replies; 2+ messages in thread
From: Paul Bolle @ 2015-01-26 11:15 UTC (permalink / raw)
To: xiaomin1
Cc: konrad.wilk, akpm, linux, lauraa, heiko.carstens, d.kasatkin,
takahiro.akashi, chris, u.kleine-koenig, linux-kernel,
Chuansheng Liu, Zhang Dongxing
(For some reason the "Date:" header of this message is 16 hours into the
future. Ie, it claims to be for (UTC) 2015-01-26, 19.30 but actually was
probably sent around (UTC) 2015-01-26, 03.30. This made this message
stick at the top of the mail folder it ended up in. And that was about
the only reason why I even scanned it.)
On Tue, 2015-01-27 at 03:30 +0800, xiaomin1 wrote:
> The maximum of SW-IOMMU is limited to 2^11*128 = 256K.
> While in different platform and different requirements this seems improper.
> So modify the IO_TLB_SEGSIZE to configtable is make sense.
configurable?
Ditto for the summary.
> Example:
> If 1M bytes are requied. There has an error like.
required one will run into an error like:
or something similar.
> [ 33.293120] DMA: Out of SW-IOMMU space for 1048576 bytes at device gadget
So in order to solve that and use 1M this new option needs to be set at
512?
> Signed-off-by: Chuansheng Liu <chuansheng.liu@intel.com>
> Signed-off-by: Zhang Dongxing <dongxing.zhang@intel.com>
> Signed-off-by: xiaomin1 <xiaoming.wang@intel.com>
> ---
> include/linux/swiotlb.h | 2 +-
> lib/Kconfig | 4 ++++
> 2 files changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/include/linux/swiotlb.h b/include/linux/swiotlb.h
> index e7a018e..5ab10b9 100644
> --- a/include/linux/swiotlb.h
> +++ b/include/linux/swiotlb.h
> @@ -14,7 +14,7 @@ extern int swiotlb_force;
> * must be a power of 2. What is the appropriate value ?
> * The complexity of {map,unmap}_single is linearly dependent on this value.
> */
> -#define IO_TLB_SEGSIZE 128
> +#define IO_TLB_SEGSIZE CONFIG_DEFAULT_IO_TLB_SEGSIZE
>
> /*
> * log of the size of each IO TLB slab. The number of slabs is command line
> diff --git a/lib/Kconfig b/lib/Kconfig
> index 54cf309..76f1108 100644
> --- a/lib/Kconfig
> +++ b/lib/Kconfig
> @@ -518,4 +518,8 @@ source "lib/fonts/Kconfig"
> config ARCH_HAS_SG_CHAIN
> def_bool n
>
> +config DEFAULT_IO_TLB_SEGSIZE
> + int
No "prompt", so to change this value one needs to edit the .config
manually. Is that intended?
> + default 128
According to include/linux/swiotlb.h this needs to be a power of 2.
Shouldn't that be explained here too? Ditto the 2K unit size. And should
a range of useful values be specified?
(These are not rhetorical questions: I know nothing about all this. This
also means I might just not be part of the intended audience for this
option.)
> endmenu
Paul Bolle
^ permalink raw reply [flat|nested] 2+ messages in thread
* [PATCH] modify the IO_TLB_SEGSIZE to configtable as flexible requirement about IOMMU/SW-IOMMU.
@ 2015-01-26 19:30 xiaomin1
2015-01-26 11:15 ` Paul Bolle
0 siblings, 1 reply; 2+ messages in thread
From: xiaomin1 @ 2015-01-26 19:30 UTC (permalink / raw)
To: konrad.wilk, akpm, linux, lauraa, heiko.carstens, d.kasatkin,
takahiro.akashi, chris, u.kleine-koenig, linux-kernel
Cc: xiaomin1, Chuansheng Liu, Zhang Dongxing
The maximum of SW-IOMMU is limited to 2^11*128 = 256K.
While in different platform and different requirements this seems improper.
So modify the IO_TLB_SEGSIZE to configtable is make sense.
Example:
If 1M bytes are requied. There has an error like.
[ 33.293120] DMA: Out of SW-IOMMU space for 1048576 bytes at device gadget
Signed-off-by: Chuansheng Liu <chuansheng.liu@intel.com>
Signed-off-by: Zhang Dongxing <dongxing.zhang@intel.com>
Signed-off-by: xiaomin1 <xiaoming.wang@intel.com>
---
include/linux/swiotlb.h | 2 +-
lib/Kconfig | 4 ++++
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/include/linux/swiotlb.h b/include/linux/swiotlb.h
index e7a018e..5ab10b9 100644
--- a/include/linux/swiotlb.h
+++ b/include/linux/swiotlb.h
@@ -14,7 +14,7 @@ extern int swiotlb_force;
* must be a power of 2. What is the appropriate value ?
* The complexity of {map,unmap}_single is linearly dependent on this value.
*/
-#define IO_TLB_SEGSIZE 128
+#define IO_TLB_SEGSIZE CONFIG_DEFAULT_IO_TLB_SEGSIZE
/*
* log of the size of each IO TLB slab. The number of slabs is command line
diff --git a/lib/Kconfig b/lib/Kconfig
index 54cf309..76f1108 100644
--- a/lib/Kconfig
+++ b/lib/Kconfig
@@ -518,4 +518,8 @@ source "lib/fonts/Kconfig"
config ARCH_HAS_SG_CHAIN
def_bool n
+config DEFAULT_IO_TLB_SEGSIZE
+ int
+ default 128
+
endmenu
--
1.7.9.5
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-01-26 11:15 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-26 19:30 [PATCH] modify the IO_TLB_SEGSIZE to configtable as flexible requirement about IOMMU/SW-IOMMU xiaomin1
2015-01-26 11:15 ` Paul Bolle
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).