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 A9CBDA0548; Tue, 7 Jun 2022 19:18:19 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9979B42B6D; Tue, 7 Jun 2022 19:17:57 +0200 (CEST) Received: from mail-pj1-f52.google.com (mail-pj1-f52.google.com [209.85.216.52]) by mails.dpdk.org (Postfix) with ESMTP id 09C7F42829 for ; Tue, 7 Jun 2022 19:17:56 +0200 (CEST) Received: by mail-pj1-f52.google.com with SMTP id hv24-20020a17090ae41800b001e33eebdb5dso14287572pjb.0 for ; Tue, 07 Jun 2022 10:17:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=SVNfZIIlO7BqF61jp/T+YhtCc+dF+9yPquzhpT8QbZ8=; b=JO9xFBmowR7u1xG6i8BYmZXdqgd6PjZq822nUZJLk1+69ZcPWQKDVJn83nO5ICao3Y KduwjJBfDkKu6mmFAEvz1/xNQYfK07DmzpTD3R9/g29vCpFKA2hoFSrNNC7W8xbh2yyJ aimA6t0j0SUj/niz9h3S56tghipTpKIHMeNPN196vCq0gjODuUQahps+SQqn9XhfJ8nf YrW2otiMZQlSKO1d6ST3Y/gmv7MolN2shPMZDFuxVLOHJ/cJtbLkRVs5bgp2fKQuJOGp vzz2n+r04CMRmTHqtDm3kSArocnXt7Vak+us7kQD300YVraRjgtPZ5q8TWforiU5Hu5s X2tQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=SVNfZIIlO7BqF61jp/T+YhtCc+dF+9yPquzhpT8QbZ8=; b=kPFFLD84z8cNwpYGEgPilwk3wmpCFJyVlI8HeItiyBiEJWGMUZkQe60Rdl7xAEvJpI zk8TAOquHOQhDEC/UQ952gmJNJ9jRVG4QglFxzsbDSAW8UljFzSUbIWsNSZo+hYEwVMT nkxsVl0hXjUv8XOuqOWcelL+x+bpBMBZkWTys20a6yxguqg9+3cKsEcrgR0049Y99gxo aiDOjQphhIHIs3XPENtuCl9M4zsGrjr2ga65/exdT9ckEE2Tq+K3HwAzkoe77NFLjz6N aPLZCNI7tUO79rYNFacPPAypYl7pzWXg5fn/AjXOQUYV79f1noYXiqe4DacvSiTyzNHM DHIA== X-Gm-Message-State: AOAM531fFuxfnR3nw2IAY+X7mj3EQXHAGlG9kkx56SybpCB3G4ptYgwn R9EsDvP1eCKhIWGzi6ritxm0FFw3uFjEhw== X-Google-Smtp-Source: ABdhPJyNJ12rkk2/NUz40eq7yAwVJ7E6qYrXek4GHP4YnG1k2mH9bzeU6J65gNunALNu+L2M5b9cUg== X-Received: by 2002:a17:902:ee8d:b0:164:7dd:6cc6 with SMTP id a13-20020a170902ee8d00b0016407dd6cc6mr31568827pld.84.1654622274915; Tue, 07 Jun 2022 10:17:54 -0700 (PDT) Received: from hermes.local (204-195-112-199.wavecable.com. [204.195.112.199]) by smtp.gmail.com with ESMTPSA id x2-20020a627c02000000b005087c23ad8dsm13185281pfc.0.2022.06.07.10.17.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jun 2022 10:17:54 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Konstantin Ananyev , Bernard Iremonger , Vladimir Medvedkin Subject: [RFC 5/8] test/ipsec: fix gcc-12 rte_memcpy warnings Date: Tue, 7 Jun 2022 10:17:43 -0700 Message-Id: <20220607171746.461772-6-stephen@networkplumber.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220607171746.461772-1-stephen@networkplumber.org> References: <20220607171746.461772-1-stephen@networkplumber.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 It is not necessary to use rte_memcpy here, and it can cause warnings when gcc-12 detects that rte_memcpy will derference past input data. Signed-off-by: Stephen Hemminger --- app/test/test_ipsec.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/app/test/test_ipsec.c b/app/test/test_ipsec.c index 8da025bf6621..4aa9b346646d 100644 --- a/app/test/test_ipsec.c +++ b/app/test/test_ipsec.c @@ -10,7 +10,6 @@ #include #include #include -#include #include #include #include @@ -569,7 +568,7 @@ setup_test_string(struct rte_mempool *mpool, return NULL; } if (string != NULL) - rte_memcpy(dst, string, t_len); + memcpy(dst, string, t_len); else memset(dst, 0, t_len); } @@ -614,21 +613,21 @@ setup_test_string_tunneled(struct rte_mempool *mpool, const char *string, /* copy outer IP and ESP header */ ipv4_outer.total_length = rte_cpu_to_be_16(t_len); ipv4_outer.packet_id = rte_cpu_to_be_16(seq); - rte_memcpy(dst, &ipv4_outer, sizeof(ipv4_outer)); + memcpy(dst, &ipv4_outer, sizeof(ipv4_outer)); dst += sizeof(ipv4_outer); m->l3_len = sizeof(ipv4_outer); - rte_memcpy(dst, &esph, sizeof(esph)); + memcpy(dst, &esph, sizeof(esph)); dst += sizeof(esph); if (string != NULL) { /* copy payload */ - rte_memcpy(dst, string, len); + memcpy(dst, string, len); dst += len; /* copy pad bytes */ - rte_memcpy(dst, esp_pad_bytes, padlen); + memcpy(dst, esp_pad_bytes, padlen); dst += padlen; /* copy ESP tail header */ - rte_memcpy(dst, &espt, sizeof(espt)); + memcpy(dst, &espt, sizeof(espt)); } else memset(dst, 0, t_len); -- 2.35.1