Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp17590432rwd; Tue, 27 Jun 2023 05:17:55 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ58NWYKlL+BZNVPmahFz3D79RzO6kods6KgvcAjmMXNE1tq+usO/rTg4GejGDVJVqpbHq7F X-Received: by 2002:a05:6a00:1a53:b0:66a:6339:e8f6 with SMTP id h19-20020a056a001a5300b0066a6339e8f6mr18009722pfv.10.1687868275678; Tue, 27 Jun 2023 05:17:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687868275; cv=none; d=google.com; s=arc-20160816; b=TCe7cJD4o3PEn58e/lnYF8TXM0snEh4nPU/saqop5f3FjtYEic2Py7dXclf/rJeGKh wNaqYUxQEe2xeqZDLscZbmm375GL+sMby6zBif232LFBennOOZpw/nUtzff+7jZx+X4q fCpMTVUdsN6f/IMgJSOGTKX0z9PWrvko5SkfkHt4385jQR9W3yzwtp8JWAwxkv6VETw/ AjwJn9mIVX/htjox99zuCK5Ags21kZyaGSrFxdbLwCfl3JseS+XkJcQWHkVT+fjx/Jco ijSoHkVU3a0hfPq87JBnbYMpqZwmJjmXn/w7OnDzFncv2KeXhkBtm3NJ7QZtr6K+lGRr gBiA== 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; bh=N+yr4uUtudu6mibyumvLqyo/EuSagL5a4hQI4FKGs9M=; fh=l7xBQVGdpXDK+Z71lZkrtPT+DrTVUNscI0qNZEzUJW4=; b=K4uqWOsBJVUoSTM/cQWA+QC0FA+AnM6Uh3CTO9cYbb8Hu/XFUxAcifcVSScaKky7UL BpWQiK+BXYn9nVbxAZlop1eLVjFWaCsSDxmWAExyHeNjxoWvqLHfT8b4NXnKFgtQwpKF vdvTzwQeAFrFbJYqApviNAy6GiThy9QFfV7bqBkvZTu95GanqWsouNHKGeej/0Tt8UJ0 OrKZEmW7hloFGRZ4N2ILEEBaMjyMkwWJB/3Bw2lO3JIx9UKb3i9Gy7ZMhgXVHvD0dp0v loMh9CLaIT1EtTaP/PYhr7uYm0E2lWNhsrA5MGMpRnTk0gGcd5txYTtf90HCxJ6J3fDz H73g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sberdevices.ru header.s=mail header.b=WqOl7HPJ; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=sberdevices.ru Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id eb25-20020a056a004c9900b0067e69fcebb9si594212pfb.86.2023.06.27.05.17.42; Tue, 27 Jun 2023 05:17:55 -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=@sberdevices.ru header.s=mail header.b=WqOl7HPJ; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=sberdevices.ru Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231772AbjF0MEZ (ORCPT + 99 others); Tue, 27 Jun 2023 08:04:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33148 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229748AbjF0MEX (ORCPT ); Tue, 27 Jun 2023 08:04:23 -0400 Received: from mx.sberdevices.ru (mx.sberdevices.ru [45.89.227.171]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D842B10EC; Tue, 27 Jun 2023 05:04:19 -0700 (PDT) Received: from s-lin-edge02.sberdevices.ru (localhost [127.0.0.1]) by mx.sberdevices.ru (Postfix) with ESMTP id 9EC795FD71; Tue, 27 Jun 2023 15:04:16 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sberdevices.ru; s=mail; t=1687867456; bh=N+yr4uUtudu6mibyumvLqyo/EuSagL5a4hQI4FKGs9M=; h=Message-ID:Date:MIME-Version:Subject:To:From:Content-Type; b=WqOl7HPJIkLi8Rw+yzXRCdsLyZGIZsnXdFAtGq/6NNVl69IhYX/kS+yNCH3KCIgQU 9zrk856UEbqQ5sQ5wlanmnvuUDqCXdO7RSifPbXjwA0jfxxdYAVM8YO03NXMLTLNI4 tzn7Dph4Kvs4TOXtIUfyI8UZeshz/A7WrD+HfYBioZiPv3FQs9ioYXqEuzQvUsib22 EutXfXCYSYvcMnmBimRjuxnigbocHApZ+eAJQHTyWEhKiB9ubFK+ZvarFM4R42K6J+ gLwB28NZVdeflb+3JCy4mklpEGImVwEujcxKGmnY5QevTgEXbMkMqGqvLMUKjKdOix rziDJ6njzO8tA== Received: from p-i-exch-sc-m01.sberdevices.ru (p-i-exch-sc-m01.sberdevices.ru [172.16.192.107]) by mx.sberdevices.ru (Postfix) with ESMTP; Tue, 27 Jun 2023 15:03:56 +0300 (MSK) Message-ID: Date: Tue, 27 Jun 2023 14:58:57 +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 0/4] virtio/vsock: some updates for MSG_PEEK flag Content-Language: en-US To: Stefano Garzarella CC: Stefan Hajnoczi , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , "Michael S. Tsirkin" , Jason Wang , Bobby Eshleman , , , , , , References: <20230618062451.79980-1-AVKrasnov@sberdevices.ru> 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-m01.sberdevices.ru (172.16.192.107) To p-i-exch-sc-m01.sberdevices.ru (172.16.192.107) X-KSMG-Rule-ID: 4 X-KSMG-Message-Action: clean X-KSMG-AntiSpam-Status: not scanned, disabled by settings X-KSMG-AntiSpam-Interceptor-Info: not scanned X-KSMG-AntiPhishing: not scanned, disabled by settings X-KSMG-AntiVirus: Kaspersky Secure Mail Gateway, version 1.1.2.30, bases: 2023/06/27 09:07:00 #21586757 X-KSMG-AntiVirus-Status: Clean, skipped X-Spam-Status: No, score=-2.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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 26.06.2023 19:30, Stefano Garzarella wrote: > On Sun, Jun 18, 2023 at 09:24:47AM +0300, Arseniy Krasnov wrote: >> Hello, >> >> This patchset does several things around MSG_PEEK flag support. In >> general words it reworks MSG_PEEK test and adds support for this flag >> in SOCK_SEQPACKET logic. Here is per-patch description: >> >> 1) This is cosmetic change for SOCK_STREAM implementation of MSG_PEEK: >>   1) I think there is no need of "safe" mode walk here as there is no >>      "unlink" of skbs inside loop (it is MSG_PEEK mode - we don't change >>      queue). >>   2) Nested while loop is removed: in case of MSG_PEEK we just walk >>      over skbs and copy data from each one. I guess this nested loop >>      even didn't behave as loop - it always executed just for single >>      iteration. >> >> 2) This adds MSG_PEEK support for SOCK_SEQPACKET. It could be implemented >>   be reworking MSG_PEEK callback for SOCK_STREAM to support SOCK_SEQPACKET >>   also, but I think it will be more simple and clear from potential >>   bugs to implemented it as separate function thus not mixing logics >>   for both types of socket. So I've added it as dedicated function. >> >> 3) This is reworked MSG_PEEK test for SOCK_STREAM. Previous version just >>   sent single byte, then tried to read it with MSG_PEEK flag, then read >>   it in normal way. New version is more complex: now sender uses buffer >>   instead of single byte and this buffer is initialized with random >>   values. Receiver tests several things: >>   1) Read empty socket with MSG_PEEK flag. >>   2) Read part of buffer with MSG_PEEK flag. >>   3) Read whole buffer with MSG_PEEK flag, then checks that it is same >>      as buffer from 2) (limited by size of buffer from 2) of course). >>   4) Read whole buffer without any flags, then checks that is is same >>      as buffer from 3). >> >> 4) This is MSG_PEEK test for SOCK_SEQPACKET. It works in the same way >>   as for SOCK_STREAM, except it also checks combination of MSG_TRUNC >>   and MSG_PEEK. >> >> Head is: >> https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next.git/commit/?id=d20dd0ea14072e8a90ff864b2c1603bd68920b4b > > Nice cleanup, LGTM, but I'd like a comment from Bobby. Got it, thanks! Thanks, Arseniy > > Thanks, > Stefano >