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 12D6943C12; Fri, 1 Mar 2024 18:21:06 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A0C804343C; Fri, 1 Mar 2024 18:17:58 +0100 (CET) Received: from mail-pl1-f173.google.com (mail-pl1-f173.google.com [209.85.214.173]) by mails.dpdk.org (Postfix) with ESMTP id 389E443392 for ; Fri, 1 Mar 2024 18:17:41 +0100 (CET) Received: by mail-pl1-f173.google.com with SMTP id d9443c01a7336-1dc49b00bdbso24001945ad.3 for ; Fri, 01 Mar 2024 09:17:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1709313460; x=1709918260; 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=QilAi4ZcFsxnQwbWp/nw4/i6IyoPNGA2EZX5mX0L24w=; b=Xvxv1tknukQqGLi2gOGAVvKuc7BLA+7VfbRtQzA3S0saZRJW/kKGoY/DYspZCJevCk YBx/LP8c/rlWpQwHH+YBEc/ojrOrKoSaHW8Ziwog6Qcajv0fKorFkpCxVD8HtA2dWmJ0 f8Op1r1Yb+u3tJPs6yYepYArHFCZJbDBYd2wGF3CkjFUEDOAA8wnoCZmynEiUFP9PdJi Kw+R/Pa6EK62DBCBU7ptY7wg/38THUE2K88uYnsbTvEWaHlWoDru7W8BnitW2C8jO75r HOW7LE+KxJH/ruRd7LowbMNBHYxgJXFobgPamx75O9q9eP4pLNqmtsGZIr4m2SEcleYg +bGA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709313460; x=1709918260; 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=QilAi4ZcFsxnQwbWp/nw4/i6IyoPNGA2EZX5mX0L24w=; b=wIW9vR747o7iZ7KfiF40wZEbXATXvt3gAK9YF2IdJhMVaQFhREr6adq5GxI7eT7Vlw 6W3MhV9J8rYG9+JZKXvMhxAYnbumsctodxs5UFn0Klf9u08GrfUHaM5qjHyfzaFMeqXn 2NIi5+IChpZ1ajG6YvmD3KRV8Fk4dZ316ww7+eRguv1pFOS3cxwaEQwPAoiHulkz+FGN fHAuU4s5Fic04jjlJ6RFRhcgC8vhlkaVMSYMeD4gDgG5hkOZ81N9MlT3MvgoXmFBzL2t AUKumvKLJcjbJ6G1zTH96omvwBToPpinGzzuE6pmf0Q+DzIG9xcf14nInAmnhqNQ3s4k lNbA== X-Gm-Message-State: AOJu0YyHaMPTHa0+nyyprP/UB+JZjr9cOmoZBAdXl9rZgsQDk2RwS2/k svC6foGZSVbvDGr/MhMO32GycGoN08+7/iThpIrF5Eac2GXKqGLsNK9/Cr7BykI4FWpeuWfIPca 9yZb5nw== X-Google-Smtp-Source: AGHT+IGDXM4UOUXsXLDcAt+5arcyr6yUkTOEr3eleAxUcB5EYfyD/qByuYYbdiJGKm/RE7kmtofoWg== X-Received: by 2002:a17:902:e805:b0:1db:d2f7:68a4 with SMTP id u5-20020a170902e80500b001dbd2f768a4mr2465451plg.24.1709313460467; Fri, 01 Mar 2024 09:17:40 -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.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Mar 2024 09:17:40 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger Subject: [PATCH v2 30/71] net/ixgbe: replace use of fixed size rte_memcpy Date: Fri, 1 Mar 2024 09:15:26 -0800 Message-ID: <20240301171707.95242-31-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/ixgbe/ixgbe_ethdev.c | 9 ++--- drivers/net/ixgbe/ixgbe_fdir.c | 7 ++-- drivers/net/ixgbe/ixgbe_flow.c | 65 ++++++++++++++----------------- drivers/net/ixgbe/ixgbe_ipsec.c | 8 ++-- drivers/net/ixgbe/ixgbe_pf.c | 5 +-- drivers/net/ixgbe/ixgbe_tm.c | 11 +++--- drivers/net/ixgbe/rte_pmd_ixgbe.c | 4 +- 7 files changed, 48 insertions(+), 61 deletions(-) diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c index 0cd3d0b105f4..6040cac9a896 100644 --- a/drivers/net/ixgbe/ixgbe_ethdev.c +++ b/drivers/net/ixgbe/ixgbe_ethdev.c @@ -6597,9 +6597,8 @@ ixgbe_add_del_ntuple_filter(struct rte_eth_dev *dev, sizeof(struct ixgbe_5tuple_filter), 0); if (filter == NULL) return -ENOMEM; - rte_memcpy(&filter->filter_info, - &filter_5tuple, - sizeof(struct ixgbe_5tuple_filter_info)); + memcpy(&filter->filter_info, &filter_5tuple, + sizeof(struct ixgbe_5tuple_filter_info)); filter->queue = ntuple_filter->queue; ret = ixgbe_add_5tuple_filter(dev, filter); if (ret < 0) { @@ -7596,9 +7595,7 @@ ixgbe_dev_l2_tunnel_filter_add(struct rte_eth_dev *dev, if (!node) return -ENOMEM; - rte_memcpy(&node->key, - &key, - sizeof(struct ixgbe_l2_tn_key)); + memcpy(&node->key, &key, sizeof(struct ixgbe_l2_tn_key)); node->pool = l2_tunnel->pool; ret = ixgbe_insert_l2_tn_filter(l2_tn_info, node); if (ret < 0) { diff --git a/drivers/net/ixgbe/ixgbe_fdir.c b/drivers/net/ixgbe/ixgbe_fdir.c index 06d6e2126de5..b168ab82781b 100644 --- a/drivers/net/ixgbe/ixgbe_fdir.c +++ b/drivers/net/ixgbe/ixgbe_fdir.c @@ -74,7 +74,7 @@ else \ ipv6_addr[i] = 0; \ } \ - rte_memcpy((ipaddr), ipv6_addr, sizeof(ipv6_addr));\ + memcpy((ipaddr), ipv6_addr, sizeof(ipv6_addr));\ } while (0) #define IXGBE_FDIRIP6M_INNER_MAC_SHIFT 4 @@ -1217,9 +1217,8 @@ ixgbe_fdir_filter_program(struct rte_eth_dev *dev, 0); if (!node) return -ENOMEM; - rte_memcpy(&node->ixgbe_fdir, - &rule->ixgbe_fdir, - sizeof(union ixgbe_atr_input)); + memcpy(&node->ixgbe_fdir, &rule->ixgbe_fdir, + sizeof(union ixgbe_atr_input)); node->fdirflags = fdircmd_flags; node->fdirhash = fdirhash; node->queue = queue; diff --git a/drivers/net/ixgbe/ixgbe_flow.c b/drivers/net/ixgbe/ixgbe_flow.c index 687341c6b8d3..8a13f47f2b8c 100644 --- a/drivers/net/ixgbe/ixgbe_flow.c +++ b/drivers/net/ixgbe/ixgbe_flow.c @@ -1944,10 +1944,10 @@ ixgbe_parse_fdir_filter_normal(struct rte_eth_dev *dev, if (item->spec) { rule->b_spec = TRUE; ipv6_spec = item->spec; - rte_memcpy(rule->ixgbe_fdir.formatted.src_ip, - ipv6_spec->hdr.src_addr, 16); - rte_memcpy(rule->ixgbe_fdir.formatted.dst_ip, - ipv6_spec->hdr.dst_addr, 16); + memcpy(rule->ixgbe_fdir.formatted.src_ip, + ipv6_spec->hdr.src_addr, 16); + memcpy(rule->ixgbe_fdir.formatted.dst_ip, + ipv6_spec->hdr.dst_addr, 16); } /** @@ -3070,9 +3070,9 @@ ixgbe_flow_create(struct rte_eth_dev *dev, PMD_DRV_LOG(ERR, "failed to allocate memory"); goto out; } - rte_memcpy(&ntuple_filter_ptr->filter_info, - &ntuple_filter, - sizeof(struct rte_eth_ntuple_filter)); + memcpy(&ntuple_filter_ptr->filter_info, + &ntuple_filter, + sizeof(struct rte_eth_ntuple_filter)); TAILQ_INSERT_TAIL(&filter_ntuple_list, ntuple_filter_ptr, entries); flow->rule = ntuple_filter_ptr; @@ -3096,9 +3096,9 @@ ixgbe_flow_create(struct rte_eth_dev *dev, PMD_DRV_LOG(ERR, "failed to allocate memory"); goto out; } - rte_memcpy(ðertype_filter_ptr->filter_info, - ðertype_filter, - sizeof(struct rte_eth_ethertype_filter)); + memcpy(ðertype_filter_ptr->filter_info, + ðertype_filter, + sizeof(struct rte_eth_ethertype_filter)); TAILQ_INSERT_TAIL(&filter_ethertype_list, ethertype_filter_ptr, entries); flow->rule = ethertype_filter_ptr; @@ -3120,9 +3120,8 @@ ixgbe_flow_create(struct rte_eth_dev *dev, PMD_DRV_LOG(ERR, "failed to allocate memory"); goto out; } - rte_memcpy(&syn_filter_ptr->filter_info, - &syn_filter, - sizeof(struct rte_eth_syn_filter)); + memcpy(&syn_filter_ptr->filter_info, &syn_filter, + sizeof(struct rte_eth_syn_filter)); TAILQ_INSERT_TAIL(&filter_syn_list, syn_filter_ptr, entries); @@ -3141,9 +3140,8 @@ ixgbe_flow_create(struct rte_eth_dev *dev, if (fdir_rule.b_mask) { if (!fdir_info->mask_added) { /* It's the first time the mask is set. */ - rte_memcpy(&fdir_info->mask, - &fdir_rule.mask, - sizeof(struct ixgbe_hw_fdir_mask)); + memcpy(&fdir_info->mask, &fdir_rule.mask, + sizeof(struct ixgbe_hw_fdir_mask)); if (fdir_rule.mask.flex_bytes_mask) { ret = ixgbe_fdir_set_flexbytes_offset(dev, @@ -3185,9 +3183,9 @@ ixgbe_flow_create(struct rte_eth_dev *dev, PMD_DRV_LOG(ERR, "failed to allocate memory"); goto out; } - rte_memcpy(&fdir_rule_ptr->filter_info, - &fdir_rule, - sizeof(struct ixgbe_fdir_rule)); + memcpy(&fdir_rule_ptr->filter_info, + &fdir_rule, + sizeof(struct ixgbe_fdir_rule)); TAILQ_INSERT_TAIL(&filter_fdir_list, fdir_rule_ptr, entries); flow->rule = fdir_rule_ptr; @@ -3222,9 +3220,8 @@ ixgbe_flow_create(struct rte_eth_dev *dev, PMD_DRV_LOG(ERR, "failed to allocate memory"); goto out; } - rte_memcpy(&l2_tn_filter_ptr->filter_info, - &l2_tn_filter, - sizeof(struct ixgbe_l2_tunnel_conf)); + memcpy(&l2_tn_filter_ptr->filter_info, &l2_tn_filter, + sizeof(struct ixgbe_l2_tunnel_conf)); TAILQ_INSERT_TAIL(&filter_l2_tunnel_list, l2_tn_filter_ptr, entries); flow->rule = l2_tn_filter_ptr; @@ -3351,9 +3348,8 @@ ixgbe_flow_destroy(struct rte_eth_dev *dev, case RTE_ETH_FILTER_NTUPLE: ntuple_filter_ptr = (struct ixgbe_ntuple_filter_ele *) pmd_flow->rule; - rte_memcpy(&ntuple_filter, - &ntuple_filter_ptr->filter_info, - sizeof(struct rte_eth_ntuple_filter)); + memcpy(&ntuple_filter, &ntuple_filter_ptr->filter_info, + sizeof(struct rte_eth_ntuple_filter)); ret = ixgbe_add_del_ntuple_filter(dev, &ntuple_filter, FALSE); if (!ret) { TAILQ_REMOVE(&filter_ntuple_list, @@ -3364,9 +3360,8 @@ ixgbe_flow_destroy(struct rte_eth_dev *dev, case RTE_ETH_FILTER_ETHERTYPE: ethertype_filter_ptr = (struct ixgbe_ethertype_filter_ele *) pmd_flow->rule; - rte_memcpy(ðertype_filter, - ðertype_filter_ptr->filter_info, - sizeof(struct rte_eth_ethertype_filter)); + memcpy(ðertype_filter, ðertype_filter_ptr->filter_info, + sizeof(struct rte_eth_ethertype_filter)); ret = ixgbe_add_del_ethertype_filter(dev, ðertype_filter, FALSE); if (!ret) { @@ -3378,9 +3373,8 @@ ixgbe_flow_destroy(struct rte_eth_dev *dev, case RTE_ETH_FILTER_SYN: syn_filter_ptr = (struct ixgbe_eth_syn_filter_ele *) pmd_flow->rule; - rte_memcpy(&syn_filter, - &syn_filter_ptr->filter_info, - sizeof(struct rte_eth_syn_filter)); + memcpy(&syn_filter, &syn_filter_ptr->filter_info, + sizeof(struct rte_eth_syn_filter)); ret = ixgbe_syn_filter_set(dev, &syn_filter, FALSE); if (!ret) { TAILQ_REMOVE(&filter_syn_list, @@ -3390,9 +3384,8 @@ ixgbe_flow_destroy(struct rte_eth_dev *dev, break; case RTE_ETH_FILTER_FDIR: fdir_rule_ptr = (struct ixgbe_fdir_rule_ele *)pmd_flow->rule; - rte_memcpy(&fdir_rule, - &fdir_rule_ptr->filter_info, - sizeof(struct ixgbe_fdir_rule)); + memcpy(&fdir_rule, &fdir_rule_ptr->filter_info, + sizeof(struct ixgbe_fdir_rule)); ret = ixgbe_fdir_filter_program(dev, &fdir_rule, TRUE, FALSE); if (!ret) { TAILQ_REMOVE(&filter_fdir_list, @@ -3405,8 +3398,8 @@ ixgbe_flow_destroy(struct rte_eth_dev *dev, case RTE_ETH_FILTER_L2_TUNNEL: l2_tn_filter_ptr = (struct ixgbe_eth_l2_tunnel_conf_ele *) pmd_flow->rule; - rte_memcpy(&l2_tn_filter, &l2_tn_filter_ptr->filter_info, - sizeof(struct ixgbe_l2_tunnel_conf)); + memcpy(&l2_tn_filter, &l2_tn_filter_ptr->filter_info, + sizeof(struct ixgbe_l2_tunnel_conf)); ret = ixgbe_dev_l2_tunnel_filter_del(dev, &l2_tn_filter); if (!ret) { TAILQ_REMOVE(&filter_l2_tunnel_list, diff --git a/drivers/net/ixgbe/ixgbe_ipsec.c b/drivers/net/ixgbe/ixgbe_ipsec.c index d3313085560d..d8ed095dce0c 100644 --- a/drivers/net/ixgbe/ixgbe_ipsec.c +++ b/drivers/net/ixgbe/ixgbe_ipsec.c @@ -680,10 +680,10 @@ ixgbe_crypto_add_ingress_sa_from_flow(const void *sess, const struct rte_flow_item_ipv6 *ipv6 = ip_spec; ic_session->src_ip.type = IPv6; ic_session->dst_ip.type = IPv6; - rte_memcpy(ic_session->src_ip.ipv6, - ipv6->hdr.src_addr, 16); - rte_memcpy(ic_session->dst_ip.ipv6, - ipv6->hdr.dst_addr, 16); + memcpy(ic_session->src_ip.ipv6, ipv6->hdr.src_addr, + 16); + memcpy(ic_session->dst_ip.ipv6, ipv6->hdr.dst_addr, + 16); } else { const struct rte_flow_item_ipv4 *ipv4 = ip_spec; ic_session->src_ip.type = IPv4; diff --git a/drivers/net/ixgbe/ixgbe_pf.c b/drivers/net/ixgbe/ixgbe_pf.c index 0a0f639e3986..f16bd45dbf6a 100644 --- a/drivers/net/ixgbe/ixgbe_pf.c +++ b/drivers/net/ixgbe/ixgbe_pf.c @@ -16,7 +16,6 @@ #include #include #include -#include #include #include @@ -450,7 +449,7 @@ ixgbe_vf_reset(struct rte_eth_dev *dev, uint16_t vf, uint32_t *msgbuf) /* reply to reset with ack and vf mac address */ msgbuf[0] = IXGBE_VF_RESET | IXGBE_VT_MSGTYPE_ACK; - rte_memcpy(new_mac, vf_mac, RTE_ETHER_ADDR_LEN); + memcpy(new_mac, vf_mac, RTE_ETHER_ADDR_LEN); /* * Piggyback the multicast filter type so VF can compute the * correct vectors @@ -472,7 +471,7 @@ ixgbe_vf_set_mac_addr(struct rte_eth_dev *dev, uint32_t vf, uint32_t *msgbuf) if (rte_is_valid_assigned_ether_addr( (struct rte_ether_addr *)new_mac)) { - rte_memcpy(vfinfo[vf].vf_mac_addresses, new_mac, 6); + memcpy(vfinfo[vf].vf_mac_addresses, new_mac, 6); return hw->mac.ops.set_rar(hw, rar_entry, new_mac, vf, IXGBE_RAH_AV); } return -1; diff --git a/drivers/net/ixgbe/ixgbe_tm.c b/drivers/net/ixgbe/ixgbe_tm.c index ac8976062fa7..00d9de43936b 100644 --- a/drivers/net/ixgbe/ixgbe_tm.c +++ b/drivers/net/ixgbe/ixgbe_tm.c @@ -289,8 +289,8 @@ ixgbe_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(&tm_conf->shaper_profile_list, shaper_profile, node); @@ -637,8 +637,8 @@ ixgbe_node_add(struct rte_eth_dev *dev, uint32_t node_id, tm_node->no = 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)); tm_conf->root = tm_node; /* increase the reference counter of the shaper profile */ @@ -718,8 +718,7 @@ ixgbe_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 == IXGBE_TM_NODE_TYPE_PORT) { tm_node->no = parent_node->reference_count; TAILQ_INSERT_TAIL(&tm_conf->tc_list, diff --git a/drivers/net/ixgbe/rte_pmd_ixgbe.c b/drivers/net/ixgbe/rte_pmd_ixgbe.c index f76ef6392194..ba700fe02313 100644 --- a/drivers/net/ixgbe/rte_pmd_ixgbe.c +++ b/drivers/net/ixgbe/rte_pmd_ixgbe.c @@ -37,8 +37,8 @@ rte_pmd_ixgbe_set_vf_mac_addr(uint16_t port, uint16_t vf, if (rte_is_valid_assigned_ether_addr( (struct rte_ether_addr *)new_mac)) { - rte_memcpy(vfinfo[vf].vf_mac_addresses, new_mac, - RTE_ETHER_ADDR_LEN); + memcpy(vfinfo[vf].vf_mac_addresses, new_mac, + RTE_ETHER_ADDR_LEN); return hw->mac.ops.set_rar(hw, rar_entry, new_mac, vf, IXGBE_RAH_AV); } -- 2.43.0