Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp30759963rwd; Thu, 6 Jul 2023 10:15:38 -0700 (PDT) X-Google-Smtp-Source: APBJJlF4xt5ywlNYg7U/T6TIX+O+yMnJX3H/vykfM9mx2bW+8sEmpMuUtvVo9rt435LVqzw1jU+c X-Received: by 2002:a17:90a:4282:b0:262:ce9e:8a25 with SMTP id p2-20020a17090a428200b00262ce9e8a25mr8193076pjg.22.1688663738237; Thu, 06 Jul 2023 10:15:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688663738; cv=none; d=google.com; s=arc-20160816; b=SVR67Fg72Z6kZeaVSPpkz+0vBIiK5AndCpSgFzW9M4WJaKkY3S3saA4egUSNn2fnKy zi3zi9R5TEs0yWqLOsG2LnZsioInrx1RS3s1NSmTaGjYg4uGe+D2hRaWUXHds1ENk5R+ xhiWuRI7Bkla6QaCqWEJ9ps76c/yXWNGwACPlA9B+2E4Z6vH8lN0UGlWRGf5ixqBU4P2 Ojq01qsYBpO3ynIpBMBF7Al4e420UgthXhxnG/4pGWNU0ldp07NwbJtzd7wOJDC6RbuT QASBDpfIBWwniMlDvoPIziS3/C+pdUJNkX/PSpqJEdbN/lJ5mx3WrFfMOH+xiga4Vt/3 tprg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=glhZ+2qeJMm9MWfPWx9SoMWGjL42JiHnlLy0ooXyD8I=; fh=LmSvGF8mKyhe+4SfmYOr3uCnhF0XAFkKvuoevTchCp0=; b=h/dewOZOpjXsY4CWMRBXvLOnZ2iZBE1pGnZfcL/6nRhFlG57VausEEb+4t7KhgpROC CB4Pf3mUhw14mexY4vFSpibfFgmOxEm4+rQ/uIqNNSu3aGxthlv4PBRpsmERy96pamae OOtfDYyQPiF31cpaQp2uC2exiN7MqCTOz+ZvrqasBAsxNBD7J6EE8R0JShqxGwq5j+ul CTcp/pMIa+mmdEMc5gaj2ngDUzsEKXTBFJYv602Wo5DnemH8UxyhxxsU7LvcQmKlfl/F s6Vhd2gJVU25MvGQepnfnierRQ35tuUqhnZhwzLjupr78+lc+gKI95p/RiAV03hvPUUI Q/Jg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=X36w60Rs; 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=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o4-20020a655204000000b005481915c0cfsi1976666pgp.1.2023.07.06.10.15.24; Thu, 06 Jul 2023 10:15:38 -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=@redhat.com header.s=mimecast20190719 header.b=X36w60Rs; 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=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232202AbjGFQzp (ORCPT + 99 others); Thu, 6 Jul 2023 12:55:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48202 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232263AbjGFQzl (ORCPT ); Thu, 6 Jul 2023 12:55:41 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2EB001BE2 for ; Thu, 6 Jul 2023 09:54:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1688662484; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=glhZ+2qeJMm9MWfPWx9SoMWGjL42JiHnlLy0ooXyD8I=; b=X36w60RsYOFhDSr5ly5vuKgqqmY2IzWrrG8E+UxHrqhOdmk6x0u3x/goXjMfe0uwLRgS87 Pn9gb62pZLzm5CeKiGoGNlaHLtygT48kpH1jMK/PP+bPyywAWKtGbhKPmgfbTSi7Fy1eEO itQBfQPw1K6dwLdItyEj+Y/mx61dse8= Received: from mail-ej1-f72.google.com (mail-ej1-f72.google.com [209.85.218.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-636-64ZUp9REPJGNUToUmbtQEQ-1; Thu, 06 Jul 2023 12:54:43 -0400 X-MC-Unique: 64ZUp9REPJGNUToUmbtQEQ-1 Received: by mail-ej1-f72.google.com with SMTP id a640c23a62f3a-99388334de6so64681366b.0 for ; Thu, 06 Jul 2023 09:54:43 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688662482; x=1691254482; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=glhZ+2qeJMm9MWfPWx9SoMWGjL42JiHnlLy0ooXyD8I=; b=ExaJPpmOi0ea2CU2QqLzJxH0W+NB8XhWW0arDX+XSiYwn8u69CghHAAz+k+MSWqbEK M6wp6dJ5VaRBBcoWZ78WFE62GUsUAlTA2lVGuzjdWJb//aN0aHZkryfUenStlN2y7QS5 eou7ir7h4VTAhiVJ+ZUWLDiAmZ7fxdsLHQjAAp4rVT4e6Zjq4g161TBQaWTSfwq00PNS UlfClKfOaG7WqnvtiAnaOJNJIOZ8ktQR8EWyHQZ7vaqSz4t6iPNajHwXtdaQDVZnwioq JMyq93rzifAt3POPjF6JQdFr7LterlqI2r6YFE5snehwm4UmTMgLFCChVxfKMXmD3VXf NjtQ== X-Gm-Message-State: ABy/qLbHPbu9/GR2gQw732q91upAzG/4qqJ9ZPLZVuiRxXudK1nW6c+p S/1Q2Ug4XjwnSBVJn5aXhAQYQPJaATyVH6Q74+PiMfN67c8oCULcoW/88i9StJbSLfvc13TGzo7 tj0ZkSDhALltCLmy7MddlRfJd X-Received: by 2002:a17:906:89a0:b0:98c:cc3c:194e with SMTP id gg32-20020a17090689a000b0098ccc3c194emr1668112ejc.52.1688662482341; Thu, 06 Jul 2023 09:54:42 -0700 (PDT) X-Received: by 2002:a17:906:89a0:b0:98c:cc3c:194e with SMTP id gg32-20020a17090689a000b0098ccc3c194emr1668102ejc.52.1688662482046; Thu, 06 Jul 2023 09:54:42 -0700 (PDT) Received: from sgarzare-redhat (host-79-46-200-163.retail.telecomitalia.it. [79.46.200.163]) by smtp.gmail.com with ESMTPSA id k12-20020a170906970c00b0096f6a131b9fsm1034242ejx.23.2023.07.06.09.54.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Jul 2023 09:54:41 -0700 (PDT) Date: Thu, 6 Jul 2023 18:54:39 +0200 From: Stefano Garzarella To: Arseniy Krasnov Cc: Stefan Hajnoczi , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , "Michael S. Tsirkin" , Jason Wang , Bobby Eshleman , kvm@vger.kernel.org, virtualization@lists.linux-foundation.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, kernel@sberdevices.ru, oxffffaa@gmail.com Subject: Re: [RFC PATCH v5 07/17] vsock: read from socket's error queue Message-ID: References: <20230701063947.3422088-1-AVKrasnov@sberdevices.ru> <20230701063947.3422088-8-AVKrasnov@sberdevices.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <20230701063947.3422088-8-AVKrasnov@sberdevices.ru> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,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 On Sat, Jul 01, 2023 at 09:39:37AM +0300, Arseniy Krasnov wrote: >This adds handling of MSG_ERRQUEUE input flag in receive call. This flag >is used to read socket's error queue instead of data queue. Possible >scenario of error queue usage is receiving completions for transmission >with MSG_ZEROCOPY flag. This patch also adds 'SOL_VSOCK' define. > >Signed-off-by: Arseniy Krasnov >--- > Changelog: > v4 -> v5: > * Update commit message by adding sentence that 'SOL_VSOCK' is also > added. Reviewed-by: Stefano Garzarella > > include/linux/socket.h | 1 + > net/vmw_vsock/af_vsock.c | 5 +++++ > 2 files changed, 6 insertions(+) > >diff --git a/include/linux/socket.h b/include/linux/socket.h >index bd1cc3238851..d79efd026880 100644 >--- a/include/linux/socket.h >+++ b/include/linux/socket.h >@@ -382,6 +382,7 @@ struct ucred { > #define SOL_MPTCP 284 > #define SOL_MCTP 285 > #define SOL_SMC 286 >+#define SOL_VSOCK 287 > > /* IPX options */ > #define IPX_TYPE 1 >diff --git a/net/vmw_vsock/af_vsock.c b/net/vmw_vsock/af_vsock.c >index 45fd20c4ed50..07803d9fbf6d 100644 >--- a/net/vmw_vsock/af_vsock.c >+++ b/net/vmw_vsock/af_vsock.c >@@ -110,6 +110,7 @@ > #include > #include > #include >+#include > > static int __vsock_bind(struct sock *sk, struct sockaddr_vm *addr); > static void vsock_sk_destruct(struct sock *sk); >@@ -2135,6 +2136,10 @@ vsock_connectible_recvmsg(struct socket *sock, struct msghdr *msg, size_t len, > int err; > > sk = sock->sk; >+ >+ if (unlikely(flags & MSG_ERRQUEUE)) >+ return sock_recv_errqueue(sk, msg, len, SOL_VSOCK, 0); >+ > vsk = vsock_sk(sk); > err = 0; > >-- >2.25.1 >