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 974BCA0545; Tue, 21 Jun 2022 17:11:54 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 73F994069C; Tue, 21 Jun 2022 17:11:54 +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 E5C6840151 for ; Tue, 21 Jun 2022 17:11:52 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1655824312; 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: in-reply-to:in-reply-to:references:references; bh=cOonVgMA7+eDUv0iRf1F75jOx6Cn0vhd7nbIGDxYmAc=; b=F48Ocndz5pFoTqjTUE3uU3wM6yfdNaE2KpU8E3gwPyNfYySUtqgCobxLBpuTZyn8kao3go cJILQbwzydTB33MDzw/cGj8yJPT9EFrEsmE1V9O2TOb2YA/AW3FoEcCmIR6zm97OmTW/np ujFkOEEqlUNw3xizfED9s4I8q+YCkPo= Received: from mail-lj1-f197.google.com (mail-lj1-f197.google.com [209.85.208.197]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-595-_vKaOr7EOSqjCPvphH6X0A-1; Tue, 21 Jun 2022 11:11:51 -0400 X-MC-Unique: _vKaOr7EOSqjCPvphH6X0A-1 Received: by mail-lj1-f197.google.com with SMTP id a16-20020a05651c211000b002557bb9091bso1884290ljq.11 for ; Tue, 21 Jun 2022 08:11:51 -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; bh=cOonVgMA7+eDUv0iRf1F75jOx6Cn0vhd7nbIGDxYmAc=; b=IarGBojdt0qsiLzDgdNA5VD8u1rUVKk8lKsTnT9zVIzLa65HJi9bzJ9feJ7T05q8CW wm6NCEZmGIXoBovR7jYUTSTZTBXtwoqnQfKuDXTfaSwvvuyaCFazb02g448jT+2+9x/a P1A8RN5y+KoIfenS2r4qyRPfYv0XMHvQns3CQZovZies+jGHvzcKqdGvrx15Z48yHh5S H3YAc5Z5cqLPZ24jwHRwU8llqzMhT7XV9ofwoyp3nujTiO19IkKlYKbSC9s4RFdmFY+U upcMs93VWIzlWDNBRnxnQNRxRuUTEQFyaW8VX5YoApBfzKCzltSfuwBJo8qNhQl+EJOk K/dw== X-Gm-Message-State: AJIora+XSZFE2pCd6ZlLYHS7eBj7k2AgR2nhrboejgh0K2VV9pnY9O87 DFxop2rlJKrte0n6gxvJppjvw08tVzulKAVK6mmYH4sEE2q9NQxemuCQXEHONT2IwdsW9LCs6kI /x+7RZJQ44b82pxflAZs= X-Received: by 2002:a05:6512:13a0:b0:47f:709d:dc11 with SMTP id p32-20020a05651213a000b0047f709ddc11mr5649182lfa.265.1655824309780; Tue, 21 Jun 2022 08:11:49 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vIyKAgzHhAtuDOdmX2q9A3EZHDNv1oDp5N/TuJm7SJtrWfq/DQzwftITlm+D7MPhan6r34g9o0gImlo/OWrIw= X-Received: by 2002:a05:6512:13a0:b0:47f:709d:dc11 with SMTP id p32-20020a05651213a000b0047f709ddc11mr5649161lfa.265.1655824309458; Tue, 21 Jun 2022 08:11:49 -0700 (PDT) MIME-Version: 1.0 References: <1655561380-64616-1-git-send-email-chcchc88@163.com> In-Reply-To: <1655561380-64616-1-git-send-email-chcchc88@163.com> From: David Marchand Date: Tue, 21 Jun 2022 17:11:38 +0200 Message-ID: Subject: Re: [PATCH] ip_frag: replace the rte memcpy with memcpy To: Huichao Cai , Konstantin Ananyev Cc: dev , Stephen Hemminger , Thomas Monjalon 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" 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 On Sat, Jun 18, 2022 at 4:10 PM Huichao Cai wrote: > > To resolve the compilation warning,replace the rte_memcpy with memcpy. > Modify in file test_ipfrag.c and rte_ipv4_fragmentation.c. > > Signed-off-by: Huichao Cai Fixed Konstantin mail address. > --- > app/test/test_ipfrag.c | 13 ++++++------- > lib/ip_frag/rte_ipv4_fragmentation.c | 7 +++---- > 2 files changed, 9 insertions(+), 11 deletions(-) > > diff --git a/app/test/test_ipfrag.c b/app/test/test_ipfrag.c > index dc62b0e..ba0ffd0 100644 > --- a/app/test/test_ipfrag.c > +++ b/app/test/test_ipfrag.c > @@ -23,7 +23,6 @@ > > #include > #include > -#include > #include > > #define NUM_MBUFS 128 > @@ -147,13 +146,13 @@ static void ut_teardown(void) > if (opt_copied) { > expected_opt->len = > sizeof(expected_first_frag_ipv4_opts_copied); > - rte_memcpy(expected_opt->data, > + memcpy(expected_opt->data, > expected_first_frag_ipv4_opts_copied, > sizeof(expected_first_frag_ipv4_opts_copied)); > } else { > expected_opt->len = > sizeof(expected_first_frag_ipv4_opts_nocopied); > - rte_memcpy(expected_opt->data, > + memcpy(expected_opt->data, > expected_first_frag_ipv4_opts_nocopied, > sizeof(expected_first_frag_ipv4_opts_nocopied)); > } > @@ -161,13 +160,13 @@ static void ut_teardown(void) > if (opt_copied) { > expected_opt->len = > sizeof(expected_sub_frag_ipv4_opts_copied); > - rte_memcpy(expected_opt->data, > + memcpy(expected_opt->data, > expected_sub_frag_ipv4_opts_copied, > sizeof(expected_sub_frag_ipv4_opts_copied)); > } else { > expected_opt->len = > sizeof(expected_sub_frag_ipv4_opts_nocopied); > - rte_memcpy(expected_opt->data, > + memcpy(expected_opt->data, > expected_sub_frag_ipv4_opts_nocopied, > sizeof(expected_sub_frag_ipv4_opts_nocopied)); > } > @@ -227,7 +226,7 @@ static void ut_teardown(void) > hdr->src_addr = rte_cpu_to_be_32(0x8080808); > hdr->dst_addr = rte_cpu_to_be_32(0x8080404); > > - rte_memcpy(hdr + 1, opt.data, opt.len); > + memcpy(hdr + 1, opt.data, opt.len); > } > > static void > @@ -312,7 +311,7 @@ static void ut_teardown(void) > char *iph_opt = rte_pktmbuf_mtod_offset(mb[i], > char *, sizeof(struct rte_ipv4_hdr)); > opt->len = opt_len; > - rte_memcpy(opt->data, iph_opt, opt_len); > + memcpy(opt->data, iph_opt, opt_len); > } else { > opt->len = RTE_IPV4_HDR_OPT_MAX_LEN; > memset(opt->data, RTE_IPV4_HDR_OPT_EOL, > diff --git a/lib/ip_frag/rte_ipv4_fragmentation.c b/lib/ip_frag/rte_ipv4_fragmentation.c > index a19f6fd..27a8ad2 100644 > --- a/lib/ip_frag/rte_ipv4_fragmentation.c > +++ b/lib/ip_frag/rte_ipv4_fragmentation.c > @@ -5,7 +5,6 @@ > #include > #include > > -#include > #include > > #include "ip_frag_common.h" > @@ -26,7 +25,7 @@ static inline void __fill_ipv4hdr_frag(struct rte_ipv4_hdr *dst, > const struct rte_ipv4_hdr *src, uint16_t header_len, > uint16_t len, uint16_t fofs, uint16_t dofs, uint32_t mf) > { > - rte_memcpy(dst, src, header_len); > + memcpy(dst, src, header_len); > fofs = (uint16_t)(fofs + (dofs >> RTE_IPV4_HDR_FO_SHIFT)); > fofs = (uint16_t)(fofs | mf << RTE_IPV4_HDR_MF_SHIFT); > dst->fragment_offset = rte_cpu_to_be_16(fofs); > @@ -48,7 +47,7 @@ static inline uint16_t __create_ipopt_frag_hdr(uint8_t *iph, > struct rte_ipv4_hdr *iph_opt = (struct rte_ipv4_hdr *)ipopt_frag_hdr; > > ipopt_len = 0; > - rte_memcpy(ipopt_frag_hdr, iph, sizeof(struct rte_ipv4_hdr)); > + memcpy(ipopt_frag_hdr, iph, sizeof(struct rte_ipv4_hdr)); > ipopt_frag_hdr += sizeof(struct rte_ipv4_hdr); > > uint8_t *p_opt = iph + sizeof(struct rte_ipv4_hdr); > @@ -65,7 +64,7 @@ static inline uint16_t __create_ipopt_frag_hdr(uint8_t *iph, > break; > > if (RTE_IPV4_HDR_OPT_COPIED(*p_opt)) { > - rte_memcpy(ipopt_frag_hdr + ipopt_len, > + memcpy(ipopt_frag_hdr + ipopt_len, > p_opt, p_opt[1]); > ipopt_len += p_opt[1]; > } > -- > 1.8.3.1 > -- David Marchand