aboutsummaryrefslogtreecommitdiffstats
path: root/net/kcm/kcmsock.c
diff options
context:
space:
mode:
authorDaniel Vetter <daniel.vetter@ffwll.ch>2017-02-26 15:34:42 -0500
committerDaniel Vetter <daniel.vetter@ffwll.ch>2017-02-26 15:34:42 -0500
commit8e22e1b3499a446df48c2b26667ca36c55bf864c (patch)
tree5329f98b3eb3c95a9dcbab0fa4f9b6e62f0e788d /net/kcm/kcmsock.c
parent00d3c14f14d51babd8aeafd5fa734ccf04f5ca3d (diff)
parent64a577196d66b44e37384bc5c4d78c61f59d5b2a (diff)
Merge airlied/drm-next into drm-misc-next
Backmerge the main pull request to sync up with all the newly landed drivers. Otherwise we'll have chaos even before 4.12 started in earnest. Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Diffstat (limited to 'net/kcm/kcmsock.c')
-rw-r--r--net/kcm/kcmsock.c40
1 files changed, 22 insertions, 18 deletions
diff --git a/net/kcm/kcmsock.c b/net/kcm/kcmsock.c
index 7e08a4d3d77d..64f0e8531af0 100644
--- a/net/kcm/kcmsock.c
+++ b/net/kcm/kcmsock.c
@@ -929,23 +929,25 @@ static int kcm_sendmsg(struct socket *sock, struct msghdr *msg, size_t len)
929 goto out_error; 929 goto out_error;
930 } 930 }
931 931
932 /* New message, alloc head skb */ 932 if (msg_data_left(msg)) {
933 head = alloc_skb(0, sk->sk_allocation); 933 /* New message, alloc head skb */
934 while (!head) {
935 kcm_push(kcm);
936 err = sk_stream_wait_memory(sk, &timeo);
937 if (err)
938 goto out_error;
939
940 head = alloc_skb(0, sk->sk_allocation); 934 head = alloc_skb(0, sk->sk_allocation);
941 } 935 while (!head) {
936 kcm_push(kcm);
937 err = sk_stream_wait_memory(sk, &timeo);
938 if (err)
939 goto out_error;
942 940
943 skb = head; 941 head = alloc_skb(0, sk->sk_allocation);
942 }
944 943
945 /* Set ip_summed to CHECKSUM_UNNECESSARY to avoid calling 944 skb = head;
946 * csum_and_copy_from_iter from skb_do_copy_data_nocache. 945
947 */ 946 /* Set ip_summed to CHECKSUM_UNNECESSARY to avoid calling
948 skb->ip_summed = CHECKSUM_UNNECESSARY; 947 * csum_and_copy_from_iter from skb_do_copy_data_nocache.
948 */
949 skb->ip_summed = CHECKSUM_UNNECESSARY;
950 }
949 951
950start: 952start:
951 while (msg_data_left(msg)) { 953 while (msg_data_left(msg)) {
@@ -1018,10 +1020,12 @@ wait_for_memory:
1018 if (eor) { 1020 if (eor) {
1019 bool not_busy = skb_queue_empty(&sk->sk_write_queue); 1021 bool not_busy = skb_queue_empty(&sk->sk_write_queue);
1020 1022
1021 /* Message complete, queue it on send buffer */ 1023 if (head) {
1022 __skb_queue_tail(&sk->sk_write_queue, head); 1024 /* Message complete, queue it on send buffer */
1023 kcm->seq_skb = NULL; 1025 __skb_queue_tail(&sk->sk_write_queue, head);
1024 KCM_STATS_INCR(kcm->stats.tx_msgs); 1026 kcm->seq_skb = NULL;
1027 KCM_STATS_INCR(kcm->stats.tx_msgs);
1028 }
1025 1029
1026 if (msg->msg_flags & MSG_BATCH) { 1030 if (msg->msg_flags & MSG_BATCH) {
1027 kcm->tx_wait_more = true; 1031 kcm->tx_wait_more = true;