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 2406743BAE; Fri, 1 Mar 2024 00:03:53 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D9F2843376; Fri, 1 Mar 2024 00:01:14 +0100 (CET) Received: from mail-pj1-f42.google.com (mail-pj1-f42.google.com [209.85.216.42]) by mails.dpdk.org (Postfix) with ESMTP id F35B84328F for ; Fri, 1 Mar 2024 00:00:25 +0100 (CET) Received: by mail-pj1-f42.google.com with SMTP id 98e67ed59e1d1-2995fa850ddso2124623a91.0 for ; Thu, 29 Feb 2024 15:00:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1709247625; x=1709852425; 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=dVdYzFeS6R1f2Mr8BG/pwkFEeBvBuT7tMok+utry1kk=; b=XzHxU39DxpkdddTEluIgyl4SQ4vEaS06ARuwbT1CqsIaDkXgSkxzLmdcv3dmT3pNJj zBSKJ+REBu6ia3Bdffw+vGTPCD1x2r38lRBRuOexL0X9vnfDC0YO9w9DYKMkV5tMdjrJ w4Z8A/B0tHCxEDYxGjlL/0Af46DVF6m5WZF8+xyLHdkNaoT0xGkmGGeCDZ7aRlv/OdX1 2tS8ZztBzzfspHtJrZ3Z7wzxA6ADJUBDyiWs5KmSG+cNQ5ACfJjVVRgBOytHgyqlm532 BIfsXcCBFU8NlerziqxTHwU6yKzrG3uusxO7KlIyYFrIZbUFB3nUg1ycIMwlLtPfN9d3 QMng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709247625; x=1709852425; 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=dVdYzFeS6R1f2Mr8BG/pwkFEeBvBuT7tMok+utry1kk=; b=LZ9CmowolS4BxnP3fRIQNAqFKI+kuyqxXOXbQ8RJvkFMJC2ikwwI5iMNITBY/odtOJ ym35EH4LE62JhWpqwq23HIlC70rFq5b5rgZPtCkf8fmZEGgC7N+Y9oV7Nkwl8z/0W9jU uNuLBOtY4knY11q0GHWdJfKRMBLrX+1sXsAXeOxppbDSiTvOnLryb/gBxpbSR/6nJmjs oxU5SKvNgVrbHJ+MwjFmfS0sIM+adakIirhOIh+jEZe4cxeAWycxKWcb6LX5lTQmvFi7 d8B/I2kdXzywEOp5+QpNDtgY5VAveG7qrPYDNE63Iov9s+Gn5sq/8tcYc9xK1V1uUqDm 4PUQ== X-Gm-Message-State: AOJu0YzWZTTyFYcj3BswGGp8m9YxBU83k2J54x9Vs8c5zxKOJ5zW7qfd BsrZBUN14OqrejqsEdbp15QDbRiTUgpSzqLmKaTbAAlxKiqwgno1J626Fvs/bTkFS/bnBA3h/cU f X-Google-Smtp-Source: AGHT+IHgqNjP9i0vLjzv29GUqGB8yE1z6SUoYKsoB8ta6p70+x5fuJbFkbNXeF3AarIGg7ksAVhh4Q== X-Received: by 2002:a17:90a:d17:b0:299:43fd:e967 with SMTP id t23-20020a17090a0d1700b0029943fde967mr425195pja.18.1709247625004; Thu, 29 Feb 2024 15:00:25 -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.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Feb 2024 15:00:24 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger Subject: [PATCH 30/71] net/ixgbe: replace use of fixed size rte_memcpy Date: Thu, 29 Feb 2024 14:58:17 -0800 Message-ID: <20240229225936.483472-31-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 --- 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 | 4 +- drivers/net/ixgbe/ixgbe_tm.c | 11 +++--- drivers/net/ixgbe/rte_pmd_ixgbe.c | 4 +- 7 files changed, 48 insertions(+), 60 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..9836d05540a3 100644 --- a/drivers/net/ixgbe/ixgbe_pf.c +++ b/drivers/net/ixgbe/ixgbe_pf.c @@ -450,7 +450,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 +472,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