From patchwork Sun Jun 12 08:57:54 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joe Damato X-Patchwork-Id: 12878663 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8D766C433EF for ; Sun, 12 Jun 2022 09:00:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235309AbiFLJAx (ORCPT ); Sun, 12 Jun 2022 05:00:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40020 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235240AbiFLJAr (ORCPT ); Sun, 12 Jun 2022 05:00:47 -0400 Received: from mail-wm1-x32f.google.com (mail-wm1-x32f.google.com [IPv6:2a00:1450:4864:20::32f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3E43751E42 for ; Sun, 12 Jun 2022 02:00:46 -0700 (PDT) Received: by mail-wm1-x32f.google.com with SMTP id a10so1470344wmj.5 for ; Sun, 12 Jun 2022 02:00:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastly.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Ea5VDYyACTdLFfDR1OzYQ+USVPk0XrM3SL5Uf8rgmF0=; b=KR0M7uzWU0BPwWn1Brdk2z+8Fi7ZcEFz/0BqFDgszVZgE8lwHoAW6oSObc3l1b6vr4 BoC6dWRtE6EBumonrLPkkC91REo5S9yRXWhNwSvD4HcKvP5LKq/IS1A2cXQD+219YWhl ZvQrPdoNkDwgS4izTjiqJ0S57mfhBZYKU3hDk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=Ea5VDYyACTdLFfDR1OzYQ+USVPk0XrM3SL5Uf8rgmF0=; b=FhR2V06BU/eFzmD6Ver5uaQb2lq34E5/mZwTDQ8uzwlVydOCt/OhR8PAFJOy+jVr5S eRndSnpImx7rGlIJt+n59WTBlsXMZK3ubdiKOkXwqX+4vVWJvXFD6A/NzSR07q0swG9y BuxZ/wycsKDYZpDXx82uQf3KjuIkzBe9pBCzh9RaFXrDoVBrwQPF15AdmTZ/KCPofBS+ OsEnio9NxvaNHEHGFzYCFOYPPYxNkSidZ3P0Xw7biHEIMSmeHwtRqgVYxRfIXn4Dsl0o b0LXGKqAALqmUgBQfeCSqqGi8GcT09FwS6zVn3bNL5jxYqOIdi2wiLoSjnBfWc8osipm H94Q== X-Gm-Message-State: AOAM531EBMbTXuyoov9Kvz8qymgmQFjekInl4dToXsLBLYu7/S1z1Din gFYHBwTOhF/5FD0OQhFm4cA9zA== X-Google-Smtp-Source: ABdhPJyNlQK22KcaUyTUuErIsRmeLRfYWG48oRcA2vWnHqeaWVoWe/3tpFsgtVdSSbyWZCmkaqjVDg== X-Received: by 2002:a7b:c346:0:b0:397:626d:d2c4 with SMTP id l6-20020a7bc346000000b00397626dd2c4mr8629025wmj.172.1655024444792; Sun, 12 Jun 2022 02:00:44 -0700 (PDT) Received: from localhost.localdomain ([178.130.153.185]) by smtp.gmail.com with ESMTPSA id d34-20020a05600c4c2200b0039c5b4ab1b0sm4798603wmp.48.2022.06.12.02.00.42 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 12 Jun 2022 02:00:43 -0700 (PDT) From: Joe Damato To: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Joe Damato Subject: [RFC,net-next v2 5/8] net: unix: Support MSG_NTCOPY Date: Sun, 12 Jun 2022 01:57:54 -0700 Message-Id: <1655024280-23827-6-git-send-email-jdamato@fastly.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1655024280-23827-1-git-send-email-jdamato@fastly.com> References: <1655024280-23827-1-git-send-email-jdamato@fastly.com> Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org X-Patchwork-State: RFC Add support for MSG_NTCOPY to unix sockets. The helper function msg_set_iter_copy_type is used to set the copy flag on the iovec iterator correctly. Signed-off-by: Joe Damato --- net/unix/af_unix.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c index 3453e00..b8f522d 100644 --- a/net/unix/af_unix.c +++ b/net/unix/af_unix.c @@ -1905,6 +1905,8 @@ static int unix_dgram_sendmsg(struct socket *sock, struct msghdr *msg, skb_put(skb, len - data_len); skb->data_len = data_len; skb->len = len; + + msg_set_iter_copy_type(msg); err = skb_copy_datagram_from_iter(skb, 0, &msg->msg_iter, len); if (err) goto out_free; @@ -2165,6 +2167,8 @@ static int unix_stream_sendmsg(struct socket *sock, struct msghdr *msg, skb_put(skb, size - data_len); skb->data_len = data_len; skb->len = size; + + msg_set_iter_copy_type(msg); err = skb_copy_datagram_from_iter(skb, 0, &msg->msg_iter, size); if (err) { kfree_skb(skb); From patchwork Sun Jun 12 08:57:55 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joe Damato X-Patchwork-Id: 12878664 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8AB1EC43334 for ; Sun, 12 Jun 2022 09:01:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235389AbiFLJBA (ORCPT ); Sun, 12 Jun 2022 05:01:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40468 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235233AbiFLJAv (ORCPT ); Sun, 12 Jun 2022 05:00:51 -0400 Received: from mail-wm1-x335.google.com (mail-wm1-x335.google.com [IPv6:2a00:1450:4864:20::335]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 35CDC51E4B for ; Sun, 12 Jun 2022 02:00:49 -0700 (PDT) Received: by mail-wm1-x335.google.com with SMTP id r123-20020a1c2b81000000b0039c1439c33cso1599384wmr.5 for ; Sun, 12 Jun 2022 02:00:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastly.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=QEsnoS6fs7x7z63+N74TXGO62/r4Rll/JtLDyGKeftw=; b=RyVH1BNMS71kJucK5zElSTO/iNUJtJ1wzfB62MK2wkxOOJQg/HG4FYnSYIx5b28jtI c1Wk6gsCMqqP+0DlffzZlNALt2iyg5mxWghT7RpQ3Yotns8G4e/n7SJRzvMrjiCaxae/ PUMD95tfWDtLUEIwDO+4QJirah2khGY715i+g= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=QEsnoS6fs7x7z63+N74TXGO62/r4Rll/JtLDyGKeftw=; b=wJRg8DU1WEKTOrDrn7+rwmj2NVdfkELVznQK+ZFldPIFpc+65MJ+ICqWrQQlZv7wOa eaJeJ6xontHik+CvC8BgeAWxu8f2bvJMB3VLfuSZbLWVmkMLqzNNUAT1FVXtzF3z+Ket TRsv6sMez6JOVLHcgMLU/pq/WJVBmdvZPP4TkMszzq0d+nTChdggcA6wYo1K9gUPsSAN Rx6ce7tpjEyEG/ftLZYoCOdC1ldi14f0uE8Far/WrY2DSnUS3pGgF1JRjJTFn/PG1uz3 sZRw4I8XzJMi1UapEzocHFsDpyF0XgA7zxgM1d1kr8ZoJ1+2yhvaIp29njTj+G7Hj+3m UTig== X-Gm-Message-State: AOAM530xyIJ9v5KAGu82Ho0Xk3EubbrmeiVIR7arsFoIXn8sCxN8mjgS yxBmKmdNzCFzHjIQGuIGYmGCuw== X-Google-Smtp-Source: ABdhPJwXZyVpsGAIc5rt4KdnvnyW5tPEH0k/SyiM2mkjkdzxtxUdKAXvWaJOWLmn6Fb+SsUMSvmc1g== X-Received: by 2002:a05:600c:4e94:b0:39c:81fd:6594 with SMTP id f20-20020a05600c4e9400b0039c81fd6594mr8030223wmq.198.1655024448441; Sun, 12 Jun 2022 02:00:48 -0700 (PDT) Received: from localhost.localdomain ([178.130.153.185]) by smtp.gmail.com with ESMTPSA id d34-20020a05600c4c2200b0039c5b4ab1b0sm4798603wmp.48.2022.06.12.02.00.45 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 12 Jun 2022 02:00:47 -0700 (PDT) From: Joe Damato To: "David S. Miller" , Hideaki YOSHIFUJI , David Ahern , Eric Dumazet , Jakub Kicinski , Paolo Abeni , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Joe Damato Subject: [RFC,net-next v2 6/8] net: ip: Support MSG_NTCOPY Date: Sun, 12 Jun 2022 01:57:55 -0700 Message-Id: <1655024280-23827-7-git-send-email-jdamato@fastly.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1655024280-23827-1-git-send-email-jdamato@fastly.com> References: <1655024280-23827-1-git-send-email-jdamato@fastly.com> Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org X-Patchwork-State: RFC Support nontemporal copies of IP data when applications set the MSG_NTCOPY flag and checksumming is offloaded. ip_generic_getfrag is used by UDP and raw sockets, so this change effectively enables MSG_NTCOPY support for both. Signed-off-by: Joe Damato --- net/ipv4/ip_output.c | 1 + 1 file changed, 1 insertion(+) diff --git a/net/ipv4/ip_output.c b/net/ipv4/ip_output.c index 00b4bf2..75c8627 100644 --- a/net/ipv4/ip_output.c +++ b/net/ipv4/ip_output.c @@ -933,6 +933,7 @@ ip_generic_getfrag(void *from, char *to, int offset, int len, int odd, struct sk struct msghdr *msg = from; if (skb->ip_summed == CHECKSUM_PARTIAL) { + msg_set_iter_copy_type(msg); if (!copy_from_iter_full(to, len, &msg->msg_iter)) return -EFAULT; } else { From patchwork Sun Jun 12 08:57:56 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joe Damato X-Patchwork-Id: 12878665 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 708FFC43334 for ; Sun, 12 Jun 2022 09:01:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235556AbiFLJBG (ORCPT ); Sun, 12 Jun 2022 05:01:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41120 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235429AbiFLJA7 (ORCPT ); Sun, 12 Jun 2022 05:00:59 -0400 Received: from mail-wm1-x336.google.com (mail-wm1-x336.google.com [IPv6:2a00:1450:4864:20::336]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A7AB351E50 for ; Sun, 12 Jun 2022 02:00:52 -0700 (PDT) Received: by mail-wm1-x336.google.com with SMTP id m39-20020a05600c3b2700b0039c511ebbacso3092217wms.3 for ; Sun, 12 Jun 2022 02:00:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastly.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=ELhqEDOqgmC+TbLCt4NyDbvbHR56jry/w5HtXxvrUIM=; b=PaZYXKu8oFHY0LGzLxFo66YYimisvTv48Bj8XCIKfLpjdtwA5eikvThJJwxRW5WgYG m6/1fv09uv8Q9xhYBCq4o2+KLW3MutYdmX/1ljpZoq+2GlpOkiLdQGZWqnuj8+qoVTvB T45fXPVb9A6z8tzB5O+p0Sm1B0o5nToqWufhY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=ELhqEDOqgmC+TbLCt4NyDbvbHR56jry/w5HtXxvrUIM=; b=erE8bUyM5jxgHqvvOcZIP8K5l47i2LEf498i2ski3vqZUF+v87ZuCWbot6MHkJGLi5 TTzOS2I596L35Gc9jP4QtrXvSdNEDqTQT81zX9lNXRK446tO29T4ukwl7NxJ11/LCJpR +F3GYwqI23IZ2xnTOWFb/IelTaoXYLbKoMD6FXUHnmXjezJxeF29IBMz8KnXCrlCz4r3 LQwrhv4FGZDEIXJWGHithlWlorq7P81OQsu1T6cYp5WE60pF6ABC5S5yJTje/7fg3eHo L4M6p1m7+EFPXDscRxq2GApTnFXTM3JLXrvRrcS11FICo0LeB6+VAzRQY3lj6y0TGQit BHoQ== X-Gm-Message-State: AOAM533LDakbGonYb/V9TiTpP+GhXdMRCDmWNzDXsTR3fQdqakTrppL2 jB6g/ju4H7MJcjtnXvsQ2kTCQN3hk/RG3w== X-Google-Smtp-Source: ABdhPJzd9bkHYJC56LA9yvbOs3N/OrPbAmtYouTWcxhGPvju+dr0MxD3WT7YPW2C1hZk3nHzKsVgMA== X-Received: by 2002:a05:600c:4a28:b0:39c:4d97:37e2 with SMTP id c40-20020a05600c4a2800b0039c4d9737e2mr8439018wmp.31.1655024451149; Sun, 12 Jun 2022 02:00:51 -0700 (PDT) Received: from localhost.localdomain ([178.130.153.185]) by smtp.gmail.com with ESMTPSA id d34-20020a05600c4c2200b0039c5b4ab1b0sm4798603wmp.48.2022.06.12.02.00.49 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 12 Jun 2022 02:00:49 -0700 (PDT) From: Joe Damato To: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Joe Damato Subject: [RFC,net-next v2 7/8] net: udplite: Support MSG_NTCOPY Date: Sun, 12 Jun 2022 01:57:56 -0700 Message-Id: <1655024280-23827-8-git-send-email-jdamato@fastly.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1655024280-23827-1-git-send-email-jdamato@fastly.com> References: <1655024280-23827-1-git-send-email-jdamato@fastly.com> Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org X-Patchwork-State: RFC Support non-temporal copies of udp-lite data when applications set the MSG_NTCOPY. Signed-off-by: Joe Damato --- include/net/udplite.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/net/udplite.h b/include/net/udplite.h index a3c5311..000677c5 100644 --- a/include/net/udplite.h +++ b/include/net/udplite.h @@ -21,6 +21,7 @@ static __inline__ int udplite_getfrag(void *from, char *to, int offset, int len, int odd, struct sk_buff *skb) { struct msghdr *msg = from; + msg_set_iter_copy_type(msg); return copy_from_iter_full(to, len, &msg->msg_iter) ? 0 : -EFAULT; } From patchwork Sun Jun 12 08:57:57 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joe Damato X-Patchwork-Id: 12878666 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id CFD2BC43334 for ; Sun, 12 Jun 2022 09:01:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235578AbiFLJBI (ORCPT ); Sun, 12 Jun 2022 05:01:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41168 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235394AbiFLJA7 (ORCPT ); Sun, 12 Jun 2022 05:00:59 -0400 Received: from mail-wm1-x32d.google.com (mail-wm1-x32d.google.com [IPv6:2a00:1450:4864:20::32d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 586D251E70 for ; Sun, 12 Jun 2022 02:00:55 -0700 (PDT) Received: by mail-wm1-x32d.google.com with SMTP id j5-20020a05600c1c0500b0039c5dbbfa48so3086407wms.5 for ; Sun, 12 Jun 2022 02:00:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastly.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=oZewD39xI/d3cA2lrYzrzbuReF/vvOH6OKqzVd89Vi0=; b=I7WHh5fScRUlNuotdc665LoLnMNVifFMFBlEzjUFcKf9gROoXJ845rIiW1Qk+PTxiR PtbBonb26DI70Kx2ARKOD7D1WUmUHI/gQp3TkURjBlfMVEc24tG55CXut6lZKgTXhGkZ xV/ndMmtPSnsvL4UM8x/2vxsNs0Yfbu6sQJzs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=oZewD39xI/d3cA2lrYzrzbuReF/vvOH6OKqzVd89Vi0=; b=phZcPwyTlSW/khylGZCtcqAqYSv0DIUbQZGWwuE/vs6vpGbUbrtppRWHwUL1jZphZh svJDnS6SiQNQqHWZAY1vGvV6bHf5ajYjR7laEU5uzgbw9zYyyQLNBKyoAuS0V0ohYx2W gtWBzS/6E8GKc11NEoDcCXsWh+2uj6u+um6LH0ExJrMbaKEklQHD0umibW0P74UNlaAV DMe1YvNB+wE9DFbAKiI9P/BZrrJfmHtDsiB1WqxAqnT5km+PKw/ECjvm/AWPIs2IV8uc kpe88lnkR0xaxwJcltngKbdv1Oso6JjpIp6TflfCgcX5nqU9dM3s5E7YeDG1o0VPHte1 63fA== X-Gm-Message-State: AOAM530dkcnYF6ybcg0DzA+1g2oeuyNzwhrrTel9DXYXOCk2627fbL0n wjuss9YMcmCMahyKqqCUnK3UIA== X-Google-Smtp-Source: ABdhPJyRc2I34omfc6W/l7b3YpL+JA18yp8NmiSPvr3XlLpY4Wwvv7Z0CdG4SFGFbc7ui5FdZrlNTQ== X-Received: by 2002:a05:600c:1ca0:b0:39c:4dbd:e9ed with SMTP id k32-20020a05600c1ca000b0039c4dbde9edmr8452040wms.40.1655024453936; Sun, 12 Jun 2022 02:00:53 -0700 (PDT) Received: from localhost.localdomain ([178.130.153.185]) by smtp.gmail.com with ESMTPSA id d34-20020a05600c4c2200b0039c5b4ab1b0sm4798603wmp.48.2022.06.12.02.00.51 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 12 Jun 2022 02:00:53 -0700 (PDT) From: Joe Damato To: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Hideaki YOSHIFUJI , David Ahern , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Joe Damato Subject: [RFC,net-next v2 8/8] net: tcp: Support MSG_NTCOPY Date: Sun, 12 Jun 2022 01:57:57 -0700 Message-Id: <1655024280-23827-9-git-send-email-jdamato@fastly.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1655024280-23827-1-git-send-email-jdamato@fastly.com> References: <1655024280-23827-1-git-send-email-jdamato@fastly.com> Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org X-Patchwork-State: RFC Support non-temporal copies in the TCP sendmsg path. Previously, the only way to enable non-temporal copies was to enable them for the entire interface (via ethtool). This change allows user programs to request non-temporal copies for specific sendmsg calls. Signed-off-by: Joe Damato --- include/net/sock.h | 2 +- net/ipv4/tcp.c | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/include/net/sock.h b/include/net/sock.h index 0063e84..b666ecd 100644 --- a/include/net/sock.h +++ b/include/net/sock.h @@ -2200,7 +2200,7 @@ static inline int skb_do_copy_data_nocache(struct sock *sk, struct sk_buff *skb, if (!csum_and_copy_from_iter_full(to, copy, &csum, from)) return -EFAULT; skb->csum = csum_block_add(skb->csum, csum, offset); - } else if (sk->sk_route_caps & NETIF_F_NOCACHE_COPY) { + } else if (sk->sk_route_caps & NETIF_F_NOCACHE_COPY || iov_iter_copy_is_nt(from)) { if (!copy_from_iter_full_nocache(to, copy, from)) return -EFAULT; } else if (!copy_from_iter_full(to, copy, from)) diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c index 14ebb4e..5b36e00 100644 --- a/net/ipv4/tcp.c +++ b/net/ipv4/tcp.c @@ -1201,6 +1201,8 @@ int tcp_sendmsg_locked(struct sock *sk, struct msghdr *msg, size_t size) flags = msg->msg_flags; + msg_set_iter_copy_type(msg); + if (flags & MSG_ZEROCOPY && size && sock_flag(sk, SOCK_ZEROCOPY)) { skb = tcp_write_queue_tail(sk); uarg = msg_zerocopy_realloc(sk, size, skb_zcopy(skb));