Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp3877572rwd; Sat, 3 Jun 2023 14:07:10 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4TIC+2GHZJpgIXMyou+Sr0RCXuP1PYn72Z3tXFM3QyxA6cBiN5BYMD7qLlY8anOcgSEOun X-Received: by 2002:a05:6a20:394c:b0:101:5192:18a9 with SMTP id r12-20020a056a20394c00b00101519218a9mr1307681pzg.21.1685826430097; Sat, 03 Jun 2023 14:07:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685826430; cv=none; d=google.com; s=arc-20160816; b=jm9/nsZiPPZhW5z7VCPOiZdRdjfD+oFkwD/ouvqcQxqE7S8X7trmOMNGGY3W8u68Pm DMDQIyU1bqa5VhVsstAaKniGG1/Yy6rbl8hRLyXIQnTrrfrlt3AzsWkBMJDZ0eFsAIaO tPfDvSef2WcNrj83komXyQSOllTfcYmrWzC46lNROeOiSkRc9mkxIpg3Ar+w1iqAerQ4 C+kobbk4inMyO5QzA33L0t/rENy9akfunDT3YHym2ltSgevmOYyWkm2bNDGOBJvHJdYg kgrp5yFRLbkJ+HcwDPZpDVt6Ho7ZOlKSW+/K1Jty789fI8nB1BRvXtp+SXeLKidZWdkF 1Grg== 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=HekjpGnl2zxNT3T4PtMzqPreuhYkvcvhGbre4mbN788=; b=xfH8bcFrsC3FcbNnFbuTyW19xxUJ90+UNZ7JU3UFDC3kRGleRmjetxuID2sdmz0Pt7 /up3Jh/5+jgOzDbfRXMYeyicqmaTT0F8+IIcxRYOcZ1SrOL5mvPFZNOBPUyTg+Fyyr+K KqkTGlm388SqZqlNBvYrqSgN+kHUEIdN95SsNaRAVw0bIeFToMvmmTWJ/rpCyAO/yGz8 pw+7ErNr+2XyWfDsK5U71SZb5hHwabqnZawbMzTJFd8PfVXuR0Rwq5b6YrW7bVmvPzKl cfy2gmSTUXZs5rkpCxLLiQi+XU/ppNO7FlfmiDNtaR3sAdtOH0pV9Z6173MlRLchRqmh 9Zsw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sberdevices.ru header.s=mail header.b=DOftSGo5; 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 m32-20020a634c60000000b0053074c54c3fsi3213074pgl.868.2023.06.03.14.06.58; Sat, 03 Jun 2023 14:07:10 -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=DOftSGo5; 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 S233843AbjFCUzy (ORCPT + 99 others); Sat, 3 Jun 2023 16:55:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37912 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232454AbjFCUy7 (ORCPT ); Sat, 3 Jun 2023 16:54:59 -0400 Received: from mx.sberdevices.ru (mx.sberdevices.ru [45.89.227.171]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0614F197; Sat, 3 Jun 2023 13:54:56 -0700 (PDT) Received: from s-lin-edge02.sberdevices.ru (localhost [127.0.0.1]) by mx.sberdevices.ru (Postfix) with ESMTP id 6924E5FD39; Sat, 3 Jun 2023 23:54:48 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sberdevices.ru; s=mail; t=1685825688; bh=HekjpGnl2zxNT3T4PtMzqPreuhYkvcvhGbre4mbN788=; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type; b=DOftSGo5jo+m1kOZn1BX823Entw774YsTwmEx0s/oDAQnInujhEzATdLSri2+OWYa 437mQH8uge5FhXVuEjrmL9xzJINR9hE+wSYTkm8Go2L3tf9I/ZtqgsbRJiMFR/Bzh1 NZboWvgrY3W7o98G6QU7G7WFpM8jc9Z2ujC9WLSGWBeOEppHSsxBA+79ImUdNKQ8nG 0txlfzL06k/RoRXCiGw+xt3I+Bp+O5mfTBnzXlCGA8pIhx7jekcukLbkRJC1cOPhEW xE1xmwzhs1wdM6wvOzqcOMXatao06chVuQD2dzQhq9dtsw0UdPRpP5vMi+I+HqP8A2 pGbWf7fM5BHzw== Received: from S-MS-EXCH01.sberdevices.ru (S-MS-EXCH01.sberdevices.ru [172.16.1.4]) by mx.sberdevices.ru (Postfix) with ESMTP; Sat, 3 Jun 2023 23:54:48 +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 v4 09/17] vsock: enable SOCK_SUPPORT_ZC bit Date: Sat, 3 Jun 2023 23:49:31 +0300 Message-ID: <20230603204939.1598818-10-AVKrasnov@sberdevices.ru> X-Mailer: git-send-email 2.35.0 In-Reply-To: <20230603204939.1598818-1-AVKrasnov@sberdevices.ru> References: <20230603204939.1598818-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/06/03 16:55:00 #21417531 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,URIBL_BLOCKED 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 033006e1b5ad..da22ae0ef477 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