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 B509F43BAE; Fri, 1 Mar 2024 00:01:58 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1AA7A4330C; Fri, 1 Mar 2024 00:00:52 +0100 (CET) Received: from mail-pj1-f49.google.com (mail-pj1-f49.google.com [209.85.216.49]) by mails.dpdk.org (Postfix) with ESMTP id 266554325B for ; Fri, 1 Mar 2024 00:00:11 +0100 (CET) Received: by mail-pj1-f49.google.com with SMTP id 98e67ed59e1d1-299a2456948so1154173a91.1 for ; Thu, 29 Feb 2024 15:00:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1709247610; x=1709852410; 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=ZKHXUX+HVRWzIo8lpBJEiNQ1BUP3TApV+QmNZ4YhqYo=; b=syL9TY01yLSVt0TfGAEr3ngJr95bmBo/2NVjOH2xyNS/UxFh8ND9CFoakcKFMJW8a9 ZKGDGjYUl4kswsg9KVQjGx+WG2z6dzLFofB0K/3ZjNSJuEn0SmfoEqBEXnrftHk9rWz8 JcIntpWbJP31K49qw7TF4dSqn4nhtRVSK6FBf88ycMkcjivsDjTslLwRkV3eruY/jNvH 79eqk3QbMM+Y0oH2S1Gkp2FVKMNAWYj4XNALlq3Dw6XdZjmNYZ/loc6jtwy6HTP6sIqh 49Ha6LEo43jzeCR1/WcxBGJ5J9l2H9jAPUintAYnUxKbWLJs/ZGyUBG0m6YCOgKMRqWz aqIQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709247610; x=1709852410; 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=ZKHXUX+HVRWzIo8lpBJEiNQ1BUP3TApV+QmNZ4YhqYo=; b=wM6CYsLF9U4BMwxsv1xrxGxaoY6mCvQEho9gj/dD3kZnrj3E9+blnR2x9Gg7EADl3G kiQNWzOd6+g2F4D7oc8x7J8p/tHzxyfQqkf+gbijsLgLQtMRImR0xGztVFcO74ylS7ya lgUUTPK+bZtRiPWvLUTAT3Oy8DHvlTlb3Kn8/MDYPD9bnIbw2zeqeW6fnh7zDfr5+B0l FXbdN8ACXaw2BYWlHIvWDfgcYuPKzYsAdpI067oROuzvNtdPHXEaz+248pvpv8ByJ5Yt VVPg4MhP1ZZrvYz0BsuYEH4FuIFkkCiTsPmTgu3hlzCACJRBwzXcuZVzT+RSBzJGLaIj W4tQ== X-Gm-Message-State: AOJu0YxXqI6/b/YFQITkZHQqxFJpBzsyxynVQczCIn0RD3IPPLFqS+BT qvZz+miX2+kflNpd0N6Fn1Xbtbta4ObqRQsS/Uf5lLqej8upEtZcWxXvMoVrWLmTH05bNgK/42+ K X-Google-Smtp-Source: AGHT+IHRqrCqbV/wMrWBwH+hEXk65UyFtRqv54EBd2gkvFBx5+kv1zlWbtmFfNR5IjM2ERrbVY+uTg== X-Received: by 2002:a17:90a:dd93:b0:29a:7579:88bc with SMTP id l19-20020a17090add9300b0029a757988bcmr18225pjv.46.1709247610248; Thu, 29 Feb 2024 15:00:10 -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.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Feb 2024 15:00:09 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Chaoyong He Subject: [PATCH 15/71] net/nfp: replace use of fixed size rte_memcpy Date: Thu, 29 Feb 2024 14:58:02 -0800 Message-ID: <20240229225936.483472-16-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/nfp/flower/nfp_conntrack.c | 2 +- drivers/net/nfp/flower/nfp_flower_flow.c | 16 ++++++++-------- drivers/net/nfp/flower/nfp_flower_representor.c | 2 +- drivers/net/nfp/nfp_mtr.c | 10 +++++----- 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/drivers/net/nfp/flower/nfp_conntrack.c b/drivers/net/nfp/flower/nfp_conntrack.c index f89003be8b40..279bf17eb3a5 100644 --- a/drivers/net/nfp/flower/nfp_conntrack.c +++ b/drivers/net/nfp/flower/nfp_conntrack.c @@ -1470,7 +1470,7 @@ nfp_ct_do_flow_merge(struct nfp_ct_zone_entry *ze, merge_entry->ze = ze; merge_entry->pre_ct_parent = pre_ct_entry; merge_entry->post_ct_parent = post_ct_entry; - rte_memcpy(merge_entry->cookie, new_cookie, sizeof(new_cookie)); + memcpy(merge_entry->cookie, new_cookie, sizeof(new_cookie)); merge_entry->rule.items_cnt = pre_ct_entry->rule.items_cnt + post_ct_entry->rule.items_cnt - cnt_same_item - 1; merge_entry->rule.actions_cnt = pre_ct_entry->rule.actions_cnt + diff --git a/drivers/net/nfp/flower/nfp_flower_flow.c b/drivers/net/nfp/flower/nfp_flower_flow.c index e26be30d1833..3d07a4429b62 100644 --- a/drivers/net/nfp/flower/nfp_flower_flow.c +++ b/drivers/net/nfp/flower/nfp_flower_flow.c @@ -178,10 +178,10 @@ nfp_mask_id_alloc(struct nfp_flow_priv *priv, return -ENOENT; } - rte_memcpy(&temp_id, &ring->buf[ring->tail], NFP_FLOWER_MASK_ELEMENT_RS); + memcpy(&temp_id, &ring->buf[ring->tail], NFP_FLOWER_MASK_ELEMENT_RS); *mask_id = temp_id; - rte_memcpy(&ring->buf[ring->tail], &freed_id, NFP_FLOWER_MASK_ELEMENT_RS); + memcpy(&ring->buf[ring->tail], &freed_id, NFP_FLOWER_MASK_ELEMENT_RS); ring->tail = (ring->tail + NFP_FLOWER_MASK_ELEMENT_RS) % (NFP_FLOWER_MASK_ENTRY_RS * NFP_FLOWER_MASK_ELEMENT_RS); @@ -200,7 +200,7 @@ nfp_mask_id_free(struct nfp_flow_priv *priv, if (CIRC_SPACE(ring->head, ring->tail, NFP_FLOWER_MASK_ENTRY_RS) == 0) return -ENOBUFS; - rte_memcpy(&ring->buf[ring->head], &mask_id, NFP_FLOWER_MASK_ELEMENT_RS); + memcpy(&ring->buf[ring->head], &mask_id, NFP_FLOWER_MASK_ELEMENT_RS); ring->head = (ring->head + NFP_FLOWER_MASK_ELEMENT_RS) % (NFP_FLOWER_MASK_ENTRY_RS * NFP_FLOWER_MASK_ELEMENT_RS); @@ -2247,13 +2247,13 @@ nfp_flow_action_set_mac(char *act_data, set_mac = action->conf; if (mac_src_flag) { - rte_memcpy(&set_eth->eth_addr[RTE_ETHER_ADDR_LEN], - set_mac->mac_addr, RTE_ETHER_ADDR_LEN); + memcpy(&set_eth->eth_addr[RTE_ETHER_ADDR_LEN], + set_mac->mac_addr, RTE_ETHER_ADDR_LEN); for (i = 0; i < RTE_ETHER_ADDR_LEN; i++) set_eth->eth_addr_mask[RTE_ETHER_ADDR_LEN + i] = 0xff; } else { - rte_memcpy(&set_eth->eth_addr[0], - set_mac->mac_addr, RTE_ETHER_ADDR_LEN); + memcpy(&set_eth->eth_addr[0], set_mac->mac_addr, + RTE_ETHER_ADDR_LEN); for (i = 0; i < RTE_ETHER_ADDR_LEN; i++) set_eth->eth_addr_mask[i] = 0xff; } @@ -2329,7 +2329,7 @@ nfp_flow_action_set_ipv6(char *act_data, set_ip->reserved = 0; for (i = 0; i < 4; i++) { - rte_memcpy(&tmp, &set_ipv6->ipv6_addr[i * 4], 4); + memcpy(&tmp, &set_ipv6->ipv6_addr[i * 4], 4); set_ip->ipv6[i].exact = tmp; set_ip->ipv6[i].mask = RTE_BE32(0xffffffff); } diff --git a/drivers/net/nfp/flower/nfp_flower_representor.c b/drivers/net/nfp/flower/nfp_flower_representor.c index 4f4df0cd2ee2..ce2b06611802 100644 --- a/drivers/net/nfp/flower/nfp_flower_representor.c +++ b/drivers/net/nfp/flower/nfp_flower_representor.c @@ -181,7 +181,7 @@ nfp_flower_repr_stats_get(struct rte_eth_dev *ethdev, struct nfp_flower_representor *repr; repr = ethdev->data->dev_private; - rte_memcpy(stats, &repr->repr_stats, sizeof(struct rte_eth_stats)); + memcpy(stats, &repr->repr_stats, sizeof(struct rte_eth_stats)); return 0; } diff --git a/drivers/net/nfp/nfp_mtr.c b/drivers/net/nfp/nfp_mtr.c index 255977ec2236..1f173409b421 100644 --- a/drivers/net/nfp/nfp_mtr.c +++ b/drivers/net/nfp/nfp_mtr.c @@ -243,7 +243,7 @@ nfp_mtr_profile_mod(struct nfp_app_fw_flower *app_fw_flower, struct nfp_profile_conf old_conf; /* Get the old profile config */ - rte_memcpy(&old_conf, &mtr_profile->conf, sizeof(old_conf)); + memcpy(&old_conf, &mtr_profile->conf, sizeof(old_conf)); memset(&mtr_profile->conf, 0, sizeof(struct nfp_profile_conf)); @@ -267,7 +267,7 @@ nfp_mtr_profile_mod(struct nfp_app_fw_flower *app_fw_flower, return 0; rollback: - rte_memcpy(&mtr_profile->conf, &old_conf, sizeof(old_conf)); + memcpy(&mtr_profile->conf, &old_conf, sizeof(old_conf)); return ret; } @@ -492,8 +492,8 @@ nfp_mtr_policy_add(struct rte_eth_dev *dev, } mtr_policy->policy_id = mtr_policy_id; - rte_memcpy(&mtr_policy->policy, policy, - sizeof(struct rte_mtr_meter_policy_params)); + memcpy(&mtr_policy->policy, policy, + sizeof(struct rte_mtr_meter_policy_params)); /* Insert policy into policy list */ LIST_INSERT_HEAD(&priv->policies, mtr_policy, next); @@ -1028,7 +1028,7 @@ nfp_mtr_stats_read(struct rte_eth_dev *dev, *stats_mask = mtr->stats_mask; rte_spinlock_lock(&priv->mtr_stats_lock); - rte_memcpy(&curr, &mtr->mtr_stats.curr, sizeof(curr)); + memcpy(&curr, &mtr->mtr_stats.curr, sizeof(curr)); rte_spinlock_unlock(&priv->mtr_stats_lock); prev = &mtr->mtr_stats.prev; -- 2.43.0