From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 5C3B542672; Fri, 29 Sep 2023 16:47:29 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 832A9410ED; Fri, 29 Sep 2023 16:47:25 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mails.dpdk.org (Postfix) with ESMTP id C4E6640EE1 for ; Fri, 29 Sep 2023 16:47:23 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1695998843; h=from:from: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; bh=dt/2HBCVYxP5ZpecsQjJd/YViDzmePTy8zxta609HCA=; b=GJrq/ypNyy8LdUazGYO0EsS1npiEGTpHZodM9aXwEVLTP4tiJ1+Q3sT+x2ekeds+l8oh22 y5J7IUObmO2FMRw+pSPN0AyejLGFef7f20jaA11UJk9oJMl+v9ayZUjv/YGUyytsDiykAp nzF4oYe/jZ3M5Latagd9em3hZm3czLE= 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-86-iElW79v6PGSu_DQnQzCM9g-1; Fri, 29 Sep 2023 10:47:19 -0400 X-MC-Unique: iElW79v6PGSu_DQnQzCM9g-1 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 190528032F6; Fri, 29 Sep 2023 14:47:19 +0000 (UTC) Received: from [10.39.208.41] (unknown [10.39.208.41]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 0326C492C37; Fri, 29 Sep 2023 14:47:17 +0000 (UTC) Message-ID: <9e25e16a-01c5-127d-0d58-6f62d429dd9a@redhat.com> Date: Fri, 29 Sep 2023 16:47:16 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.15.1 Subject: Re: [PATCH 1/3] vhost: fix build for powerpc To: Bruce Richardson , dev@dpdk.org Cc: stable@dpdk.org, Chenbo Xia , David Marchand References: <20230831121058.725577-1-bruce.richardson@intel.com> <20230831121058.725577-2-bruce.richardson@intel.com> From: Maxime Coquelin In-Reply-To: <20230831121058.725577-2-bruce.richardson@intel.com> X-Scanned-By: MIMEDefang 3.1 on 10.11.54.10 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org On 8/31/23 14:10, Bruce Richardson wrote: > When building on Ubuntu using the packaged powerpc compiler[1], a > warning is issued about the print format of the __u64 values. > > ../../lib/vhost/vduse.c: In function ‘vduse_vring_setup’: > ../../lib/vhost/vhost.h:676:17: error: format ‘%llx’ expects argument of > type ‘long long unsigned int’, but argument 5 has type ‘__u64’ {aka > ‘long unsigned int’} [-Werror=format=] > 676 | "VHOST_CONFIG: (%s) " fmt, prefix, ##args) > | ^~~~~~~~~~~~~~~~~~~~~ > > Changing the format specifier to %lx, or to use PRIx64 breaks other > builds, so the safest solution is to explicitly typecast the printed > values to match the format string. > > [1] powerpc64le-linux-gnu-gcc (Ubuntu 12.3.0-1ubuntu1~23.04) 12.3.0 > > Fixes: a9120db8b98b ("vhost: add VDUSE device startup") > Cc: maxime.coquelin@redhat.com > Cc: stable@dpdk.org > > Signed-off-by: Bruce Richardson > --- > lib/vhost/vduse.c | 9 ++++++--- > 1 file changed, 6 insertions(+), 3 deletions(-) > > diff --git a/lib/vhost/vduse.c b/lib/vhost/vduse.c > index 73ed424232..e2b6d35d37 100644 > --- a/lib/vhost/vduse.c > +++ b/lib/vhost/vduse.c > @@ -162,9 +162,12 @@ vduse_vring_setup(struct virtio_net *dev, unsigned int index) > > VHOST_LOG_CONFIG(dev->ifname, INFO, "VQ %u info:\n", index); > VHOST_LOG_CONFIG(dev->ifname, INFO, "\tnum: %u\n", vq_info.num); > - VHOST_LOG_CONFIG(dev->ifname, INFO, "\tdesc_addr: %llx\n", vq_info.desc_addr); > - VHOST_LOG_CONFIG(dev->ifname, INFO, "\tdriver_addr: %llx\n", vq_info.driver_addr); > - VHOST_LOG_CONFIG(dev->ifname, INFO, "\tdevice_addr: %llx\n", vq_info.device_addr); > + VHOST_LOG_CONFIG(dev->ifname, INFO, "\tdesc_addr: %llx\n", > + (unsigned long long)vq_info.desc_addr); > + VHOST_LOG_CONFIG(dev->ifname, INFO, "\tdriver_addr: %llx\n", > + (unsigned long long)vq_info.driver_addr); > + VHOST_LOG_CONFIG(dev->ifname, INFO, "\tdevice_addr: %llx\n", > + (unsigned long long)vq_info.device_addr); > VHOST_LOG_CONFIG(dev->ifname, INFO, "\tavail_idx: %u\n", vq_info.split.avail_index); > VHOST_LOG_CONFIG(dev->ifname, INFO, "\tready: %u\n", vq_info.ready); > It is surprising PRIx64 does not work on other architectures. I don't see a better solution, so: Acked-by: Maxime Coquelin Thanks, Maxime