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 11247A0553 for ; Fri, 10 Jun 2022 15:07:55 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 081E0427F9; Fri, 10 Jun 2022 15:07:55 +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 DD6BC40689 for ; Fri, 10 Jun 2022 15:07:52 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1654866472; 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=VW6xzifOvseJCQc+KJqn4qYiiuHiZoA7s+mRLPuFWknBDxD5+MzaaCFVxyfvjVP69jlrA1 BSgJhAxjMrHejMoUue+dz3eIHlqaCRQbmVXBnFM4VrbB0Jrg+OB8Ts0d5h29FYUT5AdMrI bTQfIP9kcYbMrrVpYyNVSuzxOi+fMNY= Received: from mail-lj1-f200.google.com (mail-lj1-f200.google.com [209.85.208.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-586--6mvEZ7pMSedDAvYit9-YA-1; Fri, 10 Jun 2022 09:07:28 -0400 X-MC-Unique: -6mvEZ7pMSedDAvYit9-YA-1 Received: by mail-lj1-f200.google.com with SMTP id z10-20020a05651c022a00b00255a0bf5ccfso3148709ljn.13 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=pFiAvRobnVAan0qIGyHySHlucE0ksvAEUenA/D8pDiJJzGu9ibVkHWIigptLnr5k0n eIpav2RdcAza5ij/MVHU7G7mwUAPOEJ4fx9+mqcZSaH8MXLbd34wdSPrDnaKVixvc7ft 7zF/ipKaqpMXAYydV42iPW0NQorzJpxv7IzL/URL5aRWoJxGNDL2R335FO/WE2JZn9Z+ wq7eFj1KOpaMp9nsNQxppiitFoYrXLNO81RNKU564prRrP4QI2AeWXdAENoUWVsCudia gc3WEFcUtBEeMk8PrDn9ZANR8WFKZiQTj7BWnD86Wq9WenG8KJvg22OLVcozqNzlFb7r eyXw== X-Gm-Message-State: AOAM532LiPDY5SNBbccfp8qV0PaDlwHy2cqF6EicKFkedZV4+S+u2Ypz LzMVOYFlgJcUA027FjGzkdqIVNH/32L32sBy7/xqIgvYe7v3S94tl4NntR+bExZH6msO2rGwMO9 SqW1J3UDXqhaw+cIMeZ1O9Zk= X-Received: by 2002:ac2:5201:0:b0:479:3923:9559 with SMTP id a1-20020ac25201000000b0047939239559mr17000729lfl.553.1654866446665; 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: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-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