From patchwork Wed May 18 10:16:46 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: David Marchand X-Patchwork-Id: 111296 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id C5064A0503; Wed, 18 May 2022 12:17:20 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B5D4140A7D; Wed, 18 May 2022 12:17:20 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mails.dpdk.org (Postfix) with ESMTP id C965F40223 for ; Wed, 18 May 2022 12:17:18 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1652869038; 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=r1gzZPUhkD+PahiC0fyjQz11WzrBicMP3lZcF7ycEZM=; b=gz85Bve0tmQmbX2GKTebQv91YZTPgeaci7pE0untJuOp1rQmaEZ3pGjollx3tkvTuX6GUq poR0bEa6SzH0xIZXfuPbFks4CBjQbz0quBtGtH6qLFRqwfL4XadwDqtxlsAlPP82QMP2iT yuY7xUVhvWq/5hpU2tnO7O1XiNViE58= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-267-1EdqMOWDPvqWREaXTLIWKA-1; Wed, 18 May 2022 06:17:17 -0400 X-MC-Unique: 1EdqMOWDPvqWREaXTLIWKA-1 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 9FF5F800882; Wed, 18 May 2022 10:17:16 +0000 (UTC) Received: from fchome.home (unknown [10.40.195.61]) by smtp.corp.redhat.com (Postfix) with ESMTP id 120AC492C14; Wed, 18 May 2022 10:17:13 +0000 (UTC) From: David Marchand To: dev@dpdk.org Cc: thomas@monjalon.net, ferruh.yigit@xilinx.com, stable@dpdk.org, Anoob Joseph Subject: [PATCH 01/12] common/cpt: fix build with GCC 12 Date: Wed, 18 May 2022 12:16:46 +0200 Message-Id: <20220518101657.1230416-2-david.marchand@redhat.com> In-Reply-To: <20220518101657.1230416-1-david.marchand@redhat.com> References: <20220518101657.1230416-1-david.marchand@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.85 on 10.11.54.10 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=david.marchand@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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 GCC 12 raises the following warning: In function ‘fill_sg_comp_from_iov’, inlined from ‘cpt_kasumi_enc_prep’ at ../drivers/common/cpt/cpt_ucode.h:2176:8, inlined from ‘cpt_fc_enc_hmac_prep’ at ../drivers/common/cpt/cpt_ucode.h:2475:3, inlined from ‘fill_digest_params’ at ../drivers/common/cpt/cpt_ucode.h:3548:14, inlined from ‘otx_cpt_enq_single_sym’ at ../drivers/crypto/octeontx/otx_cryptodev_ops.c:541:9, inlined from ‘otx_cpt_enq_single_sym_sessless’ at ../drivers/crypto/octeontx/otx_cryptodev_ops.c:584:8, inlined from ‘otx_cpt_enq_single’ at ../drivers/crypto/octeontx/otx_cryptodev_ops.c:611:11, inlined from ‘otx_cpt_pkt_enqueue’ at ../drivers/crypto/octeontx/otx_cryptodev_ops.c:643:9, inlined from ‘otx_cpt_enqueue_sym’ at ../drivers/crypto/octeontx/otx_cryptodev_ops.c:668:9: ../drivers/common/cpt/cpt_ucode.h:415:36: error: array subscript 0 is outside array bounds of ‘buf_ptr_t[0]’ {aka ‘struct buf_ptr[]’} [-Werror=array-bounds] 415 | e_dma_addr = bufs[j].dma_addr; | ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~ ../drivers/common/cpt/cpt_ucode.h:416:48: error: array subscript 0 is outside array bounds of ‘buf_ptr_t[0]’ {aka ‘struct buf_ptr[]’} [-Werror=array-bounds] 416 | e_len = (size > bufs[j].size) ? | ~~~~~~~^~~~~ For now, waive this warning until we have a proper fix. Cc: stable@dpdk.org Signed-off-by: David Marchand --- drivers/common/cpt/cpt_ucode.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/common/cpt/cpt_ucode.h b/drivers/common/cpt/cpt_ucode.h index e1f2f6005d..bdf72b400c 100644 --- a/drivers/common/cpt/cpt_ucode.h +++ b/drivers/common/cpt/cpt_ucode.h @@ -412,9 +412,17 @@ fill_sg_comp_from_iov(sg_comp_t *list, (bufs[j].size - from_offset) : size; from_offset = 0; } else { +/* FIXME */ +#if defined(RTE_TOOLCHAIN_GCC) && (GCC_VERSION >= 120000) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Warray-bounds" +#endif e_dma_addr = bufs[j].dma_addr; e_len = (size > bufs[j].size) ? bufs[j].size : size; +#if defined(RTE_TOOLCHAIN_GCC) && (GCC_VERSION >= 120000) +#pragma GCC diagnostic pop +#endif } to->u.s.len[i % 4] = rte_cpu_to_be_16(e_len); From patchwork Wed May 18 10:16:47 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: David Marchand X-Patchwork-Id: 111297 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id CAD7EA0503; Wed, 18 May 2022 12:17:31 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id BEA2042B6F; Wed, 18 May 2022 12:17: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 A08BC42B6F for ; Wed, 18 May 2022 12:17:29 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1652869049; 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=ejUhMeQFqmngUgfCLS2z8WN0CMQF8urs4BnEDBdkFOw=; b=M2uLpvx3LKpwH6DfHMTAmDGXmmIPD4yF6unr/r7052B/JXMSatZVBEHRqHu2QF6gHQnPkv hL+TByZYTPTIDCDyu7tx0wEY374QolXIfjFR/e6YZPjqPHQwoOy3v4vr3wyz6Wqd+k/5al hhJQECBBflkXrCvdBFERr4TamCOBLVY= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-620-PYj_0cdfNViRtx72D5jEkw-1; Wed, 18 May 2022 06:17:26 -0400 X-MC-Unique: PYj_0cdfNViRtx72D5jEkw-1 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 6DE2B811E78; Wed, 18 May 2022 10:17:25 +0000 (UTC) Received: from fchome.home (unknown [10.40.195.61]) by smtp.corp.redhat.com (Postfix) with ESMTP id 28357492C14; Wed, 18 May 2022 10:17:21 +0000 (UTC) From: David Marchand To: dev@dpdk.org Cc: thomas@monjalon.net, ferruh.yigit@xilinx.com, stable@dpdk.org, Ankur Dwivedi , Anoob Joseph , Tejasree Kondoj Subject: [PATCH 02/12] crypto/cnxk: fix build with GCC 12 Date: Wed, 18 May 2022 12:16:47 +0200 Message-Id: <20220518101657.1230416-3-david.marchand@redhat.com> In-Reply-To: <20220518101657.1230416-1-david.marchand@redhat.com> References: <20220518101657.1230416-1-david.marchand@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.85 on 10.11.54.10 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=david.marchand@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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 GCC 12 raises the following warning: In file included from ../drivers/crypto/cnxk/cn10k_cryptodev_ops.c:17: In function ‘fill_sg_comp_from_iov’, inlined from ‘cpt_kasumi_enc_prep’ at ../drivers/crypto/cnxk/cnxk_se.h:1413:8, inlined from ‘cpt_fc_enc_hmac_prep’ at ../drivers/crypto/cnxk/cnxk_se.h:1635:9, inlined from ‘fill_digest_params’ at ../drivers/crypto/cnxk/cnxk_se.h:2524:8, inlined from ‘cpt_sym_inst_fill’ at ../drivers/crypto/cnxk/cn10k_cryptodev_ops.c:92:9, inlined from ‘cn10k_cpt_fill_inst.constprop.isra’ at ../drivers/crypto/cnxk/cn10k_cryptodev_ops.c:146:10: ../drivers/crypto/cnxk/cnxk_se.h:208:52: error: array subscript 0 is outside array bounds of ‘struct roc_se_buf_ptr[0]’ [-Werror=array-bounds] 208 | e_vaddr = (uint64_t)bufs[j].vaddr; | ~~~~~~~^~~~~~ ../drivers/crypto/cnxk/cnxk_se.h:209:48: error: array subscript 0 is outside array bounds of ‘struct roc_se_buf_ptr[0]’ [-Werror=array-bounds] 209 | e_len = (size > bufs[j].size) ? bufs[j].size : size; | ~~~~~~~^~~~~ For now, waive this warning until we have a proper fix. Cc: stable@dpdk.org Signed-off-by: David Marchand --- drivers/crypto/cnxk/cnxk_se.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/crypto/cnxk/cnxk_se.h b/drivers/crypto/cnxk/cnxk_se.h index ce7ca2eda9..c9d147601f 100644 --- a/drivers/crypto/cnxk/cnxk_se.h +++ b/drivers/crypto/cnxk/cnxk_se.h @@ -205,8 +205,16 @@ fill_sg_comp_from_iov(struct roc_se_sglist_comp *list, uint32_t i, size; from_offset = 0; } else { +/* FIXME */ +#if defined(RTE_TOOLCHAIN_GCC) && (GCC_VERSION >= 120000) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Warray-bounds" +#endif e_vaddr = (uint64_t)bufs[j].vaddr; e_len = (size > bufs[j].size) ? bufs[j].size : size; +#if defined(RTE_TOOLCHAIN_GCC) && (GCC_VERSION >= 120000) +#pragma GCC diagnostic pop +#endif } to->u.s.len[i % 4] = rte_cpu_to_be_16(e_len); From patchwork Wed May 18 10:16:48 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: David Marchand X-Patchwork-Id: 111298 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 607B4A0503; Wed, 18 May 2022 12:17:36 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C44FA42B74; Wed, 18 May 2022 12:17:34 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mails.dpdk.org (Postfix) with ESMTP id A88EF42B76 for ; Wed, 18 May 2022 12:17:33 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1652869053; 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=xedkle9ETY5HnDA6EV9aXPh13s7Qm6ZQYYFcxVq9Ynk=; b=GIGtjMuYtfQcIKSVHX3XGh5Km0kT0SAyq1NFJXddVTYb9SKzxMqhRtHx1Fgy+Gc1jAubKq 6JC90dLZIgqpk6KFv6LdASGrok18mAasEEESFIn1duMZJVg6DUSR+bb8/+teWneRykh+u7 AQPotgAp6dxtTGZPFquOhltM34z9VN8= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-471-Dhp7OabkPsauPVd39VhtWg-1; Wed, 18 May 2022 06:17:31 -0400 X-MC-Unique: Dhp7OabkPsauPVd39VhtWg-1 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 6EB24100BAA1; Wed, 18 May 2022 10:17:31 +0000 (UTC) Received: from fchome.home (unknown [10.40.195.61]) by smtp.corp.redhat.com (Postfix) with ESMTP id 373EB492C14; Wed, 18 May 2022 10:17:28 +0000 (UTC) From: David Marchand To: dev@dpdk.org Cc: thomas@monjalon.net, ferruh.yigit@xilinx.com, stable@dpdk.org, Fan Zhang , Pablo de Lara , Deepak Kumar Jain Subject: [PATCH 03/12] crypto/ipsec_mb: fix build with GCC 12 Date: Wed, 18 May 2022 12:16:48 +0200 Message-Id: <20220518101657.1230416-4-david.marchand@redhat.com> In-Reply-To: <20220518101657.1230416-1-david.marchand@redhat.com> References: <20220518101657.1230416-1-david.marchand@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.85 on 10.11.54.10 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=david.marchand@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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 GCC 12 raises the following warning: In function ‘__rte_ring_enqueue_elems_64’, inlined from ‘__rte_ring_enqueue_elems’ at ../lib/ring/rte_ring_elem_pvt.h:130:3, inlined from ‘__rte_ring_do_hts_enqueue_elem’ at ../lib/ring/rte_ring_hts_elem_pvt.h:196:3, inlined from ‘rte_ring_mp_hts_enqueue_burst_elem’ at ../lib/ring/rte_ring_hts.h:110:9, inlined from ‘rte_ring_enqueue_burst_elem’ at ../lib/ring/rte_ring_elem.h:577:10, inlined from ‘rte_ring_enqueue_burst’ at ../lib/ring/rte_ring.h:738:9, inlined from ‘process_op_bit’ at ../drivers/crypto/ipsec_mb/pmd_snow3g.c:425:16, inlined from ‘snow3g_pmd_dequeue_burst’ 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 ‘struct rte_crypto_op[0]’ [-Werror=array-bounds] 68 | ring[idx + 1] = obj[i + 1]; | ~~~^~~~~~~ ../drivers/crypto/ipsec_mb/pmd_snow3g.c: In function ‘snow3g_pmd_dequeue_burst’: ../drivers/crypto/ipsec_mb/pmd_snow3g.c:434:1: note: at offset 8 into object ‘op’ 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 Acked-by: Stephen Hemminger --- 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/ipsec_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 snow3g_session *session, op->sym->session = NULL; } - enqueued_op = rte_ring_enqueue_burst(qp->ingress_queue, - (void **)&op, processed_op, NULL); + if (unlikely(processed_op != 1)) + return 0; + enqueued_op = rte_ring_enqueue(qp->ingress_queue, op); qp->stats.enqueued_count += enqueued_op; *accumulated_enqueued_ops += enqueued_op; - return enqueued_op; + return 1; } static uint16_t From patchwork Wed May 18 10:16:49 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: David Marchand X-Patchwork-Id: 111299 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id DD786A0503; Wed, 18 May 2022 12:17:43 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D189C42B7E; Wed, 18 May 2022 12:17:43 +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 726FE42B7C for ; Wed, 18 May 2022 12:17:42 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1652869062; 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=SpBsPtfJXg7uFYb7ZVgI2WwOY7y/aEYXx7lzo3SrJ9w=; b=J+YQXtkaH5fgM7ZyjcvJoqbm1rv/QIFblhgY4GziuPy9xknR9RSvhAhMsfzlYX6I9YJNG7 TJNM1VvXBocYwbOqCtj3gOi72OY/QgR71bi46P0k+gJCzi6xKAKSMoLCe+HdwFOK7jYsMo COfNzYQzobe9xIs35mbLg/LPFIDe8XM= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-494-svzbCtz4O2yYhEn8YWXHGg-1; Wed, 18 May 2022 06:17:39 -0400 X-MC-Unique: svzbCtz4O2yYhEn8YWXHGg-1 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 7115A3C16193; Wed, 18 May 2022 10:17:38 +0000 (UTC) Received: from fchome.home (unknown [10.40.195.61]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6EF76492C14; Wed, 18 May 2022 10:17:34 +0000 (UTC) From: David Marchand To: dev@dpdk.org Cc: thomas@monjalon.net, ferruh.yigit@xilinx.com, stable@dpdk.org, Marcin Wojtas , Michal Krawczyk , Shai Brandes , Evgeny Schemeilin , Igor Chauskin Subject: [PATCH 04/12] net/ena: fix build with GCC 12 Date: Wed, 18 May 2022 12:16:49 +0200 Message-Id: <20220518101657.1230416-5-david.marchand@redhat.com> In-Reply-To: <20220518101657.1230416-1-david.marchand@redhat.com> References: <20220518101657.1230416-1-david.marchand@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.85 on 10.11.54.10 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=david.marchand@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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 GCC 12 raises the following warning: In file included from ../lib/mempool/rte_mempool.h:46, from ../lib/mbuf/rte_mbuf.h:38, from ../lib/net/rte_ether.h:22, from ../drivers/net/ena/ena_ethdev.h:10, from ../drivers/net/ena/ena_rss.c:6: ../drivers/net/ena/ena_rss.c: In function ‘ena_rss_key_fill’: ../lib/eal/x86/include/rte_memcpy.h:370:9: warning: array subscript 64 is outside array bounds of ‘uint8_t[40]’ {aka ‘unsigned char[40]’} [-Warray-bounds] 370 | rte_mov32((uint8_t *)dst + 2 * 32, (const uint8_t *)src + 2 * 32); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ../drivers/net/ena/ena_rss.c:51:24: note: while referencing ‘default_key’ 51 | static uint8_t default_key[ENA_HASH_KEY_SIZE]; | ^~~~~~~~~~~ This is a false positive because the copied size is checked against ENA_HASH_KEY_SIZE in a (build) assert. Silence this warning by calling memcpy with the minimal size. Cc: stable@dpdk.org Signed-off-by: David Marchand Acked-by: Stephen Hemminger --- drivers/net/ena/ena_rss.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/net/ena/ena_rss.c b/drivers/net/ena/ena_rss.c index b6c4f76e38..b682d01c20 100644 --- a/drivers/net/ena/ena_rss.c +++ b/drivers/net/ena/ena_rss.c @@ -51,15 +51,14 @@ void ena_rss_key_fill(void *key, size_t size) static uint8_t default_key[ENA_HASH_KEY_SIZE]; size_t i; - RTE_ASSERT(size <= ENA_HASH_KEY_SIZE); - if (!key_generated) { - for (i = 0; i < ENA_HASH_KEY_SIZE; ++i) + for (i = 0; i < RTE_DIM(default_key); ++i) default_key[i] = rte_rand() & 0xff; key_generated = true; } - rte_memcpy(key, default_key, size); + RTE_ASSERT(size <= sizeof(default_key)); + rte_memcpy(key, default_key, RTE_MIN(size, sizeof(default_key))); } int ena_rss_reta_update(struct rte_eth_dev *dev, From patchwork Wed May 18 10:16:50 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: David Marchand X-Patchwork-Id: 111300 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id F0240A0503; Wed, 18 May 2022 12:17:49 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C84F342B7C; Wed, 18 May 2022 12:17:47 +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 D461242B7C for ; Wed, 18 May 2022 12:17:46 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1652869066; 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=kYkte8g+iQLXO5VsFitqTI3owdfv6sMTeeMCZFnmLGY=; b=gIySbALkSQmn4laDqimM9oz+Ej4WS8867yhGZ8svpm5XHMdVPGvLM0AMC8PLuBYYgNbbUg e8EkTliEvrCL2YAOz5aGR9evlMdR83hZJwoJvV+wscfDnnJ/6NCYBcZ0rtq+q5fuHpygzq DnVjHi1kZjhhN1FG0sDfWh0htWxrXxA= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-562-yuv1_gaeNdCs6b96toT1-Q-1; Wed, 18 May 2022 06:17:45 -0400 X-MC-Unique: yuv1_gaeNdCs6b96toT1-Q-1 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id DFB541C06901; Wed, 18 May 2022 10:17:44 +0000 (UTC) Received: from fchome.home (unknown [10.40.195.61]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4C4CB401E98; Wed, 18 May 2022 10:17:40 +0000 (UTC) From: David Marchand To: dev@dpdk.org Cc: thomas@monjalon.net, ferruh.yigit@xilinx.com, stable@dpdk.org, Apeksha Gupta , Sachin Saxena Subject: [PATCH 05/12] net/enetfec: fix build with GCC 12 Date: Wed, 18 May 2022 12:16:50 +0200 Message-Id: <20220518101657.1230416-6-david.marchand@redhat.com> In-Reply-To: <20220518101657.1230416-1-david.marchand@redhat.com> References: <20220518101657.1230416-1-david.marchand@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.85 on 10.11.54.10 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=david.marchand@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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 GCC 12 raises the following warning: ../drivers/net/enetfec/enet_ethdev.c: In function ‘enetfec_rx_queue_setup’: ../drivers/net/enetfec/enet_ethdev.c:473:9: error: array subscript 1 is above array bounds of ‘uint32_t[1]’ {aka ‘unsigned int[1]’} [-Werror=array-bounds] 473 | rte_write32(rte_cpu_to_le_32(fep->bd_addr_p_r[queue_idx]), | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 474 | (uint8_t *)fep->hw_baseaddr_v + ENETFEC_RD_START(queue_idx)); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from ../drivers/net/enetfec/enet_ethdev.c:9: ../drivers/net/enetfec/enet_ethdev.h:113:33: note: while referencing ‘bd_addr_p_r’ 113 | uint32_t bd_addr_p_r[ENETFEC_MAX_Q]; | ^~~~~~~~~~~ This driver properly announces that it only supports 1 rxq. Silence this warning by adding an explicit check on the queue id. Cc: stable@dpdk.org Signed-off-by: David Marchand Acked-by: Stephen Hemminger Acked-by: Sachin Saxena --- drivers/net/enetfec/enet_ethdev.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/net/enetfec/enet_ethdev.c b/drivers/net/enetfec/enet_ethdev.c index 714f8ac7ec..c938e58204 100644 --- a/drivers/net/enetfec/enet_ethdev.c +++ b/drivers/net/enetfec/enet_ethdev.c @@ -2,9 +2,12 @@ * Copyright 2020-2021 NXP */ +#include + #include #include #include + #include "enet_pmd_logs.h" #include "enet_ethdev.h" #include "enet_regs.h" @@ -454,6 +457,12 @@ enetfec_rx_queue_setup(struct rte_eth_dev *dev, return -EINVAL; } + if (queue_idx >= ENETFEC_MAX_Q) { + ENETFEC_PMD_ERR("Invalid queue id %" PRIu16 ", max %d\n", + queue_idx, ENETFEC_MAX_Q); + return -EINVAL; + } + /* allocate receive queue */ rxq = rte_zmalloc(NULL, sizeof(*rxq), RTE_CACHE_LINE_SIZE); if (rxq == NULL) { From patchwork Wed May 18 10:16:51 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: David Marchand X-Patchwork-Id: 111301 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 39FCFA0503; Wed, 18 May 2022 12:18:00 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2D96042B8C; Wed, 18 May 2022 12:18:00 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mails.dpdk.org (Postfix) with ESMTP id 7E30442B6D for ; Wed, 18 May 2022 12:17:58 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1652869078; 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=z24jm2/YWnWtt9eq46RD5dFRTH/aF5UVMwulkzXtM4k=; b=ep73I5RU4wA5FWRjBeSdQhHmZLuEtflv8qaCQ7FfAKGXAMryRLofPC2hGTnF49J9XnxOih 7QWna0ns5wEERNqRVFq47brsbuPf8ZBxEg3UXLoyOD1tDg8LGsBYvs4sMAkLaFbYSSufhz mdB74enUluce0NuZmPKDdN1ZtdKY0Y8= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-617-4qzZuGeoMO-T42og_45nCg-1; Wed, 18 May 2022 06:17:52 -0400 X-MC-Unique: 4qzZuGeoMO-T42og_45nCg-1 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 5F15D811E78; Wed, 18 May 2022 10:17:52 +0000 (UTC) Received: from fchome.home (unknown [10.40.195.61]) by smtp.corp.redhat.com (Postfix) with ESMTP id 17813492C14; Wed, 18 May 2022 10:17:48 +0000 (UTC) From: David Marchand To: dev@dpdk.org Cc: thomas@monjalon.net, ferruh.yigit@xilinx.com, stable@dpdk.org, Qiming Yang , Qi Zhang Subject: [PATCH 06/12] net/ice: fix build with GCC 12 Date: Wed, 18 May 2022 12:16:51 +0200 Message-Id: <20220518101657.1230416-7-david.marchand@redhat.com> In-Reply-To: <20220518101657.1230416-1-david.marchand@redhat.com> References: <20220518101657.1230416-1-david.marchand@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.85 on 10.11.54.10 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=david.marchand@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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 GCC 12 raises the following warning: In file included from ../lib/mempool/rte_mempool.h:46, from ../lib/mbuf/rte_mbuf.h:38, from ../lib/net/rte_ether.h:22, from ../lib/ethdev/rte_ethdev.h:172, from ../lib/ethdev/ethdev_driver.h:22, from ../lib/ethdev/ethdev_pci.h:17, from ../drivers/net/ice/ice_ethdev.c:6: ../drivers/net/ice/ice_ethdev.c: In function ‘ice_dev_configure’: ../lib/eal/x86/include/rte_memcpy.h:370:9: warning: array subscript 64 is outside array bounds of ‘struct ice_aqc_get_set_rss_keys[1]’ [-Warray-bounds] 370 | rte_mov32((uint8_t *)dst + 2 * 32, (const uint8_t *)src + 2 * 32); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ../drivers/net/ice/ice_ethdev.c:3202:41: note: while referencing ‘key’ 3202 | struct ice_aqc_get_set_rss_keys key; | ^~~ Restrict copy to minimum size. Cc: stable@dpdk.org Signed-off-by: David Marchand Acked-by: Stephen Hemminger --- drivers/net/ice/ice_ethdev.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/ice/ice_ethdev.c b/drivers/net/ice/ice_ethdev.c index 00ac2bb191..d69d480268 100644 --- a/drivers/net/ice/ice_ethdev.c +++ b/drivers/net/ice/ice_ethdev.c @@ -3263,7 +3263,8 @@ static int ice_init_rss(struct ice_pf *pf) RTE_MIN(rss_conf->rss_key_len, vsi->rss_key_size)); - rte_memcpy(key.standard_rss_key, vsi->rss_key, vsi->rss_key_size); + rte_memcpy(key.standard_rss_key, vsi->rss_key, + RTE_MIN(sizeof(key.standard_rss_key), vsi->rss_key_size)); ret = ice_aq_set_rss_key(hw, vsi->idx, &key); if (ret) goto out; From patchwork Wed May 18 10:16:52 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: David Marchand X-Patchwork-Id: 111302 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id D51B8A0503; Wed, 18 May 2022 12:18:08 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A234842B9B; Wed, 18 May 2022 12:18:04 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mails.dpdk.org (Postfix) with ESMTP id 7656040A7D for ; Wed, 18 May 2022 12:18:03 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1652869083; 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=LM/x7PulAV6h9ltzVEzlSvTBhCc7hLQBO4EZnodeW2o=; b=asumr7171V8ja07u0w1BlrH4cOcbj1oKruQrZeDdvY++q0F+VXIkSjZNKSye2qXDtasl93 ojbkMo1BZT9cBj0ygQ7GsAO2WXwipvbwFLjieBwUw/7xMmQIUjB3Vxz7GxoTRuBThCEpRS eu46hFscjrZbdWQyyd15Q2AYxiIiyhg= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-507-e9ocsnDiMsGEakWkMaMqFA-1; Wed, 18 May 2022 06:17:57 -0400 X-MC-Unique: e9ocsnDiMsGEakWkMaMqFA-1 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 6361B185A7B2; Wed, 18 May 2022 10:17:57 +0000 (UTC) Received: from fchome.home (unknown [10.40.195.61]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3A7F2492C14; Wed, 18 May 2022 10:17:54 +0000 (UTC) From: David Marchand To: dev@dpdk.org Cc: thomas@monjalon.net, ferruh.yigit@xilinx.com, stable@dpdk.org, Qiming Yang , Qi Zhang Subject: [PATCH 07/12] net/ice/base: fix build with GCC 12 Date: Wed, 18 May 2022 12:16:52 +0200 Message-Id: <20220518101657.1230416-8-david.marchand@redhat.com> In-Reply-To: <20220518101657.1230416-1-david.marchand@redhat.com> References: <20220518101657.1230416-1-david.marchand@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.85 on 10.11.54.10 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=david.marchand@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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 GCC 12 raises the following warning: ../drivers/net/ice/base/ice_switch.c: In function ‘ice_add_sw_recipe’: ../drivers/net/ice/base/ice_switch.c:7219:61: error: writing 1 byte into a region of size 0 [-Werror=stringop-overflow=] 7219 | buf[recps].content.lkup_indx[i + 1] = entry->fv_idx[i]; | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~ In file included from ../drivers/net/ice/base/ice_controlq.h:8, from ../drivers/net/ice/base/ice_type.h:54, from ../drivers/net/ice/base/ice_common.h:8, from ../drivers/net/ice/base/ice_switch.h:8, from ../drivers/net/ice/base/ice_switch.c:5: ../drivers/net/ice/base/ice_adminq_cmd.h:744:12: note: at offset 5 into destination object ‘lkup_indx’ of size 5 744 | u8 lkup_indx[5]; | ^~~~~~~~~ Since this code is in the base driver, waive the check until the base driver is fixed by the relevant people. Cc: stable@dpdk.org Signed-off-by: David Marchand --- drivers/net/ice/base/meson.build | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/net/ice/base/meson.build b/drivers/net/ice/base/meson.build index 3cf4ce05fa..89d8c5eba1 100644 --- a/drivers/net/ice/base/meson.build +++ b/drivers/net/ice/base/meson.build @@ -40,6 +40,11 @@ if (toolchain == 'gcc' and cc.version().version_compare('>=11.0.0')) error_cflags += ['-Wno-array-bounds'] endif +# FIXME +if (toolchain == 'gcc' and cc.version().version_compare('>=12.0.0')) + error_cflags += ['-Wno-stringop-overflow'] +endif + if is_windows and cc.get_id() != 'clang' cflags += ['-fno-asynchronous-unwind-tables'] endif From patchwork Wed May 18 10:16:53 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: David Marchand X-Patchwork-Id: 111303 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id A0EFFA0503; Wed, 18 May 2022 12:18:14 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 92ED442B79; Wed, 18 May 2022 12:18:14 +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 F3E5242B6D for ; Wed, 18 May 2022 12:18:12 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1652869092; 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=dp47vNQsjcDqvx78LnQOiHpVNC0tzvJ86tJG/uIg9Ck=; b=ahCfT7TLnZgjme3dvXWg1jhej3OlbzJOG8GVKFTtR6avbEBbO9gw525VmFpcJhKbwc72X1 5fXqrzypd7FS69mhIvpbNSMz1r+QWrw/A5JGeVl2uZb8hkzp80mbBwJn5cZPNQPAtQQNFw 3t0vA3I/b4enoeuiaaMm+s0Qi7sl7V4= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-356-k7ZCweX_PwClvlTHG3fgxQ-1; Wed, 18 May 2022 06:18:03 -0400 X-MC-Unique: k7ZCweX_PwClvlTHG3fgxQ-1 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 870A43C1618C; Wed, 18 May 2022 10:18:03 +0000 (UTC) Received: from fchome.home (unknown [10.40.195.61]) by smtp.corp.redhat.com (Postfix) with ESMTP id 710BB492C14; Wed, 18 May 2022 10:18:00 +0000 (UTC) From: David Marchand To: dev@dpdk.org Cc: thomas@monjalon.net, ferruh.yigit@xilinx.com, stable@dpdk.org, Rasesh Mody , Devendra Singh Rawat Subject: [PATCH 08/12] net/qede/base: fix build with GCC 12 Date: Wed, 18 May 2022 12:16:53 +0200 Message-Id: <20220518101657.1230416-9-david.marchand@redhat.com> In-Reply-To: <20220518101657.1230416-1-david.marchand@redhat.com> References: <20220518101657.1230416-1-david.marchand@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.85 on 10.11.54.10 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=david.marchand@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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 GCC raises the following warning: In function ‘_mm256_storeu_si256’, inlined from ‘rte_mov32’ at ../lib/eal/x86/include/rte_memcpy.h:320:2, inlined from ‘rte_mov128’ at ../lib/eal/x86/include/rte_memcpy.h:342:2, inlined from ‘rte_memcpy_generic’ at ../lib/eal/x86/include/rte_memcpy.h:438:4, inlined from ‘rte_memcpy’ at ../lib/eal/x86/include/rte_memcpy.h:882:10, inlined from ‘__ecore_mcp_cmd_and_union’ at ../drivers/net/qede/base/ecore_mcp.c:541:3, inlined from ‘_ecore_mcp_cmd_and_union’ at ../drivers/net/qede/base/ecore_mcp.c:638:2, inlined from ‘ecore_mcp_cmd_and_union’ at ../drivers/net/qede/base/ecore_mcp.c:742:9: /usr/lib/gcc/x86_64-redhat-linux/12/include/avxintrin.h:935:8: error: array subscript 1 is outside array bounds of ‘union drv_union_data[1]’ [-Werror=array-bounds] 935 | *__P = __A; | ~~~~~^~~~~ ../drivers/net/qede/base/ecore_mcp.c: In function ‘ecore_mcp_cmd_and_union’: ../drivers/net/qede/base/ecore_mcp.c:533:30: note: at offset 32 into object ‘union_data’ of size 32 533 | union drv_union_data union_data; | ^~~~~~~~~~ Since this code is in the base driver, waive the check until the base driver is fixed by the relevant people. Cc: stable@dpdk.org Signed-off-by: David Marchand --- drivers/net/qede/base/meson.build | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/net/qede/base/meson.build b/drivers/net/qede/base/meson.build index 4ad177b478..c7b19be20a 100644 --- a/drivers/net/qede/base/meson.build +++ b/drivers/net/qede/base/meson.build @@ -44,6 +44,11 @@ error_cflags = [ '-Wno-sometimes-uninitialized', '-Wno-pointer-bool-conversion', ] +# FIXME +if (toolchain == 'gcc' and cc.version().version_compare('>=12.0.0')) + error_cflags += ['-Wno-array-bounds'] +endif + c_args = cflags foreach flag: error_cflags if cc.has_argument(flag) From patchwork Wed May 18 10:16:54 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: David Marchand X-Patchwork-Id: 111304 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 64D30A0503; Wed, 18 May 2022 12:18:20 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9E36542B8A; Wed, 18 May 2022 12:18:16 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mails.dpdk.org (Postfix) with ESMTP id 53B7D42B6F for ; Wed, 18 May 2022 12:18:14 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1652869093; 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=oZ/y7nclR7WR6EXfbowFZSQwikaaJO0W8mjCzaCSOfw=; b=D4L1C1MUmqlx4YCC0UUXa8azzzWZoHgwHJayPZMS6p47EiTOizl1F2VLlIweeONDMFExyl OzgwP6lhQr4/lR7wzo9QYY1fZbzT/mPW+7CKGA6lvmf6adRVxEwW/i6cCjEk31f42jlrOc 3aGhmbMLHpG4quBms4V2Phw0rlx0n4g= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-609-s2RfLtrANcSXyNvsyPkP6Q-1; Wed, 18 May 2022 06:18:10 -0400 X-MC-Unique: s2RfLtrANcSXyNvsyPkP6Q-1 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 4B62E3C1618C; Wed, 18 May 2022 10:18:10 +0000 (UTC) Received: from fchome.home (unknown [10.40.195.61]) by smtp.corp.redhat.com (Postfix) with ESMTP id 360A5492C14; Wed, 18 May 2022 10:18:06 +0000 (UTC) From: David Marchand To: dev@dpdk.org Cc: thomas@monjalon.net, ferruh.yigit@xilinx.com, stable@dpdk.org, Xiao Wang Subject: [PATCH 09/12] vdpa/ifc: fix build with GCC 12 Date: Wed, 18 May 2022 12:16:54 +0200 Message-Id: <20220518101657.1230416-10-david.marchand@redhat.com> In-Reply-To: <20220518101657.1230416-1-david.marchand@redhat.com> References: <20220518101657.1230416-1-david.marchand@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.85 on 10.11.54.10 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=david.marchand@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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 GCC 12 raises the following warning: ../drivers/vdpa/ifc/ifcvf_vdpa.c: In function ‘vdpa_enable_vfio_intr’: ../drivers/vdpa/ifc/ifcvf_vdpa.c:383:62: error: writing 4 bytes into a region of size 0 [-Werror=stringop-overflow=] 383 | fd_ptr[RTE_INTR_VEC_RXTX_OFFSET + i] = fd; | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~ ../drivers/vdpa/ifc/ifcvf_vdpa.c:348:14: note: at offset 32 into destination object ‘irq_set_buf’ of size 32 348 | char irq_set_buf[MSIX_IRQ_SET_BUF_LEN]; | ^~~~~~~~~~~ Validate number of vrings to avoid out of bound access. Cc: stable@dpdk.org Signed-off-by: David Marchand Acked-by: Xiao Wang Acked-by: Stephen Hemminger --- drivers/vdpa/ifc/ifcvf_vdpa.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/vdpa/ifc/ifcvf_vdpa.c b/drivers/vdpa/ifc/ifcvf_vdpa.c index 9f05595b6b..6708849bd3 100644 --- a/drivers/vdpa/ifc/ifcvf_vdpa.c +++ b/drivers/vdpa/ifc/ifcvf_vdpa.c @@ -354,6 +354,8 @@ vdpa_enable_vfio_intr(struct ifcvf_internal *internal, bool m_rx) vring.callfd = -1; nr_vring = rte_vhost_get_vring_num(internal->vid); + if (nr_vring > IFCVF_MAX_QUEUES * 2) + return -1; irq_set = (struct vfio_irq_set *)irq_set_buf; irq_set->argsz = sizeof(irq_set_buf); From patchwork Wed May 18 10:16:55 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: David Marchand X-Patchwork-Id: 111305 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id C8C86A0503; Wed, 18 May 2022 12:18:26 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9888442B93; Wed, 18 May 2022 12:18:21 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mails.dpdk.org (Postfix) with ESMTP id B198642B83 for ; Wed, 18 May 2022 12:18:19 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1652869099; 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=xLW0iJD6GeR0hQ9rJdpnM4aBxE0PFyoitbbs01ZptQE=; b=E04r2DP1hupwEVTm3lgUVlcDVJBBrYM2USk/mhxGnXHF0Z92gRASLmhqk7S7m8OPRNR6Ai PFjJWVhLgg0l2tqOwqG73V5exsqNY0qd/a0WotEMDFfH+UdB9HNEvAWtunpAcNBa8HOirg g9oTUgXlEFkyVWymzM44uvszuzW67AM= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-175-bCpT5B_gMsCgsI8IgZl44A-1; Wed, 18 May 2022 06:18:16 -0400 X-MC-Unique: bCpT5B_gMsCgsI8IgZl44A-1 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id CE3DE185A79C; Wed, 18 May 2022 10:18:15 +0000 (UTC) Received: from fchome.home (unknown [10.40.195.61]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9E72B401E98; Wed, 18 May 2022 10:18:12 +0000 (UTC) From: David Marchand To: dev@dpdk.org Cc: thomas@monjalon.net, ferruh.yigit@xilinx.com, stable@dpdk.org, Maxime Coquelin , Chenbo Xia , Fan Zhang Subject: [PATCH 10/12] vhost/crypto: fix build with GCC 12 Date: Wed, 18 May 2022 12:16:55 +0200 Message-Id: <20220518101657.1230416-11-david.marchand@redhat.com> In-Reply-To: <20220518101657.1230416-1-david.marchand@redhat.com> References: <20220518101657.1230416-1-david.marchand@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.85 on 10.11.54.10 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=david.marchand@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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 GCC 12 raises the following warning: In file included from ../lib/mempool/rte_mempool.h:46, from ../lib/mbuf/rte_mbuf.h:38, from ../lib/vhost/vhost_crypto.c:7: ../lib/vhost/vhost_crypto.c: In function ‘rte_vhost_crypto_fetch_requests’: ../lib/eal/x86/include/rte_memcpy.h:371:9: warning: array subscript 1 is outside array bounds of ‘struct virtio_crypto_op_data_req[1]’ [-Warray-bounds] 371 | rte_mov32((uint8_t *)dst + 3 * 32, (const uint8_t *)src + 3 * 32); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ../lib/vhost/vhost_crypto.c:1178:42: note: while referencing ‘req’ 1178 | struct virtio_crypto_op_data_req req; | ^~~ Check that copied length is within req boundaries. Fixes: 3c79609fda7c ("vhost/crypto: handle virtually non-contiguous buffers") Cc: stable@dpdk.org Signed-off-by: David Marchand Acked-by: Stephen Hemminger --- lib/vhost/vhost_crypto.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/vhost/vhost_crypto.c b/lib/vhost/vhost_crypto.c index b1c0eb6a0f..83325b7042 100644 --- a/lib/vhost/vhost_crypto.c +++ b/lib/vhost/vhost_crypto.c @@ -576,16 +576,16 @@ copy_data(void *dst_data, struct vhost_crypto_data_req *vc_req, uint32_t to_copy; uint8_t *data = dst_data; uint8_t *src; - int left = size; + uint32_t left = size; - to_copy = RTE_MIN(desc->len, (uint32_t)left); + to_copy = RTE_MIN(desc->len, left); dlen = to_copy; src = IOVA_TO_VVA(uint8_t *, vc_req, desc->addr, &dlen, VHOST_ACCESS_RO); - if (unlikely(!src || !dlen)) + if (unlikely(!src || !dlen || dlen > left)) return -1; - rte_memcpy((uint8_t *)data, src, dlen); + rte_memcpy(data, src, dlen); data += dlen; if (unlikely(dlen < to_copy)) { From patchwork Wed May 18 10:16:56 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: David Marchand X-Patchwork-Id: 111306 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 13BDBA0503; Wed, 18 May 2022 12:18:33 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id CAA7F42B84; Wed, 18 May 2022 12:18:24 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mails.dpdk.org (Postfix) with ESMTP id 945B942B97 for ; Wed, 18 May 2022 12:18:22 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1652869102; 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=LA10iG6lJdOGqsX75jLkP5aBiAcSyrwWxaX2eGOrcyc=; b=TPbP3VXNswNYS7a88rMvFUUlMXsoyiqvZp4dTQ/JS0ohynLK2nFVkjU98bMYTlv1qRxejk CUtqtRxaTZhsKczOGAeV7rnCNHwKhS3knEIG7UyWzz+biAgsI6DXDIqzOYjFDtLoDEbNlR ZO8md7WfPYIp5DnvidxbprQy010B1JI= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-447-mTpKFnx3Me6sJ_TJEngChw-1; Wed, 18 May 2022 06:18:21 -0400 X-MC-Unique: mTpKFnx3Me6sJ_TJEngChw-1 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 867173802B94; Wed, 18 May 2022 10:18:20 +0000 (UTC) Received: from fchome.home (unknown [10.40.195.61]) by smtp.corp.redhat.com (Postfix) with ESMTP id C8A1A492C14; Wed, 18 May 2022 10:18:17 +0000 (UTC) From: David Marchand To: dev@dpdk.org Cc: thomas@monjalon.net, ferruh.yigit@xilinx.com, stable@dpdk.org, Wisam Jaddo Subject: [PATCH 11/12] app/flow-perf: fix build with GCC 12 Date: Wed, 18 May 2022 12:16:56 +0200 Message-Id: <20220518101657.1230416-12-david.marchand@redhat.com> In-Reply-To: <20220518101657.1230416-1-david.marchand@redhat.com> References: <20220518101657.1230416-1-david.marchand@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.85 on 10.11.54.10 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=david.marchand@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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 GCC 12 raises the following warning: ../app/test-flow-perf/main.c: In function ‘start_forwarding’: ../app/test-flow-perf/main.c:1737:28: error: ‘sprintf’ may write a terminating nul past the end of the destination [-Werror=format-overflow=] 1737 | sprintf(p[i++], "%d", (int)n); | ^ In function ‘pretty_number’, inlined from ‘packet_per_second_stats’ at ../app/test-flow-perf/main.c:1792:4, inlined from ‘start_forwarding’ at ../app/test-flow-perf/main.c:1831:3: [...] We can simplify this code and rely on libc integer formatting via this system locales. Cc: stable@dpdk.org Signed-off-by: David Marchand Acked-by: Bruce Richardson Acked-by: Stephen Hemminger --- app/test-flow-perf/main.c | 48 ++++++++------------------------------- 1 file changed, 9 insertions(+), 39 deletions(-) diff --git a/app/test-flow-perf/main.c b/app/test-flow-perf/main.c index 56d43734e3..3922e92ded 100644 --- a/app/test-flow-perf/main.c +++ b/app/test-flow-perf/main.c @@ -16,6 +16,7 @@ * gives packet per second measurement. */ +#include #include #include #include @@ -1713,36 +1714,6 @@ do_tx(struct lcore_info *li, uint16_t cnt, uint16_t tx_port, rte_pktmbuf_free(li->pkts[i]); } -/* - * Method to convert numbers into pretty numbers that easy - * to read. The design here is to add comma after each three - * digits and set all of this inside buffer. - * - * For example if n = 1799321, the output will be - * 1,799,321 after this method which is easier to read. - */ -static char * -pretty_number(uint64_t n, char *buf) -{ - char p[6][4]; - int i = 0; - int off = 0; - - while (n > 1000) { - sprintf(p[i], "%03d", (int)(n % 1000)); - n /= 1000; - i += 1; - } - - sprintf(p[i++], "%d", (int)n); - - while (i--) - off += sprintf(buf + off, "%s,", p[i]); - buf[strlen(buf) - 1] = '\0'; - - return buf; -} - static void packet_per_second_stats(void) { @@ -1764,7 +1735,6 @@ packet_per_second_stats(void) uint64_t total_rx_pkts = 0; uint64_t total_tx_drops = 0; uint64_t tx_delta, rx_delta, drops_delta; - char buf[3][32]; int nr_valid_core = 0; sleep(1); @@ -1789,10 +1759,8 @@ packet_per_second_stats(void) tx_delta = li->tx_pkts - oli->tx_pkts; rx_delta = li->rx_pkts - oli->rx_pkts; drops_delta = li->tx_drops - oli->tx_drops; - printf("%6d %16s %16s %16s\n", i, - pretty_number(tx_delta, buf[0]), - pretty_number(drops_delta, buf[1]), - pretty_number(rx_delta, buf[2])); + printf("%6d %'16.3"PRId64" %'16.3"PRId64" %'16.3"PRId64"\n", + i, tx_delta, drops_delta, rx_delta); total_tx_pkts += tx_delta; total_rx_pkts += rx_delta; @@ -1803,10 +1771,9 @@ packet_per_second_stats(void) } if (nr_valid_core > 1) { - printf("%6s %16s %16s %16s\n", "total", - pretty_number(total_tx_pkts, buf[0]), - pretty_number(total_tx_drops, buf[1]), - pretty_number(total_rx_pkts, buf[2])); + printf("%6s %'16.3"PRId64" %'16.3"PRId64" %'16.3"PRId64"\n", + "total", total_tx_pkts, total_tx_drops, + total_rx_pkts); nr_lines += 1; } @@ -2139,6 +2106,9 @@ main(int argc, char **argv) if (argc > 1) args_parse(argc, argv); + /* For more fancy, localised integer formatting. */ + setlocale(LC_NUMERIC, ""); + init_port(); nb_lcores = rte_lcore_count(); From patchwork Wed May 18 10:16:57 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: David Marchand X-Patchwork-Id: 111307 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id A8155A0503; Wed, 18 May 2022 12:18:40 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 05C4B42B75; Wed, 18 May 2022 12:18:36 +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 BEC7442B85 for ; Wed, 18 May 2022 12:18:33 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1652869113; 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=7lx4sCx/tZfITgMdJHK1HRFZ4nY1QrJKbQ7ev6u8dtQ=; b=OL/OdKDZ/+x1ln5xyPHdXHoLrxO/8tAHxT97tPpyYF6Jx/bm5PhydLppewnXBnLVAhhQgn 6exixiL1zy1B8K7bUB2DbLtDob7+oKSe8orp74fZU93orhR69qASVhKTUPwOtUa5nhwTau 6roOzfpk1Xp9xCicTH3lsRX9aF2xxQU= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-342-wykL6s0CPxWGCtkMnnrfHA-1; Wed, 18 May 2022 06:18:28 -0400 X-MC-Unique: wykL6s0CPxWGCtkMnnrfHA-1 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id AF81D8117B0; Wed, 18 May 2022 10:18:27 +0000 (UTC) Received: from fchome.home (unknown [10.40.195.61]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4C92A492C14; Wed, 18 May 2022 10:18:24 +0000 (UTC) From: David Marchand To: dev@dpdk.org Cc: thomas@monjalon.net, ferruh.yigit@xilinx.com, stable@dpdk.org, Konstantin Ananyev , Bernard Iremonger , Vladimir Medvedkin Subject: [PATCH 12/12] test/ipsec: fix build with GCC 12 Date: Wed, 18 May 2022 12:16:57 +0200 Message-Id: <20220518101657.1230416-13-david.marchand@redhat.com> In-Reply-To: <20220518101657.1230416-1-david.marchand@redhat.com> References: <20220518101657.1230416-1-david.marchand@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.85 on 10.11.54.10 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=david.marchand@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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 GCC 12 raises the following warning: In function ‘_mm256_loadu_si256’, inlined from ‘rte_mov32’ at ../lib/eal/x86/include/rte_memcpy.h:319:9, inlined from ‘rte_mov128’ at ../lib/eal/x86/include/rte_memcpy.h:344:2, inlined from ‘rte_memcpy_generic’ at ../lib/eal/x86/include/rte_memcpy.h:438:4, inlined from ‘rte_memcpy’ at ../lib/eal/x86/include/rte_memcpy.h:882:10, inlined from ‘setup_test_string.constprop’ at ../app/test/test_ipsec.c:572:4: /usr/lib/gcc/x86_64-redhat-linux/12/include/avxintrin.h:929:10: error: array subscript ‘__m256i_u[3]’ is partly outside array bounds of ‘const char[108]’ [-Werror=array-bounds] 929 | return *__P; | ^~~~ ../app/test/test_ipsec.c: In function ‘setup_test_string.constprop’: ../app/test/test_ipsec.c:539:12: note: at offset 96 into object ‘null_plain_data’ of size 108 539 | const char null_plain_data[] = | ^~~~~~~~~~~~~~~ Split copy request into copies of string lengths and remove unused blocksize. Cc: stable@dpdk.org Signed-off-by: David Marchand --- app/test/test_ipsec.c | 48 ++++++++++++++++++++++++++----------------- 1 file changed, 29 insertions(+), 19 deletions(-) diff --git a/app/test/test_ipsec.c b/app/test/test_ipsec.c index 8da025bf66..d7455fd021 100644 --- a/app/test/test_ipsec.c +++ b/app/test/test_ipsec.c @@ -554,24 +554,28 @@ struct rte_ipv4_hdr ipv4_outer = { }; static struct rte_mbuf * -setup_test_string(struct rte_mempool *mpool, - const char *string, size_t len, uint8_t blocksize) +setup_test_string(struct rte_mempool *mpool, const char *string, + size_t string_len, size_t len) { struct rte_mbuf *m = rte_pktmbuf_alloc(mpool); - size_t t_len = len - (blocksize ? (len % blocksize) : 0); if (m) { memset(m->buf_addr, 0, m->buf_len); - char *dst = rte_pktmbuf_append(m, t_len); + char *dst = rte_pktmbuf_append(m, len); if (!dst) { rte_pktmbuf_free(m); return NULL; } - if (string != NULL) - rte_memcpy(dst, string, t_len); - else - memset(dst, 0, t_len); + if (string != NULL) { + size_t off; + + for (off = 0; off + string_len < len; off += string_len) + rte_memcpy(&dst[off], string, string_len); + rte_memcpy(&dst[off], string, len % string_len); + } else { + memset(dst, 0, len); + } } return m; @@ -1365,7 +1369,8 @@ test_ipsec_crypto_outb_burst_null_null(int i) /* Generate input mbuf data */ for (j = 0; j < num_pkts && rc == 0; j++) { ut_params->ibuf[j] = setup_test_string(ts_params->mbuf_pool, - null_plain_data, test_cfg[i].pkt_sz, 0); + null_plain_data, sizeof(null_plain_data), + test_cfg[i].pkt_sz); if (ut_params->ibuf[j] == NULL) rc = TEST_FAILED; else { @@ -1483,7 +1488,8 @@ test_ipsec_inline_crypto_inb_burst_null_null(int i) /* Generate test mbuf data */ ut_params->obuf[j] = setup_test_string( ts_params->mbuf_pool, - null_plain_data, test_cfg[i].pkt_sz, 0); + null_plain_data, sizeof(null_plain_data), + test_cfg[i].pkt_sz); if (ut_params->obuf[j] == NULL) rc = TEST_FAILED; } @@ -1551,16 +1557,17 @@ test_ipsec_inline_proto_inb_burst_null_null(int i) /* Generate inbound mbuf data */ for (j = 0; j < num_pkts && rc == 0; j++) { - ut_params->ibuf[j] = setup_test_string( - ts_params->mbuf_pool, - null_plain_data, test_cfg[i].pkt_sz, 0); + ut_params->ibuf[j] = setup_test_string(ts_params->mbuf_pool, + null_plain_data, sizeof(null_plain_data), + test_cfg[i].pkt_sz); if (ut_params->ibuf[j] == NULL) rc = TEST_FAILED; else { /* Generate test mbuf data */ ut_params->obuf[j] = setup_test_string( ts_params->mbuf_pool, - null_plain_data, test_cfg[i].pkt_sz, 0); + null_plain_data, sizeof(null_plain_data), + test_cfg[i].pkt_sz); if (ut_params->obuf[j] == NULL) rc = TEST_FAILED; } @@ -1660,7 +1667,8 @@ test_ipsec_inline_crypto_outb_burst_null_null(int i) /* Generate test mbuf data */ for (j = 0; j < num_pkts && rc == 0; j++) { ut_params->ibuf[j] = setup_test_string(ts_params->mbuf_pool, - null_plain_data, test_cfg[i].pkt_sz, 0); + null_plain_data, sizeof(null_plain_data), + test_cfg[i].pkt_sz); if (ut_params->ibuf[0] == NULL) rc = TEST_FAILED; @@ -1738,15 +1746,16 @@ test_ipsec_inline_proto_outb_burst_null_null(int i) /* Generate test mbuf data */ for (j = 0; j < num_pkts && rc == 0; j++) { ut_params->ibuf[j] = setup_test_string(ts_params->mbuf_pool, - null_plain_data, test_cfg[i].pkt_sz, 0); + null_plain_data, sizeof(null_plain_data), + test_cfg[i].pkt_sz); if (ut_params->ibuf[0] == NULL) rc = TEST_FAILED; if (rc == 0) { /* Generate test tunneled mbuf data for comparison */ ut_params->obuf[j] = setup_test_string( - ts_params->mbuf_pool, - null_plain_data, test_cfg[i].pkt_sz, 0); + ts_params->mbuf_pool, null_plain_data, + sizeof(null_plain_data), test_cfg[i].pkt_sz); if (ut_params->obuf[j] == NULL) rc = TEST_FAILED; } @@ -1815,7 +1824,8 @@ test_ipsec_lksd_proto_inb_burst_null_null(int i) for (j = 0; j < num_pkts && rc == 0; j++) { /* packet with sequence number 0 is invalid */ ut_params->ibuf[j] = setup_test_string(ts_params->mbuf_pool, - null_encrypted_data, test_cfg[i].pkt_sz, 0); + null_encrypted_data, sizeof(null_encrypted_data), + test_cfg[i].pkt_sz); if (ut_params->ibuf[j] == NULL) rc = TEST_FAILED; }