Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7bced397 authored by Dan Williams's avatar Dan Williams
Browse files

net_dma: simple removal

Per commit "77873803 net_dma: mark broken" net_dma is no longer used
and there is no plan to fix it.

This is the mechanical removal of bits in CONFIG_NET_DMA ifdef guards.
Reverting the remainder of the net_dma induced changes is deferred to
subsequent patches.

Marked for stable due to Roman's report of a memory leak in
dma_pin_iovec_pages():

    https://lkml.org/lkml/2014/9/3/177



Cc: Dave Jiang <dave.jiang@intel.com>
Cc: Vinod Koul <vinod.koul@intel.com>
Cc: David Whipple <whipple@securedatainnovations.ch>
Cc: Alexander Duyck <alexander.h.duyck@intel.com>
Cc: <stable@vger.kernel.org>
Reported-by: default avatarRoman Gushchin <klamm@yandex-team.ru>
Acked-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarDan Williams <dan.j.williams@intel.com>
parent 08223d80
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
What:		tcp_dma_copybreak sysctl
Date:		Removed in kernel v3.13
Contact:	Dan Williams <dan.j.williams@intel.com>
Description:
	Formerly the lower limit, in bytes, of the size of socket reads
	that will be offloaded to a DMA copy engine.  Removed due to
	coherency issues of the cpu potentially touching the buffers
	while dma is in flight.
+0 −6
Original line number Diff line number Diff line
@@ -582,12 +582,6 @@ tcp_workaround_signed_windows - BOOLEAN
	not receive a window scaling option from them.
	Default: 0

tcp_dma_copybreak - INTEGER
	Lower limit, in bytes, of the size of socket reads that will be
	offloaded to a DMA copy engine, if one is present in the system
	and CONFIG_NET_DMA is enabled.
	Default: 4096

tcp_thin_linear_timeouts - BOOLEAN
	Enable dynamic triggering of linear timeouts for thin streams.
	If set, a check is performed upon retransmission by timeout to
+0 −12
Original line number Diff line number Diff line
@@ -368,18 +368,6 @@ config DMA_OF
comment "DMA Clients"
	depends on DMA_ENGINE

config NET_DMA
	bool "Network: TCP receive copy offload"
	depends on DMA_ENGINE && NET
	default (INTEL_IOATDMA || FSL_DMA)
	depends on BROKEN
	help
	  This enables the use of DMA engines in the network stack to
	  offload receive copy-to-user operations, freeing CPU cycles.

	  Say Y here if you enabled INTEL_IOATDMA or FSL_DMA, otherwise
	  say N.

config ASYNC_TX_DMA
	bool "Async_tx: Offload support for the async_tx api"
	depends on DMA_ENGINE
+0 −1
Original line number Diff line number Diff line
@@ -6,7 +6,6 @@ obj-$(CONFIG_DMA_VIRTUAL_CHANNELS) += virt-dma.o
obj-$(CONFIG_DMA_ACPI) += acpi-dma.o
obj-$(CONFIG_DMA_OF) += of-dma.o

obj-$(CONFIG_NET_DMA) += iovlock.o
obj-$(CONFIG_INTEL_MID_DMAC) += intel_mid_dma.o
obj-$(CONFIG_DMATEST) += dmatest.o
obj-$(CONFIG_INTEL_IOATDMA) += ioat/
+0 −104
Original line number Diff line number Diff line
@@ -1084,110 +1084,6 @@ dmaengine_get_unmap_data(struct device *dev, int nr, gfp_t flags)
}
EXPORT_SYMBOL(dmaengine_get_unmap_data);

/**
 * dma_async_memcpy_pg_to_pg - offloaded copy from page to page
 * @chan: DMA channel to offload copy to
 * @dest_pg: destination page
 * @dest_off: offset in page to copy to
 * @src_pg: source page
 * @src_off: offset in page to copy from
 * @len: length
 *
 * Both @dest_page/@dest_off and @src_page/@src_off must be mappable to a bus
 * address according to the DMA mapping API rules for streaming mappings.
 * Both @dest_page/@dest_off and @src_page/@src_off must stay memory resident
 * (kernel memory or locked user space pages).
 */
