Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2586458rwd; Mon, 22 May 2023 00:47:48 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6zsv7hYgZzgNRiFz2XnT3p5cYBlM0PfnI6HZes3Cd4HIMZkPZDA/Xg9kkPw7zTTOICbkSC X-Received: by 2002:a05:6a21:9008:b0:101:3112:c839 with SMTP id tq8-20020a056a21900800b001013112c839mr7511475pzb.15.1684741667962; Mon, 22 May 2023 00:47:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684741667; cv=none; d=google.com; s=arc-20160816; b=Dxayt0d1eCnx9iOLac8a85/oEbOJ0kjB3sPyZUDdQIQRau0yR5eyOSsCsKmnkeud8n Z8Aym6ksshqCuZvgZlyYeO7Ymh504b+6JRBdQHMFALpWcPSrofxrgtSc38dJUmfzl4yn c8UQ6T04g7c3VNM1jRtp3lEqKaLmELlO17RH5Hs/YPwIyqhAmMBZEiZOhJlDtqmcoKsU 1AEdNyZpnEV2aq1OfijlpyuxeVC2HMmEO3+Aq8jrROQ2dAT4UEjixN3y2sacNPBgASu6 xiLVyLWIeU5n4B3ifo9s1Y+C9YyhH0Mpldu10EUH9mtmA+yEriw9jLs8nieDYpkPbiWm IlSA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=3BbsJ5TMl3aSTqlIon+Jbfxl/Far1E+D+4rr7uYhsuk=; b=PlVd18Lp7UAxy+k2DnCms26mnZ33epnCixMM06SnRIDK2YrJMr1vSkZ8L8SUUEeM4T jxbe4CeAyBHNSSlT+l56p17ioDEFFONirk36wjp+JllyNuCwHCGmsYd1Rx3q8wsOMaiQ oeaagYF6sn0Mm7TKAOANrs6MpHX4pdN67cPPnKu4LGvlvffB4nEuE6lhYfHGwyiiGoiv F+4dPmVBvN7sQOqGgdNXn+RN+K2DCP5QJR6NeOr+gEX/OGMcT1yLSiwj7+IYBbvQkaac ZfFzijiAEOH7KInKuQr++ZmoZhXwIvF00diyixF7OoxD8PLAKig/yiWiUUaHuX+IyjDZ G6OQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sberdevices.ru header.s=mail header.b=lqvw15LP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=sberdevices.ru Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n3-20020a637203000000b0051b2e37e657si866506pgc.719.2023.05.22.00.47.35; Mon, 22 May 2023 00:47:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@sberdevices.ru header.s=mail header.b=lqvw15LP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=sberdevices.ru Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232718AbjEVHpU (ORCPT + 99 others); Mon, 22 May 2023 03:45:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34232 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232673AbjEVHoy (ORCPT ); Mon, 22 May 2023 03:44:54 -0400 Received: from mx.sberdevices.ru (mx.sberdevices.ru [45.89.227.171]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 11A3FB6; Mon, 22 May 2023 00:44:53 -0700 (PDT) Received: from s-lin-edge02.sberdevices.ru (localhost [127.0.0.1]) by mx.sberdevices.ru (Postfix) with ESMTP id B9F285FD53; Mon, 22 May 2023 10:44:50 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sberdevices.ru; s=mail; t=1684741490; bh=3BbsJ5TMl3aSTqlIon+Jbfxl/Far1E+D+4rr7uYhsuk=; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type; b=lqvw15LPfzEaL1BzK8IGJMhXFr9hkMGIayN80/EgUyWFuk3qlrbqoJtl3/bTZbRQK 2oezNG9icLHyj8AStDPNHg8/7QYSSqPNSPHyr8v94a2PPyMMtoXvPmPj0ipteWTsp7 kNwSSlRRaDdbG2XRF3s5LuNfW4IzUPPJS7mO/ET4SBmtcCfZGCe6IcNfao8QQe1eaO vuDNoPW3s8tHu6COqxKrt8E2tmSIRjenc3OsaIGXelOWoeaFpk8BAFbe4jNX0O8yFs sf+owYZMFcbXUBKWH+D40MLQ2eoTKWhwrG6Cf4hu+YYi9j32CfSvsSiknxvK+R6Ehw iG13+N51T8i1w== Received: from S-MS-EXCH01.sberdevices.ru (S-MS-EXCH01.sberdevices.ru [172.16.1.4]) by mx.sberdevices.ru (Postfix) with ESMTP; Mon, 22 May 2023 10:44:50 +0300 (MSK) From: Arseniy Krasnov To: Stefan Hajnoczi , Stefano Garzarella , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , "Michael S. Tsirkin" , Jason Wang , Bobby Eshleman CC: , , , , , , , Arseniy Krasnov Subject: [RFC PATCH v3 09/17] vsock: enable SOCK_SUPPORT_ZC bit Date: Mon, 22 May 2023 10:39:42 +0300 Message-ID: <20230522073950.3574171-10-AVKrasnov@sberdevices.ru> X-Mailer: git-send-email 2.35.0 In-Reply-To: <20230522073950.3574171-1-AVKrasnov@sberdevices.ru> References: <20230522073950.3574171-1-AVKrasnov@sberdevices.ru> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [172.16.1.6] X-ClientProxiedBy: S-MS-EXCH02.sberdevices.ru (172.16.1.5) To S-MS-EXCH01.sberdevices.ru (172.16.1.4) X-KSMG-Rule-ID: 4 X-KSMG-Message-Action: clean X-KSMG-AntiSpam-Status: not scanned, disabled by settings X-KSMG-AntiSpam-Interceptor-Info: not scanned X-KSMG-AntiPhishing: not scanned, disabled by settings X-KSMG-AntiVirus: Kaspersky Secure Mail Gateway, version 1.1.2.30, bases: 2023/05/22 04:49:00 #21364689 X-KSMG-AntiVirus-Status: Clean, skipped X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This bit is used by io_uring in case of zerocopy tx mode. io_uring code checks, that socket has this feature. This patch sets it in two places: 1) For socket in 'connect()' call. 2) For new socket which is returned by 'accept()' call. Signed-off-by: Arseniy Krasnov --- net/vmw_vsock/af_vsock.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/net/vmw_vsock/af_vsock.c b/net/vmw_vsock/af_vsock.c index dbfe82ee7769..bee1c36dc29f 100644 --- a/net/vmw_vsock/af_vsock.c +++ b/net/vmw_vsock/af_vsock.c @@ -1406,6 +1406,9 @@ static int vsock_connect(struct socket *sock, struct sockaddr *addr, goto out; } + if (vsock_msgzerocopy_allow(transport)) + set_bit(SOCK_SUPPORT_ZC, &sk->sk_socket->flags); + err = vsock_auto_bind(vsk); if (err) goto out; @@ -1560,6 +1563,9 @@ static int vsock_accept(struct socket *sock, struct socket *newsock, int flags, } else { newsock->state = SS_CONNECTED; sock_graft(connected, newsock); + if (vsock_msgzerocopy_allow(vconnected->transport)) + set_bit(SOCK_SUPPORT_ZC, + &connected->sk_socket->flags); } release_sock(connected); -- 2.25.1