[v2,54/71] net/bnx2x: replace use of fixed size rte_memcpy

Message ID 20240301171707.95242-55-stephen@networkplumber.org (mailing list archive)
State Superseded
Delegated to: Thomas Monjalon
Headers
Series replace use of fixed size rte_mempcy |

Checks

Context Check Description
ci/checkpatch warning coding style issues

Commit Message

Stephen Hemminger March 1, 2024, 5:15 p.m. UTC
  Automatically generated by devtools/cocci/rte_memcpy.cocci.

Note: the indentation in this file does not follow the coding
standard of DPDK, so it will get some checkpatch warnings.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/net/bnx2x/bnx2x.c       | 32 +++++++++++++++-----------------
 drivers/net/bnx2x/bnx2x_stats.c | 10 +++++-----
 drivers/net/bnx2x/bnx2x_vfpf.c  | 19 ++++++++++---------
 3 files changed, 30 insertions(+), 31 deletions(-)
  

Patch

diff --git a/drivers/net/bnx2x/bnx2x.c b/drivers/net/bnx2x/bnx2x.c
index 597ee4335977..16a9ff7f8c06 100644
--- a/drivers/net/bnx2x/bnx2x.c
+++ b/drivers/net/bnx2x/bnx2x.c
@@ -2242,18 +2242,18 @@  int bnx2x_tx_encap(struct bnx2x_tx_queue *txq, struct rte_mbuf *m0)
 		tx_parse_bd->parsing_data =
 		    (mac_type << ETH_TX_PARSE_BD_E2_ETH_ADDR_TYPE_SHIFT);
 
-		rte_memcpy(&tx_parse_bd->data.mac_addr.dst_hi,
-			   &eh->dst_addr.addr_bytes[0], 2);
-		rte_memcpy(&tx_parse_bd->data.mac_addr.dst_mid,
-			   &eh->dst_addr.addr_bytes[2], 2);
-		rte_memcpy(&tx_parse_bd->data.mac_addr.dst_lo,
-			   &eh->dst_addr.addr_bytes[4], 2);
-		rte_memcpy(&tx_parse_bd->data.mac_addr.src_hi,
-			   &eh->src_addr.addr_bytes[0], 2);
-		rte_memcpy(&tx_parse_bd->data.mac_addr.src_mid,
-			   &eh->src_addr.addr_bytes[2], 2);
-		rte_memcpy(&tx_parse_bd->data.mac_addr.src_lo,
-			   &eh->src_addr.addr_bytes[4], 2);
+		memcpy(&tx_parse_bd->data.mac_addr.dst_hi,
+		       &eh->dst_addr.addr_bytes[0], 2);
+		memcpy(&tx_parse_bd->data.mac_addr.dst_mid,
+		       &eh->dst_addr.addr_bytes[2], 2);
+		memcpy(&tx_parse_bd->data.mac_addr.dst_lo,
+		       &eh->dst_addr.addr_bytes[4], 2);
+		memcpy(&tx_parse_bd->data.mac_addr.src_hi,
+		       &eh->src_addr.addr_bytes[0], 2);
+		memcpy(&tx_parse_bd->data.mac_addr.src_mid,
+		       &eh->src_addr.addr_bytes[2], 2);
+		memcpy(&tx_parse_bd->data.mac_addr.src_lo,
+		       &eh->src_addr.addr_bytes[4], 2);
 
 		tx_parse_bd->data.mac_addr.dst_hi =
 		    rte_cpu_to_be_16(tx_parse_bd->data.mac_addr.dst_hi);
