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 0782AA0503 for ; Wed, 18 May 2022 12:17:58 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 02D57400D6; Wed, 18 May 2022 12:17:58 +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 785B342B6D for ; Wed, 18 May 2022 12:17:56 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1652869076; 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=bj598PpHlzhQkqa/b9WoEkKcqDz392kDq0HJrfF3MfTab5zjFN7Jgtzn7QGqAeb1amCImF VIHVrpT3KZMmkicSQh9xaVvBFzTB5KGPmf5Dx1VwcJ2Biuu0VIyqMpKcFMFRzaQpj7bcSv XtQaS35HuDPd1OerLpixPppkR3i/sxE= 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 Content-Type: text/plain; charset=UTF-8 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 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 --- 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; -- 2.36.1