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 EDDDF43BAE; Fri, 1 Mar 2024 00:02:30 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7189443332; Fri, 1 Mar 2024 00:00:59 +0100 (CET) Received: from mail-pj1-f50.google.com (mail-pj1-f50.google.com [209.85.216.50]) by mails.dpdk.org (Postfix) with ESMTP id D96174329E for ; Fri, 1 Mar 2024 00:00:16 +0100 (CET) Received: by mail-pj1-f50.google.com with SMTP id 98e67ed59e1d1-299566373d4so1085225a91.1 for ; Thu, 29 Feb 2024 15:00:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1709247615; x=1709852415; 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=OoUWowKhrMEflDaoUwwzGnre0FIbuyfQ26+Nm2E73oY=; b=GE3THGSsTBiwBqiIf+9KCgU32pLzbryeyghakHnU3TmnMduC0ASp+6SU7PhASP74Mv NMsvYVH0ebCzOJwT6mDqIWtZBumZAaWSYxLVYHQqjB94VcI1NUtEX4lRAxBF8rA1i443 gnNLYvvr8FpyGZxSP6bZTNbqsGMcCfAKP+aFJuFewqDhRrwgOj5IVWvaKR8oPI0txroX y0Q/OEVmzfT5KL+vejF7tAPYkAXYmK+rYZ8LAj8KyXHpIIb9wZLTVW967giuyvcQojG0 D0eHfKoMwBHPEiXFxlJDVQfqu+Z6YgWhRzDUoo50TdhNQf6MWmmvD4T4xJIpe8Q+ymIY XCyQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709247615; x=1709852415; 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=OoUWowKhrMEflDaoUwwzGnre0FIbuyfQ26+Nm2E73oY=; b=DbwHmfxO/Oa/ue3lPpI1KN1Fk4+5BNYf0xIzGLEgAUGDiD03gyixGve3F8Z+1Io90I 60fLKqa3bE5mnfhWKsBon1iXvjLtkOM5Tdn/JXoZAuF4d874VJei9czkGa/SZkJsD/TJ 2aH302wC0jadbUi4dE7ZvPDLd+TAp6Is1TxDwIwtEB5jvzffVNuFR+eE1LqJctgwa4qi i9xYUHIFAEDxaXdnt5S6kl+jcdwg4IjGVFLD9SPLaOz7teZUQKDxMJePaL8JAxpiKuoG h1JK3zPiBXZFKTvNwIUbHaWnbTMefxXO/tMf4agJGxg4GumXDApxnl2OgBZe1pDjDNVZ t53Q== X-Gm-Message-State: AOJu0YxKpGHpWYpTkpTXKww2MD2Zu9IAAjfAmZc6/hbDEyZTqn+JB/zE p4/ZpWdp6hpdCRD0GBzqeR429GmnPfjgypqkBuA9QZ3m72uTQGT0xQ6CG20Z/HPDeTu0TwtEAfp / X-Google-Smtp-Source: AGHT+IHL616GhU3fOSyuO+5jTCnqVPiXp6vhmxQKBbPIacKadblgnS7bVex+c2yLpYrL0iICHNwdMw== X-Received: by 2002:a17:90a:3d45:b0:29b:125c:a97a with SMTP id o5-20020a17090a3d4500b0029b125ca97amr14195pjf.43.1709247614825; Thu, 29 Feb 2024 15:00:14 -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.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Feb 2024 15:00:14 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Andrew Rybchenko Subject: [PATCH 19/71] net/sfc: replace use of fixed size rte_memcpy Date: Thu, 29 Feb 2024 14:58:06 -0800 Message-ID: <20240229225936.483472-20-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/sfc/sfc.c | 2 +- drivers/net/sfc/sfc_ef10_tx.c | 2 +- drivers/net/sfc/sfc_ethdev.c | 11 +++++------ drivers/net/sfc/sfc_flow.c | 20 ++++++++++---------- drivers/net/sfc/sfc_flow_rss.c | 2 +- drivers/net/sfc/sfc_mae.c | 2 +- drivers/net/sfc/sfc_rx.c | 2 +- drivers/net/sfc/sfc_tso.c | 2 +- drivers/net/sfc/sfc_tso.h | 9 ++++----- 9 files changed, 25 insertions(+), 27 deletions(-) diff --git a/drivers/net/sfc/sfc.c b/drivers/net/sfc/sfc.c index 2cfff20f4783..2fd160e99ed2 100644 --- a/drivers/net/sfc/sfc.c +++ b/drivers/net/sfc/sfc.c @@ -850,7 +850,7 @@ sfc_rss_attach(struct sfc_adapter *sa) efx_ev_fini(sa->nic); efx_intr_fini(sa->nic); - rte_memcpy(rss->key, default_rss_key, sizeof(rss->key)); + memcpy(rss->key, default_rss_key, sizeof(rss->key)); memset(&rss->dummy_ctx, 0, sizeof(rss->dummy_ctx)); rss->dummy_ctx.conf.qid_span = 1; rss->dummy_ctx.dummy = true; diff --git a/drivers/net/sfc/sfc_ef10_tx.c b/drivers/net/sfc/sfc_ef10_tx.c index 116229382b68..0b78a9eaccd1 100644 --- a/drivers/net/sfc/sfc_ef10_tx.c +++ b/drivers/net/sfc/sfc_ef10_tx.c @@ -514,7 +514,7 @@ sfc_ef10_xmit_tso_pkt(struct sfc_ef10_txq * const txq, struct rte_mbuf *m_seg, first_m_seg->outer_l2_len); th = (const struct rte_tcp_hdr *)(hdr_addr + tcph_off); - rte_memcpy(&sent_seq, &th->sent_seq, sizeof(uint32_t)); + memcpy(&sent_seq, &th->sent_seq, sizeof(uint32_t)); sent_seq = rte_be_to_cpu_32(sent_seq); sfc_ef10_tx_qdesc_tso2_create(txq, *added, packet_id, outer_packet_id, diff --git a/drivers/net/sfc/sfc_ethdev.c b/drivers/net/sfc/sfc_ethdev.c index 92ca5e7a60de..a6f0743f102c 100644 --- a/drivers/net/sfc/sfc_ethdev.c +++ b/drivers/net/sfc/sfc_ethdev.c @@ -1287,8 +1287,7 @@ sfc_set_mc_addr_list(struct rte_eth_dev *dev, } for (i = 0; i < nb_mc_addr; ++i) { - rte_memcpy(mc_addrs, mc_addr_set[i].addr_bytes, - EFX_MAC_ADDR_LEN); + memcpy(mc_addrs, mc_addr_set[i].addr_bytes, EFX_MAC_ADDR_LEN); mc_addrs += EFX_MAC_ADDR_LEN; } @@ -1672,7 +1671,7 @@ sfc_dev_rss_hash_conf_get(struct rte_eth_dev *dev, rss_conf->rss_hf = sfc_rx_hf_efx_to_rte(rss, rss->hash_types); rss_conf->rss_key_len = EFX_RSS_KEY_SIZE; if (rss_conf->rss_key != NULL) - rte_memcpy(rss_conf->rss_key, rss->key, EFX_RSS_KEY_SIZE); + memcpy(rss_conf->rss_key, rss->key, EFX_RSS_KEY_SIZE); return 0; } @@ -1741,7 +1740,7 @@ sfc_dev_rss_hash_update(struct rte_eth_dev *dev, } } - rte_memcpy(rss->key, rss_conf->rss_key, sizeof(rss->key)); + memcpy(rss->key, rss_conf->rss_key, sizeof(rss->key)); } rss->hash_types = efx_hash_types; @@ -1840,7 +1839,7 @@ sfc_dev_rss_reta_update(struct rte_eth_dev *dev, sfc_adapter_lock(sa); - rte_memcpy(rss_tbl_new, rss->tbl, sizeof(rss->tbl)); + memcpy(rss_tbl_new, rss->tbl, sizeof(rss->tbl)); for (entry = 0; entry < reta_size; entry++) { int grp_idx = entry % RTE_ETH_RETA_GROUP_SIZE; @@ -1864,7 +1863,7 @@ sfc_dev_rss_reta_update(struct rte_eth_dev *dev, goto fail_scale_tbl_set; } - rte_memcpy(rss->tbl, rss_tbl_new, sizeof(rss->tbl)); + memcpy(rss->tbl, rss_tbl_new, sizeof(rss->tbl)); fail_scale_tbl_set: bad_reta_entry: diff --git a/drivers/net/sfc/sfc_flow.c b/drivers/net/sfc/sfc_flow.c index 1b50aefe5c48..2bb98a443335 100644 --- a/drivers/net/sfc/sfc_flow.c +++ b/drivers/net/sfc/sfc_flow.c @@ -325,8 +325,8 @@ sfc_flow_parse_eth(const struct rte_flow_item *item, efx_spec->efs_match_flags |= is_ifrm ? EFX_FILTER_MATCH_IFRM_LOC_MAC : EFX_FILTER_MATCH_LOC_MAC; - rte_memcpy(loc_mac, spec->hdr.dst_addr.addr_bytes, - EFX_MAC_ADDR_LEN); + memcpy(loc_mac, spec->hdr.dst_addr.addr_bytes, + EFX_MAC_ADDR_LEN); } else if (memcmp(mask->hdr.dst_addr.addr_bytes, ig_mask, EFX_MAC_ADDR_LEN) == 0) { if (rte_is_unicast_ether_addr(&spec->hdr.dst_addr)) @@ -348,8 +348,8 @@ sfc_flow_parse_eth(const struct rte_flow_item *item, */ if (rte_is_same_ether_addr(&mask->hdr.src_addr, &supp_mask.hdr.src_addr)) { efx_spec->efs_match_flags |= EFX_FILTER_MATCH_REM_MAC; - rte_memcpy(efx_spec->efs_rem_mac, spec->hdr.src_addr.addr_bytes, - EFX_MAC_ADDR_LEN); + memcpy(efx_spec->efs_rem_mac, spec->hdr.src_addr.addr_bytes, + EFX_MAC_ADDR_LEN); } else if (!rte_is_zero_ether_addr(&mask->hdr.src_addr)) { goto fail_bad_mask; } @@ -624,8 +624,8 @@ sfc_flow_parse_ipv6(const struct rte_flow_item *item, RTE_BUILD_BUG_ON(sizeof(efx_spec->efs_rem_host) != sizeof(spec->hdr.src_addr)); - rte_memcpy(&efx_spec->efs_rem_host, spec->hdr.src_addr, - sizeof(efx_spec->efs_rem_host)); + memcpy(&efx_spec->efs_rem_host, spec->hdr.src_addr, + sizeof(efx_spec->efs_rem_host)); } else if (!sfc_flow_is_zero(mask->hdr.src_addr, sizeof(mask->hdr.src_addr))) { goto fail_bad_mask; @@ -637,8 +637,8 @@ sfc_flow_parse_ipv6(const struct rte_flow_item *item, RTE_BUILD_BUG_ON(sizeof(efx_spec->efs_loc_host) != sizeof(spec->hdr.dst_addr)); - rte_memcpy(&efx_spec->efs_loc_host, spec->hdr.dst_addr, - sizeof(efx_spec->efs_loc_host)); + memcpy(&efx_spec->efs_loc_host, spec->hdr.dst_addr, + sizeof(efx_spec->efs_loc_host)); } else if (!sfc_flow_is_zero(mask->hdr.dst_addr, sizeof(mask->hdr.dst_addr))) { goto fail_bad_mask; @@ -889,8 +889,8 @@ sfc_flow_set_efx_spec_vni_or_vsid(efx_filter_spec_t *efx_spec, if (memcmp(vni_or_vsid_mask, vni_or_vsid_full_mask, EFX_VNI_OR_VSID_LEN) == 0) { efx_spec->efs_match_flags |= EFX_FILTER_MATCH_VNI_OR_VSID; - rte_memcpy(efx_spec->efs_vni_or_vsid, vni_or_vsid_val, - EFX_VNI_OR_VSID_LEN); + memcpy(efx_spec->efs_vni_or_vsid, vni_or_vsid_val, + EFX_VNI_OR_VSID_LEN); } else if (!sfc_flow_is_zero(vni_or_vsid_mask, EFX_VNI_OR_VSID_LEN)) { rte_flow_error_set(error, EINVAL, RTE_FLOW_ERROR_TYPE_ITEM, item, diff --git a/drivers/net/sfc/sfc_flow_rss.c b/drivers/net/sfc/sfc_flow_rss.c index e28c943335f3..a46ce1fa87e1 100644 --- a/drivers/net/sfc/sfc_flow_rss.c +++ b/drivers/net/sfc/sfc_flow_rss.c @@ -119,7 +119,7 @@ sfc_flow_rss_parse_conf(struct sfc_adapter *sa, key = ethdev_rss->key; } - rte_memcpy(out->key, key, sizeof(out->key)); + memcpy(out->key, key, sizeof(out->key)); switch (in->func) { case RTE_ETH_HASH_FUNCTION_DEFAULT: diff --git a/drivers/net/sfc/sfc_mae.c b/drivers/net/sfc/sfc_mae.c index 60ff6d21810a..1f243e798e00 100644 --- a/drivers/net/sfc/sfc_mae.c +++ b/drivers/net/sfc/sfc_mae.c @@ -547,7 +547,7 @@ sfc_mae_mac_addr_add(struct sfc_adapter *sa, if (mac_addr == NULL) return ENOMEM; - rte_memcpy(mac_addr->addr_bytes, addr_bytes, EFX_MAC_ADDR_LEN); + memcpy(mac_addr->addr_bytes, addr_bytes, EFX_MAC_ADDR_LEN); mac_addr->refcnt = 1; mac_addr->fw_rsrc.mac_id.id = EFX_MAE_RSRC_ID_INVALID; diff --git a/drivers/net/sfc/sfc_rx.c b/drivers/net/sfc/sfc_rx.c index a19322926572..55aae9ef04f3 100644 --- a/drivers/net/sfc/sfc_rx.c +++ b/drivers/net/sfc/sfc_rx.c @@ -1526,7 +1526,7 @@ sfc_rx_process_adv_conf_rss(struct sfc_adapter *sa, sizeof(rss->key)); return EINVAL; } - rte_memcpy(rss->key, conf->rss_key, sizeof(rss->key)); + memcpy(rss->key, conf->rss_key, sizeof(rss->key)); } rss->hash_types = efx_hash_types; diff --git a/drivers/net/sfc/sfc_tso.c b/drivers/net/sfc/sfc_tso.c index a0827d1c0dd6..5da2de3c3d49 100644 --- a/drivers/net/sfc/sfc_tso.c +++ b/drivers/net/sfc/sfc_tso.c @@ -159,7 +159,7 @@ sfc_efx_tso_do(struct sfc_efx_txq *txq, unsigned int idx, /* Handle TCP header */ th = (const struct rte_tcp_hdr *)(tsoh + tcph_off); - rte_memcpy(&sent_seq, &th->sent_seq, sizeof(uint32_t)); + memcpy(&sent_seq, &th->sent_seq, sizeof(uint32_t)); sent_seq = rte_be_to_cpu_32(sent_seq); efx_tx_qdesc_tso2_create(txq->common, packet_id, 0, sent_seq, diff --git a/drivers/net/sfc/sfc_tso.h b/drivers/net/sfc/sfc_tso.h index 9029ad159014..e914eae77ef8 100644 --- a/drivers/net/sfc/sfc_tso.h +++ b/drivers/net/sfc/sfc_tso.h @@ -35,7 +35,7 @@ sfc_tso_ip4_get_ipid(const uint8_t *pkt_hdrp, size_t ip_hdr_off) uint16_t ipid; ip_hdrp = (const struct rte_ipv4_hdr *)(pkt_hdrp + ip_hdr_off); - rte_memcpy(&ipid, &ip_hdrp->packet_id, sizeof(ipid)); + memcpy(&ipid, &ip_hdrp->packet_id, sizeof(ipid)); return rte_be_to_cpu_16(ipid); } @@ -46,9 +46,8 @@ sfc_tso_outer_udp_fix_len(const struct rte_mbuf *m, uint8_t *tsoh) rte_be16_t len = rte_cpu_to_be_16(m->l2_len + m->l3_len + m->l4_len + m->tso_segsz); - rte_memcpy(tsoh + m->outer_l2_len + m->outer_l3_len + - offsetof(struct rte_udp_hdr, dgram_len), - &len, sizeof(len)); + memcpy(tsoh + m->outer_l2_len + m->outer_l3_len + offsetof(struct rte_udp_hdr, dgram_len), + &len, sizeof(len)); } static inline void @@ -67,7 +66,7 @@ sfc_tso_innermost_ip_fix_len(const struct rte_mbuf *m, uint8_t *tsoh, len = rte_cpu_to_be_16(ip_payload_len); } - rte_memcpy(tsoh + iph_ofst + field_ofst, &len, sizeof(len)); + memcpy(tsoh + iph_ofst + field_ofst, &len, sizeof(len)); } unsigned int sfc_tso_prepare_header(uint8_t *tsoh, size_t header_len, -- 2.43.0