Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp4757061rwr; Sun, 23 Apr 2023 12:33:28 -0700 (PDT) X-Google-Smtp-Source: AKy350aOXEMYrT9UGZWdGOezx5fQY6pdGaGb2lTXhgiluU/c3AYqQ4Ow8PlIQgPsm+lE2mOx94SY X-Received: by 2002:a05:6a00:cd2:b0:627:6328:79f1 with SMTP id b18-20020a056a000cd200b00627632879f1mr16109809pfv.34.1682278408494; Sun, 23 Apr 2023 12:33:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682278408; cv=none; d=google.com; s=arc-20160816; b=rRn7S03g6M10mSV67jmy4yrKK72gWEKwyGM3QW5/Ug8rzBAQSGogZE4pmEFpMCevpZ d7trNNwTYOEsG4yv0ZfWys2mLqnl3Yjst/9IaQco7RroA2Gg/9qCMZJeLFZwHybcwSb9 FjqPTCIDbRNWTf+13/qLddob44zKlEs+7xoAbf+sw1uCz/OvfMfGugQdmGOmUnzttm8z YVyqYoOfp9OQCvJHo0zR2EiPSXNIeV5r6kxHoqMEsAiduoXE50THvFxlhwXiUsr0kQRU qEB6JMVOAs/jIaQwlu1OIjes7vZ3LZzO22rtahGJIErZcRhNm2T9CUsWuQwVEqjLiKL1 FF/g== 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=I6s5f+VVEU4mKHhe9+5VqHMuX1hjVKhfruoOIGVs/SQ=; b=CQjsLMbMvadwFU2t1hNOGkQQZXOG5CU842e+GnOLg5zD1jVoMD8YMBFep6SDwnyl2/ IIzXVOyLOyLc2KIHfG2fm1nrwBmKZ30Y6GXuGLJcYHFxntBDc5A+p9i2wGk52Hy4y6kq Uhp3wo9wZtFRLoQWy+oIMhgwp0JLN/E32rOCiVxpLCgfdHJI6CRKGNvQ0/nrIqBMlax0 PmxiOHDRDdK9TwK7QlF+uZIQb8CbUxbvCXD02QBHXkEDCFcF+kSkUk5IUwoN2JOTKkig uixU633E4BKNpVx15OkuA7fdIWdjsZ4fP8nfOEbSMpe91vhlqWuSjFhVbkwxDA+lzh2X Novw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sberdevices.ru header.s=mail header.b=lg8IECuE; 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 e13-20020a056a0000cd00b0063473a51539si5582077pfj.398.2023.04.23.12.33.15; Sun, 23 Apr 2023 12:33:28 -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=lg8IECuE; 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 S229841AbjDWTcG (ORCPT + 99 others); Sun, 23 Apr 2023 15:32:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56282 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230034AbjDWTb3 (ORCPT ); Sun, 23 Apr 2023 15:31:29 -0400 Received: from mx.sberdevices.ru (mx.sberdevices.ru [45.89.227.171]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D38EB10DB; Sun, 23 Apr 2023 12:31:27 -0700 (PDT) Received: from s-lin-edge02.sberdevices.ru (localhost [127.0.0.1]) by mx.sberdevices.ru (Postfix) with ESMTP id 3154C5FD14; Sun, 23 Apr 2023 22:31:23 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sberdevices.ru; s=mail; t=1682278283; bh=I6s5f+VVEU4mKHhe9+5VqHMuX1hjVKhfruoOIGVs/SQ=; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type; b=lg8IECuEd4AdXNXlmfSFk/lwSrSIW9NV7ikX3i5WjR0bXNc99qZGI22kPh7CmGrFa 5v6VDUX9GHXHLqO1eCh1ZIo8OV/5fQU55STHIy0jdTEd98UXKDacNXuPbSpxNarrK3 R1Si42FZjWRIg+bAOm77sTJmW0WMFzb4lHAy/dSCI3RL40irScDxddAdMroruV8ojK tjSqJ6XFiyI+sEO1AVrBzk5mJgJIBamF+dG8SNFNhb0lThzSknyiz0Xs2mlA8biGFA zaCdRBB8v1+IZhj7BMOqssJ0Taxvo1nK1xW2Xa0xRCe/ZivNvHq8tdcqAPOhExJtqy LPaXPel3vJebw== Received: from S-MS-EXCH01.sberdevices.ru (S-MS-EXCH01.sberdevices.ru [172.16.1.4]) by mx.sberdevices.ru (Postfix) with ESMTP; Sun, 23 Apr 2023 22:31:23 +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 v2 09/15] vhost/vsock: support MSG_ZEROCOPY for transport Date: Sun, 23 Apr 2023 22:26:37 +0300 Message-ID: <20230423192643.1537470-10-AVKrasnov@sberdevices.ru> X-Mailer: git-send-email 2.35.0 In-Reply-To: <20230423192643.1537470-1-AVKrasnov@sberdevices.ru> References: <20230423192643.1537470-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-EXCH01.sberdevices.ru (172.16.1.4) 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/04/23 16:01:00 #21150277 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 Add 'msgzerocopy_allow()' callback for vhost transport. Signed-off-by: Arseniy Krasnov --- drivers/vhost/vsock.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/vhost/vsock.c b/drivers/vhost/vsock.c index 1e70aa390e44..4a33940a6020 100644 --- a/drivers/vhost/vsock.c +++ b/drivers/vhost/vsock.c @@ -405,6 +405,11 @@ static bool vhost_vsock_more_replies(struct vhost_vsock *vsock) return val < vq->num; } +static bool vhost_transport_msgzerocopy_allow(void) +{ + return true; +} + static bool vhost_transport_seqpacket_allow(u32 remote_cid); static struct virtio_transport vhost_transport = { @@ -451,6 +456,7 @@ static struct virtio_transport vhost_transport = { .notify_buffer_size = virtio_transport_notify_buffer_size, .read_skb = virtio_transport_read_skb, + .msgzerocopy_allow = vhost_transport_msgzerocopy_allow, }, .send_pkt = vhost_transport_send_pkt, -- 2.25.1