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 B8199A0548; Thu, 11 Nov 2021 16:17:35 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8054D40E28; Thu, 11 Nov 2021 16:17:35 +0100 (CET) Received: from mail-il1-f173.google.com (mail-il1-f173.google.com [209.85.166.173]) by mails.dpdk.org (Postfix) with ESMTP id 0513A40E03 for ; Thu, 11 Nov 2021 16:17:35 +0100 (CET) Received: by mail-il1-f173.google.com with SMTP id h23so6159711ila.4 for ; Thu, 11 Nov 2021 07:17:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=FT4P88PlmekftV3qKTwpD7eW+GtbAyVVAc1smkkuUm4=; b=l/BXhlBNAwg32CQna0MwMpH/CBmNZdQe7XUZX2TdcZ+ODzfE52RDs0UuI4DbQedast OEKmi1IaR2MWoaHX8b9XNKwVY97m1dMjvQNcHbU62bd5f5QUmVka2yj39c8ji8y4SK1o KBaN+1QEo1ZdfOAxzRWEJ+nMp4eu2OG9GXhk2M2ZCIGGJpUmIAsZu0kEsl8svmL0uyen c7qjHgaiMAFrGwGNlwFTPvkpoToF0AMJjO1kIZbw1V//tlSCK7y31+KxzzBKLBq2fJzs z2x/+vj6+YCWqUvxsagsvGQMqqZdYFu2Ni+jNNohNzYhEj1LG6h6GtOv67VOEsnI23aT P2Rg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=FT4P88PlmekftV3qKTwpD7eW+GtbAyVVAc1smkkuUm4=; b=G+C8cxfrv//H5uVwCDCWhtxcJECL1M/cHZaE8/HTOu6MWykfSMIttxMHW/cWEG0ktp /P58Gzq8ttEx0zVdXGCNWR9kXY0GG7IwQuTIzLeMm6Ew3MoqG4MgdK04y0s29KaSJ5o3 92qFD84E2/IOvHGzku5O5NguWApErDAjLCowpkTynBiYV8hBr/nyv/gouFPXDb+mRosk /lNVmccUnD/M8Hc6j4XBV2+dR1RZJSx/u65i54aQeLXnJ27D+SSHyymIGq2b1g2UN5P8 qjuGZvkTn4xPw4pZH0QQsqjnZmcVsj9H/vYk6b4Hl84x1+4+PLrKZRkGh1OLRWo7DlKr /JVA== X-Gm-Message-State: AOAM531wv/gtNziA5f2bMDSfOZELNOlVECfrclaRU/7e9oCHYbJHHuY7 +NxQ9HSekAWkqSBEerYdhKI8Oy8Zt9RuOZKO7Jc= X-Google-Smtp-Source: ABdhPJwgKJoODnZKeKVu3WzOP69zU0jpZGrKvjTAgMzVnjSTTu5JmrRCMJV6STgMHqhqfXkQ9qQkdvsBby4Fxvbe8vU= X-Received: by 2002:a05:6e02:1aac:: with SMTP id l12mr5042874ilv.295.1636643854300; Thu, 11 Nov 2021 07:17:34 -0800 (PST) MIME-Version: 1.0 References: <20211108091948.9659-1-adwivedi@marvell.com> In-Reply-To: <20211108091948.9659-1-adwivedi@marvell.com> From: Jerin Jacob Date: Thu, 11 Nov 2021 20:47:08 +0530 Message-ID: Subject: Re: [dpdk-dev] [PATCH] common/cnxk: fix pointer argument with gcc 12 To: Ankur Dwivedi , Ferruh Yigit Cc: dpdk-dev , Jerin Jacob , Gowrishankar Muthukrishnan , Nithin Dabilpuram , Kiran Kumar K , Sunil Kumar Kori , Satha Koteswara Rao Kottidi Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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 Mon, Nov 8, 2021 at 2:50 PM Ankur Dwivedi wrote: > > The pointer passed to the rq_ctx and sq_ctx functions was the address > of qctx. Instead of that qctx should be passed. This patch fixes this. > > This patch also resolves warning observed with gcc 12 compiler. > > log: > ../drivers/common/cnxk/cnxk_telemetry.h:12:38: warning: array subscrip= t > =E2=80=98struct nix_cn10k_sq_ctx_s[0]=E2=80=99 is partly outside array= bounds of > =E2=80=98volatile void[8]=E2=80=99 [-Warray-bounds] > > Bugzilla ID: 853 > Fixes: af75aac78978 ("common/cnxk: support telemetry for NIX") > > Signed-off-by: Ankur Dwivedi > Reviewed-by: Gowrishankar Muthukrishnan > Reviewed-by: Jerin Jacob Applied to dpdk-next-net-mrvl/for-next-net. Thanks > --- > drivers/common/cnxk/cnxk_telemetry_nix.c | 32 +++++++++++++++--------- > 1 file changed, 20 insertions(+), 12 deletions(-) > > diff --git a/drivers/common/cnxk/cnxk_telemetry_nix.c b/drivers/common/cn= xk/cnxk_telemetry_nix.c > index 1175f68a51..df6458039d 100644 > --- a/drivers/common/cnxk/cnxk_telemetry_nix.c > +++ b/drivers/common/cnxk/cnxk_telemetry_nix.c > @@ -266,9 +266,11 @@ cnxk_tel_nix_sq(struct roc_nix_sq *sq, struct plt_te= l_data *d) > } > > static void > -nix_rq_ctx_cn9k(void *qctx, struct plt_tel_data *d) > +nix_rq_ctx_cn9k(volatile void *qctx, struct plt_tel_data *d) > { > - struct nix_rq_ctx_s *ctx =3D (struct nix_rq_ctx_s *)qctx; > + volatile struct nix_rq_ctx_s *ctx; > + > + ctx =3D (volatile struct nix_rq_ctx_s *)qctx; > > /* W0 */ > CNXK_TEL_DICT_INT(d, ctx, wqe_aura, w0_); > @@ -343,9 +345,11 @@ nix_rq_ctx_cn9k(void *qctx, struct plt_tel_data *d) > } > > static void > -nix_rq_ctx(void *qctx, struct plt_tel_data *d) > +nix_rq_ctx(volatile void *qctx, struct plt_tel_data *d) > { > - struct nix_cn10k_rq_ctx_s *ctx =3D (struct nix_cn10k_rq_ctx_s *)q= ctx; > + volatile struct nix_cn10k_rq_ctx_s *ctx; > + > + ctx =3D (volatile struct nix_cn10k_rq_ctx_s *)qctx; > > /* W0 */ > CNXK_TEL_DICT_INT(d, ctx, wqe_aura, w0_); > @@ -453,9 +457,9 @@ cnxk_tel_nix_rq_ctx(struct roc_nix *roc_nix, uint8_t = n, struct plt_tel_data *d) > } > > if (roc_model_is_cn9k()) > - nix_rq_ctx_cn9k(&qctx, d); > + nix_rq_ctx_cn9k(qctx, d); > else > - nix_rq_ctx(&qctx, d); > + nix_rq_ctx(qctx, d); > > return 0; > } > @@ -512,9 +516,11 @@ cnxk_tel_nix_cq_ctx(struct roc_nix *roc_nix, uint8_t= n, struct plt_tel_data *d) > } > > static void > -nix_sq_ctx_cn9k(void *qctx, struct plt_tel_data *d) > +nix_sq_ctx_cn9k(volatile void *qctx, struct plt_tel_data *d) > { > - struct nix_sq_ctx_s *ctx =3D (struct nix_sq_ctx_s *)qctx; > + volatile struct nix_sq_ctx_s *ctx; > + > + ctx =3D (volatile struct nix_sq_ctx_s *)qctx; > > /* W0 */ > CNXK_TEL_DICT_INT(d, ctx, sqe_way_mask, w0_); > @@ -595,9 +601,11 @@ nix_sq_ctx_cn9k(void *qctx, struct plt_tel_data *d) > } > > static void > -nix_sq_ctx(void *qctx, struct plt_tel_data *d) > +nix_sq_ctx(volatile void *qctx, struct plt_tel_data *d) > { > - struct nix_cn10k_sq_ctx_s *ctx =3D (struct nix_cn10k_sq_ctx_s *)q= ctx; > + volatile struct nix_cn10k_sq_ctx_s *ctx; > + > + ctx =3D (volatile struct nix_cn10k_sq_ctx_s *)qctx; > > /* W0 */ > CNXK_TEL_DICT_INT(d, ctx, sqe_way_mask, w0_); > @@ -698,9 +706,9 @@ cnxk_tel_nix_sq_ctx(struct roc_nix *roc_nix, uint8_t = n, struct plt_tel_data *d) > } > > if (roc_model_is_cn9k()) > - nix_sq_ctx_cn9k(&qctx, d); > + nix_sq_ctx_cn9k(qctx, d); > else > - nix_sq_ctx(&qctx, d); > + nix_sq_ctx(qctx, d); > > return 0; > } > -- > 2.28.0 >