Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp669353rwb; Sun, 6 Nov 2022 11:47:11 -0800 (PST) X-Google-Smtp-Source: AMsMyM7wGnqtbKs26icEwlxg+4TohmGxVpzZABZJOE8/XI6Jc+ozIsKxI30Ds6TppzKLdQXaYYqX X-Received: by 2002:a05:6402:28d:b0:463:3509:76af with SMTP id l13-20020a056402028d00b00463350976afmr41173804edv.226.1667764031102; Sun, 06 Nov 2022 11:47:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1667764031; cv=none; d=google.com; s=arc-20160816; b=ee5GweJM0atxkoQdPpUGBMnHJdS6WjewZsRnkDNa7ydXfEP4aMmHdIQ0h83TwV93fJ c+D/zbnhujjNxHhP6j8QfvGDeOHHKgTaLzPYlDWGvgJP+pPOVXTPaLRYeZ1r30mta/l6 kw+Htxl/IdOP4e+fS9ZD9GDgIt3qwbWdVmhbFSOAtHF/2VijxHk3NNZzVnmxBlRuIACg YtiF5nNRQzLrFMMzVUECkIjPT69VJiG6UhKW+ZSDCGIQuSY0WG/REe653Yo7CQH3sibz 52c0jn83FJfe6uv8jI/0R83yclXqTjNVkrUAISS2JW2vArKxsMVEEM0yjmkpYLLBfEPT q2BQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :content-id:content-language:accept-language:in-reply-to:message-id :date:thread-index:thread-topic:subject:cc:to:from:dkim-signature; bh=yQ6suEWJBzxoUrocwoSmUoXHvbi6PvhSnqawY+nZJZ8=; b=xXyzaxOM+10Qm85/Dqp+o5O0ntdswiWp8q4A2UtFhjYPVr4vo1tOpcVwOnIbq3HVv6 /J8TJmGE2CD8G22Dq18QERS3hJnFl96R0MDcWwg8Xo9Y4Tm99vmy3NHYn5DvmPj76lbQ U+fFZEWYZApD/u8PpkI/FFVJS2GynzzsI+iN6fqNXBag/uO2dule259ynyiBvOzQOkJD iyRk9cjL9gjR6EM7gYE4x9rxaX3zs1r4eo4VYMJUPeNbTI6rhDXXckNh9HG7ViTFyWRB RZ/xatN1rMY7djtSiNlY5SLnVoKvi0594QwlIv0lH/1zJVBcEJH4rmJwFxIUiU55lm9R cxuA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sberdevices.ru header.s=mail header.b=YV1yrrDK; 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 bs25-20020a170906d1d900b0079330b37fb5si4524785ejb.564.2022.11.06.11.46.40; Sun, 06 Nov 2022 11:47:11 -0800 (PST) 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=YV1yrrDK; 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 S230099AbiKFTgj (ORCPT + 96 others); Sun, 6 Nov 2022 14:36:39 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40752 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229947AbiKFTgh (ORCPT ); Sun, 6 Nov 2022 14:36:37 -0500 Received: from mx.sberdevices.ru (mx.sberdevices.ru [45.89.227.171]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0998BE084; Sun, 6 Nov 2022 11:36:35 -0800 (PST) Received: from s-lin-edge02.sberdevices.ru (localhost [127.0.0.1]) by mx.sberdevices.ru (Postfix) with ESMTP id 5438B5FD04; Sun, 6 Nov 2022 22:36:33 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sberdevices.ru; s=mail; t=1667763393; bh=yQ6suEWJBzxoUrocwoSmUoXHvbi6PvhSnqawY+nZJZ8=; h=From:To:Subject:Date:Message-ID:Content-Type:MIME-Version; b=YV1yrrDKglvFQLa34c6eqjzoqkTQQDdNQdyDxpaC6X/S6vOK5GLypskjvi+zp++Dm AhAfoS6eplCCgnaql70kq2zZIgZ4x20bZ15dsHACujm9LlO/N2UjuvrVMWWaIVbmy6 /q8GXlCZXIo9wDlCZKG/+dDz7dr2VwRtVrDXVsEl97SFZ3HreObFKRGRnZOBbn+P8v K9cSd98Nbz19+MBQq04/Y386P6CS1NzpglnFgdgaJwbgJFSzYpStKvR15+PLcozJUf E+6Mi/7mMASbAzeDOfaC75mlFgGA73t1xEFi0/+4kOB7mrjmx0Rl7/LceX84b6e8qq wlREl7z+nWDVw== Received: from S-MS-EXCH01.sberdevices.ru (S-MS-EXCH01.sberdevices.ru [172.16.1.4]) by mx.sberdevices.ru (Postfix) with ESMTP; Sun, 6 Nov 2022 22:36:33 +0300 (MSK) From: Arseniy Krasnov To: Stefano Garzarella , Stefan Hajnoczi , "Michael S. Tsirkin" , Jason Wang , "David S. Miller" , "edumazet@google.com" , Jakub Kicinski , Paolo Abeni , Krasnov Arseniy CC: "linux-kernel@vger.kernel.org" , "kvm@vger.kernel.org" , "virtualization@lists.linux-foundation.org" , "netdev@vger.kernel.org" , kernel Subject: [RFC PATCH v3 01/11] virtio/vsock: rework packet allocation logic Thread-Topic: [RFC PATCH v3 01/11] virtio/vsock: rework packet allocation logic Thread-Index: AQHY8hcBEbxDmf4aG021vuOLUMusCQ== Date: Sun, 6 Nov 2022 19:36:02 +0000 Message-ID: In-Reply-To: Accept-Language: en-US, ru-RU Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [172.16.1.12] Content-Type: text/plain; charset="utf-8" Content-ID: Content-Transfer-Encoding: base64 MIME-Version: 1.0 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: 2022/11/06 12:52:00 #20573807 X-KSMG-AntiVirus-Status: Clean, skipped X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS 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 VG8gc3VwcG9ydCB6ZXJvY29weSByZWNlaXZlLCBwYWNrZXQncyBidWZmZXIgYWxsb2NhdGlvbiBp cyBjaGFuZ2VkOiBmb3INCmJ1ZmZlcnMgd2hpY2ggY291bGQgYmUgbWFwcGVkIHRvIHVzZXIncyB2 bWEgd2UgY2FuJ3QgdXNlICdrbWFsbG9jKCknKGFzDQprZXJuZWwgcmVzdHJpY3RzIHRvIG1hcCBz bGFiIHBhZ2VzIHRvIHVzZXIncyB2bWEpIGFuZCByYXcgYnVkZHkNCmFsbG9jYXRvciBub3cgY2Fs bGVkLiBCdXQsIGZvciB0eCBwYWNrZXRzKHN1Y2ggcGFja2V0cyB3b24ndCBiZSBtYXBwZWQNCnRv IHVzZXIpLCBwcmV2aW91cyAna21hbGxvYygpJyB3YXkgaXMgdXNlZCwgYnV0IHdpdGggc3BlY2lh bCBmbGFnIGluDQpwYWNrZXQncyBzdHJ1Y3R1cmUgd2hpY2ggYWxsb3dzIHRvIGRpc3Rpbmd1aXNo IGJldHdlZW4gJ2ttYWxsb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