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 29134A0553; Fri, 10 Jun 2022 15:07:31 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0B4194069C; Fri, 10 Jun 2022 15:07:31 +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 E149140689 for ; Fri, 10 Jun 2022 15:07:29 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1654866449; 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=DoO9d7GNMLWXxYd8hcNw4au0/9/9cd5nOrW04wQATdo=; b=RhJu9EdszQIQuLhE9cNVmc5CKGT5y4pOzxeDcbwySa1gU1FuccKjX6sfQzVaOhSOP3u7IS p0HopNa0eex7j25WVEauCJguc9BOT5YmOW8XFN1nnjEsgfFvX3zCvCjj5YsamnMUbLzPj1 9OVIVLRrYNUyFGC5tNfdj/+TRM/RCPU= Received: from mail-lf1-f69.google.com (mail-lf1-f69.google.com [209.85.167.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-668-1TpU0ZNZNAuuYkZyn83w0w-1; Fri, 10 Jun 2022 09:07:28 -0400 X-MC-Unique: 1TpU0ZNZNAuuYkZyn83w0w-1 Received: by mail-lf1-f69.google.com with SMTP id d37-20020a0565123d2500b0047c62294e85so2522187lfv.4 for ; Fri, 10 Jun 2022 06:07:28 -0700 (PDT) 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=DoO9d7GNMLWXxYd8hcNw4au0/9/9cd5nOrW04wQATdo=; b=kq1zp5//HZfDhsMo4No08/UasBy8OG63CMOZUPAfz5VeWzxOzWjpN/O85AM2D4vkkW qEp5IK69VVyRKVNBqu5DBdTQf5zUkG/2D1KsryIrgT44Db4QRWFlCCwSL/TqxJjWPuK+ jLP8lRyIclkEbDFxeV8WuofxAbRBp6Bv4VZRk5w/F/z8UDf8iUMT7deByxrb4kOJxU6Z /1PSJxn6jnhZlTTVFwOURapllqOlWCm6+9kHfwkPpwU5abzcOwDuzw9rbF8BDBoGL1A+ C19XycvnrSLuQisxhDPWfQGrlGm0RSYR2ouH6I11LXWSn6AtibdLmWSUEd3yIJJi1uNa LkRw== X-Gm-Message-State: AOAM532gPdZvc8UVV4Opq4fDtcRCKFMjzY62oCNO4nsQnWveXMbUX/eO lbXiBnUPGK3o5bZsjwLtf18bdjw0tkAcQD8JVcJmgO8uWitVRAVuO1X8/kQp4TM6oCBfY1rcHk2 ykni2G5Zx2qwxZ6yKiWY= X-Received: by 2002:ac2:5201:0:b0:479:3923:9559 with SMTP id a1-20020ac25201000000b0047939239559mr17000738lfl.553.1654866446751; Fri, 10 Jun 2022 06:07:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy94EiS1EsV6UToYZxheeh0lxJzI3S+Ji95XGITuCMVlT0j6x+MoYNRl/JORAN6hK2+dx41R8rFm1RsNR+/Pas= X-Received: by 2002:ac2:5201:0:b0:479:3923:9559 with SMTP id a1-20020ac25201000000b0047939239559mr17000718lfl.553.1654866446463; Fri, 10 Jun 2022 06:07:26 -0700 (PDT) MIME-Version: 1.0 References: <20220518101657.1230416-1-david.marchand@redhat.com> <20220518101657.1230416-4-david.marchand@redhat.com> In-Reply-To: From: David Marchand Date: Fri, 10 Jun 2022 15:07:14 +0200 Message-ID: Subject: Re: [PATCH 03/12] crypto/ipsec_mb: fix build with GCC 12 To: Fan Zhang , Pablo de Lara Cc: dev , Thomas Monjalon , Ferruh Yigit , dpdk stable , Deepak Kumar Jain , Bruce Richardson Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=dmarchan@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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 Thu, Jun 2, 2022 at 11:50 AM Bruce Richardson wrote: > > On Wed, May 18, 2022 at 12:16:48PM +0200, David Marchand wrote: > > GCC 12 raises the following warning: > > > > In function =E2=80=98__rte_ring_enqueue_elems_64=E2=80=99, > > inlined from =E2=80=98__rte_ring_enqueue_elems=E2=80=99 at > > ../lib/ring/rte_ring_elem_pvt.h:130:3, > > inlined from =E2=80=98__rte_ring_do_hts_enqueue_elem=E2=80=99 at > > ../lib/ring/rte_ring_hts_elem_pvt.h:196:3, > > inlined from =E2=80=98rte_ring_mp_hts_enqueue_burst_elem=E2=80=99 a= t > > ../lib/ring/rte_ring_hts.h:110:9, > > inlined from =E2=80=98rte_ring_enqueue_burst_elem=E2=80=99 at > > ../lib/ring/rte_ring_elem.h:577:10, > > inlined from =E2=80=98rte_ring_enqueue_burst=E2=80=99 at > > ../lib/ring/rte_ring.h:738:9, > > inlined from =E2=80=98process_op_bit=E2=80=99 at > > ../drivers/crypto/ipsec_mb/pmd_snow3g.c:425:16, > > inlined from =E2=80=98snow3g_pmd_dequeue_burst=E2=80=99 at > > ../drivers/crypto/ipsec_mb/pmd_snow3g.c:484:20: > > ../lib/ring/rte_ring_elem_pvt.h:68:44: error: array subscript 1 is > > outside array bounds of =E2=80=98struct rte_crypto_op[0]=E2=80= =99 > > [-Werror=3Darray-bounds] > > 68 | ring[idx + 1] =3D obj[i + 1]; > > | ~~~^~~~~~~ > > ../drivers/crypto/ipsec_mb/pmd_snow3g.c: In function > > =E2=80=98snow3g_pmd_dequeue_burst=E2=80=99: > > ../drivers/crypto/ipsec_mb/pmd_snow3g.c:434:1: note: > > at offset 8 into object =E2=80=98op=E2=80=99 of size 8 > > 434 | snow3g_pmd_dequeue_burst(void *queue_pair, > > | ^~~~~~~~~~~~~~~~~~~~~~~~ > > > > Validate that one (exactly) op has been processed or return early. > > > > Fixes: b537abdbee74 ("crypto/snow3g: support bit-level operations") > > Cc: stable@dpdk.org > > > > Signed-off-by: David Marchand > > --- > > drivers/crypto/ipsec_mb/pmd_snow3g.c | 7 ++++--- > > 1 file changed, 4 insertions(+), 3 deletions(-) > > > > diff --git a/drivers/crypto/ipsec_mb/pmd_snow3g.c b/drivers/crypto/ipse= c_mb/pmd_snow3g.c > > index ebc9a0b562..9a85f46721 100644 > > --- a/drivers/crypto/ipsec_mb/pmd_snow3g.c > > +++ b/drivers/crypto/ipsec_mb/pmd_snow3g.c > > @@ -422,12 +422,13 @@ process_op_bit(struct rte_crypto_op *op, struct s= now3g_session *session, > > op->sym->session =3D NULL; > > } > > > > - enqueued_op =3D rte_ring_enqueue_burst(qp->ingress_queue, > > - (void **)&op, processed_op, NULL); > > + if (unlikely(processed_op !=3D 1)) > > + return 0; > > + enqueued_op =3D rte_ring_enqueue(qp->ingress_queue, op); > > As a fix for the compiler warning this looks ok, but question for > maintainer would be - should this check for processed_op !=3D 1 not go > earlier in the function, immediately after the switch statement? > > Fan, Pablo, can you please comment? Fan? Pablo? --=20 David Marchand