@@ -6675,8 +6675,7 @@  bnx2x_config_rss_pf(struct bnx2x_softc *sc, struct ecore_rss_config_obj *rss_obj
 	/* Hash bits */
 	params.rss_result_mask = MULTI_MASK;
 
-	rte_memcpy(params.ind_table, rss_obj->ind_table,
-			 sizeof(params.ind_table));
+	memcpy(params.ind_table, rss_obj->ind_table, sizeof(params.ind_table));
 
 	if (config_hash) {
 /* RSS keys */
@@ -6742,8 +6741,7 @@  bnx2x_set_mac_one(struct bnx2x_softc *sc, uint8_t * mac,
 
 	/* fill a user request section if needed */
 	if (!rte_bit_relaxed_get32(RAMROD_CONT, ramrod_flags)) {
-		rte_memcpy(ramrod_param.user_req.u.mac.mac, mac,
-				 ETH_ALEN);
+		memcpy(ramrod_param.user_req.u.mac.mac, mac, ETH_ALEN);
 
 		rte_bit_relaxed_set32(mac_type,
 				      &ramrod_param.user_req.vlan_mac_flags);
@@ -6958,7 +6956,7 @@  static void bnx2x_link_report_locked(struct bnx2x_softc *sc)
 
 	ELINK_DEBUG_P1(sc, "link status change count = %x", sc->link_cnt);
 	/* report new link params and remember the state for the next time */
-	rte_memcpy(&sc->last_reported_link, &cur_data, sizeof(cur_data));
+	memcpy(&sc->last_reported_link, &cur_data, sizeof(cur_data));
 
 	if (rte_bit_relaxed_get32(BNX2X_LINK_REPORT_LINK_DOWN,
 			 &cur_data.link_report_flags)) {
diff --git a/drivers/net/bnx2x/bnx2x_stats.c b/drivers/net/bnx2x/bnx2x_stats.c
index c07b01510a06..23c74c21c635 100644
--- a/drivers/net/bnx2x/bnx2x_stats.c
+++ b/drivers/net/bnx2x/bnx2x_stats.c
@@ -114,8 +114,8 @@  bnx2x_hw_stats_post(struct bnx2x_softc *sc)
 
 	/* Update MCP's statistics if possible */
 	if (sc->func_stx) {
-		rte_memcpy(BNX2X_SP(sc, func_stats), &sc->func_stats,
-				sizeof(sc->func_stats));
+		memcpy(BNX2X_SP(sc, func_stats), &sc->func_stats,
+		       sizeof(sc->func_stats));
 	}
 
 	/* loader */
@@ -817,10 +817,10 @@  bnx2x_hw_stats_update(struct bnx2x_softc *sc)
 			  etherstatspktsover1522octets);
     }
 
-    rte_memcpy(old, new, sizeof(struct nig_stats));
+    memcpy(old, new, sizeof(struct nig_stats));
 
-    rte_memcpy(&(estats->rx_stat_ifhcinbadoctets_hi), &(pstats->mac_stx[1]),
-	   sizeof(struct mac_stx));
+    memcpy(&(estats->rx_stat_ifhcinbadoctets_hi), &(pstats->mac_stx[1]),
+           sizeof(struct mac_stx));
     estats->brb_drop_hi = pstats->brb_drop_hi;
     estats->brb_drop_lo = pstats->brb_drop_lo;
 
diff --git a/drivers/net/bnx2x/bnx2x_vfpf.c b/drivers/net/bnx2x/bnx2x_vfpf.c
index 63953c2979ce..678c9e7d7d7c 100644
--- a/drivers/net/bnx2x/bnx2x_vfpf.c
+++ b/drivers/net/bnx2x/bnx2x_vfpf.c
@@ -52,9 +52,9 @@  bnx2x_check_bull(struct bnx2x_softc *sc)
 
 	/* check the mac address and VLAN and allocate memory if valid */
 	if (valid_bitmap & (1 << MAC_ADDR_VALID) && memcmp(bull->mac, sc->old_bulletin.mac, ETH_ALEN))
-		rte_memcpy(&sc->link_params.mac_addr, bull->mac, ETH_ALEN);
+		memcpy(&sc->link_params.mac_addr, bull->mac, ETH_ALEN);
 	if (valid_bitmap & (1 << VLAN_VALID))
-		rte_memcpy(&bull->vlan, &sc->old_bulletin.vlan, RTE_VLAN_HLEN);
+		memcpy(&bull->vlan, &sc->old_bulletin.vlan, RTE_VLAN_HLEN);
 
 	sc->old_bulletin = *bull;
 
@@ -569,7 +569,7 @@  bnx2x_vf_set_mac(struct bnx2x_softc *sc, int set)
 
 	bnx2x_check_bull(sc);
 
-	rte_memcpy(query->filters[0].mac, sc->link_params.mac_addr, ETH_ALEN);
+	memcpy(query->filters[0].mac, sc->link_params.mac_addr, ETH_ALEN);
 
 	bnx2x_add_tlv(sc, query, query->first_tlv.tl.length,
 		      BNX2X_VF_TLV_LIST_END,
@@ -583,10 +583,10 @@  bnx2x_vf_set_mac(struct bnx2x_softc *sc, int set)
 	while (BNX2X_VF_STATUS_FAILURE == reply->status &&
 			bnx2x_check_bull(sc)) {
 		/* A new mac was configured by PF for us */
-		rte_memcpy(sc->link_params.mac_addr, sc->pf2vf_bulletin->mac,
-				ETH_ALEN);
-		rte_memcpy(query->filters[0].mac, sc->pf2vf_bulletin->mac,
-				ETH_ALEN);
+		memcpy(sc->link_params.mac_addr, sc->pf2vf_bulletin->mac,
+		       ETH_ALEN);
+		memcpy(query->filters[0].mac, sc->pf2vf_bulletin->mac,
+		       ETH_ALEN);
 
 		rc = bnx2x_do_req4pf(sc, sc->vf2pf_mbox_mapping.paddr);
 		if (rc)
@@ -622,10 +622,11 @@  bnx2x_vf_config_rss(struct bnx2x_softc *sc,
 		      BNX2X_VF_TLV_LIST_END,
 		      sizeof(struct channel_list_end_tlv));
 
-	rte_memcpy(query->rss_key, params->rss_key, sizeof(params->rss_key));
+	memcpy(query->rss_key, params->rss_key, sizeof(params->rss_key));
 	query->rss_key_size = T_ETH_RSS_KEY;
 
-	rte_memcpy(query->ind_table, params->ind_table, T_ETH_INDIRECTION_TABLE_SIZE);
+	memcpy(query->ind_table, params->ind_table,
+	       T_ETH_INDIRECTION_TABLE_SIZE);
 	query->ind_table_size = T_ETH_INDIRECTION_TABLE_SIZE;
 
 	query->rss_result_mask = params->rss_result_mask;