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 07E4443BAE; Fri, 1 Mar 2024 00:03:40 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2A6ED4336C; Fri, 1 Mar 2024 00:01:12 +0100 (CET) Received: from mail-pj1-f45.google.com (mail-pj1-f45.google.com [209.85.216.45]) by mails.dpdk.org (Postfix) with ESMTP id 1525D4328F for ; Fri, 1 Mar 2024 00:00:25 +0100 (CET) Received: by mail-pj1-f45.google.com with SMTP id 98e67ed59e1d1-29a940614easo1097420a91.3 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=1709247624; x=1709852424; 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=qdAA3iJSf0kN6lRRf3OZ1XpyKBJJ/7yNhjjfszqSWsVLcjHNzyspyAXuIVEjpKz1xx X9vUPfgTxhmiEpXh4Wzv3OV11WfA3LIAVAbXEW2D8EeCnsdrSTLO+eoNueMxAWHPDrsE LewXQ2Pz/pAzvcLuTpVeKSWtiKnt0leg5XxnnTiViV3PeIkiXZTBSNXIq/+o0OFOqtKq FtZJ1XJn7WksGZtCV3AMNQ3aYUqF6o/0zsBcKqNH08+hu4HTn+RvXc4Wo1pNmbztdEY0 vixP1xaNDMcQc9w5DthJNGnisA56AMj6Zv1FE4/ll1g2BvdGKIR/Cr4FLgmC1ia6rCL8 cjyw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709247624; x=1709852424; 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=ARPtUaeZyqS65eHRbflcDcAJu9PSKC/cs/Lb+glo4wUFQvMXuTYDKYAEOxMv43RE5+ GcF6t7Xw8vd8zIYhgzk7TD1w+GZ3esIoXvJHDwagffVzbVR4eaysMTQIIxPHxm+Cmvzm SdZS1CHn+RyQe+ymGsVM90LcpFEpYCQ3zGV31gNRsuvdJmiYHYkC7pHLd6EDPlgoiJz+ uOArpxNd5Ftaq7bP4dN8R550q927hXd1zyrcGOXro7lvIpMfVW0oY8BOr2YNBBExjLEw wUPp/kst6Bgs+W2vcg2hZXPHKIOGWJUKLUi117YgpwX46dlv428FtZV+7UL46RIOYA9f u27w== X-Gm-Message-State: AOJu0YxIcMP2BMt23lZOjVfIscYFUT5ulxLAFjsiwdHF9xjQAqN0T64g 8ljnCsWpsUIVPO+fFNoxQMEEogZcqXgfDNvRqeGoPPVCp2kphELmdm0ZQBEypRsbf/kaKbM/w2o q X-Google-Smtp-Source: AGHT+IGktSQuWWjzNgk0xFWucN1o5I8lcsyg5iw4+hubYb0Gv1MZDDJcB0GNwAFHZo6mT/EwMACLmw== X-Received: by 2002:a17:90a:4a89:b0:29b:9e1:2fb3 with SMTP id f9-20020a17090a4a8900b0029b09e12fb3mr37376pjh.8.1709247624197; Thu, 29 Feb 2024 15:00:24 -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.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Feb 2024 15:00:23 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Rosen Xu Subject: [PATCH 29/71] net/ipn3ke: replace use of fixed size rte_memcpy Date: Thu, 29 Feb 2024 14:58:16 -0800 Message-ID: <20240229225936.483472-30-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/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