Message ID | 20230603204939.1598818-7-AVKrasnov@sberdevices.ru |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp1841132vqr; Sat, 3 Jun 2023 13:56:48 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6vQmL5M3+LYZdukP852v8j5d7AS2OlIqXb+OHcdTznNKfMDfw4kbmgtlv8n/TDWrb7sM7t X-Received: by 2002:a05:6358:4411:b0:123:6652:f581 with SMTP id z17-20020a056358441100b001236652f581mr16872411rwc.4.1685825808542; Sat, 03 Jun 2023 13:56:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685825808; cv=none; d=google.com; s=arc-20160816; b=0ZiGr6MV3daUbgc4PP1YoSIIfgwf1wa6Uxm8j8R7mG2zx0NBTIa8KmHw8jL8OQS4aG ddSN96vhSHzPkLDYPtppdVbw5vFIuZP8kOpIcedCLqEOSp7UfTP//YW/FRPQoICCXt76 a6xz+kKmQxP5XEqmEbSGFs2rEHFz7BXN1p/hOzY6GomeIunNcCCmmLNE2KVcF9MKzZRq t/wzj+IVbo8rtZSo55YdqKBHzqPtdb2CdjIddBwoegVDWs0GEQXEi9u5xlTp5We65ayn K7+jMZORARHoZbwBBApLf0SOTzf2mVKFPtqDXrxModLiamCKrgLdnpfEUaqA1qPvYLWK W+nw== 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=Lz8wUwmvEr3RVG1tld+2qsVDKoN2L55XiM0gSmTilXk=; b=dLmIsQxQwq9AYOcEvK1sdxir2naFvFFDEgYFk+K8IrB7UY6Wkkb9i1/TrnH6YFhCnN 2BIKUKyGH1zrnd9BXvOpJNUtsKJWdgtTBlzsalnbTE2+OaYuPKBxl/UeobHlcJenKZxL oV7nuO6EbWh44zpqDOYTqAB/UNKutzXS+trH/KV/D0zK5HO8OsEcZMq8NXsUxR5m64TK kicqHOHOoLGQZrKrdjk02FslnIgLlRGTX4GxqlWXcBSDEiAxGm4t1HVf1fYZ0fAmR+R8 a988tjDpq/SAefRM23nj/1zbephzwKMmPe2WnH5Wf/WeO4ULHoXNoS4nXAco++RxkhBm svhQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sberdevices.ru header.s=mail header.b=ZuNfwktT; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q16-20020a17090a2e1000b00258d8f6eabdsi3428373pjd.66.2023.06.03.13.56.36; Sat, 03 Jun 2023 13:56:48 -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=ZuNfwktT; 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 S232898AbjFCUzt (ORCPT <rfc822;stefanalexe802@gmail.com> + 99 others); Sat, 3 Jun 2023 16:55:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37894 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232390AbjFCUy7 (ORCPT <rfc822;linux-kernel@vger.kernel.org>); 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 06E8C19A; 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 A12FD5FD36; Sat, 3 Jun 2023 23:54:47 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sberdevices.ru; s=mail; t=1685825687; bh=Lz8wUwmvEr3RVG1tld+2qsVDKoN2L55XiM0gSmTilXk=; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type; b=ZuNfwktTwU0LX48iEAIFz2n10dgnL5mnVcLoEx1496yfGCwBz1AJhGKZdQ3XH38DZ ePCS0Cx5h6hMbQc4zlGJyMslh5wQ+aJa6DodmgQKMuvHJlE4HJf4ADGohtkr8cemeu wpr69g09J+z+ihNwbLBdVGkqmb6Ub+1CJbAAZK+f7hrz0kPxObuPSrANr91xyK67SN ZIKtExwgbdDnZGD+FLevtTsrzqIwFF0SOeQV5uVsF5ZcdxOgdMUC4CHcZHzkS9TFYl YLSg4SG2pntbamX9e2jBhnznNMihwoINiflyopoTmuj6IDrS9MVS68+1TOkTpyPepf 96sgS4sLs0XhQ== 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:47 +0300 (MSK) From: Arseniy Krasnov <AVKrasnov@sberdevices.ru> To: Stefan Hajnoczi <stefanha@redhat.com>, Stefano Garzarella <sgarzare@redhat.com>, "David S. Miller" <davem@davemloft.net>, Eric Dumazet <edumazet@google.com>, Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>, "Michael S. Tsirkin" <mst@redhat.com>, Jason Wang <jasowang@redhat.com>, Bobby Eshleman <bobby.eshleman@bytedance.com> CC: <kvm@vger.kernel.org>, <virtualization@lists.linux-foundation.org>, <netdev@vger.kernel.org>, <linux-kernel@vger.kernel.org>, <kernel@sberdevices.ru>, <oxffffaa@gmail.com>, <avkrasnov@sberdevices.ru>, Arseniy Krasnov <AVKrasnov@sberdevices.ru> Subject: [RFC PATCH v4 06/17] vsock: check error queue to set EPOLLERR Date: Sat, 3 Jun 2023 23:49:28 +0300 Message-ID: <20230603204939.1598818-7-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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1767716483175080746?= X-GMAIL-MSGID: =?utf-8?q?1767716483175080746?= |
Series |
vsock: MSG_ZEROCOPY flag support
|
|
Commit Message
Arseniy Krasnov
June 3, 2023, 8:49 p.m. UTC
If socket's error queue is not empty, EPOLLERR must be set. Otherwise,
reader of error queue won't detect data in it using EPOLLERR bit.
Signed-off-by: Arseniy Krasnov <AVKrasnov@sberdevices.ru>
---
net/vmw_vsock/af_vsock.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Comments
On Sat, Jun 03, 2023 at 11:49:28PM +0300, Arseniy Krasnov wrote: >If socket's error queue is not empty, EPOLLERR must be set. Otherwise, >reader of error queue won't detect data in it using EPOLLERR bit. > >Signed-off-by: Arseniy Krasnov <AVKrasnov@sberdevices.ru> >--- > net/vmw_vsock/af_vsock.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) This patch looks like it can go even without this series. Is it a fix? Should we add a fixes tag? Thanks, Stefano > >diff --git a/net/vmw_vsock/af_vsock.c b/net/vmw_vsock/af_vsock.c >index efb8a0937a13..45fd20c4ed50 100644 >--- a/net/vmw_vsock/af_vsock.c >+++ b/net/vmw_vsock/af_vsock.c >@@ -1030,7 +1030,7 @@ static __poll_t vsock_poll(struct file *file, struct socket *sock, > poll_wait(file, sk_sleep(sk), wait); > mask = 0; > >- if (sk->sk_err) >+ if (sk->sk_err || !skb_queue_empty_lockless(&sk->sk_error_queue)) > /* Signify that there has been an error on this socket. */ > mask |= EPOLLERR; > >-- >2.25.1 >
On 26.06.2023 19:04, Stefano Garzarella wrote: > On Sat, Jun 03, 2023 at 11:49:28PM +0300, Arseniy Krasnov wrote: >> If socket's error queue is not empty, EPOLLERR must be set. Otherwise, >> reader of error queue won't detect data in it using EPOLLERR bit. >> >> Signed-off-by: Arseniy Krasnov <AVKrasnov@sberdevices.ru> >> --- >> net/vmw_vsock/af_vsock.c | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) > > This patch looks like it can go even without this series. > > Is it a fix? Should we add a fixes tag? Yes, it is fix and I can exclude it from this set to reduce number of patches, but there is no reproducer for this without MSG_ZEROCOPY support - at this moment this feature is the only user of error queue for AF_VSOCK. Thanks, Arseniy > > Thanks, > Stefano > >> >> diff --git a/net/vmw_vsock/af_vsock.c b/net/vmw_vsock/af_vsock.c >> index efb8a0937a13..45fd20c4ed50 100644 >> --- a/net/vmw_vsock/af_vsock.c >> +++ b/net/vmw_vsock/af_vsock.c >> @@ -1030,7 +1030,7 @@ static __poll_t vsock_poll(struct file *file, struct socket *sock, >> poll_wait(file, sk_sleep(sk), wait); >> mask = 0; >> >> - if (sk->sk_err) >> + if (sk->sk_err || !skb_queue_empty_lockless(&sk->sk_error_queue)) >> /* Signify that there has been an error on this socket. */ >> mask |= EPOLLERR; >> >> -- >> 2.25.1 >> >
On Tue, Jun 27, 2023 at 07:44:25AM +0300, Arseniy Krasnov wrote: > > >On 26.06.2023 19:04, Stefano Garzarella wrote: >> On Sat, Jun 03, 2023 at 11:49:28PM +0300, Arseniy Krasnov wrote: >>> If socket's error queue is not empty, EPOLLERR must be set. Otherwise, >>> reader of error queue won't detect data in it using EPOLLERR bit. >>> >>> Signed-off-by: Arseniy Krasnov <AVKrasnov@sberdevices.ru> >>> --- >>> net/vmw_vsock/af_vsock.c | 2 +- >>> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> This patch looks like it can go even without this series. >> >> Is it a fix? Should we add a fixes tag? > >Yes, it is fix and I can exclude it from this set to reduce number >of patches, but there is no reproducer for this without MSG_ZEROCOPY >support - at this moment this feature is the only user of error queue >for AF_VSOCK. Okay, so it's fine to keep it here, but please mention in the comment that without MSG_ZEROCOPY it can't be reproduced. That way we know that we don't have to backport into the stable branches. Thanks, Stefano > >Thanks, Arseniy > >> >> Thanks, >> Stefano >> >>> >>> diff --git a/net/vmw_vsock/af_vsock.c b/net/vmw_vsock/af_vsock.c >>> index efb8a0937a13..45fd20c4ed50 100644 >>> --- a/net/vmw_vsock/af_vsock.c >>> +++ b/net/vmw_vsock/af_vsock.c >>> @@ -1030,7 +1030,7 @@ static __poll_t vsock_poll(struct file *file, struct socket *sock, >>> poll_wait(file, sk_sleep(sk), wait); >>> mask = 0; >>> >>> - if (sk->sk_err) >>> + if (sk->sk_err || !skb_queue_empty_lockless(&sk->sk_error_queue)) >>> /* Signify that there has been an error on this socket. */ >>> mask |= EPOLLERR; >>> >>> -- >>> 2.25.1 >>> >> >
diff --git a/net/vmw_vsock/af_vsock.c b/net/vmw_vsock/af_vsock.c index efb8a0937a13..45fd20c4ed50 100644 --- a/net/vmw_vsock/af_vsock.c +++ b/net/vmw_vsock/af_vsock.c @@ -1030,7 +1030,7 @@ static __poll_t vsock_poll(struct file *file, struct socket *sock, poll_wait(file, sk_sleep(sk), wait); mask = 0; - if (sk->sk_err) + if (sk->sk_err || !skb_queue_empty_lockless(&sk->sk_error_queue)) /* Signify that there has been an error on this socket. */ mask |= EPOLLERR;