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 7328543BAE; Fri, 1 Mar 2024 00:08:35 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2E40F43389; Fri, 1 Mar 2024 00:02:26 +0100 (CET) Received: from mail-pj1-f47.google.com (mail-pj1-f47.google.com [209.85.216.47]) by mails.dpdk.org (Postfix) with ESMTP id 50FA343330 for ; Fri, 1 Mar 2024 00:00:59 +0100 (CET) Received: by mail-pj1-f47.google.com with SMTP id 98e67ed59e1d1-29a7951c6faso1117129a91.1 for ; Thu, 29 Feb 2024 15:00:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1709247658; x=1709852458; 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=hBjpL2B+GH6WMvX1UmW3MDbk0gtjo8OUJmzZdg4n6Y8=; b=Pyjzi1rUKKt3UI8I0CpBeHxWkypzzkoS5aXKDus13e4o61mPNDLIdQHT1I5m0pMQRO qkxDPJM7rqBx8A7evO4NJgKax59XdRRjK1iDgwunbAxLQogYS/AJJJPX6CUW4Lr1454o LcFCsOfVZ3pD9IHhVlx0YGBE3ghUAZOONnIs5Bxo9iBssLUgoB5MYgm6z5AoFJE/WbwX dld0E2cbechvvFE6L8mFrOM+dClrCgVyHxid1rX88MXlJdy20ui8EBEbXjpMZCkGWc8i UfcFuJKQRuewAKUfeUfVTRfbHl3ctAc2ctLivFngxv87Cxcg4Ri3BSQtRIA1Qvksz2W/ sCVg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709247658; x=1709852458; 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=hBjpL2B+GH6WMvX1UmW3MDbk0gtjo8OUJmzZdg4n6Y8=; b=htACYRJtDWMGbYOFi1kiC0feWPdOi/r9R8UuRaaYvKWfzZYrNc8INMocd9VFxEpwEw oZXgqi3wDOV7+yocnafsToHRGgGexyCvE4EifL6aL27jRivlfYPOydPiBQE7BoQQu/ME 3M0oa59WESzanrxf5K7zTRg6/EQTnOpOC/PEsYKBSigZAjcyWfkf0VuQAPTo1Bz8//uv UIhv+AuKs+sb/BmcrtcrWHy2dfdvqfB/s8INSkI10+kzeNyHX59U9eRfqL2bZfO8g/LS o5J6XnbRRPMkgpBBTfHxYK1+2xbf9e5UxRXkp1cb9xNurkDxFYcTnIrfdfyLey6NwwIf HlsQ== X-Gm-Message-State: AOJu0Yyj+s0bnuVtD+EoagGuxplPNdTCMsE/GZ4MWRMbYBOGp9V7wWVi GlID0I51stAuLgTZesEjLqfNQqKvA4EiKmsD02TQ/nACZpVzbjyD7V94giagj7/ELCZh/TpwJdB +3TQ= X-Google-Smtp-Source: AGHT+IHsAA11DWXyh36yU4o8m/KGH9gXFN5GK+rTz4E7o6MDCJjKxQgYncwJqKtnNF9bM/skX5dFXg== X-Received: by 2002:a17:90a:8046:b0:29a:7efc:4720 with SMTP id e6-20020a17090a804600b0029a7efc4720mr25405pjw.31.1709247658488; Thu, 29 Feb 2024 15:00:58 -0800 (PST) Received: from hermes.local (204-195-123-141.wavecable.com. [204.195.123.141]) by smtp.gmail.com with ESMTPSA id l22-20020a17090b079600b0029a8e5355fcsm1965578pjz.53.2024.02.29.15.00.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Feb 2024 15:00:58 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Aman Singh , Yuying Zhang , Ori Kam Subject: [PATCH 67/71] app/test-pmd: replace use of fixed size rte_memcpy Date: Thu, 29 Feb 2024 14:58:54 -0800 Message-ID: <20240229225936.483472-68-stephen@networkplumber.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240229225936.483472-1-stephen@networkplumber.org> References: <20240229225936.483472-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 +++---- 3 files changed, 40 insertions(+), 40 deletions(-) diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c index 566057caa523..898fb69a2f4d 100644 --- a/app/test-pmd/cmdline.c +++ b/app/test-pmd/cmdline.c @@ -9529,7 +9529,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; @@ -9543,10 +9543,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 = { @@ -9724,7 +9724,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); @@ -9734,10 +9734,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 = { @@ -9851,10 +9851,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 = { @@ -10033,7 +10033,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); @@ -10043,10 +10043,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 = { @@ -10269,7 +10269,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) { @@ -10281,10 +10281,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 b4389e51506b..17b73d2407c4 100644 --- a/app/test-pmd/cmdline_flow.c +++ b/app/test-pmd/cmdline_flow.c @@ -13732,7 +13732,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++; } } @@ -13893,8 +13893,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; @@ -13939,21 +13939,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 08d7d0e2f87c..2b81f3ef3d2d 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; } @@ -3261,8 +3261,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) -- 2.43.0