DPDK patches and discussions
 help / color / mirror / Atom feed
From: Tyler Retzlaff <roretzla@linux.microsoft.com>
To: Ferruh Yigit <ferruh.yigit@amd.com>
Cc: Jiawen Wu <jiawenwu@trustnetic.com>,
	Honnappa Nagarahalli <Honnappa.Nagarahalli@arm.com>,
	dev@dpdk.org
Subject: Re: [PATCH 1/2] net/txgbe: add vectorized functions for Rx/Tx
Date: Thu, 21 Mar 2024 10:55:50 -0700	[thread overview]
Message-ID: <20240321175550.GA9249@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net> (raw)
In-Reply-To: <91a42fb8-e0c8-4efb-9eea-f25e5cb2ec43@amd.com>

On Thu, Mar 21, 2024 at 04:27:26PM +0000, Ferruh Yigit wrote:
> On 3/5/2024 8:10 AM, Jiawen Wu wrote:
> 
> <...>
> 
> >>> +++ b/drivers/net/txgbe/txgbe_rxtx_vec_neon.c
> >>> @@ -0,0 +1,604 @@
> >>> +/* SPDX-License-Identifier: BSD-3-Clause
> >>> + * Copyright(c) 2015-2024 Beijing WangXun Technology Co., Ltd.
> >>> + * Copyright(c) 2010-2015 Intel Corporation
> >>> + */
> >>> +
> >>> +#include <ethdev_driver.h>
> >>> +#include <rte_malloc.h>
> >>> +#include <rte_vect.h>
> >>> +
> >>> +#include "txgbe_ethdev.h"
> >>> +#include "txgbe_rxtx.h"
> >>> +#include "txgbe_rxtx_vec_common.h"
> >>> +
> >>> +#pragma GCC diagnostic ignored "-Wcast-qual"
> >>> +
> >>
> >> Is this pragma really required?
> > 
> > Yes. Otherwise, there are warnings in the compilation:
> > 
> > [1909/2921] Compiling C object drivers/libtmp_rte_net_txgbe.a.p/net_txgbe_txgbe_rxtx_vec_neon.c.o
> > ../drivers/net/txgbe/txgbe_rxtx_vec_neon.c: In function ‘txgbe_rxq_rearm’:
> > ../drivers/net/txgbe/txgbe_rxtx_vec_neon.c:37:15: warning: cast discards ‘volatile’ qualifier from pointer target type [-Wcast-qual]
> >      vst1q_u64((uint64_t *)&rxdp[i], zero);
> >                ^
> > ../drivers/net/txgbe/txgbe_rxtx_vec_neon.c:60:13: warning: cast discards ‘volatile’ qualifier from pointer target type [-Wcast-qual]
> >    vst1q_u64((uint64_t *)rxdp++, dma_addr0);
> >              ^
> > ../drivers/net/txgbe/txgbe_rxtx_vec_neon.c:65:13: warning: cast discards ‘volatile’ qualifier from pointer target type [-Wcast-qual]
> >    vst1q_u64((uint64_t *)rxdp++, dma_addr1);
> > 
> 
> Hi Honnappa,
> 
> There are multiple drivers ignores "-Wcast-qual" for neon implementation.
> 
> Is there a better, more proper way to address this warning?

rather than suppress the warning you could just cast away the volatile
qualifier the common approach is to cast through uintptr_t to discard.

volatile uint64_t *vp;
uint64_t *p = (uint64_t *)(uintptr_t)vp;

perhaps better than broad suppression of warnings. but does require code
be reviewed to be certain it is okay to have the qualifier removed which
i suspect is okay in functions that are inline assembly or intrinsics.

> 
> 
> Thanks,
> ferruh

  reply	other threads:[~2024-03-21 17:55 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-01  3:00 [PATCH 0/2] Wangxun support vector Rx/Tx Jiawen Wu
2024-02-01  3:00 ` [PATCH 1/2] net/txgbe: add vectorized functions for Rx/Tx Jiawen Wu
2024-02-07  3:13   ` Ferruh Yigit
2024-03-05  8:10     ` Jiawen Wu
2024-03-21 16:21       ` Ferruh Yigit
2024-04-07  8:32         ` Jiawen Wu
2024-03-21 16:27       ` Ferruh Yigit
2024-03-21 17:55         ` Tyler Retzlaff [this message]
2024-02-01  3:00 ` [PATCH 2/2] net/ngbe: " Jiawen Wu
2024-02-06  1:50 ` [PATCH 0/2] Wangxun support vector Rx/Tx Jiawen Wu

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=20240321175550.GA9249@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net \
    --to=roretzla@linux.microsoft.com \
    --cc=Honnappa.Nagarahalli@arm.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@amd.com \
    --cc=jiawenwu@trustnetic.com \
    /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).