Received: by 2002:a05:7412:37c9:b0:e2:908c:2ebd with SMTP id jz9csp2760395rdb; Fri, 22 Sep 2023 07:44:51 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFeV1QpfXEN3g/lOVEEMMvbep0FidEWV4E5VsMwdHF7RFTPkNGSmpNnWFExcRF+12MNvBmg X-Received: by 2002:a05:6a00:1950:b0:68e:4955:c405 with SMTP id s16-20020a056a00195000b0068e4955c405mr8036079pfk.27.1695393890856; Fri, 22 Sep 2023 07:44:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695393890; cv=none; d=google.com; s=arc-20160816; b=bUs9fW53xFnHbT+Aag+LV1wPIlpHlCIe/aZMn4UmEDPbAwCota/RoRYnWiRcZSqOvh MklqrJdaeCHqkxnBaZhhzRgnjdq9+CR9Rdxaj6oXBEUqdavX3cQcGaO3VYMlSBt8s/I+ nhoARjL9Dl09mM27CN0hatMKt8GpQapsQdk2Jzzg7xaSQZSCcJP300rAzhiU8DXvlbsu VcVdA9G9grVYHUde/TcmyU4hwUonVXzhzDWEMut9+QJ/8QtxmlFCGCLNGaArgnz4csxb bYX+Z26WZ29v976A2bShvjAUQYpYU5lVZjSmQU/jsifwieZXEAHIcMNReTRkB4VRTIT2 IULA== 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:dkim-filter; bh=DNBdCZuTTDmqTiWLQnja4rvWVLyn68hKlFPwRHIjNjU=; fh=wIHqZpOIuzcidDZ82yQbOZuyHJty7uvaWDEh/efoVzA=; b=w3yA+2YLyk922eBTkQDC7+NgiodFwfGv+tDuSwb9DN3EbAVJEDGOcwm0YTxphvNVpd yZvGBP9EZQ56EyNNTb2jSiZV66X50MG/OIIuQfYnwvbr8obJtc+lnENMBwZnfZsJ5I96 SnaaEbs72hCLfEIU45bxO20kkPj+gZyXCMIBPqT4o208JvKwxz2uC9/U3KcqAoT5WxYO O6bStQIyPgQcn/TzJFad01Je4XTIzH8PVSpnzrDKcaYhQhh5u6QIzmr601FN10AdQJzB 1Rg5TIKCS21MFpWemkGkl81O1PntgZuPralByYEmlSvSJ6hxbuE2c3LmrEuQKJiOxI00 TK1A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@salutedevices.com header.s=mail header.b=tvqCOI7n; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=salutedevices.com Return-Path: Received: from morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id h12-20020a056a00230c00b0068ff741579fsi4135534pfh.318.2023.09.22.07.44.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Sep 2023 07:44:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; dkim=pass header.i=@salutedevices.com header.s=mail header.b=tvqCOI7n; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=salutedevices.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id 4A6828379A58; Thu, 21 Sep 2023 22:31:58 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230483AbjIVFby (ORCPT + 99 others); Fri, 22 Sep 2023 01:31:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42280 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229541AbjIVFbw (ORCPT ); Fri, 22 Sep 2023 01:31:52 -0400 Received: from mx1.sberdevices.ru (mx2.sberdevices.ru [45.89.224.132]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6B9BB197; Thu, 21 Sep 2023 22:31:45 -0700 (PDT) Received: from p-infra-ksmg-sc-msk02 (localhost [127.0.0.1]) by mx1.sberdevices.ru (Postfix) with ESMTP id AB4AF120009; Fri, 22 Sep 2023 08:31:43 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.sberdevices.ru AB4AF120009 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=salutedevices.com; s=mail; t=1695360703; bh=DNBdCZuTTDmqTiWLQnja4rvWVLyn68hKlFPwRHIjNjU=; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type:From; b=tvqCOI7nqsD1fxtJZmd7K/oFBGsaaYqhnOf09yVuguvvH6iSAyQDU1kE52qoSDyjF 095u4RyCBItrL7xUXuKwzguz0qjm48UAM4sUd+6lQn4OsvnZ6YyKB01t7ZxrvQA9kh ZXgFYLOE1P3W4bA16pKrZ/A72KOd0LeQlOt3l0/3mDlf7Gm+Wj4g4QlLTVuoWP7Ind r6GxkUVsjtKIzQ2E+83NP++oI8wzhxWUp3H04TKm+fQJyYfgwz2WfEEPGQmGQ9MTmi zwDwleUekU8uuo/zR35ShxiYUHcyub3C0QP8CCiTdfiUgifVAvr5DwOFHh8UNp/vcl 5IDKCd0Uz8OIA== Received: from p-i-exch-sc-m01.sberdevices.ru (p-i-exch-sc-m01.sberdevices.ru [172.16.192.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.sberdevices.ru (Postfix) with ESMTPS; Fri, 22 Sep 2023 08:31:43 +0300 (MSK) Received: from localhost.localdomain (100.64.160.123) by p-i-exch-sc-m01.sberdevices.ru (172.16.192.107) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.30; Fri, 22 Sep 2023 08:31:43 +0300 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: , , , , , , Subject: [PATCH net-next v1 04/12] vsock: enable SOCK_SUPPORT_ZC bit Date: Fri, 22 Sep 2023 08:24:20 +0300 Message-ID: <20230922052428.4005676-5-avkrasnov@salutedevices.com> X-Mailer: git-send-email 2.35.0 In-Reply-To: <20230922052428.4005676-1-avkrasnov@salutedevices.com> References: <20230922052428.4005676-1-avkrasnov@salutedevices.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [100.64.160.123] X-ClientProxiedBy: p-i-exch-sc-m01.sberdevices.ru (172.16.192.107) To p-i-exch-sc-m01.sberdevices.ru (172.16.192.107) X-KSMG-Rule-ID: 10 X-KSMG-Message-Action: clean X-KSMG-AntiSpam-Lua-Profiles: 180033 [Sep 21 2023] X-KSMG-AntiSpam-Version: 5.9.59.0 X-KSMG-AntiSpam-Envelope-From: avkrasnov@salutedevices.com X-KSMG-AntiSpam-Rate: 0 X-KSMG-AntiSpam-Status: not_detected X-KSMG-AntiSpam-Method: none X-KSMG-AntiSpam-Auth: dkim=none X-KSMG-AntiSpam-Info: LuaCore: 534 534 808c2ea49f7195c68d40844e073217da4fa0d1e3, {Tracking_from_domain_doesnt_match_to}, 100.64.160.123:7.1.2;127.0.0.199:7.1.2;salutedevices.com:7.1.1;p-i-exch-sc-m01.sberdevices.ru:5.0.1,7.1.1;d41d8cd98f00b204e9800998ecf8427e.com:7.1.1, FromAlignment: s, ApMailHostAddress: 100.64.160.123 X-MS-Exchange-Organization-SCL: -1 X-KSMG-AntiSpam-Interceptor-Info: scan successful X-KSMG-AntiPhishing: Clean X-KSMG-LinksScanning: Clean X-KSMG-AntiVirus: Kaspersky Secure Mail Gateway, version 2.0.1.6960, bases: 2023/09/22 02:22:00 #21944311 X-KSMG-AntiVirus-Status: Clean, skipped X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Thu, 21 Sep 2023 22:31:58 -0700 (PDT) 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 Reviewed-by: Stefano Garzarella --- 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 134494a78c14..482300eb88e0 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