Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp5909806rdb; Thu, 14 Dec 2023 03:18:38 -0800 (PST) X-Google-Smtp-Source: AGHT+IGQWmkIBa80W5Tj5T+YN10RskE26/iXuAT5wanWNmaspXnavMaPfhanikOrOQjZNBqnKK0P X-Received: by 2002:a62:bd10:0:b0:6ce:2732:296 with SMTP id a16-20020a62bd10000000b006ce27320296mr4186937pff.69.1702552717829; Thu, 14 Dec 2023 03:18:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702552717; cv=none; d=google.com; s=arc-20160816; b=ilaRHn3qFowTve9zs2mkqJQx/rOX6OKyTlCS/w3GHKoNQ3qpFba5ECuSDcF+vzBkq6 N4Zn7Lus3zl+9zTFP+mSrkl2eNir0qmrHcWVL62hdeOLkuow9HAGMqKjme3TuXp1QQZz zPzUIMNf3lEQ2mJd1G12fe43TeA92AyoSXJY1XS9sRMiOebrrUhk66beI2WqH7MfUkeb tfg8yviAo4wlxGLUWHVqtPPpM1B4YTSdi69E0JW0vRYfrG2ADDvcNISj625UbKQ7gc21 c3lSP9DZp3UTQ0bB3GEaFvgWtQHhAgPRGQP5i9KPgzkGLtQm9COok+SJmtcVg3aEyMmi Avyg== 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=VaN6TC3I4TNZRPtVPtcTdPQQalk1XpMFkRRRirXd7I0=; fh=mgDOnflgqBhki4srQQbjlV/AUGmKs0Gt5yx+zXhaHYo=; b=EGqhsXw2W1ds4wZTWc7MRF6jDbV7r5QcHlojlj670lODhIQu+xLE5PeuwfcQKi/VcE 5bcP0lNYzvD443MrZGMbkElvaTHBrnUO5ibrjQ9CnK4cug1UO/JfkXneZDW1ZtRmgTcj mdIQh+ob2gz7sdY7mp5MoaMbza22M3/+WHhkb+PwYdxw2KCtzw/Fe7q34PR4bFXQvTvX ZlYvNGh+K77OwDUF9H9kTe7JSs2jnhMhnW/OyZDar81xYSY/ZJsWDJ0xq+/d2fZGvOWN fkk7d2PkVb891a6lKwwsMZ6ebXD2lFzLPbpKu08o9y/I13nWweuw0yxU11/KidQ2je0D SnBw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=eM4GF+Af; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 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 morse.vger.email (morse.vger.email. [23.128.96.31]) by mx.google.com with ESMTPS id eb16-20020a056a004c9000b006cea561bd7asi11240148pfb.226.2023.12.14.03.18.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Dec 2023 03:18:37 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) client-ip=23.128.96.31; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=eM4GF+Af; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id 456B383266A8; Thu, 14 Dec 2023 03:18:35 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1443865AbjLNLSD (ORCPT + 99 others); Thu, 14 Dec 2023 06:18:03 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54338 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1443730AbjLNLSA (ORCPT ); Thu, 14 Dec 2023 06:18:00 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6B9A411A for ; Thu, 14 Dec 2023 03:18:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1702552685; 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=VaN6TC3I4TNZRPtVPtcTdPQQalk1XpMFkRRRirXd7I0=; b=eM4GF+AffIoOz8rhw4PCT04rTw+/brEJvU5WuDsXFBhapFfAFgpGjek3YcIk9W1EoJ70n0 1c2InCiEN6GNDpmPxNyFr+5wJiF4sX/qjRgFxkxUHBfvmOzjoKR1vUEqgKQcQEO/oO8M2r HUIeJS4/uMY2Qb4gyw6a+cK6NNpdbYY= Received: from mail-ed1-f71.google.com (mail-ed1-f71.google.com [209.85.208.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-219-q_YJXD34NgGDKSGS4HpvMQ-1; Thu, 14 Dec 2023 06:18:04 -0500 X-MC-Unique: q_YJXD34NgGDKSGS4HpvMQ-1 Received: by mail-ed1-f71.google.com with SMTP id 4fb4d7f45d1cf-55285349727so74447a12.1 for ; Thu, 14 Dec 2023 03:18:03 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702552683; x=1703157483; 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=VaN6TC3I4TNZRPtVPtcTdPQQalk1XpMFkRRRirXd7I0=; b=mUwWAXxBHXjbV9JTuMIS7NTcQrveg9QC4aF3omKng7sdLcT5ctqnDCaMHjHR/AJxAM 9E7PS5tQdmtPEVPg6uq1Qw0TpYBqXHk76MtR5IdBBCeVrYbIGPOOQkUWQmefzRSddg5v 2s+nj0GJsecQUeJ7X+zwbgQk4/qJOcnhwFaLOm2e9ybxg6KbVNL7j1ASpZp+GtE8cQDQ W+J2fso4aXNCELqP0MKzc90uzYQr4u/Xt70t2uDu/uglxpYDZdrnQGlEhnpARPGESBIK X1TwCkh47V7CX2JfPmXItfbVliVAeLftHHYbRUPVlFmmenj+Bm5HhVWXl1Iz4RgyTvZC k4tg== X-Gm-Message-State: AOJu0YzLvNLP5y4orR7JGbbtHFGm0CjgYzIXobK1nbN50FuZimwMuZ+c 7gVZXYtyc9WfO2g3rPzeKgNUSEPm/rMU/wrL5V7ynRpN73pom+ExUkMWzAMxq0Brg7KL/em9h6h 0dzZ4MKp+r5b/74sPB7zCUfII X-Received: by 2002:a05:6402:2318:b0:551:76e6:afdb with SMTP id l24-20020a056402231800b0055176e6afdbmr2088866eda.77.1702552683020; Thu, 14 Dec 2023 03:18:03 -0800 (PST) X-Received: by 2002:a05:6402:2318:b0:551:76e6:afdb with SMTP id l24-20020a056402231800b0055176e6afdbmr2088851eda.77.1702552682642; Thu, 14 Dec 2023 03:18:02 -0800 (PST) Received: from redhat.com ([2.52.132.243]) by smtp.gmail.com with ESMTPSA id dk4-20020a0564021d8400b005522eddd380sm1316992edb.34.2023.12.14.03.17.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Dec 2023 03:18:01 -0800 (PST) Date: Thu, 14 Dec 2023 06:17:57 -0500 From: "Michael S. Tsirkin" To: Arseniy Krasnov Cc: Stefan Hajnoczi , Stefano Garzarella , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , 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: [PATCH net-next v9 3/4] vsock: update SO_RCVLOWAT setting callback Message-ID: <20231214061738-mutt-send-email-mst@kernel.org> References: <20231214091947.395892-1-avkrasnov@salutedevices.com> <20231214091947.395892-4-avkrasnov@salutedevices.com> <20231214052502-mutt-send-email-mst@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,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 morse.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 (morse.vger.email [0.0.0.0]); Thu, 14 Dec 2023 03:18:35 -0800 (PST) On Thu, Dec 14, 2023 at 01:52:50PM +0300, Arseniy Krasnov wrote: > > > 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 commit message should reflect all that patch does. > > > >> --- > >> 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 > >