Skip to content

Commit

Permalink
I/OAT: Add DCA services
Browse files Browse the repository at this point in the history
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 <[email protected]>
Acked-by: David S. Miller <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
Shannon Nelson authored and Linus Torvalds committed Oct 16, 2007
1 parent 7589670 commit 2ed6dc3
Show file tree
Hide file tree
Showing 7 changed files with 320 additions and 32 deletions.
6 changes: 1 addition & 5 deletions drivers/dca/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,5 @@
#

config DCA
tristate "DCA support for clients and providers"
default m
help
This is a server to help modules that want to use Direct Cache
Access to find DCA providers that will supply correct CPU tags.
tristate

60 changes: 35 additions & 25 deletions drivers/dma/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -2,42 +2,52 @@
# DMA engine configuration
#

menu "DMA Engine support"
depends on HAS_DMA
menuconfig DMADEVICES
bool "DMA Offload Engine support"
depends on (PCI && X86) || ARCH_IOP32X || ARCH_IOP33X || ARCH_IOP13XX
help
Intel(R) offload engines enable offloading memory copies in the
network stack and RAID operations in the MD driver.

if DMADEVICES

comment "DMA Devices"

config INTEL_IOATDMA
tristate "Intel I/OAT DMA support"
depends on PCI && X86
select DMA_ENGINE
select DCA
help
Enable support for the Intel(R) I/OAT DMA engine present
in recent Intel Xeon chipsets.

Say Y here if you have such a chipset.

If unsure, say N.

config INTEL_IOP_ADMA
tristate "Intel IOP ADMA support"
depends on ARCH_IOP32X || ARCH_IOP33X || ARCH_IOP13XX
select ASYNC_CORE
select DMA_ENGINE
help
Enable support for the Intel(R) IOP Series RAID engines.

config DMA_ENGINE
bool "Support for DMA engines"
---help---
DMA engines offload bulk memory operations from the CPU to dedicated
hardware, allowing the operations to happen asynchronously.
bool

comment "DMA Clients"
depends on DMA_ENGINE

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

comment "DMA Devices"

config INTEL_IOATDMA
tristate "Intel I/OAT DMA support"
depends on DMA_ENGINE && PCI
default m
---help---
Enable support for the Intel(R) I/OAT DMA engine.

config INTEL_IOP_ADMA
tristate "Intel IOP ADMA support"
depends on DMA_ENGINE && (ARCH_IOP32X || ARCH_IOP33X || ARCH_IOP13XX)
select ASYNC_CORE
default m
---help---
Enable support for the Intel(R) IOP Series RAID engines.

endmenu
endif
2 changes: 1 addition & 1 deletion drivers/dma/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
obj-$(CONFIG_DMA_ENGINE) += dmaengine.o
obj-$(CONFIG_NET_DMA) += iovlock.o
obj-$(CONFIG_INTEL_IOATDMA) += ioatdma.o
ioatdma-objs := ioat.o ioat_dma.o
ioatdma-objs := ioat.o ioat_dma.o ioat_dca.o
obj-$(CONFIG_INTEL_IOP_ADMA) += iop-adma.o
17 changes: 16 additions & 1 deletion drivers/dma/ioat.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Intel I/OAT DMA Linux driver
* Copyright(c) 2004 - 2007 Intel Corporation.
* Copyright(c) 2007 Intel Corporation.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
Expand Down Expand Up @@ -29,6 +29,7 @@
#include <linux/module.h>
#include <linux/pci.h>
#include <linux/interrupt.h>
#include <linux/dca.h>
#include "ioatdma.h"
#include "ioatdma_registers.h"
#include "ioatdma_hw.h"
Expand All @@ -49,6 +50,7 @@ struct ioat_device {
struct pci_dev *pdev;
void __iomem *iobase;
struct ioatdma_device *dma;
struct dca_provider *dca;
};

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

static int ioat_dca_enabled = 1;
module_param(ioat_dca_enabled, int, 0644);
MODULE_PARM_DESC(ioat_dca_enabled, "control support of dca service (default: 1)");

static int ioat_setup_functionality(struct pci_dev *pdev, void __iomem *iobase)
{
struct ioat_device *device = pci_get_drvdata(pdev);
Expand All @@ -67,6 +73,8 @@ static int ioat_setup_functionality(struct pci_dev *pdev, void __iomem *iobase)
switch (version) {
case IOAT_VER_1_2:
device->dma = ioat_dma_probe(pdev, iobase);
if (ioat_dca_enabled)
device->dca = ioat_dca_init(pdev, iobase);
break;
default:
err = -ENODEV;
Expand All @@ -83,6 +91,13 @@ static void ioat_shutdown_functionality(struct pci_dev *pdev)
ioat_dma_remove(device->dma);
device->dma = NULL;
}

if (device->dca) {
unregister_dca_provider(device->dca);
free_dca_provider(device->dca);
device->dca = NULL;
}

}

static struct pci_driver ioat_pci_drv = {
Expand Down
Loading

0 comments on commit 2ed6dc3

Please sign in to comment.