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 F0CF943C12; Fri, 1 Mar 2024 18:25:27 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D6EE94350F; Fri, 1 Mar 2024 18:18:50 +0100 (CET) Received: from mail-pl1-f179.google.com (mail-pl1-f179.google.com [209.85.214.179]) by mails.dpdk.org (Postfix) with ESMTP id 2171C43487 for ; Fri, 1 Mar 2024 18:18:15 +0100 (CET) Received: by mail-pl1-f179.google.com with SMTP id d9443c01a7336-1dca160163dso23227495ad.3 for ; Fri, 01 Mar 2024 09:18:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1709313494; x=1709918294; 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=6C2FGPHnRzt39pnm08MPnZG73sDYQhkMrLyqqUoxDfo=; b=UTzXQ0xGsqfUo/3tAya5FRwv2CXLdANpxTSKCTUagtB7pUxq3wUCLWh2WzZsY6mxr0 w3Y6SHf+wovT+0UPEntobbsgHUaV/8WXfhpmMeLpJD55+2rDiszhXZVjVoixz6Tz5B0F emvOwOSrqwbntThbg1ovnzMN67XMSvBVdo3wsQVIKDs0eKPXVr11Kydmi6mObXkSHPHe JpsC2fgPYTO6YeW+wrGDT0X9W4V4cvV96mmnSZYNpUiF/RBOLOBQe6rvCed24ao1stKu vrdHUOzCfALDrJ06RHugeluQNIJhMlMePGeXucbuycBv4ja7FyIRT9yZ6RCCCb/g+H24 wleQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709313494; x=1709918294; 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=6C2FGPHnRzt39pnm08MPnZG73sDYQhkMrLyqqUoxDfo=; b=ZkfL94f4d+mgFd+74EfaPVW7XS2TqxooHCvLDdCUZ2Smn88aSNYSsfBdH2W9rhv5+H iWMaznThxcYwPBU1n8HUH3lgfYZp1mf6uWE6JRj+LrOUwomeeD6KVf6uJgNxkMdxmf3v gpFHTyoXfLZLRmkSaQJ5EqBzahbrGrRw7YVHakUgn+W13jLl+AKorCT/OkaWu+PAdYWq sZIwQ+iM49UULzT6+eLvtLphDHaE0GrRsJg/8r4AEbXV+8UB+qEJFreW/7RlBkxa+J+a QFgZhCGuTmHKYrku9m0mAKzjV4N2RsvE9pAMo/tIqXMi2lYkhZjDwyxfeb+Dj0a/gx/A Vy3A== X-Gm-Message-State: AOJu0YxQgWH9hTfcDCxPatUoitvVUhy4haUThTm6tYyhh3gtM9lVNztg /LDOIK2IL/mhfjBDGnMdmMqkPG8hPZe2g63nKlckQh+dYc6ep0ZyEGK5q6Td9/+Ulh1zqfB4UU0 WN7NmCQ== X-Google-Smtp-Source: AGHT+IEEJ/DpTEsRvPyHM7hUQwsMLheNgfsze0FckzOgErnLBKSNwiNQ1s9fyADCwyAAQqy4IGHtpg== X-Received: by 2002:a17:903:32d0:b0:1db:cbff:df15 with SMTP id i16-20020a17090332d000b001dbcbffdf15mr2617971plr.9.1709313494197; Fri, 01 Mar 2024 09:18:14 -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.18.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Mar 2024 09:18:13 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Nicolas Chautru , Tomasz Kantecki , Kirill Rybalchenko , Maxime Coquelin , Chenbo Xia Subject: [PATCH v2 71/71] examples: replace use of fixed size rte_memcpy Date: Fri, 1 Mar 2024 09:16:07 -0800 Message-ID: <20240301171707.95242-72-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 --- examples/bbdev_app/main.c | 2 +- examples/l2fwd-cat/cat.c | 4 +--- examples/ptpclient/ptpclient.c | 11 +++++------ examples/vhost/main.c | 5 ++--- examples/vmdq/main.c | 6 ++---- examples/vmdq_dcb/main.c | 15 +++++---------- 6 files changed, 16 insertions(+), 27 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..d1689fca2912 100644 --- a/examples/l2fwd-cat/cat.c +++ b/examples/l2fwd-cat/cat.c @@ -12,7 +12,6 @@ #include #include -#include #include @@ -314,8 +313,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..d928f4a45ccf 100644 --- a/examples/vmdq/main.c +++ b/examples/vmdq/main.c @@ -17,7 +17,6 @@ #include #include #include -#include #include #include #include @@ -151,9 +150,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..f93eca59367b 100644 --- a/examples/vmdq_dcb/main.c +++ b/examples/vmdq_dcb/main.c @@ -17,7 +17,6 @@ #include #include #include -#include #include #include #include @@ -161,15 +160,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