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 050E944093; Wed, 22 May 2024 05:33:04 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1C44F410D0; Wed, 22 May 2024 05:31:06 +0200 (CEST) Received: from mail-pj1-f50.google.com (mail-pj1-f50.google.com [209.85.216.50]) by mails.dpdk.org (Postfix) with ESMTP id A6EEE40DCE for ; Wed, 22 May 2024 05:30:45 +0200 (CEST) Received: by mail-pj1-f50.google.com with SMTP id 98e67ed59e1d1-2b5f3e20615so1925105a91.1 for ; Tue, 21 May 2024 20:30:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1716348645; x=1716953445; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=6vyZnwMQ85VNmiZ7SeoROosshHH4iQ1mXI8UQAr+eIc=; b=zzDUtiCCf4n1/9c67eZ7SVmf4WpnjdgMNCQjdZm+hru2VcVCSWYWrLeBJ2XfJraPL4 OKuRNGZvuWp8MPaf0jiNXb5j3Ao3SF1nnP5bOIVaWy6uSezsEN98zFPAXo2AmfT14w0c y3t2l2zbtnx3PV3NcLpMOb0V7M4ZqRXIBJLGjnzdF43jmF/qNXR8/M/xf6AIxTPGA0Ml IDO0yjDL1c8e/0chYy2hBwmYsKVXP3kcW/DJGB2LNbRcT8NrYQ4NP1lwCEVCC2pzRKxR LS9UQJm+P3Ra09SltkIJXMoV+XNdmshYhDvWpUHF8//JKAa33s9OdolVrbBwYf85zwOn 9q6A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716348645; x=1716953445; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=6vyZnwMQ85VNmiZ7SeoROosshHH4iQ1mXI8UQAr+eIc=; b=WC7nMASFkMXRCoEqhWw7AUc9c1w5ONs7cxjKOpYBRxSDvDjiJqppVbUlX88r1CZpg+ slZS4f82egX90FZ7sdI+U6mHmlleyNJKpGbNpirFu7klaDz8uvngDUqtbGzI+2/PNYKV 0l0iHyjqNH1UEH11aA9gIaAHuojTAGp8jUlmvf+7hlHHkbJbfzpNpldGrpRa68N1Z6+R ACEK4GiHB8kYK+pGaxkUbLnndD6MAZCQE8C9uVCM5VqkYXYPCfCHIO9ZbRNy7VgRWUwB zRAUKv47iTWFKLov5qjtOUf0Ipu8HN9PvFDhlL6ffbVNOWiWgYLWqJqOHKUuqP95xzr+ utvg== X-Gm-Message-State: AOJu0YwVxrQhz4MxRQA7gq/iRpi+9VwyU1diy5VDTLB99j04rIigaZt0 7dP9NRvQxWuNofnUgK5caZErThsRSWD2YACFWSkcdqClyr4ig3bpRqyVP/a4b9SIXFTKcSlg8sS gz1c= X-Google-Smtp-Source: AGHT+IF828WnB/MG7x13apJFvKbXwRhGudJvU+nlUaN3MDfykuDoKSCmapgRcGK1gSb5PmrzfrE98w== X-Received: by 2002:a17:90a:9908:b0:2bd:8378:af81 with SMTP id 98e67ed59e1d1-2bd9f46e4b4mr942541a91.4.1716348644837; Tue, 21 May 2024 20:30:44 -0700 (PDT) Received: from hermes.local (204-195-96-226.wavecable.com. [204.195.96.226]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-1f323c70dafsm2264325ad.260.2024.05.21.20.30.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 May 2024 20:30:44 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Aman Singh , Yuying Zhang , Ori Kam Subject: [PATCH v5 22/32] app/test-pmd: replace use of fixed size rte_memcpy Date: Tue, 21 May 2024 20:27:49 -0700 Message-ID: <20240522033009.143100-23-stephen@networkplumber.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240522033009.143100-1-stephen@networkplumber.org> References: <20240403163432.437275-1-stephen@networkplumber.org> <20240522033009.143100-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 Automatically generated by devtools/cocci/rte_memcpy.cocci Signed-off-by: Stephen Hemminger --- app/test-pmd/cmdline.c | 48 ++++++++++++++++++------------------- app/test-pmd/cmdline_flow.c | 24 +++++++++---------- app/test-pmd/config.c | 8 +++---- app/test-pmd/csumonly.c | 1 - app/test-pmd/flowgen.c | 1 - app/test-pmd/iofwd.c | 1 - app/test-pmd/macfwd.c | 1 - app/test-pmd/macswap.c | 1 - app/test-pmd/noisy_vnf.c | 1 - app/test-pmd/rxonly.c | 1 - app/test-pmd/testpmd.c | 1 - 11 files changed, 40 insertions(+), 48 deletions(-) diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c index b7759e38a8..5e0740348a 100644 --- a/app/test-pmd/cmdline.c +++ b/app/test-pmd/cmdline.c @@ -9534,7 +9534,7 @@ static void cmd_set_vxlan_parsed(void *parsed_result, vxlan_encap_conf.select_ipv4 = 0; else return; - rte_memcpy(vxlan_encap_conf.vni, &id.vni[1], 3); + memcpy(vxlan_encap_conf.vni, &id.vni[1], 3); vxlan_encap_conf.udp_src = rte_cpu_to_be_16(res->udp_src); vxlan_encap_conf.udp_dst = rte_cpu_to_be_16(res->udp_dst); vxlan_encap_conf.ip_tos = res->tos; @@ -9548,10 +9548,10 @@ static void cmd_set_vxlan_parsed(void *parsed_result, } if (vxlan_encap_conf.select_vlan) vxlan_encap_conf.vlan_tci = rte_cpu_to_be_16(res->tci); - rte_memcpy(vxlan_encap_conf.eth_src, res->eth_src.addr_bytes, - RTE_ETHER_ADDR_LEN); - rte_memcpy(vxlan_encap_conf.eth_dst, res->eth_dst.addr_bytes, - RTE_ETHER_ADDR_LEN); + memcpy(vxlan_encap_conf.eth_src, res->eth_src.addr_bytes, + RTE_ETHER_ADDR_LEN); + memcpy(vxlan_encap_conf.eth_dst, res->eth_dst.addr_bytes, + RTE_ETHER_ADDR_LEN); } static cmdline_parse_inst_t cmd_set_vxlan = { @@ -9729,7 +9729,7 @@ static void cmd_set_nvgre_parsed(void *parsed_result, nvgre_encap_conf.select_ipv4 = 0; else return; - rte_memcpy(nvgre_encap_conf.tni, &id.tni[1], 3); + memcpy(nvgre_encap_conf.tni, &id.tni[1], 3); if (nvgre_encap_conf.select_ipv4) { IPV4_ADDR_TO_UINT(res->ip_src, nvgre_encap_conf.ipv4_src); IPV4_ADDR_TO_UINT(res->ip_dst, nvgre_encap_conf.ipv4_dst); @@ -9739,10 +9739,10 @@ static void cmd_set_nvgre_parsed(void *parsed_result, } if (nvgre_encap_conf.select_vlan) nvgre_encap_conf.vlan_tci = rte_cpu_to_be_16(res->tci); - rte_memcpy(nvgre_encap_conf.eth_src, res->eth_src.addr_bytes, - RTE_ETHER_ADDR_LEN); - rte_memcpy(nvgre_encap_conf.eth_dst, res->eth_dst.addr_bytes, - RTE_ETHER_ADDR_LEN); + memcpy(nvgre_encap_conf.eth_src, res->eth_src.addr_bytes, + RTE_ETHER_ADDR_LEN); + memcpy(nvgre_encap_conf.eth_dst, res->eth_dst.addr_bytes, + RTE_ETHER_ADDR_LEN); } static cmdline_parse_inst_t cmd_set_nvgre = { @@ -9856,10 +9856,10 @@ static void cmd_set_l2_encap_parsed(void *parsed_result, return; if (l2_encap_conf.select_vlan) l2_encap_conf.vlan_tci = rte_cpu_to_be_16(res->tci); - rte_memcpy(l2_encap_conf.eth_src, res->eth_src.addr_bytes, - RTE_ETHER_ADDR_LEN); - rte_memcpy(l2_encap_conf.eth_dst, res->eth_dst.addr_bytes, - RTE_ETHER_ADDR_LEN); + memcpy(l2_encap_conf.eth_src, res->eth_src.addr_bytes, + RTE_ETHER_ADDR_LEN); + memcpy(l2_encap_conf.eth_dst, res->eth_dst.addr_bytes, + RTE_ETHER_ADDR_LEN); } static cmdline_parse_inst_t cmd_set_l2_encap = { @@ -10038,7 +10038,7 @@ static void cmd_set_mplsogre_encap_parsed(void *parsed_result, mplsogre_encap_conf.select_ipv4 = 0; else return; - rte_memcpy(mplsogre_encap_conf.label, &id.label, 3); + memcpy(mplsogre_encap_conf.label, &id.label, 3); if (mplsogre_encap_conf.select_ipv4) { IPV4_ADDR_TO_UINT(res->ip_src, mplsogre_encap_conf.ipv4_src); IPV4_ADDR_TO_UINT(res->ip_dst, mplsogre_encap_conf.ipv4_dst); @@ -10048,10 +10048,10 @@ static void cmd_set_mplsogre_encap_parsed(void *parsed_result, } if (mplsogre_encap_conf.select_vlan) mplsogre_encap_conf.vlan_tci = rte_cpu_to_be_16(res->tci); - rte_memcpy(mplsogre_encap_conf.eth_src, res->eth_src.addr_bytes, - RTE_ETHER_ADDR_LEN); - rte_memcpy(mplsogre_encap_conf.eth_dst, res->eth_dst.addr_bytes, - RTE_ETHER_ADDR_LEN); + memcpy(mplsogre_encap_conf.eth_src, res->eth_src.addr_bytes, + RTE_ETHER_ADDR_LEN); + memcpy(mplsogre_encap_conf.eth_dst, res->eth_dst.addr_bytes, + RTE_ETHER_ADDR_LEN); } static cmdline_parse_inst_t cmd_set_mplsogre_encap = { @@ -10274,7 +10274,7 @@ static void cmd_set_mplsoudp_encap_parsed(void *parsed_result, mplsoudp_encap_conf.select_ipv4 = 0; else return; - rte_memcpy(mplsoudp_encap_conf.label, &id.label, 3); + memcpy(mplsoudp_encap_conf.label, &id.label, 3); mplsoudp_encap_conf.udp_src = rte_cpu_to_be_16(res->udp_src); mplsoudp_encap_conf.udp_dst = rte_cpu_to_be_16(res->udp_dst); if (mplsoudp_encap_conf.select_ipv4) { @@ -10286,10 +10286,10 @@ static void cmd_set_mplsoudp_encap_parsed(void *parsed_result, } if (mplsoudp_encap_conf.select_vlan) mplsoudp_encap_conf.vlan_tci = rte_cpu_to_be_16(res->tci); - rte_memcpy(mplsoudp_encap_conf.eth_src, res->eth_src.addr_bytes, - RTE_ETHER_ADDR_LEN); - rte_memcpy(mplsoudp_encap_conf.eth_dst, res->eth_dst.addr_bytes, - RTE_ETHER_ADDR_LEN); + memcpy(mplsoudp_encap_conf.eth_src, res->eth_src.addr_bytes, + RTE_ETHER_ADDR_LEN); + memcpy(mplsoudp_encap_conf.eth_dst, res->eth_dst.addr_bytes, + RTE_ETHER_ADDR_LEN); } static cmdline_parse_inst_t cmd_set_mplsoudp_encap = { diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c index 60ee9337cf..95d9133ecb 100644 --- a/app/test-pmd/cmdline_flow.c +++ b/app/test-pmd/cmdline_flow.c @@ -13768,7 +13768,7 @@ cmd_set_raw_parsed_sample(const struct buffer *in) fprintf(stderr, "Error - Not supported action\n"); return; } - rte_memcpy(data, action, sizeof(struct rte_flow_action)); + memcpy(data, action, sizeof(struct rte_flow_action)); data++; } } @@ -13929,8 +13929,8 @@ cmd_set_raw_parsed(const struct buffer *in) /* We have to add GTP header extra word. */ *total_size += sizeof(ext_word); - rte_memcpy(data_tail - (*total_size), - &ext_word, sizeof(ext_word)); + memcpy(data_tail - (*total_size), &ext_word, + sizeof(ext_word)); } size = sizeof(struct rte_gtp_hdr); break; @@ -13975,21 +13975,21 @@ cmd_set_raw_parsed(const struct buffer *in) if (opt->checksum_rsvd.checksum) { *total_size += sizeof(opt->checksum_rsvd); - rte_memcpy(data_tail - (*total_size), - &opt->checksum_rsvd, - sizeof(opt->checksum_rsvd)); + memcpy(data_tail - (*total_size), + &opt->checksum_rsvd, + sizeof(opt->checksum_rsvd)); } if (opt->key.key) { *total_size += sizeof(opt->key.key); - rte_memcpy(data_tail - (*total_size), - &opt->key.key, - sizeof(opt->key.key)); + memcpy(data_tail - (*total_size), + &opt->key.key, + sizeof(opt->key.key)); } if (opt->sequence.sequence) { *total_size += sizeof(opt->sequence.sequence); - rte_memcpy(data_tail - (*total_size), - &opt->sequence.sequence, - sizeof(opt->sequence.sequence)); + memcpy(data_tail - (*total_size), + &opt->sequence.sequence, + sizeof(opt->sequence.sequence)); } } proto = 0x2F; diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c index ba1007ace6..8b201f2104 100644 --- a/app/test-pmd/config.c +++ b/app/test-pmd/config.c @@ -2639,8 +2639,8 @@ port_flow_template_table_create(portid_t port_id, uint32_t id, } pt->nb_pattern_templates = nb_pattern_templates; pt->nb_actions_templates = nb_actions_templates; - rte_memcpy(&pt->flow_attr, &table_attr->flow_attr, - sizeof(struct rte_flow_attr)); + memcpy(&pt->flow_attr, &table_attr->flow_attr, + sizeof(struct rte_flow_attr)); printf("Template table #%u created\n", pt->id); return 0; } @@ -3259,8 +3259,8 @@ port_queue_action_handle_update(portid_t port_id, update = action->conf; break; case RTE_FLOW_ACTION_TYPE_METER_MARK: - rte_memcpy(&mtr_update.meter_mark, action->conf, - sizeof(struct rte_flow_action_meter_mark)); + memcpy(&mtr_update.meter_mark, action->conf, + sizeof(struct rte_flow_action_meter_mark)); if (mtr_update.meter_mark.profile) mtr_update.profile_valid = 1; if (mtr_update.meter_mark.policy) diff --git a/app/test-pmd/csumonly.c b/app/test-pmd/csumonly.c index 6711dda42e..0db26902a1 100644 --- a/app/test-pmd/csumonly.c +++ b/app/test-pmd/csumonly.c @@ -19,7 +19,6 @@ #include #include #include -#include #include #include #include diff --git a/app/test-pmd/flowgen.c b/app/test-pmd/flowgen.c index 53b5f24f11..d9454a4d22 100644 --- a/app/test-pmd/flowgen.c +++ b/app/test-pmd/flowgen.c @@ -19,7 +19,6 @@ #include #include #include -#include #include #include #include diff --git a/app/test-pmd/iofwd.c b/app/test-pmd/iofwd.c index ba06fae4a6..c9727d2856 100644 --- a/app/test-pmd/iofwd.c +++ b/app/test-pmd/iofwd.c @@ -24,7 +24,6 @@ #include #include #include -#include #include #include #include diff --git a/app/test-pmd/macfwd.c b/app/test-pmd/macfwd.c index d19ace7395..ba63aedd79 100644 --- a/app/test-pmd/macfwd.c +++ b/app/test-pmd/macfwd.c @@ -19,7 +19,6 @@ #include #include #include -#include #include #include #include diff --git a/app/test-pmd/macswap.c b/app/test-pmd/macswap.c index 57f77003fe..e1f9be4901 100644 --- a/app/test-pmd/macswap.c +++ b/app/test-pmd/macswap.c @@ -19,7 +19,6 @@ #include #include #include -#include #include #include #include diff --git a/app/test-pmd/noisy_vnf.c b/app/test-pmd/noisy_vnf.c index 81d1187cfe..cf951e9532 100644 --- a/app/test-pmd/noisy_vnf.c +++ b/app/test-pmd/noisy_vnf.c @@ -24,7 +24,6 @@ #include #include #include -#include #include #include #include diff --git a/app/test-pmd/rxonly.c b/app/test-pmd/rxonly.c index 315f9286cd..cc73cf4ebf 100644 --- a/app/test-pmd/rxonly.c +++ b/app/test-pmd/rxonly.c @@ -19,7 +19,6 @@ #include #include #include -#include #include #include #include diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c index 70ea257fda..9dd3ffa850 100644 --- a/app/test-pmd/testpmd.c +++ b/app/test-pmd/testpmd.c @@ -30,7 +30,6 @@ #include #include #include -#include #include #include #include -- 2.43.0