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 9F66E43BAE; Fri, 1 Mar 2024 00:09:00 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 420E04347A; Fri, 1 Mar 2024 00:02:31 +0100 (CET) Received: from mail-pj1-f46.google.com (mail-pj1-f46.google.com [209.85.216.46]) by mails.dpdk.org (Postfix) with ESMTP id 056B24334B for ; Fri, 1 Mar 2024 00:01:03 +0100 (CET) Received: by mail-pj1-f46.google.com with SMTP id 98e67ed59e1d1-299e4b352cdso1034796a91.0 for ; Thu, 29 Feb 2024 15:01:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1709247662; x=1709852462; 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=AUKs81hKZunyk3wFcrrlREf0TGlUU5PWAiTZswg+L+E=; b=VGBJn5yAFoit1fmXkaQ7T8UWCLphUyY/4fiAFXOC1hbXe6hfCGd8a0XEWM52SCjrt3 dySMD6fMuFKal8JYzBFScNrd/iuAD2AJ/4ZjtXReyeQsbLECRbzaOmVLPfdcxqKPkj4l m9W0Z04LIFfWrun8L3wDZz2MO6aHhc9d6/8cxjvbAiXDi/0aaenOypSr3U6cR3EGV6g2 bT8f1ZYFbrq0m8h6dGMgiVmh8wIOa0FSO60zUSh+LDQaubVEbXnHhsb1Do1Vp71ODzec NyS6kvKl9UtWUC6G1Q9U9JUpNPea4VADZxl/naHyDCxpaKAHiD1v/Y2X31NNRPo2pEs5 4ADQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709247662; x=1709852462; 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=AUKs81hKZunyk3wFcrrlREf0TGlUU5PWAiTZswg+L+E=; b=uKvqxs2KlE8Fw7ryI575dNB617dRuiHRDmtraIEK2WmmhaUPB052KEn33WT1lloFsS G0ydBLuS8CkhwQtOr9JD3XNLXEtXRyHZdjEyXo7kKHZkotK7tmJ5jVe9XjUfsQemIbc4 /wT3dsaqBu34AOS/m3rlNFbjlJ5S96OPOOEpZ89W6V8c9reql0gi037AMXyo/i8jvlvt ZM0PTMsVt2loQ1vzd3A/eOvvImDSrVctczNfMNhTwyRXn5kTqs1soTdXCYUP60WHLOra knlMzRPOvcokRLwcb4iwHabH7irtGxz6cec2YTRKUs17bdo9gjaiPdb01qs9A3FZ4NWr PK4Q== X-Gm-Message-State: AOJu0YysrauBaxZ+H884kMabVMqDiqbTLzxdtG8NEKaWHJaHbWblV42p 73VhpGwPXWXZM39vrLujXLxOx1qruB9Nf+bi1CG/MWYu7sUtcXkqd/lbKAcrnI5f/IQTCzGutgp ukWg= X-Google-Smtp-Source: AGHT+IFZrqEQxo4tvvfoAnRXiVQ0n8CfFQ8ZTp7Bu/RnkrbcZH5PWqJH5yZmnN5XmpwffLNOaEn6og== X-Received: by 2002:a17:90b:fc9:b0:299:7f4c:31e0 with SMTP id gd9-20020a17090b0fc900b002997f4c31e0mr36199pjb.1.1709247662195; Thu, 29 Feb 2024 15:01:02 -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.01.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Feb 2024 15:01:01 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Nicolas Chautru , Tomasz Kantecki , Kirill Rybalchenko , Maxime Coquelin , Chenbo Xia Subject: [PATCH 71/71] examples: replace use of fixed size rte_memcpy Date: Thu, 29 Feb 2024 14:58:58 -0800 Message-ID: <20240229225936.483472-72-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 --- examples/bbdev_app/main.c | 2 +- examples/l2fwd-cat/cat.c | 3 +-- examples/ptpclient/ptpclient.c | 11 +++++------ examples/vhost/main.c | 5 ++--- examples/vmdq/main.c | 5 ++--- examples/vmdq_dcb/main.c | 14 +++++--------- 6 files changed, 16 insertions(+), 24 deletions(-) diff --git a/examples/bbdev_app/main.c b/examples/bbdev_app/main.c index 16599ae9cee3..52c8eabba778 100644 --- a/examples/bbdev_app/main.c +++ b/examples/bbdev_app/main.c @@ -359,7 +359,7 @@ add_ether_hdr(struct rte_mbuf *pkt_src, struct rte_mbuf *pkt_dst) eth_to = rte_pktmbuf_mtod(pkt_dst, struct rte_ether_hdr *); /* copy header */ - rte_memcpy(eth_to, eth_from, sizeof(struct rte_ether_hdr)); + memcpy(eth_to, eth_from, sizeof(struct rte_ether_hdr)); } static inline void diff --git a/examples/l2fwd-cat/cat.c b/examples/l2fwd-cat/cat.c index 00e4cde48b48..b03fef47fdb7 100644 --- a/examples/l2fwd-cat/cat.c +++ b/examples/l2fwd-cat/cat.c @@ -314,8 +314,7 @@ parse_l3ca(const char *l3ca) if (cmask != 0 && is_contiguous(cmask) == 0) goto err; - rte_memcpy(&m_config[idx].cpumask, - &cpuset, sizeof(rte_cpuset_t)); + memcpy(&m_config[idx].cpumask, &cpuset, sizeof(rte_cpuset_t)); if (cmask != 0) { m_config[idx].cdp = 1; diff --git a/examples/ptpclient/ptpclient.c b/examples/ptpclient/ptpclient.c index 2535d848a1e9..e918bc05db34 100644 --- a/examples/ptpclient/ptpclient.c +++ b/examples/ptpclient/ptpclient.c @@ -359,9 +359,9 @@ parse_sync(struct ptpv2_data_slave_ordinary *ptp_data, uint16_t rx_tstamp_idx) ptp_data->seqID_SYNC = rte_be_to_cpu_16(ptp_hdr->seq_id); if (ptp_data->ptpset == 0) { - rte_memcpy(&ptp_data->master_clock_id, - &ptp_hdr->source_port_id.clock_id, - sizeof(struct clock_id)); + memcpy(&ptp_data->master_clock_id, + &ptp_hdr->source_port_id.clock_id, + sizeof(struct clock_id)); ptp_data->ptpset = 1; } @@ -466,9 +466,8 @@ parse_fup(struct ptpv2_data_slave_ordinary *ptp_data) client_clkid->id[6] = eth_hdr->src_addr.addr_bytes[4]; client_clkid->id[7] = eth_hdr->src_addr.addr_bytes[5]; - rte_memcpy(&ptp_data->client_clock_id, - client_clkid, - sizeof(struct clock_id)); + memcpy(&ptp_data->client_clock_id, client_clkid, + sizeof(struct clock_id)); /* Enable flag for hardware timestamping. */ created_pkt->ol_flags |= RTE_MBUF_F_TX_IEEE1588_TMST; diff --git a/examples/vhost/main.c b/examples/vhost/main.c index 3fc1b151d182..5691ec110ac8 100644 --- a/examples/vhost/main.c +++ b/examples/vhost/main.c @@ -405,9 +405,8 @@ get_eth_conf(struct rte_eth_conf *eth_conf, uint32_t num_devices) conf.pool_map[i].pools = (1UL << i); } - (void)(rte_memcpy(eth_conf, &vmdq_conf_default, sizeof(*eth_conf))); - (void)(rte_memcpy(ð_conf->rx_adv_conf.vmdq_rx_conf, &conf, - sizeof(eth_conf->rx_adv_conf.vmdq_rx_conf))); + (void)(memcpy(eth_conf, &vmdq_conf_default, sizeof(*eth_conf))); + (void)(memcpy(ð_conf->rx_adv_conf.vmdq_rx_conf, &conf, sizeof(eth_conf->rx_adv_conf.vmdq_rx_conf))); return 0; } diff --git a/examples/vmdq/main.c b/examples/vmdq/main.c index 4a3ce6884c5c..3a9d1281d901 100644 --- a/examples/vmdq/main.c +++ b/examples/vmdq/main.c @@ -151,9 +151,8 @@ get_eth_conf(struct rte_eth_conf *eth_conf, uint32_t num_pools) conf.pool_map[i].pools = (1UL << (i % num_pools)); } - (void)(rte_memcpy(eth_conf, &vmdq_conf_default, sizeof(*eth_conf))); - (void)(rte_memcpy(ð_conf->rx_adv_conf.vmdq_rx_conf, &conf, - sizeof(eth_conf->rx_adv_conf.vmdq_rx_conf))); + (void)(memcpy(eth_conf, &vmdq_conf_default, sizeof(*eth_conf))); + (void)(memcpy(ð_conf->rx_adv_conf.vmdq_rx_conf, &conf, sizeof(eth_conf->rx_adv_conf.vmdq_rx_conf))); if (rss_enable) { eth_conf->rxmode.mq_mode = RTE_ETH_MQ_RX_VMDQ_RSS; eth_conf->rx_adv_conf.rss_conf.rss_hf = RTE_ETH_RSS_IP | diff --git a/examples/vmdq_dcb/main.c b/examples/vmdq_dcb/main.c index 4ccc2fe4b01c..4aab67b23d67 100644 --- a/examples/vmdq_dcb/main.c +++ b/examples/vmdq_dcb/main.c @@ -161,15 +161,11 @@ get_eth_conf(struct rte_eth_conf *eth_conf) tx_conf.dcb_tc[i] = i % num_tcs; } dcb_conf.nb_tcs = (enum rte_eth_nb_tcs)num_tcs; - (void)(rte_memcpy(eth_conf, &vmdq_dcb_conf_default, sizeof(*eth_conf))); - (void)(rte_memcpy(ð_conf->rx_adv_conf.vmdq_dcb_conf, &conf, - sizeof(conf))); - (void)(rte_memcpy(ð_conf->rx_adv_conf.dcb_rx_conf, &dcb_conf, - sizeof(dcb_conf))); - (void)(rte_memcpy(ð_conf->rx_adv_conf.vmdq_rx_conf, &vmdq_conf, - sizeof(vmdq_conf))); - (void)(rte_memcpy(ð_conf->tx_adv_conf.vmdq_dcb_tx_conf, &tx_conf, - sizeof(tx_conf))); + (void)(memcpy(eth_conf, &vmdq_dcb_conf_default, sizeof(*eth_conf))); + (void)(memcpy(ð_conf->rx_adv_conf.vmdq_dcb_conf, &conf, sizeof(conf))); + (void)(memcpy(ð_conf->rx_adv_conf.dcb_rx_conf, &dcb_conf, sizeof(dcb_conf))); + (void)(memcpy(ð_conf->rx_adv_conf.vmdq_rx_conf, &vmdq_conf, sizeof(vmdq_conf))); + (void)(memcpy(ð_conf->tx_adv_conf.vmdq_dcb_tx_conf, &tx_conf, sizeof(tx_conf))); if (rss_enable) { eth_conf->rxmode.mq_mode = RTE_ETH_MQ_RX_VMDQ_DCB_RSS; eth_conf->rx_adv_conf.rss_conf.rss_hf = RTE_ETH_RSS_IP | -- 2.43.0