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 A510E43C12; Fri, 1 Mar 2024 18:20:59 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9130943437; Fri, 1 Mar 2024 18:17:57 +0100 (CET) Received: from mail-pl1-f174.google.com (mail-pl1-f174.google.com [209.85.214.174]) by mails.dpdk.org (Postfix) with ESMTP id 7AD43433A8 for ; Fri, 1 Mar 2024 18:17:40 +0100 (CET) Received: by mail-pl1-f174.google.com with SMTP id d9443c01a7336-1dca3951ad9so21947345ad.3 for ; Fri, 01 Mar 2024 09:17:40 -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=3UtlnItxEhj0GYMDyQyD+uneqNt6DkIIu+AK6QFO2Nk=; b=J6A/u8pH977TGPHm9Y7llkadbXKqBQuNrUG8R8Q4IQGJeTo38qm96f2o3U51EUCujz 6Qjx9wwdpXOCjfCpG5037ZeVmuYu8usb2xQa06IlRIY8VROCSqg++ANewUbqfEzjzEDE 8/PHPgWIGGm7v63dOj7INo903iKtDu03RMYkIv0DLkCu+inuhKFbgXpwpR/xvE/LFoMG Wp5Q9UkOl6/pY78jtxHGbSs2z8ZFTgIY3mlfcVkoskInb4K0wMPXvmo/wI48SJ/I4Csf CvU9/ySFp/CE87M33ih5zeTt/5PwlPybSImygqGzjFwKBpwIc9Gj4XopUVxYEtw2BrK+ cbdA== 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=3UtlnItxEhj0GYMDyQyD+uneqNt6DkIIu+AK6QFO2Nk=; b=B3m1Q4Jf6ElE2CkAPcVUKnDfiO2FlWhQp8x6cKQ9RQ0GWu2w1Zp3JIbrhrTaPnl0iT oWsLx8iUmtorGQ53TkKJaZTPAxa4VmYwphzvQU3DbEAeDZzll+V6fdC9mqvaoMO3d9c2 jtpwIoTeY1qCUH6Bi7jAPfzNLY7twFkzQY/PVhE9wcm6QJPqcz2+AMimGmk3Y34Q5q3N qkRCOuPxFJiSQrkHSMPDwWi921/7zXeoch78LAFTQkEPid5kXSxBwxAfjpu1u+XqLGp4 HhnQ1rGuyivnv5JrEeC9RbGZqu5LtoXzd9uQLEQyYvMaLmLqj7OZZPVD5X19L2IrmccC 1w3Q== X-Gm-Message-State: AOJu0Yyffge9+Q5sHamGJe4oiv6xRNIfMFu6u0gZeL9Abq1TLUadNf7q Tz2Jk9lV8KC5WUFgx6zW8WyjebmFFOfJay3UTXlRmoVGytqfvveu/pAkwnRX26VtAbfU2RNwGd+ cn15rNA== X-Google-Smtp-Source: AGHT+IEY3mI22BsF/JA5a+SJDXZC6VaKlqFf3F0bdG9DXb1H0MAqL+spbgbH5N8VIIbXhRMvNPIeIQ== X-Received: by 2002:a17:902:f7ce:b0:1db:37b1:b1a3 with SMTP id h14-20020a170902f7ce00b001db37b1b1a3mr2080236plw.17.1709313459743; Fri, 01 Mar 2024 09:17:39 -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:39 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Rosen Xu Subject: [PATCH v2 29/71] net/ipn3ke: replace use of fixed size rte_memcpy Date: Fri, 1 Mar 2024 09:15:25 -0800 Message-ID: <20240301171707.95242-30-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/ipn3ke/ipn3ke_flow.c | 32 ++++++++++++------------- drivers/net/ipn3ke/ipn3ke_representor.c | 16 ++++++------- drivers/net/ipn3ke/ipn3ke_tm.c | 6 ++--- 3 files changed, 26 insertions(+), 28 deletions(-) diff --git a/drivers/net/ipn3ke/ipn3ke_flow.c b/drivers/net/ipn3ke/ipn3ke_flow.c index d20a29b9a2d6..eeb0ec55d9a6 100644 --- a/drivers/net/ipn3ke/ipn3ke_flow.c +++ b/drivers/net/ipn3ke/ipn3ke_flow.c @@ -100,15 +100,14 @@ ipn3ke_pattern_vxlan(const struct rte_flow_item patterns[], case RTE_FLOW_ITEM_TYPE_ETH: eth = item->spec; - rte_memcpy(&parser->key[0], - eth->hdr.src_addr.addr_bytes, - RTE_ETHER_ADDR_LEN); + memcpy(&parser->key[0], eth->hdr.src_addr.addr_bytes, + RTE_ETHER_ADDR_LEN); break; case RTE_FLOW_ITEM_TYPE_VXLAN: vxlan = item->spec; - rte_memcpy(&parser->key[6], vxlan->hdr.vni, 3); + memcpy(&parser->key[6], vxlan->hdr.vni, 3); break; default: @@ -164,9 +163,8 @@ ipn3ke_pattern_mac(const struct rte_flow_item patterns[], case RTE_FLOW_ITEM_TYPE_ETH: eth = item->spec; - rte_memcpy(parser->key, - eth->hdr.src_addr.addr_bytes, - RTE_ETHER_ADDR_LEN); + memcpy(parser->key, eth->hdr.src_addr.addr_bytes, + RTE_ETHER_ADDR_LEN); break; default: @@ -369,13 +367,13 @@ ipn3ke_pattern_ip_tcp(const struct rte_flow_item patterns[], case RTE_FLOW_ITEM_TYPE_IPV4: ipv4 = item->spec; - rte_memcpy(&parser->key[0], &ipv4->hdr.src_addr, 4); + memcpy(&parser->key[0], &ipv4->hdr.src_addr, 4); break; case RTE_FLOW_ITEM_TYPE_TCP: tcp = item->spec; - rte_memcpy(&parser->key[4], &tcp->hdr.src_port, 2); + memcpy(&parser->key[4], &tcp->hdr.src_port, 2); break; default: @@ -434,13 +432,13 @@ ipn3ke_pattern_ip_udp(const struct rte_flow_item patterns[], case RTE_FLOW_ITEM_TYPE_IPV4: ipv4 = item->spec; - rte_memcpy(&parser->key[0], &ipv4->hdr.src_addr, 4); + memcpy(&parser->key[0], &ipv4->hdr.src_addr, 4); break; case RTE_FLOW_ITEM_TYPE_UDP: udp = item->spec; - rte_memcpy(&parser->key[4], &udp->hdr.src_port, 2); + memcpy(&parser->key[4], &udp->hdr.src_port, 2); break; default: @@ -502,19 +500,19 @@ ipn3ke_pattern_ip_nvgre(const struct rte_flow_item patterns[], case RTE_FLOW_ITEM_TYPE_IPV4: ipv4 = item->spec; - rte_memcpy(&parser->key[0], &ipv4->hdr.src_addr, 4); + memcpy(&parser->key[0], &ipv4->hdr.src_addr, 4); break; case RTE_FLOW_ITEM_TYPE_UDP: udp = item->spec; - rte_memcpy(&parser->key[4], &udp->hdr.src_port, 2); + memcpy(&parser->key[4], &udp->hdr.src_port, 2); break; case RTE_FLOW_ITEM_TYPE_NVGRE: nvgre = item->spec; - rte_memcpy(&parser->key[6], nvgre->tni, 3); + memcpy(&parser->key[6], nvgre->tni, 3); break; default: @@ -576,19 +574,19 @@ ipn3ke_pattern_vxlan_ip_udp(const struct rte_flow_item patterns[], case RTE_FLOW_ITEM_TYPE_VXLAN: vxlan = item->spec; - rte_memcpy(&parser->key[0], vxlan->hdr.vni, 3); + memcpy(&parser->key[0], vxlan->hdr.vni, 3); break; case RTE_FLOW_ITEM_TYPE_IPV4: ipv4 = item->spec; - rte_memcpy(&parser->key[3], &ipv4->hdr.src_addr, 4); + memcpy(&parser->key[3], &ipv4->hdr.src_addr, 4); break; case RTE_FLOW_ITEM_TYPE_UDP: udp = item->spec; - rte_memcpy(&parser->key[7], &udp->hdr.src_port, 2); + memcpy(&parser->key[7], &udp->hdr.src_port, 2); break; default: diff --git a/drivers/net/ipn3ke/ipn3ke_representor.c b/drivers/net/ipn3ke/ipn3ke_representor.c index 8145f1bb2a0e..99527d18793a 100644 --- a/drivers/net/ipn3ke/ipn3ke_representor.c +++ b/drivers/net/ipn3ke/ipn3ke_representor.c @@ -137,17 +137,17 @@ ipn3ke_rpst_dev_start(struct rte_eth_dev *dev) if (hw->retimer.mac_type == IFPGA_RAWDEV_RETIMER_MAC_TYPE_10GE_XFI) { /* Set mac address */ - rte_memcpy(((char *)(&val)), - (char *)&dev->data->mac_addrs->addr_bytes[0], - sizeof(uint32_t)); + memcpy(((char *)(&val)), + (char *)&dev->data->mac_addrs->addr_bytes[0], + sizeof(uint32_t)); (*hw->f_mac_write)(hw, val, IPN3KE_MAC_PRIMARY_MAC_ADDR0, rpst->port_id, 0); - rte_memcpy(((char *)(&val)), - (char *)&dev->data->mac_addrs->addr_bytes[4], - sizeof(uint16_t)); + memcpy(((char *)(&val)), + (char *)&dev->data->mac_addrs->addr_bytes[4], + sizeof(uint16_t)); (*hw->f_mac_write)(hw, val, IPN3KE_MAC_PRIMARY_MAC_ADDR1, @@ -2753,13 +2753,13 @@ ipn3ke_rpst_mac_addr_set(struct rte_eth_dev *ethdev, rte_ether_addr_copy(&mac_addr[0], &rpst->mac_addr); /* Set mac address */ - rte_memcpy(((char *)(&val)), &mac_addr[0], sizeof(uint32_t)); + memcpy(((char *)(&val)), &mac_addr[0], sizeof(uint32_t)); (*hw->f_mac_write)(hw, val, IPN3KE_MAC_PRIMARY_MAC_ADDR0, rpst->port_id, 0); - rte_memcpy(((char *)(&val)), &mac_addr[4], sizeof(uint16_t)); + memcpy(((char *)(&val)), &mac_addr[4], sizeof(uint16_t)); (*hw->f_mac_write)(hw, val, IPN3KE_MAC_PRIMARY_MAC_ADDR0, diff --git a/drivers/net/ipn3ke/ipn3ke_tm.c b/drivers/net/ipn3ke/ipn3ke_tm.c index 0260227900ae..b7097083d2d6 100644 --- a/drivers/net/ipn3ke/ipn3ke_tm.c +++ b/drivers/net/ipn3ke/ipn3ke_tm.c @@ -814,7 +814,7 @@ ipn3ke_tm_shaper_profile_add(struct rte_eth_dev *dev, rte_strerror(EINVAL)); } else { sp->valid = 1; - rte_memcpy(&sp->params, profile, sizeof(sp->params)); + memcpy(&sp->params, profile, sizeof(sp->params)); } tm->h.n_shaper_profiles++; @@ -960,7 +960,7 @@ ipn3ke_tm_tdrop_profile_add(struct rte_eth_dev *dev, IPN3KE_TDROP_TH2_MASK); tp->th1 = th1; tp->th2 = th2; - rte_memcpy(&tp->params, profile, sizeof(tp->params)); + memcpy(&tp->params, profile, sizeof(tp->params)); /* Add to list */ tm->h.n_tdrop_profiles++; @@ -1308,7 +1308,7 @@ ipn3ke_tm_node_add(struct rte_eth_dev *dev, n->tdrop_profile = ipn3ke_hw_tm_tdrop_profile_search(hw, params->leaf.wred.wred_profile_id); - rte_memcpy(&n->params, params, sizeof(n->params)); + memcpy(&n->params, params, sizeof(n->params)); return 0; } -- 2.43.0