Skip to content

Commit 2ed6dc3

Browse files
Shannon NelsonLinus Torvalds
authored andcommitted
I/OAT: Add DCA services
Add code to connect to the DCA driver and provide cpu tags for use by drivers that would like to use Direct Cache Access hints. [Adrian Bunk] Several Kconfig cleanup items [Andrew Morten, Chris Leech] Fix for using cpu_physical_id() even when built for uni-processor Signed-off-by: Shannon Nelson <shannon.nelson@intel.com> Acked-by: David S. Miller <davem@davemloft.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 7589670 commit 2ed6dc3

7 files changed

Lines changed: 320 additions & 32 deletions

File tree

‎drivers/dca/Kconfig‎

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,5 @@
33
#
44

55
config DCA
6-
tristate "DCA support for clients and providers"
7-
default m
8-
help
9-
This is a server to help modules that want to use Direct Cache
10-
Access to find DCA providers that will supply correct CPU tags.
6+
tristate
117

‎drivers/dma/Kconfig‎

Lines changed: 35 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -2,42 +2,52 @@
22
# DMA engine configuration
33
#
44

5-
menu "DMA Engine support"
6-
depends on HAS_DMA
5+
menuconfig DMADEVICES
6+
bool "DMA Offload Engine support"
7+
depends on (PCI && X86) || ARCH_IOP32X || ARCH_IOP33X || ARCH_IOP13XX
8+
help
9+
Intel(R) offload engines enable offloading memory copies in the
10+
network stack and RAID operations in the MD driver.
11+
12+
if DMADEVICES
13+
14+
comment "DMA Devices"
15+
16+
config INTEL_IOATDMA
17+
tristate "Intel I/OAT DMA support"
18+
depends on PCI && X86
19+
select DMA_ENGINE
20+
select DCA
21+
help
22+
Enable support for the Intel(R) I/OAT DMA engine present
23+
in recent Intel Xeon chipsets.
24+
25+
Say Y here if you have such a chipset.
26+
27+
If unsure, say N.
28+
29+
config INTEL_IOP_ADMA
30+
tristate "Intel IOP ADMA support"
31+
depends on ARCH_IOP32X || ARCH_IOP33X || ARCH_IOP13XX
32+
select ASYNC_CORE
33+
select DMA_ENGINE
34+
help
35+
Enable support for the Intel(R) IOP Series RAID engines.
736

837
config DMA_ENGINE
9-
bool "Support for DMA engines"
10-
---help---
11-
DMA engines offload bulk memory operations from the CPU to dedicated
12-
hardware, allowing the operations to happen asynchronously.
38+
bool
1339

1440
comment "DMA Clients"
41+
depends on DMA_ENGINE
1542

1643
config NET_DMA
1744
bool "Network: TCP receive copy offload"
1845
depends on DMA_ENGINE && NET
1946
default y
20-
---help---
47+
help
2148
This enables the use of DMA engines in the network stack to
2249
offload receive copy-to-user operations, freeing CPU cycles.
2350
Since this is the main user of the DMA engine, it should be enabled;
2451
say Y here.
2552

26-
comment "DMA Devices"
27-
28-
config INTEL_IOATDMA
29-
tristate "Intel I/OAT DMA support"
30-
depends on DMA_ENGINE && PCI
31-
default m
32-
---help---
33-
Enable support for the Intel(R) I/OAT DMA engine.
34-
35-
config INTEL_IOP_ADMA
36-
tristate "Intel IOP ADMA support"
37-
depends on DMA_ENGINE && (ARCH_IOP32X || ARCH_IOP33X || ARCH_IOP13XX)
38-
select ASYNC_CORE
39-
default m
40-
---help---
41-
Enable support for the Intel(R) IOP Series RAID engines.
42-
43-
endmenu
53+
endif

‎drivers/dma/Makefile‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
obj-$(CONFIG_DMA_ENGINE) += dmaengine.o
22
obj-$(CONFIG_NET_DMA) += iovlock.o
33
obj-$(CONFIG_INTEL_IOATDMA) += ioatdma.o
4-
ioatdma-objs := ioat.o ioat_dma.o
4+
ioatdma-objs := ioat.o ioat_dma.o ioat_dca.o
55
obj-$(CONFIG_INTEL_IOP_ADMA) += iop-adma.o

‎drivers/dma/ioat.c‎

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* Intel I/OAT DMA Linux driver
3-
* Copyright(c) 2004 - 2007 Intel Corporation.
3+
* Copyright(c) 2007 Intel Corporation.
44
*
55
* This program is free software; you can redistribute it and/or modify it
66
* under the terms and conditions of the GNU General Public License,
@@ -29,6 +29,7 @@
2929
#include <linux/module.h>
3030
#include <linux/pci.h>
3131
#include <linux/interrupt.h>
32+
#include <linux/dca.h>
3233
#include "ioatdma.h"
3334
#include "ioatdma_registers.h"
3435
#include "ioatdma_hw.h"
@@ -49,6 +50,7 @@ struct ioat_device {
4950
struct pci_dev *pdev;
5051
void __iomem *iobase;
5152
struct ioatdma_device *dma;
53+
struct dca_provider *dca;
5254
};
5355

5456
static int __devinit ioat_probe(struct pci_dev *pdev,
@@ -57,6 +59,10 @@ static int __devinit ioat_probe(struct pci_dev *pdev,
5759
static void __devexit ioat_remove(struct pci_dev *pdev);
5860
#endif
5961

62+
static int ioat_dca_enabled = 1;
63+
module_param(ioat_dca_enabled, int, 0644);
64+
MODULE_PARM_DESC(ioat_dca_enabled, "control support of dca service (default: 1)");
65+
6066
static int ioat_setup_functionality(struct pci_dev *pdev, void __iomem *iobase)
6167
{
6268
struct ioat_device *device = pci_get_drvdata(pdev);
@@ -67,6 +73,8 @@ static int ioat_setup_functionality(struct pci_dev *pdev, void __iomem *iobase)
6773
switch (version) {
6874
case IOAT_VER_1_2:
6975
device->dma = ioat_dma_probe(pdev, iobase);
76+
if (ioat_dca_enabled)
77+
device->dca = ioat_dca_init(pdev, iobase);
7078
break;
7179
default:
7280
err = -ENODEV;
@@ -83,6 +91,13 @@ static void ioat_shutdown_functionality(struct pci_dev *pdev)
8391
ioat_dma_remove(device->dma);
8492
device->dma = NULL;
8593
}
94+
95+
if (device->dca) {
96+
unregister_dca_provider(device->dca);
97+
free_dca_provider(device->dca);
98+
device->dca = NULL;
99+
}
100+
86101
}
87102

88103
static struct pci_driver ioat_pci_drv = {

0 commit comments

Comments
 (0)