Received: by 2002:a05:7412:b130:b0:e2:908c:2ebd with SMTP id az48csp374514rdb; Fri, 17 Nov 2023 00:59:02 -0800 (PST) X-Google-Smtp-Source: AGHT+IGo60ZISGSt7BdHiph2yFiJ70HPzcXTEIYIRorTdFmm2XPthBNtIUSpUnSQigyPD84LRn33 X-Received: by 2002:a17:902:da86:b0:1cc:4488:afba with SMTP id j6-20020a170902da8600b001cc4488afbamr6353657plx.6.1700211541912; Fri, 17 Nov 2023 00:59:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700211541; cv=none; d=google.com; s=arc-20160816; b=naYII/5icYYhtjT52hGJAdcQTWSGNQQ1RL4Ml44E/HfelCu8e2kuFhtjrUe07iL4DI 8VFG6XoihkuO6+XD8bfjWR71ILVyhL3PhAcOwti42IhnKuPqL6mw9owa32gjUJNnfzDj 7t33rJtSjKKecNgMGDTmgCkZ3l0rfxdhAYoBUOu9ZPfCvnyNsawtaX+T9kGmxtI/0maR 1eJ9m8vESLTNBi+M3M0rCOcuAicfoZ7AcEszci7kaprCbV4MVEv/dTrPJKoLPP2mTdrG IlXQtbyGonOHMNOtK53UEh+1OlMpUqyjNyEwid02KFoRXgk9nwE8uwh9RYIgfCBhaaGX l09g== 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 :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:dkim-signature:dkim-filter; bh=HN+PvIjLqzQn6wjZP926vHy0wPu+a4K5ITDOFK7AlOE=; fh=l7xBQVGdpXDK+Z71lZkrtPT+DrTVUNscI0qNZEzUJW4=; b=C4IyjXg48XiltAFXIxpdVEpmy0jGwF8L+tEXr8TgSPkN62jNiLWE4JaAUVjtD+aAE0 g+WlFT6sUu2jXs8DsAi4BwE9+YzTPKhRsif//IRHza7fQIPL17lxJ3/N6YukST1H525P AhVjk9gRJK7D2Pg0LKl64USl4CTDCiqgDz9RiPmTKQ9JodjdjuEs45vteSC9yBQVGjix nXPdeVNIDAy7L8Umt8dl9X3hfQzkGlkfZhVK1X9kxcU+GX26gSqoXouV4HAGFoJsunB4 sFbl+AZ6stVWoDk9pA8x4o4ebcVrAZRH/G1v4IK+ERasrO0omYsDj0yA42djnceVdUy5 VDoQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@salutedevices.com header.s=mail header.b=fbTB1TKj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 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 agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id ix21-20020a170902f81500b001c74d844254si1368255plb.101.2023.11.17.00.59.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Nov 2023 00:59:01 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@salutedevices.com header.s=mail header.b=fbTB1TKj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 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 agentk.vger.email (Postfix) with ESMTP id 06FFB81C70B4; Fri, 17 Nov 2023 00:58:59 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345714AbjKQI6t (ORCPT + 99 others); Fri, 17 Nov 2023 03:58:49 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42528 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229952AbjKQI6s (ORCPT ); Fri, 17 Nov 2023 03:58:48 -0500 Received: from mx1.sberdevices.ru (mx2.sberdevices.ru [45.89.224.132]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 27C3A11F; Fri, 17 Nov 2023 00:58:43 -0800 (PST) Received: from p-infra-ksmg-sc-msk02 (localhost [127.0.0.1]) by mx1.sberdevices.ru (Postfix) with ESMTP id A64B9120097; Fri, 17 Nov 2023 11:58:40 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.sberdevices.ru A64B9120097 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=salutedevices.com; s=mail; t=1700211520; bh=HN+PvIjLqzQn6wjZP926vHy0wPu+a4K5ITDOFK7AlOE=; h=Message-ID:Date:MIME-Version:Subject:To:From:Content-Type:From; b=fbTB1TKjZE9AIUNudoR0Vy7AVqsTakFba2sLFRyrNstMcANH1pgsLVYXHK6ITrOE+ RU3YvcWfqGgqUCZPQ41moC7zCReP6GTarQHJx0ZYEXm5HuKHgtp4522pitd2wYYxhj 60npuohOI7JFMtLNBsJpdD5RqkxFG/eN6vlFJdIDPDFZ6ENtP1WhdMbe4YvZaOXzSb gU0RryRcspaEmkqh50nWKgHrDNnf+ELoT6vqhDmJ5yikPagei9i6Ao9Lqkz0at6c5k SjfoqusdKk5ydlEcvuDF/GlwKsMovwEJjm/jfgKwK1o7cRSbYMQm2ThR5niBnw7M37 J+IcbfY7hiGjQ== Received: from p-i-exch-sc-m01.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; Fri, 17 Nov 2023 11:58:40 +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; Fri, 17 Nov 2023 11:58:40 +0300 Message-ID: <1700ac19-a355-fad4-79e2-7598ee33bd00@salutedevices.com> Date: Fri, 17 Nov 2023 11:50:59 +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: [RFC PATCH v1 2/2] vsock/test: SO_RCVLOWAT + deferred credit update test To: Stefano Garzarella CC: Stefan Hajnoczi , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , "Michael S. Tsirkin" , Jason Wang , Bobby Eshleman , , , , , , References: <20231108072004.1045669-1-avkrasnov@salutedevices.com> <20231108072004.1045669-3-avkrasnov@salutedevices.com> <923a6149-3bd5-c5b4-766d-8301f9e7484a@salutedevices.com> Content-Language: en-US From: Arseniy Krasnov In-Reply-To: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit 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: 181429 [Nov 17 2023] X-KSMG-AntiSpam-Version: 6.0.0.2 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: 543 543 1e3516af5cdd92079dfeb0e292c8747a62cb1ee4, {Tracking_uf_ne_domains}, {Tracking_from_domain_doesnt_match_to}, salutedevices.com:7.1.1;docs.kernel.org:7.1.1;100.64.160.123:7.1.2;d41d8cd98f00b204e9800998ecf8427e.com:7.1.1;p-i-exch-sc-m01.sberdevices.ru:5.0.1,7.1.1;127.0.0.199:7.1.2, FromAlignment: s, ApMailHostAddress: 100.64.160.123 X-MS-Exchange-Organization-SCL: -1 X-KSMG-AntiSpam-Interceptor-Info: scan successful X-KSMG-AntiPhishing: Clean, bases: 2023/11/17 08:17:00 X-KSMG-LinksScanning: Clean, bases: 2023/11/17 08:17:00 X-KSMG-AntiVirus: Kaspersky Secure Mail Gateway, version 2.0.1.6960, bases: 2023/11/17 07:09:00 #22469944 X-KSMG-AntiVirus-Status: Clean, skipped X-Spam-Status: No, score=-4.1 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,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.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 (agentk.vger.email [0.0.0.0]); Fri, 17 Nov 2023 00:58:59 -0800 (PST) On 17.11.2023 11:30, Stefano Garzarella wrote: > On Fri, Nov 17, 2023 at 10:12:38AM +0300, Arseniy Krasnov wrote: >> >> >> On 15.11.2023 14:11, Stefano Garzarella wrote: >>> On Wed, Nov 08, 2023 at 10:20:04AM +0300, Arseniy Krasnov wrote: >>>> This adds test which checks, that updating SO_RCVLOWAT value also sends >>> >>> You can avoid "This adds", and write just "Add test ...". >>> >>> See https://docs.kernel.org/process/submitting-patches.html#describe-your-changes >>> >>>     Describe your changes in imperative mood, e.g. "make xyzzy do frotz" >>>     instead of "[This patch] makes xyzzy do frotz" or "[I] changed xyzzy >>>     to do frotz", as if you are giving orders to the codebase to change >>>     its behaviour. >>> >>> Also in the other patch. >>> >>>> credit update message. Otherwise mutual hungup may happen when receiver >>>> didn't send credit update and then calls 'poll()' with non default >>>> SO_RCVLOWAT value (e.g. waiting enough bytes to read), while sender >>>> waits for free space at receiver's side. >>>> >>>> Signed-off-by: Arseniy Krasnov >>>> --- >>>> tools/testing/vsock/vsock_test.c | 131 +++++++++++++++++++++++++++++++ >>>> 1 file changed, 131 insertions(+) >>>> >>>> diff --git a/tools/testing/vsock/vsock_test.c b/tools/testing/vsock/vsock_test.c >>>> index c1f7bc9abd22..c71b3875fd16 100644 >>>> --- a/tools/testing/vsock/vsock_test.c >>>> +++ b/tools/testing/vsock/vsock_test.c >>>> @@ -1180,6 +1180,132 @@ static void test_stream_shutrd_server(const struct test_opts *opts) >>>>     close(fd); >>>> } >>>> >>>> +#define RCVLOWAT_CREDIT_UPD_BUF_SIZE    (1024 * 128) >>>> +#define VIRTIO_VSOCK_MAX_PKT_BUF_SIZE    (1024 * 64) >>> >>> What about adding a comment like the one in the cover letter about >>> dependency with kernel values? >>> >>> Please add it also in the commit description. >>> >>> I'm thinking if we should move all the defines that depends on the >>> kernel in some special header. >> >> IIUC it will be new header file in tools/testing/vsock, which includes such defines. At >> this moment in will contain only VIRTIO_VSOCK_MAX_PKT_BUF_SIZE. Idea is that such defines > > So this only works on the virtio transport though, not the other > transports, right? (but maybe the others don't have this problem, so > it's fine). Yes, this case is only actual in virtio as this logic exists in virtio only (the same situation as for skb merging sometimes ago). > >> are not supposed to use by user (so do not move it to uapi headers), but needed by tests >> to check kernel behaviour. Please correct me if i'm wrong. > > Right! > Maybe if it's just one, we can leave it there for now, but with a > comment on top explaining where it comes. Ok, got it, I'll add comment Thanks, Arseniy > > Thanks, > Stefano >