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 39E77A0093 for ; Fri, 17 Jun 2022 15:59:27 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B709E4281C; Fri, 17 Jun 2022 15:59:26 +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 2E3EE427F3 for ; Fri, 17 Jun 2022 15:59:25 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1655474364; 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=wWRbqWgIA3ONUIcJnIXW+vlti97xiBYSxIjlvB8h2f0=; b=c0Bdz0uQBIBLWJ983FexFY+ijDyS4eg4j8K8C19flSGNlOIcSA6BOZBN2ppHXMAYBKPc4V zimALgTgzyZFR4+mM5gOOJwRZhm+N7CZO/lQsGRaRkZlYuL93+oUC9C9mX8ym+tG3+EnJn jHtY+9GAjtkDvR+7q1cJS/9na7hgcwM= 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-629-5Lp0KRmGNNOUQ3_T0pQcuw-1; Fri, 17 Jun 2022 09:59:21 -0400 X-MC-Unique: 5Lp0KRmGNNOUQ3_T0pQcuw-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 07050811E75; Fri, 17 Jun 2022 13:59:21 +0000 (UTC) Received: from [10.39.208.34] (unknown [10.39.208.34]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 07A5418EAB; Fri, 17 Jun 2022 13:59:19 +0000 (UTC) Message-ID: <05feb155-5909-5613-6fe5-5ea71f198bbb@redhat.com> Date: Fri, 17 Jun 2022 15:59:17 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.0 Subject: Re: [PATCH v3] vhost/crypto: fix build with GCC 12 To: David Marchand , dev@dpdk.org Cc: stable@dpdk.org, Chenbo Xia , Fan Zhang References: <20220518101657.1230416-13-david.marchand@redhat.com> <20220616144650.1013920-1-david.marchand@redhat.com> From: Maxime Coquelin In-Reply-To: <20220616144650.1013920-1-david.marchand@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=maxime.coquelin@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit 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 6/16/22 16:46, David Marchand wrote: > 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; > | ^~~ > > Split this function and separate the per descriptor copy. > This makes the code clearer, and the compiler happier. > > Note: logs for errors have been moved to callers to avoid duplicates. > > Fixes: 3c79609fda7c ("vhost/crypto: handle virtually non-contiguous buffers") > Cc: stable@dpdk.org > > Signed-off-by: David Marchand > --- > Changes since v2: > - fixed 32-bits build, > > Changes since v1: > - refactored copy function, > > --- > lib/vhost/vhost_crypto.c | 123 +++++++++++++++------------------------ > 1 file changed, 46 insertions(+), 77 deletions(-) > Reviewed-by: Maxime Coquelin I'll wait until tuesday to apply it to my tree to let some time for testing Thanks, Maxime