Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp5900227rdb; Thu, 14 Dec 2023 03:01:36 -0800 (PST) X-Google-Smtp-Source: AGHT+IHCGdf27QtkwITYfrm1ogPaI8s/y55iiamUpAspVdJnhRrQxEbXZvyIvGZSWMqRAH3Pp4Ml X-Received: by 2002:a17:902:d48e:b0:1d3:5d66:19e4 with SMTP id c14-20020a170902d48e00b001d35d6619e4mr2500359plg.20.1702551695843; Thu, 14 Dec 2023 03:01:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702551695; cv=none; d=google.com; s=arc-20160816; b=fUklN9PPDIHjVxnzaoXxmF6iZwPkuRXDkEd9BbnEqq4iWTAy8IGRA+SIZul70DYP8p AdErCcPlmx3mEaN2E7kyGh5pT2mkLzHoUboyqWOx1dYMZo5dHc2hAUxgHURCiKC+TgY3 Yy3il3zo1Tar52EENf6/G0NT9kUTBCIvlHCCkYSBd7RsoHPPqIo+YJTq1RaVDWmTsW7h En0d55C05VFBxHiRiYHHP/QPgIFFSDT2X1Fvhph24NrPfNfPLNyUn0RUkbo58NURE09U vG/tVHjUnHFJXtavErcluUzBXJi/TtV6uH1pq4czyL+dXrmzNQlJte3fiJAHoELGn0iZ EOPg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature:dkim-filter; bh=Ocja7oLDcU2O2ANLOIyPEwBcA8pE24kYRcLiOan5xok=; fh=YtSViko0S4mzjRL+vIBcPZ6MScNClfhalnj7Ll4mpO4=; b=nRV7FzZcd1jv60tzP6YH5fTRCNpNG1YU40lTVQXCFvn5mte6EBqLvX1Hc8EM2NlAwJ odT/Ock/T/LL3Qqg0o134IU9s31cqtepiyUuRo5V3iHW559rRM5Pu367pjdcAETeAx60 RmCnKdPLw37g54WcKMcSxNTQBxsPc9BvaJXhlxxnaan2Aqt83zBMDA4VUHH8US1kl5nF Gd00PAbQeSM7qSudYLnkhATlj9M7DGWzwV2+vmo3zpXTaoA9kaZla1i54KrgmDMXm0VM LJjr5DPL7gCrP9Y5tZWROE97dD4g5ejOaaRG+jB0ahT99mytsNTX4b0skGYFmExzHz7K sDvw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@salutedevices.com header.s=mail header.b="XTPV9i/4"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 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 pete.vger.email (pete.vger.email. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id bb8-20020a170902bc8800b001cfd66f31ccsi11185919plb.55.2023.12.14.03.01.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Dec 2023 03:01:35 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) client-ip=2620:137:e000::3:6; Authentication-Results: mx.google.com; dkim=pass header.i=@salutedevices.com header.s=mail header.b="XTPV9i/4"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 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 pete.vger.email (Postfix) with ESMTP id 6B70881FEC6C; Thu, 14 Dec 2023 03:01:32 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1443787AbjLNLBO (ORCPT + 99 others); Thu, 14 Dec 2023 06:01:14 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49700 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1443808AbjLNLBN (ORCPT ); Thu, 14 Dec 2023 06:01:13 -0500 Received: from mx1.sberdevices.ru (mx1.sberdevices.ru [37.18.73.165]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 80E1712A; Thu, 14 Dec 2023 03:01:16 -0800 (PST) Received: from p-infra-ksmg-sc-msk01 (localhost [127.0.0.1]) by mx1.sberdevices.ru (Postfix) with ESMTP id 9D06410002A; Thu, 14 Dec 2023 14:01:13 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.sberdevices.ru 9D06410002A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=salutedevices.com; s=mail; t=1702551673; bh=Ocja7oLDcU2O2ANLOIyPEwBcA8pE24kYRcLiOan5xok=; h=Message-ID:Date:MIME-Version:Subject:To:From:Content-Type:From; b=XTPV9i/4hEsj0ZH0ZnUL4L4qi6NFTyCbyJyrhwEBeG/40659PSOwVxLBaXYF36AqZ OE4WoOaEaI2nUMisuHA9lIGp7EoDWeAH1w56j13GauAKBU8juoc0/7WY8kwHTYM6+P /C9nfY/ntx/hX1uIPQrwJZDuVvJSpZxlygivzBezrvquTuxzTWfigV1wC8WEDzL8KY /PFlkKqIyc3rNjx5zb0p1TrgcYHZFfwZZ92sZJ8OibH6/zEyeeC3HIFqNE9sOOGxfB 2QTMPl+LBUGY1EshExG2z8s+MVwqkxWQfGi1E4mzXM0+x1Cl8n5AEKIU0eXF6zdOHr h/c4LW2IHdFwQ== Received: from smtp.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; Thu, 14 Dec 2023 14:01:13 +0300 (MSK) Received: from [192.168.0.106] (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.40; Thu, 14 Dec 2023 14:01:13 +0300 Message-ID: Date: Thu, 14 Dec 2023 13:52:50 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.7.1 Subject: Re: [PATCH net-next v9 3/4] vsock: update SO_RCVLOWAT setting callback Content-Language: en-US To: "Michael S. Tsirkin" CC: Stefan Hajnoczi , Stefano Garzarella , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Jason Wang , Bobby Eshleman , , , , , , References: <20231214091947.395892-1-avkrasnov@salutedevices.com> <20231214091947.395892-4-avkrasnov@salutedevices.com> <20231214052502-mutt-send-email-mst@kernel.org> From: Arseniy Krasnov In-Reply-To: <20231214052502-mutt-send-email-mst@kernel.org> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Originating-IP: [100.64.160.123] X-ClientProxiedBy: p-i-exch-sc-m02.sberdevices.ru (172.16.192.103) 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: 182107 [Dec 14 2023] X-KSMG-AntiSpam-Version: 6.1.0.3 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: 7 0.3.7 6d6bf5bd8eea7373134f756a2fd73e9456bb7d1a, {Tracking_from_domain_doesnt_match_to}, smtp.sberdevices.ru:7.1.1,5.0.1;127.0.0.199:7.1.2;100.64.160.123:7.1.2;salutedevices.com: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/12/14 08:33:00 #22688916 X-KSMG-AntiVirus-Status: Clean, skipped X-Spam-Status: No, score=-2.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.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 (pete.vger.email [0.0.0.0]); Thu, 14 Dec 2023 03:01:32 -0800 (PST) On 14.12.2023 13:29, Michael S. Tsirkin wrote: > On Thu, Dec 14, 2023 at 12:19:46PM +0300, Arseniy Krasnov wrote: >> Do not return if transport callback for SO_RCVLOWAT is set (only in >> error case). In this case we don't need to set 'sk_rcvlowat' field in >> each transport - only in 'vsock_set_rcvlowat()'. Also, if 'sk_rcvlowat' >> is now set only in af_vsock.c, change callback name from 'set_rcvlowat' >> to 'notify_set_rcvlowat'. >> >> Signed-off-by: Arseniy Krasnov >> Reviewed-by: Stefano Garzarella >> Acked-by: Michael S. Tsirkin > > Maybe squash this with patch 2/4? You mean just do 'git squash' without updating commit message manually? Thanks, Arseniy > >> --- >> Changelog: >> v3 -> v4: >> * Rename 'set_rcvlowat' to 'notify_set_rcvlowat'. >> * Commit message updated. >> >> include/net/af_vsock.h | 2 +- >> net/vmw_vsock/af_vsock.c | 9 +++++++-- >> net/vmw_vsock/hyperv_transport.c | 4 ++-- >> 3 files changed, 10 insertions(+), 5 deletions(-) >> >> diff --git a/include/net/af_vsock.h b/include/net/af_vsock.h >> index e302c0e804d0..535701efc1e5 100644 >> --- a/include/net/af_vsock.h >> +++ b/include/net/af_vsock.h >> @@ -137,7 +137,6 @@ struct vsock_transport { >> u64 (*stream_rcvhiwat)(struct vsock_sock *); >> bool (*stream_is_active)(struct vsock_sock *); >> bool (*stream_allow)(u32 cid, u32 port); >> - int (*set_rcvlowat)(struct vsock_sock *vsk, int val); >> >> /* SEQ_PACKET. */ >> ssize_t (*seqpacket_dequeue)(struct vsock_sock *vsk, struct msghdr *msg, >> @@ -168,6 +167,7 @@ struct vsock_transport { >> struct vsock_transport_send_notify_data *); >> /* sk_lock held by the caller */ >> void (*notify_buffer_size)(struct vsock_sock *, u64 *); >> + int (*notify_set_rcvlowat)(struct vsock_sock *vsk, int val); >> >> /* Shutdown. */ >> int (*shutdown)(struct vsock_sock *, int); >> diff --git a/net/vmw_vsock/af_vsock.c b/net/vmw_vsock/af_vsock.c >> index 816725af281f..54ba7316f808 100644 >> --- a/net/vmw_vsock/af_vsock.c >> +++ b/net/vmw_vsock/af_vsock.c >> @@ -2264,8 +2264,13 @@ static int vsock_set_rcvlowat(struct sock *sk, int val) >> >> transport = vsk->transport; >> >> - if (transport && transport->set_rcvlowat) >> - return transport->set_rcvlowat(vsk, val); >> + if (transport && transport->notify_set_rcvlowat) { >> + int err; >> + >> + err = transport->notify_set_rcvlowat(vsk, val); >> + if (err) >> + return err; >> + } >> >> WRITE_ONCE(sk->sk_rcvlowat, val ? : 1); >> return 0; > > > > I would s > >> diff --git a/net/vmw_vsock/hyperv_transport.c b/net/vmw_vsock/hyperv_transport.c >> index 7cb1a9d2cdb4..e2157e387217 100644 >> --- a/net/vmw_vsock/hyperv_transport.c >> +++ b/net/vmw_vsock/hyperv_transport.c >> @@ -816,7 +816,7 @@ int hvs_notify_send_post_enqueue(struct vsock_sock *vsk, ssize_t written, >> } >> >> static >> -int hvs_set_rcvlowat(struct vsock_sock *vsk, int val) >> +int hvs_notify_set_rcvlowat(struct vsock_sock *vsk, int val) >> { >> return -EOPNOTSUPP; >> } >> @@ -856,7 +856,7 @@ static struct vsock_transport hvs_transport = { >> .notify_send_pre_enqueue = hvs_notify_send_pre_enqueue, >> .notify_send_post_enqueue = hvs_notify_send_post_enqueue, >> >> - .set_rcvlowat = hvs_set_rcvlowat >> + .notify_set_rcvlowat = hvs_notify_set_rcvlowat >> }; >> >> static bool hvs_check_transport(struct vsock_sock *vsk) >> -- >> 2.25.1 >