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 991C643C12; Fri, 1 Mar 2024 18:20:30 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6DF0F433EC; Fri, 1 Mar 2024 18:17:52 +0100 (CET) Received: from mail-pl1-f175.google.com (mail-pl1-f175.google.com [209.85.214.175]) by mails.dpdk.org (Postfix) with ESMTP id 8818643391 for ; Fri, 1 Mar 2024 18:17:37 +0100 (CET) Received: by mail-pl1-f175.google.com with SMTP id d9443c01a7336-1dc75972f25so21374805ad.1 for ; Fri, 01 Mar 2024 09:17:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1709313457; x=1709918257; 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=TS0Y82C50IXLWOuwUCN6eRSQrrai0mBOAwp6IHmBJM4=; b=DKWRaA3mzbVtJKGhAHtUtQ6Fm9KeidbH2Cx38L1X5E8fXSTW81hiGAeOsuPNPnh9J5 /VwUFJpcsi7Yj4WxmXkeyuZZruXBGbJETQhwxGxEwtEc7n9XvDVV2godG+QUR6qiSTvn fPCqEyaYfJXdH/CblEwcO0UZhrmPy7BxEjX/pgmXu0Nyc85noThA/jChbAQkILfLWG/2 c3JnNOJL7r6EQVwhp/VcAr2ylhKcXx9WA7vUkDMyEzk4okHX6cxK5qgHcg+wU4qD3Btp chZAk2Cvg3Mitxt4fAg5Gl4pJ3Fa1mn+gu25NPCNCq6W/kyASg93J+QhEQOVokkYV46a Y4yA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709313457; x=1709918257; 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=TS0Y82C50IXLWOuwUCN6eRSQrrai0mBOAwp6IHmBJM4=; b=iCIsB396YZK9xSZZi1ai6wDVUUGKNKK9e3X9wU/dJubsuYcZn0fxGMdpOnlRcfnILj R3dKUu5b+2UawkzbVnQZgdKMsxeE1xzSe8OssLa3dxA9Zr8S7I6hZG39J/HB3NwMJEw2 fLny5X6I8CmgjEhUDNVwDsV6h9IO8rt+/N386eIpS6SSdRR9QrAXXw2KO38XTP+4aMnI V6o37/P7v8/yoGqGUUU7IdBEGN9B2Tc7rpCtACrX7BRPjJmAjOy0bdAeDpp35UdWQWgr SQt6zTJbmVfpXPOTR5hp2OY8+ie7k/UrB5XTcT+8vzrbdqHXdloylNKIrysQoSlpjK8U Fuuw== X-Gm-Message-State: AOJu0YzN+W8cDr+eH37hg/ZbG6j2PRMimhPNzk6MU/cEMEhTrHdaVNA2 pthF23mFduPzzBhy4a4J4K9qOCrIqa3a15Gw5moihsWsW7BasKRhvyNPgP9hXT0qkoem/CnZk93 VrOhGmw== X-Google-Smtp-Source: AGHT+IEJ2AI2A4PXH7QWswb1Pl+gt6cMF8gwgWO825iLJOSfVYqMzyrwBBoRP6/GArj8+vx2Cu7gcQ== X-Received: by 2002:a17:903:2b0b:b0:1dc:cbc0:196f with SMTP id mc11-20020a1709032b0b00b001dccbc0196fmr2766956plb.10.1709313456606; Fri, 01 Mar 2024 09:17:36 -0800 (PST) Received: from hermes.local (204-195-123-141.wavecable.com. [204.195.123.141]) by smtp.gmail.com with ESMTPSA id j14-20020a170902da8e00b001dc8d6a9d40sm3695764plx.144.2024.03.01.09.17.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Mar 2024 09:17:36 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Yuying Zhang Subject: [PATCH v2 25/71] net/i40e: replace use of fixed size rte_memcpy Date: Fri, 1 Mar 2024 09:15:21 -0800 Message-ID: <20240301171707.95242-26-stephen@networkplumber.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240301171707.95242-1-stephen@networkplumber.org> References: <20240229225936.483472-1-stephen@networkplumber.org> <20240301171707.95242-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 --- drivers/net/i40e/i40e_ethdev.c | 109 ++++++++++++++------------------ drivers/net/i40e/i40e_fdir.c | 28 ++++---- drivers/net/i40e/i40e_flow.c | 56 ++++++++-------- drivers/net/i40e/i40e_pf.c | 3 +- drivers/net/i40e/i40e_tm.c | 11 ++-- drivers/net/i40e/rte_pmd_i40e.c | 34 +++++----- 6 files changed, 108 insertions(+), 133 deletions(-) diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c index 4d21341382d8..9ccfe88a3318 100644 --- a/drivers/net/i40e/i40e_ethdev.c +++ b/drivers/net/i40e/i40e_ethdev.c @@ -22,7 +22,6 @@ #include #include #include -#include #include #include #include @@ -4310,7 +4309,7 @@ i40e_macaddr_add(struct rte_eth_dev *dev, return -EINVAL; } - rte_memcpy(&mac_filter.mac_addr, mac_addr, RTE_ETHER_ADDR_LEN); + memcpy(&mac_filter.mac_addr, mac_addr, RTE_ETHER_ADDR_LEN); if (rxmode->offloads & RTE_ETH_RX_OFFLOAD_VLAN_FILTER) mac_filter.filter_type = I40E_MACVLAN_PERFECT_MATCH; else @@ -5195,7 +5194,7 @@ i40e_vsi_vlan_pvid_set(struct i40e_vsi *vsi, vsi->info.valid_sections = rte_cpu_to_le_16(I40E_AQ_VSI_PROP_VLAN_VALID); memset(&ctxt, 0, sizeof(ctxt)); - rte_memcpy(&ctxt.info, &vsi->info, sizeof(vsi->info)); + memcpy(&ctxt.info, &vsi->info, sizeof(vsi->info)); ctxt.seid = vsi->seid; hw = I40E_VSI_TO_HW(vsi); @@ -5234,8 +5233,8 @@ i40e_vsi_update_tc_bandwidth(struct i40e_vsi *vsi, uint8_t enabled_tcmap) return ret; } - rte_memcpy(vsi->info.qs_handle, tc_bw_data.qs_handles, - sizeof(vsi->info.qs_handle)); + memcpy(vsi->info.qs_handle, tc_bw_data.qs_handles, + sizeof(vsi->info.qs_handle)); return I40E_SUCCESS; } @@ -5492,8 +5491,7 @@ i40e_update_default_filter_setting(struct i40e_vsi *vsi) if (vsi->type != I40E_VSI_MAIN) return I40E_ERR_CONFIG; memset(&def_filter, 0, sizeof(def_filter)); - rte_memcpy(def_filter.mac_addr, hw->mac.perm_addr, - ETH_ADDR_LEN); + memcpy(def_filter.mac_addr, hw->mac.perm_addr, ETH_ADDR_LEN); def_filter.vlan_tag = 0; def_filter.flags = I40E_AQC_MACVLAN_DEL_PERFECT_MATCH | I40E_AQC_MACVLAN_DEL_IGNORE_VLAN; @@ -5511,16 +5509,15 @@ i40e_update_default_filter_setting(struct i40e_vsi *vsi) return I40E_ERR_NO_MEMORY; } mac = &f->mac_info.mac_addr; - rte_memcpy(&mac->addr_bytes, hw->mac.perm_addr, - ETH_ADDR_LEN); + memcpy(&mac->addr_bytes, hw->mac.perm_addr, ETH_ADDR_LEN); f->mac_info.filter_type = I40E_MACVLAN_PERFECT_MATCH; TAILQ_INSERT_TAIL(&vsi->mac_list, f, next); vsi->mac_num++; return ret; } - rte_memcpy(&filter.mac_addr, - (struct rte_ether_addr *)(hw->mac.perm_addr), ETH_ADDR_LEN); + memcpy(&filter.mac_addr, (struct rte_ether_addr *)(hw->mac.perm_addr), + ETH_ADDR_LEN); filter.filter_type = I40E_MACVLAN_PERFECT_MATCH; return i40e_vsi_add_mac(vsi, &filter); } @@ -5839,8 +5836,8 @@ i40e_vsi_setup(struct i40e_pf *pf, PMD_DRV_LOG(ERR, "Failed to get VSI params"); goto fail_msix_alloc; } - rte_memcpy(&vsi->info, &ctxt.info, - sizeof(struct i40e_aqc_vsi_properties_data)); + memcpy(&vsi->info, &ctxt.info, + sizeof(struct i40e_aqc_vsi_properties_data)); vsi->vsi_id = ctxt.vsi_number; vsi->info.valid_sections = 0; @@ -5857,8 +5854,8 @@ i40e_vsi_setup(struct i40e_pf *pf, rte_cpu_to_le_16(I40E_AQ_VSI_PROP_VLAN_VALID); vsi->info.port_vlan_flags = I40E_AQ_VSI_PVLAN_MODE_ALL | I40E_AQ_VSI_PVLAN_EMOD_STR_BOTH; - rte_memcpy(&ctxt.info, &vsi->info, - sizeof(struct i40e_aqc_vsi_properties_data)); + memcpy(&ctxt.info, &vsi->info, + sizeof(struct i40e_aqc_vsi_properties_data)); ret = i40e_vsi_config_tc_queue_mapping(vsi, &ctxt.info, I40E_DEFAULT_TCMAP); if (ret != I40E_SUCCESS) { @@ -5878,16 +5875,15 @@ i40e_vsi_setup(struct i40e_pf *pf, goto fail_msix_alloc; } - rte_memcpy(&vsi->info.tc_mapping, &ctxt.info.tc_mapping, - sizeof(vsi->info.tc_mapping)); - rte_memcpy(&vsi->info.queue_mapping, - &ctxt.info.queue_mapping, - sizeof(vsi->info.queue_mapping)); + memcpy(&vsi->info.tc_mapping, &ctxt.info.tc_mapping, + sizeof(vsi->info.tc_mapping)); + memcpy(&vsi->info.queue_mapping, &ctxt.info.queue_mapping, + sizeof(vsi->info.queue_mapping)); vsi->info.mapping_flags = ctxt.info.mapping_flags; vsi->info.valid_sections = 0; - rte_memcpy(pf->dev_addr.addr_bytes, hw->mac.perm_addr, - ETH_ADDR_LEN); + memcpy(pf->dev_addr.addr_bytes, hw->mac.perm_addr, + ETH_ADDR_LEN); /** * Updating default filter settings are necessary to prevent @@ -6030,7 +6026,7 @@ i40e_vsi_setup(struct i40e_pf *pf, if (vsi->type != I40E_VSI_FDIR) { /* MAC/VLAN configuration for non-FDIR VSI*/ - rte_memcpy(&filter.mac_addr, &broadcast, RTE_ETHER_ADDR_LEN); + memcpy(&filter.mac_addr, &broadcast, RTE_ETHER_ADDR_LEN); filter.filter_type = I40E_MACVLAN_PERFECT_MATCH; ret = i40e_vsi_add_mac(vsi, &filter); @@ -6143,7 +6139,7 @@ i40e_vsi_config_vlan_stripping(struct i40e_vsi *vsi, bool on) vsi->info.port_vlan_flags &= ~(I40E_AQ_VSI_PVLAN_EMOD_MASK); vsi->info.port_vlan_flags |= vlan_flags; ctxt.seid = vsi->seid; - rte_memcpy(&ctxt.info, &vsi->info, sizeof(vsi->info)); + memcpy(&ctxt.info, &vsi->info, sizeof(vsi->info)); ret = i40e_aq_update_vsi_params(hw, &ctxt, NULL); if (ret) PMD_DRV_LOG(INFO, "Update VSI failed to %s vlan stripping", @@ -7010,8 +7006,8 @@ i40e_add_macvlan_filters(struct i40e_vsi *vsi, memset(req_list, 0, ele_buff_size); for (i = 0; i < actual_num; i++) { - rte_memcpy(req_list[i].mac_addr, - &filter[num + i].macaddr, ETH_ADDR_LEN); + memcpy(req_list[i].mac_addr, &filter[num + i].macaddr, + ETH_ADDR_LEN); req_list[i].vlan_tag = rte_cpu_to_le_16(filter[num + i].vlan_id); @@ -7086,8 +7082,8 @@ i40e_remove_macvlan_filters(struct i40e_vsi *vsi, memset(req_list, 0, ele_buff_size); for (i = 0; i < actual_num; i++) { - rte_memcpy(req_list[i].mac_addr, - &filter[num + i].macaddr, ETH_ADDR_LEN); + memcpy(req_list[i].mac_addr, &filter[num + i].macaddr, + ETH_ADDR_LEN); req_list[i].vlan_tag = rte_cpu_to_le_16(filter[num + i].vlan_id); @@ -7243,8 +7239,8 @@ i40e_find_all_vlan_for_mac(struct i40e_vsi *vsi, "vlan number doesn't match"); return I40E_ERR_PARAM; } - rte_memcpy(&mv_f[i].macaddr, - addr, ETH_ADDR_LEN); + memcpy(&mv_f[i].macaddr, addr, + ETH_ADDR_LEN); mv_f[i].vlan_id = j * I40E_UINT32_BIT_SIZE + k; i++; @@ -7272,8 +7268,7 @@ i40e_find_all_mac_for_vlan(struct i40e_vsi *vsi, PMD_DRV_LOG(ERR, "buffer number not match"); return I40E_ERR_PARAM; } - rte_memcpy(&mv_f[i].macaddr, &f->mac_info.mac_addr, - ETH_ADDR_LEN); + memcpy(&mv_f[i].macaddr, &f->mac_info.mac_addr, ETH_ADDR_LEN); mv_f[i].vlan_id = vlan; mv_f[i].filter_type = f->mac_info.filter_type; i++; @@ -7308,8 +7303,8 @@ i40e_vsi_remove_all_macvlan_filter(struct i40e_vsi *vsi) i = 0; if (vsi->vlan_num == 0) { TAILQ_FOREACH(f, &vsi->mac_list, next) { - rte_memcpy(&mv_f[i].macaddr, - &f->mac_info.mac_addr, ETH_ADDR_LEN); + memcpy(&mv_f[i].macaddr, &f->mac_info.mac_addr, + ETH_ADDR_LEN); mv_f[i].filter_type = f->mac_info.filter_type; mv_f[i].vlan_id = 0; i++; @@ -7478,8 +7473,7 @@ i40e_vsi_add_mac(struct i40e_vsi *vsi, struct i40e_mac_filter_info *mac_filter) for (i = 0; i < vlan_num; i++) { mv_f[i].filter_type = mac_filter->filter_type; - rte_memcpy(&mv_f[i].macaddr, &mac_filter->mac_addr, - ETH_ADDR_LEN); + memcpy(&mv_f[i].macaddr, &mac_filter->mac_addr, ETH_ADDR_LEN); } if (mac_filter->filter_type == I40E_MACVLAN_PERFECT_MATCH || @@ -7501,8 +7495,7 @@ i40e_vsi_add_mac(struct i40e_vsi *vsi, struct i40e_mac_filter_info *mac_filter) ret = I40E_ERR_NO_MEMORY; goto DONE; } - rte_memcpy(&f->mac_info.mac_addr, &mac_filter->mac_addr, - ETH_ADDR_LEN); + memcpy(&f->mac_info.mac_addr, &mac_filter->mac_addr, ETH_ADDR_LEN); f->mac_info.filter_type = mac_filter->filter_type; TAILQ_INSERT_TAIL(&vsi->mac_list, f, next); vsi->mac_num++; @@ -7548,8 +7541,7 @@ i40e_vsi_delete_mac(struct i40e_vsi *vsi, struct rte_ether_addr *addr) for (i = 0; i < vlan_num; i++) { mv_f[i].filter_type = filter_type; - rte_memcpy(&mv_f[i].macaddr, &f->mac_info.mac_addr, - ETH_ADDR_LEN); + memcpy(&mv_f[i].macaddr, &f->mac_info.mac_addr, ETH_ADDR_LEN); } if (filter_type == I40E_MACVLAN_PERFECT_MATCH || filter_type == I40E_MACVLAN_HASH_MATCH) { @@ -7835,9 +7827,8 @@ i40e_tunnel_filter_convert( tunnel_filter->input.flags = cld_filter->element.flags; tunnel_filter->input.tenant_id = cld_filter->element.tenant_id; tunnel_filter->queue = cld_filter->element.queue_number; - rte_memcpy(tunnel_filter->input.general_fields, - cld_filter->general_fields, - sizeof(cld_filter->general_fields)); + memcpy(tunnel_filter->input.general_fields, + cld_filter->general_fields, sizeof(cld_filter->general_fields)); return 0; } @@ -8384,9 +8375,8 @@ i40e_dev_consistent_tunnel_filter_set(struct i40e_pf *pf, ip_type = I40E_AQC_ADD_CLOUD_FLAGS_IPV4; ipv4_addr = rte_be_to_cpu_32(tunnel_filter->ip_addr.ipv4_addr); ipv4_addr_le = rte_cpu_to_le_32(ipv4_addr); - rte_memcpy(&pfilter->element.ipaddr.v4.data, - &ipv4_addr_le, - sizeof(pfilter->element.ipaddr.v4.data)); + memcpy(&pfilter->element.ipaddr.v4.data, &ipv4_addr_le, + sizeof(pfilter->element.ipaddr.v4.data)); } else { ip_type = I40E_AQC_ADD_CLOUD_FLAGS_IPV6; for (i = 0; i < 4; i++) { @@ -8394,9 +8384,8 @@ i40e_dev_consistent_tunnel_filter_set(struct i40e_pf *pf, rte_cpu_to_le_32(rte_be_to_cpu_32( tunnel_filter->ip_addr.ipv6_addr[i])); } - rte_memcpy(&pfilter->element.ipaddr.v6.data, - &convert_ipv6, - sizeof(pfilter->element.ipaddr.v6.data)); + memcpy(&pfilter->element.ipaddr.v6.data, &convert_ipv6, + sizeof(pfilter->element.ipaddr.v6.data)); } /* check tunneled type */ @@ -8641,7 +8630,7 @@ i40e_dev_consistent_tunnel_filter_set(struct i40e_pf *pf, return -ENOMEM; } - rte_memcpy(tunnel, &check_filter, sizeof(check_filter)); + memcpy(tunnel, &check_filter, sizeof(check_filter)); ret = i40e_sw_tunnel_filter_insert(pf, tunnel); if (ret < 0) rte_free(tunnel); @@ -9766,8 +9755,7 @@ static int i40e_ethertype_filter_convert(const struct rte_eth_ethertype_filter *input, struct i40e_ethertype_filter *filter) { - rte_memcpy(&filter->input.mac_addr, &input->mac_addr, - RTE_ETHER_ADDR_LEN); + memcpy(&filter->input.mac_addr, &input->mac_addr, RTE_ETHER_ADDR_LEN); filter->input.ether_type = input->ether_type; filter->flags = input->flags; filter->queue = input->queue; @@ -9914,8 +9902,7 @@ i40e_ethertype_filter_set(struct i40e_pf *pf, return -ENOMEM; } - rte_memcpy(ethertype_filter, &check_filter, - sizeof(check_filter)); + memcpy(ethertype_filter, &check_filter, sizeof(check_filter)); ret = i40e_sw_ethertype_filter_insert(pf, ethertype_filter); if (ret < 0) rte_free(ethertype_filter); @@ -10795,11 +10782,10 @@ i40e_vsi_config_tc(struct i40e_vsi *vsi, uint8_t tc_map) goto out; } /* update the local VSI info with updated queue map */ - rte_memcpy(&vsi->info.tc_mapping, &ctxt.info.tc_mapping, - sizeof(vsi->info.tc_mapping)); - rte_memcpy(&vsi->info.queue_mapping, - &ctxt.info.queue_mapping, - sizeof(vsi->info.queue_mapping)); + memcpy(&vsi->info.tc_mapping, &ctxt.info.tc_mapping, + sizeof(vsi->info.tc_mapping)); + memcpy(&vsi->info.queue_mapping, &ctxt.info.queue_mapping, + sizeof(vsi->info.queue_mapping)); vsi->info.mapping_flags = ctxt.info.mapping_flags; vsi->info.valid_sections = 0; @@ -11551,9 +11537,8 @@ i40e_tunnel_filter_restore(struct i40e_pf *pf) cld_filter.element.flags = f->input.flags; cld_filter.element.tenant_id = f->input.tenant_id; cld_filter.element.queue_number = f->queue; - rte_memcpy(cld_filter.general_fields, - f->input.general_fields, - sizeof(f->input.general_fields)); + memcpy(cld_filter.general_fields, f->input.general_fields, + sizeof(f->input.general_fields)); if (((f->input.flags & I40E_AQC_ADD_CLOUD_FILTER_0X11) == diff --git a/drivers/net/i40e/i40e_fdir.c b/drivers/net/i40e/i40e_fdir.c index 47f79ecf11cc..554b763e9f84 100644 --- a/drivers/net/i40e/i40e_fdir.c +++ b/drivers/net/i40e/i40e_fdir.c @@ -464,10 +464,10 @@ fill_ip6_head(const struct i40e_fdir_input *fdir_input, unsigned char *raw_pkt, * need to be presented in a reversed order with respect * to the expected received packets. */ - rte_memcpy(&ip6->src_addr, &fdir_input->flow.ipv6_flow.dst_ip, - IPV6_ADDR_LEN); - rte_memcpy(&ip6->dst_addr, &fdir_input->flow.ipv6_flow.src_ip, - IPV6_ADDR_LEN); + memcpy(&ip6->src_addr, &fdir_input->flow.ipv6_flow.dst_ip, + IPV6_ADDR_LEN); + memcpy(&ip6->dst_addr, &fdir_input->flow.ipv6_flow.src_ip, + IPV6_ADDR_LEN); len += sizeof(struct rte_ipv6_hdr); return len; @@ -528,18 +528,16 @@ i40e_flow_fdir_fill_eth_ip_head(struct i40e_pf *pf, [I40E_FILTER_PCTYPE_NONF_IPV6_OTHER] = IPPROTO_NONE, }; - rte_memcpy(raw_pkt, &fdir_input->flow.l2_flow.dst, - sizeof(struct rte_ether_addr)); - rte_memcpy(raw_pkt + sizeof(struct rte_ether_addr), - &fdir_input->flow.l2_flow.src, - sizeof(struct rte_ether_addr)); + memcpy(raw_pkt, &fdir_input->flow.l2_flow.dst, + sizeof(struct rte_ether_addr)); + memcpy(raw_pkt + sizeof(struct rte_ether_addr), + &fdir_input->flow.l2_flow.src, sizeof(struct rte_ether_addr)); raw_pkt += 2 * sizeof(struct rte_ether_addr); if (vlan && fdir_input->flow_ext.vlan_tci) { - rte_memcpy(raw_pkt, vlan_frame, sizeof(vlan_frame)); - rte_memcpy(raw_pkt + sizeof(uint16_t), - &fdir_input->flow_ext.vlan_tci, - sizeof(uint16_t)); + memcpy(raw_pkt, vlan_frame, sizeof(vlan_frame)); + memcpy(raw_pkt + sizeof(uint16_t), + &fdir_input->flow_ext.vlan_tci, sizeof(uint16_t)); raw_pkt += sizeof(vlan_frame); len += sizeof(vlan_frame); } @@ -1003,7 +1001,7 @@ static int i40e_fdir_filter_convert(const struct i40e_fdir_filter_conf *input, struct i40e_fdir_filter *filter) { - rte_memcpy(&filter->fdir, input, sizeof(struct i40e_fdir_filter_conf)); + memcpy(&filter->fdir, input, sizeof(struct i40e_fdir_filter_conf)); if (input->input.flow_ext.pkt_template) { filter->fdir.input.flow.raw_flow.packet = NULL; filter->fdir.input.flow.raw_flow.length = @@ -1060,7 +1058,7 @@ i40e_sw_fdir_filter_insert(struct i40e_pf *pf, struct i40e_fdir_filter *filter) return -1; hash_filter = &fdir_info->fdir_filter_array[ret]; - rte_memcpy(hash_filter, filter, sizeof(*filter)); + memcpy(hash_filter, filter, sizeof(*filter)); fdir_info->hash_map[ret] = hash_filter; TAILQ_INSERT_TAIL(&fdir_info->fdir_list, hash_filter, rules); diff --git a/drivers/net/i40e/i40e_flow.c b/drivers/net/i40e/i40e_flow.c index 92165c8422d5..9afb7a540d21 100644 --- a/drivers/net/i40e/i40e_flow.c +++ b/drivers/net/i40e/i40e_flow.c @@ -1175,7 +1175,7 @@ i40e_pattern_skip_void_item(struct rte_flow_item *items, pb = pe + 1; } /* Copy the END item. */ - rte_memcpy(items, pe, sizeof(struct rte_flow_item)); + memcpy(items, pe, sizeof(struct rte_flow_item)); } /* Check if the pattern matches a supported item type array */ @@ -1986,10 +1986,10 @@ i40e_flow_parse_fdir_pattern(struct rte_eth_dev *dev, filter->input.flow_ext.oip_type = I40E_FDIR_IPTYPE_IPV6; - rte_memcpy(filter->input.flow.ipv6_flow.src_ip, - ipv6_spec->hdr.src_addr, 16); - rte_memcpy(filter->input.flow.ipv6_flow.dst_ip, - ipv6_spec->hdr.dst_addr, 16); + memcpy(filter->input.flow.ipv6_flow.src_ip, + ipv6_spec->hdr.src_addr, 16); + memcpy(filter->input.flow.ipv6_flow.dst_ip, + ipv6_spec->hdr.dst_addr, 16); /* Check if it is fragment. */ if (ipv6_spec->hdr.proto == @@ -2926,14 +2926,14 @@ i40e_flow_parse_vxlan_pattern(__rte_unused struct rte_eth_dev *dev, } if (!vxlan_flag) { - rte_memcpy(&filter->outer_mac, - ð_spec->hdr.dst_addr, - RTE_ETHER_ADDR_LEN); + memcpy(&filter->outer_mac, + ð_spec->hdr.dst_addr, + RTE_ETHER_ADDR_LEN); filter_type |= RTE_ETH_TUNNEL_FILTER_OMAC; } else { - rte_memcpy(&filter->inner_mac, - ð_spec->hdr.dst_addr, - RTE_ETHER_ADDR_LEN); + memcpy(&filter->inner_mac, + ð_spec->hdr.dst_addr, + RTE_ETHER_ADDR_LEN); filter_type |= RTE_ETH_TUNNEL_FILTER_IMAC; } } @@ -3026,8 +3026,8 @@ i40e_flow_parse_vxlan_pattern(__rte_unused struct rte_eth_dev *dev, return -rte_errno; } - rte_memcpy(((uint8_t *)&tenant_id_be + 1), - vxlan_spec->hdr.vni, 3); + memcpy(((uint8_t *)&tenant_id_be + 1), + vxlan_spec->hdr.vni, 3); filter->tenant_id = rte_be_to_cpu_32(tenant_id_be); filter_type |= RTE_ETH_TUNNEL_FILTER_TENID; @@ -3156,14 +3156,14 @@ i40e_flow_parse_nvgre_pattern(__rte_unused struct rte_eth_dev *dev, } if (!nvgre_flag) { - rte_memcpy(&filter->outer_mac, - ð_spec->hdr.dst_addr, - RTE_ETHER_ADDR_LEN); + memcpy(&filter->outer_mac, + ð_spec->hdr.dst_addr, + RTE_ETHER_ADDR_LEN); filter_type |= RTE_ETH_TUNNEL_FILTER_OMAC; } else { - rte_memcpy(&filter->inner_mac, - ð_spec->hdr.dst_addr, - RTE_ETHER_ADDR_LEN); + memcpy(&filter->inner_mac, + ð_spec->hdr.dst_addr, + RTE_ETHER_ADDR_LEN); filter_type |= RTE_ETH_TUNNEL_FILTER_IMAC; } } @@ -3278,8 +3278,8 @@ i40e_flow_parse_nvgre_pattern(__rte_unused struct rte_eth_dev *dev, "Invalid NVGRE item"); return -rte_errno; } - rte_memcpy(((uint8_t *)&tenant_id_be + 1), - nvgre_spec->tni, 3); + memcpy(((uint8_t *)&tenant_id_be + 1), + nvgre_spec->tni, 3); filter->tenant_id = rte_be_to_cpu_32(tenant_id_be); filter_type |= RTE_ETH_TUNNEL_FILTER_TENID; @@ -3447,8 +3447,8 @@ i40e_flow_parse_mpls_pattern(__rte_unused struct rte_eth_dev *dev, "Invalid MPLS label mask"); return -rte_errno; } - rte_memcpy(((uint8_t *)&label_be + 1), - mpls_spec->label_tc_s, 3); + memcpy(((uint8_t *)&label_be + 1), + mpls_spec->label_tc_s, 3); filter->tenant_id = rte_be_to_cpu_32(label_be) >> 4; break; default: @@ -4051,9 +4051,8 @@ i40e_flow_destroy_tunnel_filter(struct i40e_pf *pf, cld_filter.element.flags = filter->input.flags; cld_filter.element.tenant_id = filter->input.tenant_id; cld_filter.element.queue_number = filter->queue; - rte_memcpy(cld_filter.general_fields, - filter->input.general_fields, - sizeof(cld_filter.general_fields)); + memcpy(cld_filter.general_fields, filter->input.general_fields, + sizeof(cld_filter.general_fields)); if (!filter->is_to_vf) vsi = pf->main_vsi; @@ -4271,9 +4270,8 @@ i40e_flow_query(struct rte_eth_dev *dev __rte_unused, "action not supported"); return -rte_errno; } - rte_memcpy(rss_conf, - &rss_rule->rss_filter_info.conf, - sizeof(struct rte_flow_action_rss)); + memcpy(rss_conf, &rss_rule->rss_filter_info.conf, + sizeof(struct rte_flow_action_rss)); break; default: return rte_flow_error_set(error, ENOTSUP, diff --git a/drivers/net/i40e/i40e_pf.c b/drivers/net/i40e/i40e_pf.c index 15d9ff868f3a..f8073ef9cb47 100644 --- a/drivers/net/i40e/i40e_pf.c +++ b/drivers/net/i40e/i40e_pf.c @@ -16,7 +16,6 @@ #include #include #include -#include #include "i40e_logs.h" #include "base/i40e_prototype.h" @@ -869,7 +868,7 @@ i40e_pf_host_process_cmd_add_ether_address(struct i40e_pf_vf *vf, for (i = 0; i < addr_list->num_elements; i++) { mac = (struct rte_ether_addr *)(addr_list->list[i].addr); - rte_memcpy(&filter.mac_addr, mac, RTE_ETHER_ADDR_LEN); + memcpy(&filter.mac_addr, mac, RTE_ETHER_ADDR_LEN); filter.filter_type = I40E_MACVLAN_PERFECT_MATCH; if (rte_is_zero_ether_addr(mac) || i40e_vsi_add_mac(vf->vsi, &filter)) { diff --git a/drivers/net/i40e/i40e_tm.c b/drivers/net/i40e/i40e_tm.c index cab296e1a4af..3f77a7b3a056 100644 --- a/drivers/net/i40e/i40e_tm.c +++ b/drivers/net/i40e/i40e_tm.c @@ -279,8 +279,8 @@ i40e_shaper_profile_add(struct rte_eth_dev *dev, if (!shaper_profile) return -ENOMEM; shaper_profile->shaper_profile_id = shaper_profile_id; - rte_memcpy(&shaper_profile->profile, profile, - sizeof(struct rte_tm_shaper_params)); + memcpy(&shaper_profile->profile, profile, + sizeof(struct rte_tm_shaper_params)); TAILQ_INSERT_TAIL(&pf->tm_conf.shaper_profile_list, shaper_profile, node); @@ -526,8 +526,8 @@ i40e_node_add(struct rte_eth_dev *dev, uint32_t node_id, tm_node->reference_count = 0; tm_node->parent = NULL; tm_node->shaper_profile = shaper_profile; - rte_memcpy(&tm_node->params, params, - sizeof(struct rte_tm_node_params)); + memcpy(&tm_node->params, params, + sizeof(struct rte_tm_node_params)); pf->tm_conf.root = tm_node; /* increase the reference counter of the shaper profile */ @@ -600,8 +600,7 @@ i40e_node_add(struct rte_eth_dev *dev, uint32_t node_id, tm_node->reference_count = 0; tm_node->parent = parent_node; tm_node->shaper_profile = shaper_profile; - rte_memcpy(&tm_node->params, params, - sizeof(struct rte_tm_node_params)); + memcpy(&tm_node->params, params, sizeof(struct rte_tm_node_params)); if (parent_node_type == I40E_TM_NODE_TYPE_PORT) { TAILQ_INSERT_TAIL(&pf->tm_conf.tc_list, tm_node, node); diff --git a/drivers/net/i40e/rte_pmd_i40e.c b/drivers/net/i40e/rte_pmd_i40e.c index 9d39984ea1fc..03d0b61902a9 100644 --- a/drivers/net/i40e/rte_pmd_i40e.c +++ b/drivers/net/i40e/rte_pmd_i40e.c @@ -90,7 +90,7 @@ rte_pmd_i40e_set_vf_mac_anti_spoof(uint16_t port, uint16_t vf_id, uint8_t on) vsi->info.sec_flags &= ~I40E_AQ_VSI_SEC_FLAG_ENABLE_MAC_CHK; memset(&ctxt, 0, sizeof(ctxt)); - rte_memcpy(&ctxt.info, &vsi->info, sizeof(vsi->info)); + memcpy(&ctxt.info, &vsi->info, sizeof(vsi->info)); ctxt.seid = vsi->seid; hw = I40E_VSI_TO_HW(vsi); @@ -192,7 +192,7 @@ rte_pmd_i40e_set_vf_vlan_anti_spoof(uint16_t port, uint16_t vf_id, uint8_t on) vsi->info.sec_flags &= ~I40E_AQ_VSI_SEC_FLAG_ENABLE_VLAN_CHK; memset(&ctxt, 0, sizeof(ctxt)); - rte_memcpy(&ctxt.info, &vsi->info, sizeof(vsi->info)); + memcpy(&ctxt.info, &vsi->info, sizeof(vsi->info)); ctxt.seid = vsi->seid; hw = I40E_VSI_TO_HW(vsi); @@ -237,9 +237,8 @@ i40e_vsi_rm_mac_filter(struct i40e_vsi *vsi) for (i = 0; i < vlan_num; i++) { mv_f[i].filter_type = filter_type; - rte_memcpy(&mv_f[i].macaddr, - &f->mac_info.mac_addr, - ETH_ADDR_LEN); + memcpy(&mv_f[i].macaddr, &f->mac_info.mac_addr, + ETH_ADDR_LEN); } if (filter_type == I40E_MACVLAN_PERFECT_MATCH || filter_type == I40E_MACVLAN_HASH_MATCH) { @@ -298,9 +297,8 @@ i40e_vsi_restore_mac_filter(struct i40e_vsi *vsi) for (i = 0; i < vlan_num; i++) { mv_f[i].filter_type = f->mac_info.filter_type; - rte_memcpy(&mv_f[i].macaddr, - &f->mac_info.mac_addr, - ETH_ADDR_LEN); + memcpy(&mv_f[i].macaddr, &f->mac_info.mac_addr, + ETH_ADDR_LEN); } if (f->mac_info.filter_type == I40E_MACVLAN_PERFECT_MATCH || @@ -380,7 +378,7 @@ i40e_vsi_set_tx_loopback(struct i40e_vsi *vsi, uint8_t on) vsi->info.switch_id &= ~I40E_AQ_VSI_SW_ID_FLAG_ALLOW_LB; memset(&ctxt, 0, sizeof(ctxt)); - rte_memcpy(&ctxt.info, &vsi->info, sizeof(vsi->info)); + memcpy(&ctxt.info, &vsi->info, sizeof(vsi->info)); ctxt.seid = vsi->seid; ret = i40e_aq_update_vsi_params(hw, &ctxt, NULL); @@ -705,7 +703,7 @@ int rte_pmd_i40e_set_vf_vlan_insert(uint16_t port, uint16_t vf_id, vsi->info.port_vlan_flags &= ~I40E_AQ_VSI_PVLAN_INSERT_PVID; memset(&ctxt, 0, sizeof(ctxt)); - rte_memcpy(&ctxt.info, &vsi->info, sizeof(vsi->info)); + memcpy(&ctxt.info, &vsi->info, sizeof(vsi->info)); ctxt.seid = vsi->seid; hw = I40E_VSI_TO_HW(vsi); @@ -767,7 +765,7 @@ int rte_pmd_i40e_set_vf_broadcast(uint16_t port, uint16_t vf_id, } if (on) { - rte_memcpy(&filter.mac_addr, &broadcast, RTE_ETHER_ADDR_LEN); + memcpy(&filter.mac_addr, &broadcast, RTE_ETHER_ADDR_LEN); filter.filter_type = I40E_MACVLAN_PERFECT_MATCH; ret = i40e_vsi_add_mac(vsi, &filter); } else { @@ -839,7 +837,7 @@ int rte_pmd_i40e_set_vf_vlan_tag(uint16_t port, uint16_t vf_id, uint8_t on) } memset(&ctxt, 0, sizeof(ctxt)); - rte_memcpy(&ctxt.info, &vsi->info, sizeof(vsi->info)); + memcpy(&ctxt.info, &vsi->info, sizeof(vsi->info)); ctxt.seid = vsi->seid; hw = I40E_VSI_TO_HW(vsi); @@ -2586,11 +2584,10 @@ i40e_vsi_update_queue_region_mapping(struct i40e_hw *hw, return ret; } /* update the local VSI info with updated queue map */ - rte_memcpy(&vsi->info.tc_mapping, &ctxt.info.tc_mapping, - sizeof(vsi->info.tc_mapping)); - rte_memcpy(&vsi->info.queue_mapping, - &ctxt.info.queue_mapping, - sizeof(vsi->info.queue_mapping)); + memcpy(&vsi->info.tc_mapping, &ctxt.info.tc_mapping, + sizeof(vsi->info.tc_mapping)); + memcpy(&vsi->info.queue_mapping, &ctxt.info.queue_mapping, + sizeof(vsi->info.queue_mapping)); vsi->info.mapping_flags = ctxt.info.mapping_flags; vsi->info.valid_sections = 0; @@ -2961,8 +2958,7 @@ i40e_queue_region_get_all_info(struct i40e_pf *pf, { struct i40e_queue_regions *info = &pf->queue_region; - rte_memcpy(regions_ptr, info, - sizeof(struct i40e_queue_regions)); + memcpy(regions_ptr, info, sizeof(struct i40e_queue_regions)); return 0; } -- 2.43.0