diff options
-rw-r--r-- | drivers/dma/dmaengine.c | 14 | ||||
-rw-r--r-- | include/linux/dmaengine.h | 1 | ||||
-rw-r--r-- | net/ipv4/tcp.c | 4 | ||||
-rw-r--r-- | net/ipv4/tcp_input.c | 2 | ||||
-rw-r--r-- | net/ipv4/tcp_ipv4.c | 2 | ||||
-rw-r--r-- | net/ipv6/tcp_ipv6.c | 2 |
6 files changed, 20 insertions, 5 deletions
diff --git a/drivers/dma/dmaengine.c b/drivers/dma/dmaengine.c index a6c6051ec858..0f1ca74fe0bb 100644 --- a/drivers/dma/dmaengine.c +++ b/drivers/dma/dmaengine.c | |||
@@ -332,6 +332,20 @@ struct dma_chan *dma_find_channel(enum dma_transaction_type tx_type) | |||
332 | } | 332 | } |
333 | EXPORT_SYMBOL(dma_find_channel); | 333 | EXPORT_SYMBOL(dma_find_channel); |
334 | 334 | ||
335 | /* | ||
336 | * net_dma_find_channel - find a channel for net_dma | ||
337 | * net_dma has alignment requirements | ||
338 | */ | ||
339 | struct dma_chan *net_dma_find_channel(void) | ||
340 | { | ||
341 | struct dma_chan *chan = dma_find_channel(DMA_MEMCPY); | ||
342 | if (chan && !is_dma_copy_aligned(chan->device, 1, 1, 1)) | ||
343 | return NULL; | ||
344 | |||
345 | return chan; | ||
346 | } | ||
347 | EXPORT_SYMBOL(net_dma_find_channel); | ||
348 | |||
335 | /** | 349 | /** |
336 | * dma_issue_pending_all - flush all pending operations across all channels | 350 | * dma_issue_pending_all - flush all pending operations across all channels |
337 | */ | 351 | */ |
diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h index 679b349d9b66..a5bb3ad5c7a5 100644 --- a/include/linux/dmaengine.h +++ b/include/linux/dmaengine.h | |||
@@ -948,6 +948,7 @@ int dma_async_device_register(struct dma_device *device); | |||
948 | void dma_async_device_unregister(struct dma_device *device); | 948 | void dma_async_device_unregister(struct dma_device *device); |
949 | void dma_run_dependencies(struct dma_async_tx_descriptor *tx); | 949 | void dma_run_dependencies(struct dma_async_tx_descriptor *tx); |
950 | struct dma_chan *dma_find_channel(enum dma_transaction_type tx_type); | 950 | struct dma_chan *dma_find_channel(enum dma_transaction_type tx_type); |
951 | struct dma_chan *net_dma_find_channel(void); | ||
951 | #define dma_request_channel(mask, x, y) __dma_request_channel(&(mask), x, y) | 952 | #define dma_request_channel(mask, x, y) __dma_request_channel(&(mask), x, y) |
952 | 953 | ||
953 | /* --- Helper iov-locking functions --- */ | 954 | /* --- Helper iov-locking functions --- */ |
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c index 22ef5f9fd2ff..8712c5d4f91d 100644 --- a/net/ipv4/tcp.c +++ b/net/ipv4/tcp.c | |||
@@ -1450,7 +1450,7 @@ int tcp_recvmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, | |||
1450 | if ((available < target) && | 1450 | if ((available < target) && |
1451 | (len > sysctl_tcp_dma_copybreak) && !(flags & MSG_PEEK) && | 1451 | (len > sysctl_tcp_dma_copybreak) && !(flags & MSG_PEEK) && |
1452 | !sysctl_tcp_low_latency && | 1452 | !sysctl_tcp_low_latency && |
1453 | dma_find_channel(DMA_MEMCPY)) { | 1453 | net_dma_find_channel()) { |
1454 | preempt_enable_no_resched(); | 1454 | preempt_enable_no_resched(); |
1455 | tp->ucopy.pinned_list = | 1455 | tp->ucopy.pinned_list = |
1456 | dma_pin_iovec_pages(msg->msg_iov, len); | 1456 | dma_pin_iovec_pages(msg->msg_iov, len); |
@@ -1665,7 +1665,7 @@ do_prequeue: | |||
1665 | if (!(flags & MSG_TRUNC)) { | 1665 | if (!(flags & MSG_TRUNC)) { |
1666 | #ifdef CONFIG_NET_DMA | 1666 | #ifdef CONFIG_NET_DMA |
1667 | if (!tp->ucopy.dma_chan && tp->ucopy.pinned_list) | 1667 | if (!tp->ucopy.dma_chan && tp->ucopy.pinned_list) |
1668 | tp->ucopy.dma_chan = dma_find_channel(DMA_MEMCPY); | 1668 | tp->ucopy.dma_chan = net_dma_find_channel(); |
1669 | 1669 | ||
1670 | if (tp->ucopy.dma_chan) { | 1670 | if (tp->ucopy.dma_chan) { |
1671 | tp->ucopy.dma_cookie = dma_skb_copy_datagram_iovec( | 1671 | tp->ucopy.dma_cookie = dma_skb_copy_datagram_iovec( |
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c index b5e315f13641..27c676dfea33 100644 --- a/net/ipv4/tcp_input.c +++ b/net/ipv4/tcp_input.c | |||
@@ -5190,7 +5190,7 @@ static int tcp_dma_try_early_copy(struct sock *sk, struct sk_buff *skb, | |||
5190 | return 0; | 5190 | return 0; |
5191 | 5191 | ||
5192 | if (!tp->ucopy.dma_chan && tp->ucopy.pinned_list) | 5192 | if (!tp->ucopy.dma_chan && tp->ucopy.pinned_list) |
5193 | tp->ucopy.dma_chan = dma_find_channel(DMA_MEMCPY); | 5193 | tp->ucopy.dma_chan = net_dma_find_channel(); |
5194 | 5194 | ||
5195 | if (tp->ucopy.dma_chan && skb_csum_unnecessary(skb)) { | 5195 | if (tp->ucopy.dma_chan && skb_csum_unnecessary(skb)) { |
5196 | 5196 | ||
diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c index fd54c5f8a255..3810b6fe0a1e 100644 --- a/net/ipv4/tcp_ipv4.c +++ b/net/ipv4/tcp_ipv4.c | |||
@@ -1727,7 +1727,7 @@ process: | |||
1727 | #ifdef CONFIG_NET_DMA | 1727 | #ifdef CONFIG_NET_DMA |
1728 | struct tcp_sock *tp = tcp_sk(sk); | 1728 | struct tcp_sock *tp = tcp_sk(sk); |
1729 | if (!tp->ucopy.dma_chan && tp->ucopy.pinned_list) | 1729 | if (!tp->ucopy.dma_chan && tp->ucopy.pinned_list) |
1730 | tp->ucopy.dma_chan = dma_find_channel(DMA_MEMCPY); | 1730 | tp->ucopy.dma_chan = net_dma_find_channel(); |
1731 | if (tp->ucopy.dma_chan) | 1731 | if (tp->ucopy.dma_chan) |
1732 | ret = tcp_v4_do_rcv(sk, skb); | 1732 | ret = tcp_v4_do_rcv(sk, skb); |
1733 | else | 1733 | else |
diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c index 3edd05ae4388..fcb3e4f0010e 100644 --- a/net/ipv6/tcp_ipv6.c +++ b/net/ipv6/tcp_ipv6.c | |||
@@ -1755,7 +1755,7 @@ process: | |||
1755 | #ifdef CONFIG_NET_DMA | 1755 | #ifdef CONFIG_NET_DMA |
1756 | struct tcp_sock *tp = tcp_sk(sk); | 1756 | struct tcp_sock *tp = tcp_sk(sk); |
1757 | if (!tp->ucopy.dma_chan && tp->ucopy.pinned_list) | 1757 | if (!tp->ucopy.dma_chan && tp->ucopy.pinned_list) |
1758 | tp->ucopy.dma_chan = dma_find_channel(DMA_MEMCPY); | 1758 | tp->ucopy.dma_chan = net_dma_find_channel(); |
1759 | if (tp->ucopy.dma_chan) | 1759 | if (tp->ucopy.dma_chan) |
1760 | ret = tcp_v6_do_rcv(sk, skb); | 1760 | ret = tcp_v6_do_rcv(sk, skb); |
1761 | else | 1761 | else |