Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp4928492rdb; Fri, 15 Sep 2023 17:45:08 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE3xeYBZ58RZh2njZC308XP41ZnaazPkHfCNkrjy1mm0ijrQH1pydHdi9Euur2VQ8whDPMt X-Received: by 2002:a17:902:f54b:b0:1bc:2d43:c747 with SMTP id h11-20020a170902f54b00b001bc2d43c747mr3593198plf.38.1694825108110; Fri, 15 Sep 2023 17:45:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694825108; cv=none; d=google.com; s=arc-20160816; b=LKBAxVGwgJSGcD7x6St5nmopazCbdREoCBIhuiyUmvAWQp8Hj5ynVAtC2eag8+nleG 3+UByCMIUwj8xEm7nrRfUmqWqWIkLfUqvzFnq27A9PKb8NQCyb9l74tjG3uK/V9wqDWf WCe1BN1VgMWsrACAb5t1DTc/OXmxvTeYDJct6Bf1hhLx6RJrUe6Zk1UuxFbAKFpI6fyg Ngk58DHATzRFvWMYwfxmEDWyKzozfv/G1nGBQowiT/A5HCY/ZPTc+XnyvrOylnSYSJl+ 2h/HQinsHD/orGIBXYFLcy7cO8K1JBfDBSYlBvqz/Dzotz3gxTU3o0IJvTbdH7XAlZOR I56w== 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=EoVRfIycVq5CUGfnsCjJEvjbWmLF3KZCRHTlIU2ad1c=; fh=7SOKOoAg8TY2MgZ5I+z3DE14god2GIwBxiKk71+UF6o=; b=bl5Bu10vYWXgBwe6eMnhlaUMu/neevgLXkGWTeg6yXdKVZHV9rmdai5bBMj7f7QpRy lgmsqnWNkGJVvcY/W4eod7H8+1QQb/j12jxIQAmCvHOxWKm0alPJPh+hazm19iFefrZw riyQ7CJE3QAnreJO+WZpzaIG/n3grVqAJSRhJM40YGVQceXWUV7/6n2YqsREovQfiNMR KBrRqHQWyw4zbBGTdBe7UH6fozCRuYx0afhVgtLpvMiMqrUoFwPRwVKRdWhKAYYxmc6P SIwEQsjg3sROhvIF+WdSAW6vPV7Ihwz3j+H9MuptFnwwBkqRMLp49HVNaRS7oc054GDG Soxw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@salutedevices.com header.s=mail header.b=sKafJcg3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 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 groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id k4-20020a170902c40400b001bc8af2bc6bsi4361028plk.170.2023.09.15.17.44.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Sep 2023 17:45:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; dkim=pass header.i=@salutedevices.com header.s=mail header.b=sKafJcg3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 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 groat.vger.email (Postfix) with ESMTP id 835EB8347A6E; Fri, 15 Sep 2023 12:36:34 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236748AbjIOTgC (ORCPT + 99 others); Fri, 15 Sep 2023 15:36:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51630 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237025AbjIOTf4 (ORCPT ); Fri, 15 Sep 2023 15:35:56 -0400 Received: from mx1.sberdevices.ru (mx2.sberdevices.ru [45.89.224.132]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D2C811BD3; Fri, 15 Sep 2023 12:35:50 -0700 (PDT) Received: from p-infra-ksmg-sc-msk02 (localhost [127.0.0.1]) by mx1.sberdevices.ru (Postfix) with ESMTP id 6BC05120006; Fri, 15 Sep 2023 22:35:49 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.sberdevices.ru 6BC05120006 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=salutedevices.com; s=mail; t=1694806549; bh=EoVRfIycVq5CUGfnsCjJEvjbWmLF3KZCRHTlIU2ad1c=; h=Message-ID:Date:MIME-Version:Subject:To:From:Content-Type:From; b=sKafJcg33wiPmnYgdgs/37KbtxssDPZT8snLLUyGWV6qQlRjtm26Jq7J72Dl5S5Es VM/Kd5ZF3zZe2YQuqv9wfBLduqClKz5Q5fB0HqHdPwXWbWDq1RKiUlPWq1OnHZR/6b Ny2CsL/cFGUkyHcXjovgZloL7udrHky5zOWV+bm8oSLsAvM6UFWc0akTK47JsO24Ls a7wH8s6rQzkdw+7K2D4yiDcPPE8Y8kkvlzJX8EYMbSJaIShukRymCFs1sIVFt/uWk8 Ga5ts0oR5QPLWYP9PfMGNuoBUNZQCw88OBMzEFPha+/NWANPMjLlRMx/S4L7x0c5l+ 0v3t4anhgYrdw== 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, 15 Sep 2023 22:35:49 +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.30; Fri, 15 Sep 2023 22:35:49 +0300 Message-ID: <97ea5def-d82f-9f8b-fb45-8b37c3d96cb9@salutedevices.com> Date: Fri, 15 Sep 2023 22:29:06 +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 5/5] vsock/test: track bytes in MSG_PEEK test for SOCK_SEQPACKET Content-Language: en-US To: Stefano Garzarella , CC: , , , Bobby Eshleman References: <20230915121452.87192-1-sgarzare@redhat.com> <20230915121452.87192-6-sgarzare@redhat.com> From: Arseniy Krasnov In-Reply-To: <20230915121452.87192-6-sgarzare@redhat.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Originating-IP: [100.64.160.123] X-ClientProxiedBy: p-i-exch-sc-m01.sberdevices.ru (172.16.192.107) 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: 179903 [Sep 15 2023] X-KSMG-AntiSpam-Version: 5.9.59.0 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: 530 530 ecb1547b3f72d1df4c71c0b60e67ba6b4aea5432, {Tracking_from_domain_doesnt_match_to}, 100.64.160.123:7.1.2;p-i-exch-sc-m01.sberdevices.ru:7.1.1,5.0.1;d41d8cd98f00b204e9800998ecf8427e.com:7.1.1;salutedevices.com: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 X-KSMG-LinksScanning: Clean X-KSMG-AntiVirus: Kaspersky Secure Mail Gateway, version 2.0.1.6960, bases: 2023/09/15 17:43:00 #21898246 X-KSMG-AntiVirus-Status: Clean, skipped X-Spam-Status: No, score=-2.3 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 autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.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 (groat.vger.email [0.0.0.0]); Fri, 15 Sep 2023 12:36:34 -0700 (PDT) Small remark on 'Subject' - this is not MSG_PEEK test, it is test for sk_buff merging. Considering that: Reviewed-by: Arseniy Krasnov Thanks, Arseniy On 15.09.2023 15:14, Stefano Garzarella wrote: > The test was a bit complicated to read. > Added variables to keep track of the bytes read and to be read > in each step. Also some comments. > > The test is unchanged. > > Signed-off-by: Stefano Garzarella > --- > tools/testing/vsock/vsock_test.c | 14 +++++++++++--- > 1 file changed, 11 insertions(+), 3 deletions(-) > > diff --git a/tools/testing/vsock/vsock_test.c b/tools/testing/vsock/vsock_test.c > index b18acbaf92e2..5743dcae2350 100644 > --- a/tools/testing/vsock/vsock_test.c > +++ b/tools/testing/vsock/vsock_test.c > @@ -1002,6 +1002,7 @@ static void test_stream_virtio_skb_merge_client(const struct test_opts *opts) > > static void test_stream_virtio_skb_merge_server(const struct test_opts *opts) > { > + size_t read = 0, to_read; > unsigned char buf[64]; > int fd; > > @@ -1014,14 +1015,21 @@ static void test_stream_virtio_skb_merge_server(const struct test_opts *opts) > control_expectln("SEND0"); > > /* Read skbuff partially. */ > - recv_buf(fd, buf, 2, 0, 2); > + to_read = 2; > + recv_buf(fd, buf + read, to_read, 0, to_read); > + read += to_read; > > control_writeln("REPLY0"); > control_expectln("SEND1"); > > - recv_buf(fd, buf + 2, 8, 0, 8); > + /* Read the rest of both buffers */ > + to_read = strlen(HELLO_STR WORLD_STR) - read; > + recv_buf(fd, buf + read, to_read, 0, to_read); > + read += to_read; > > - recv_buf(fd, buf, sizeof(buf) - 8 - 2, MSG_DONTWAIT, -EAGAIN); > + /* No more bytes should be there */ > + to_read = sizeof(buf) - read; > + recv_buf(fd, buf + read, to_read, MSG_DONTWAIT, -EAGAIN); > > if (memcmp(buf, HELLO_STR WORLD_STR, strlen(HELLO_STR WORLD_STR))) { > fprintf(stderr, "pattern mismatch\n");