patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Maxime Coquelin <maxime.coquelin@redhat.com>
To: Bruce Richardson <bruce.richardson@intel.com>, dev@dpdk.org
Cc: stable@dpdk.org, Chenbo Xia <chenbo.xia@intel.com>,
	David Marchand <david.marchand@redhat.com>
Subject: Re: [PATCH 1/3] vhost: fix build for powerpc
Date: Fri, 29 Sep 2023 16:47:16 +0200	[thread overview]
Message-ID: <9e25e16a-01c5-127d-0d58-6f62d429dd9a@redhat.com> (raw)
In-Reply-To: <20230831121058.725577-2-bruce.richardson@intel.com>



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 <bruce.richardson@intel.com>
> ---
>   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 <maxime.coquelin@redhat.com>

Thanks,
Maxime


  parent reply	other threads:[~2023-09-29 14:47 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20230831121058.725577-1-bruce.richardson@intel.com>
2023-08-31 12:10 ` Bruce Richardson
2023-09-01 14:59   ` Bruce Richardson
2023-09-12 18:30     ` David Christensen
2023-09-29 14:47   ` Maxime Coquelin [this message]
2023-08-31 12:10 ` [PATCH 2/3] crypto/ipsec_mb: fix build failures due to incompatible lib Bruce Richardson
2023-08-31 13:18   ` Power, Ciara

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9e25e16a-01c5-127d-0d58-6f62d429dd9a@redhat.com \
    --to=maxime.coquelin@redhat.com \
    --cc=bruce.richardson@intel.com \
    --cc=chenbo.xia@intel.com \
    --cc=david.marchand@redhat.com \
    --cc=dev@dpdk.org \
    --cc=stable@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).