DPDK patches and discussions
 help / color / mirror / Atom feed
From: David Marchand <david.marchand@redhat.com>
To: Huichao Cai <chcchc88@163.com>,
	Konstantin Ananyev <konstantin.v.ananyev@yandex.ru>
Cc: dev <dev@dpdk.org>,
	Stephen Hemminger <stephen@networkplumber.org>,
	 Thomas Monjalon <thomas@monjalon.net>
Subject: Re: [PATCH] ip_frag: replace the rte memcpy with memcpy
Date: Tue, 21 Jun 2022 17:11:38 +0200	[thread overview]
Message-ID: <CAJFAV8zYZ4Mm5nkAq1WyF1hVpMFe3gmBQYWO1w-rQ4UW9fkX-g@mail.gmail.com> (raw)
In-Reply-To: <1655561380-64616-1-git-send-email-chcchc88@163.com>

On Sat, Jun 18, 2022 at 4:10 PM Huichao Cai <chcchc88@163.com> 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 <chcchc88@163.com>

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 <rte_ip_frag.h>
>  #include <rte_mbuf.h>
> -#include <rte_memcpy.h>
>  #include <rte_random.h>
>
>  #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 <stddef.h>
>  #include <errno.h>
>
> -#include <rte_memcpy.h>
>  #include <rte_ether.h>
>
>  #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


  reply	other threads:[~2022-06-21 15:11 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-18 14:09 Huichao Cai
2022-06-21 15:11 ` David Marchand [this message]
2022-06-22 22:49 ` Konstantin Ananyev
2022-06-23  2:35   ` Stephen Hemminger
2022-06-23 14:24     ` David Marchand
2022-06-24 17:25     ` Konstantin Ananyev
2022-06-27 11:12       ` Liang Ma
2022-06-23 14:26 ` David Marchand

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAJFAV8zYZ4Mm5nkAq1WyF1hVpMFe3gmBQYWO1w-rQ4UW9fkX-g@mail.gmail.com \
    --to=david.marchand@redhat.com \
    --cc=chcchc88@163.com \
    --cc=dev@dpdk.org \
    --cc=konstantin.v.ananyev@yandex.ru \
    --cc=stephen@networkplumber.org \
    --cc=thomas@monjalon.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).