dma_cookie_t
dma_async_memcpy_pg_to_pg(struct dma_chan *chan, struct page *dest_pg,
	unsigned int dest_off, struct page *src_pg, unsigned int src_off,
	size_t len)
{
	struct dma_device *dev = chan->device;
	struct dma_async_tx_descriptor *tx;
	struct dmaengine_unmap_data *unmap;
	dma_cookie_t cookie;
	unsigned long flags;

	unmap = dmaengine_get_unmap_data(dev->dev, 2, GFP_NOWAIT);
	if (!unmap)
		return -ENOMEM;

	unmap->to_cnt = 1;
	unmap->from_cnt = 1;
	unmap->addr[0] = dma_map_page(dev->dev, src_pg, src_off, len,
				      DMA_TO_DEVICE);
	unmap->addr[1] = dma_map_page(dev->dev, dest_pg, dest_off, len,
				      DMA_FROM_DEVICE);
	unmap->len = len;
	flags = DMA_CTRL_ACK;
	tx = dev->device_prep_dma_memcpy(chan, unmap->addr[1], unmap->addr[0],
					 len, flags);

	if (!tx) {
		dmaengine_unmap_put(unmap);
		return -ENOMEM;
	}

	dma_set_unmap(tx, unmap);
	cookie = tx->tx_submit(tx);
	dmaengine_unmap_put(unmap);

	preempt_disable();
	__this_cpu_add(chan->local->bytes_transferred, len);
	__this_cpu_inc(chan->local->memcpy_count);
	preempt_enable();

	return cookie;
}
EXPORT_SYMBOL(dma_async_memcpy_pg_to_pg);

/**
 * dma_async_memcpy_buf_to_buf - offloaded copy between virtual addresses
 * @chan: DMA channel to offload copy to
 * @dest: destination address (virtual)
 * @src: source address (virtual)
 * @len: length
 *
 * Both @dest and @src must be mappable to a bus address according to the
 * DMA mapping API rules for streaming mappings.
 * Both @dest and @src must stay memory resident (kernel memory or locked
 * user space pages).
 */
dma_cookie_t
dma_async_memcpy_buf_to_buf(struct dma_chan *chan, void *dest,
			    void *src, size_t len)
{
	return dma_async_memcpy_pg_to_pg(chan, virt_to_page(dest),
					 (unsigned long) dest & ~PAGE_MASK,
					 virt_to_page(src),
					 (unsigned long) src & ~PAGE_MASK, len);
}
EXPORT_SYMBOL(dma_async_memcpy_buf_to_buf);

/**
 * dma_async_memcpy_buf_to_pg - offloaded copy from address to page
 * @chan: DMA channel to offload copy to
 * @page: destination page
 * @offset: offset in page to copy to
 * @kdata: source address (virtual)
 * @len: length
 *
 * Both @page/@offset and @kdata must be mappable to a bus address according
 * to the DMA mapping API rules for streaming mappings.
 * Both @page/@offset and @kdata must stay memory resident (kernel memory or
 * locked user space pages)
 */
dma_cookie_t
dma_async_memcpy_buf_to_pg(struct dma_chan *chan, struct page *page,
			   unsigned int offset, void *kdata, size_t len)
{
	return dma_async_memcpy_pg_to_pg(chan, page, offset,
					 virt_to_page(kdata),
					 (unsigned long) kdata & ~PAGE_MASK, len);
}
EXPORT_SYMBOL(dma_async_memcpy_buf_to_pg);

void dma_async_tx_descriptor_init(struct dma_async_tx_descriptor *tx,
	struct dma_chan *chan)
{
Loading