From nobody Sun Feb 8 17:37:12 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1659712844; cv=none; d=zohomail.com; s=zohoarc; b=IbjDW44i5Zdmeht6KhiADYH/1hxlCOqAWIobu56N0yptLLA9DvMBHwroVwMLfxDGkxN6eGn9QDTgx+4vkxkKtGP2ZunENuFW7GudRCIY032Npz6rGOa1O2DZBAJPxr1DOpaPj0O9sKeAVZ+r8DA2nC+t98D0OgiGKSsM8Mpq5Vo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1659712844; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=oSMr73zQz43CzVBTEsg8WelO+8OR5Phlmmi7IjJzNKI=; b=RhwEeg8wL8ljghfZWGyHrzD2Is5tiLsUCzxxqNbs3L6ou0O8wZmTadxV9Y7MK/CSVDWcN7b7tXZYjst0pfaEwa5JGa/77G6ldcawn6n1JcgUbWMu9ek6OpVo38veOSePa83WH4BE2ecF4uUapit2iTfIyZdBfCNYEc1bnyfHTCQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1659712844336136.5302742703334; Fri, 5 Aug 2022 08:20:44 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-260-MQnUi_nbP8ehSnhvDJZsww-1; Fri, 05 Aug 2022 11:20:34 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id EB8148037AE; Fri, 5 Aug 2022 15:20:30 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id D873394571; Fri, 5 Aug 2022 15:20:30 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 977961946A60; Fri, 5 Aug 2022 15:20:30 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 546C51946A5F for ; Fri, 5 Aug 2022 15:20:29 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 46D77202699A; Fri, 5 Aug 2022 15:20:29 +0000 (UTC) Received: from localhost.localdomain.com (unknown [10.39.194.117]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3DB592026D07; Fri, 5 Aug 2022 15:20:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1659712843; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=oSMr73zQz43CzVBTEsg8WelO+8OR5Phlmmi7IjJzNKI=; b=M+6tu3DfnnfMmi5zFG77wV+NbclrWXvHaHl7YKTAeOdLxYHT2823+3jr0rx1mKfSfGwmNL TPhLY+sTouz7oO2lFd4DtYyWWp5kKUEwdW9HkRc4my8fYbfkTEQgJ8GhJ2XfRhUOgiByzq DTdzQIEQdidDmdUmKGIZL01YoGrBiwc= X-MC-Unique: MQnUi_nbP8ehSnhvDJZsww-1 X-Original-To: libvir-list@listman.corp.redhat.com From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: qemu-devel@nongnu.org Subject: [PULL 2/6] QIOChannelSocket: Add support for MSG_ZEROCOPY + IPV6 Date: Fri, 5 Aug 2022 16:20:10 +0100 Message-Id: <20220805152014.135768-3-berrange@redhat.com> In-Reply-To: <20220805152014.135768-1-berrange@redhat.com> References: <20220805152014.135768-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Thomas Huth , Beraldo Leal , David Hildenbrand , libvir-list@redhat.com, Cornelia Huck , Richard Henderson , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Wainer dos Santos Moschetta , Leonardo Bras , qemu-s390x@nongnu.org, qemu-arm@nongnu.org, Gerd Hoffmann , Paolo Bonzini , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , =?UTF-8?q?Alex=20Benn=C3=A9e?= Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1659712845785100001 From: Leonardo Bras For using MSG_ZEROCOPY, there are two steps: 1 - io_writev() the packet, which enqueues the packet for sending, and 2 - io_flush(), which gets confirmation that all packets got correctly sent Currently, if MSG_ZEROCOPY is used to send packets over IPV6, no error will be reported in (1), but it will fail in the first time (2) happens. This happens because (2) currently checks for cmsg_level & cmsg_type associated with IPV4 only, before reporting any error. Add checks for cmsg_level & cmsg_type associated with IPV6, and thus enable support for MSG_ZEROCOPY + IPV6 Fixes: 2bc58ffc29 ("QIOChannelSocket: Implement io_writev zero copy flag & = io_flush for CONFIG_LINUX") Signed-off-by: Leonardo Bras Signed-off-by: Daniel P. Berrang=C3=A9 --- io/channel-socket.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/io/channel-socket.c b/io/channel-socket.c index 74a936cc1f..b76dca9cc1 100644 --- a/io/channel-socket.c +++ b/io/channel-socket.c @@ -746,8 +746,8 @@ static int qio_channel_socket_flush(QIOChannel *ioc, } =20 cm =3D CMSG_FIRSTHDR(&msg); - if (cm->cmsg_level !=3D SOL_IP && - cm->cmsg_type !=3D IP_RECVERR) { + if (cm->cmsg_level !=3D SOL_IP && cm->cmsg_type !=3D IP_RECVERR = && + cm->cmsg_level !=3D SOL_IPV6 && cm->cmsg_type !=3D IPV6_RECVER= R) { error_setg_errno(errp, EPROTOTYPE, "Wrong cmsg in errqueue"); return -1; --=20 2.37.1