[59/71] net/cxgbe: replace use of fixed size rte_memcpy

Message ID 20240229225936.483472-60-stephen@networkplumber.org (mailing list archive)
State Superseded, archived
Delegated to: Thomas Monjalon
Headers
Series replace use of fixed size rte_memcpy |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Stephen Hemminger Feb. 29, 2024, 10:58 p.m. UTC
Automatically generated by devtools/cocci/rte_memcpy.cocci

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/net/cxgbe/clip_tbl.c     |  2 +-
 drivers/net/cxgbe/cxgbe_filter.c |  8 ++++----
 drivers/net/cxgbe/l2t.c          |  4 ++--
 drivers/net/cxgbe/smt.c          | 20 +++++++++-----------
 4 files changed, 16 insertions(+), 18 deletions(-)
  

Patch

diff --git a/drivers/net/cxgbe/clip_tbl.c b/drivers/net/cxgbe/clip_tbl.c
index b709e26f6aa9..d30fa6425f28 100644
--- a/drivers/net/cxgbe/clip_tbl.c
+++ b/drivers/net/cxgbe/clip_tbl.c
@@ -115,7 +115,7 @@  static struct clip_entry *t4_clip_alloc(struct rte_eth_dev *dev,
 	if (ce) {
 		t4_os_lock(&ce->lock);
 		if (__atomic_load_n(&ce->refcnt, __ATOMIC_RELAXED) == 0) {
-			rte_memcpy(ce->addr, lip, sizeof(ce->addr));
+			memcpy(ce->addr, lip, sizeof(ce->addr));
 			if (v6) {
 				ce->type = FILTER_TYPE_IPV6;
 				__atomic_store_n(&ce->refcnt, 1,
diff --git a/drivers/net/cxgbe/cxgbe_filter.c b/drivers/net/cxgbe/cxgbe_filter.c
index 5a7efe7a733e..3d1d087ec215 100644
--- a/drivers/net/cxgbe/cxgbe_filter.c
+++ b/drivers/net/cxgbe/cxgbe_filter.c
@@ -851,10 +851,10 @@  static int set_filter_wr(struct rte_eth_dev *dev, unsigned int fidx)
 	fwr->ivlanm = cpu_to_be16(f->fs.mask.ivlan);
 	fwr->ovlan = cpu_to_be16(f->fs.val.ovlan);
 	fwr->ovlanm = cpu_to_be16(f->fs.mask.ovlan);
-	rte_memcpy(fwr->lip, f->fs.val.lip, sizeof(fwr->lip));
-	rte_memcpy(fwr->lipm, f->fs.mask.lip, sizeof(fwr->lipm));
-	rte_memcpy(fwr->fip, f->fs.val.fip, sizeof(fwr->fip));
-	rte_memcpy(fwr->fipm, f->fs.mask.fip, sizeof(fwr->fipm));
+	memcpy(fwr->lip, f->fs.val.lip, sizeof(fwr->lip));
+	memcpy(fwr->lipm, f->fs.mask.lip, sizeof(fwr->lipm));
+	memcpy(fwr->fip, f->fs.val.fip, sizeof(fwr->fip));
+	memcpy(fwr->fipm, f->fs.mask.fip, sizeof(fwr->fipm));
 	fwr->lp = cpu_to_be16(f->fs.val.lport);
 	fwr->lpm = cpu_to_be16(f->fs.mask.lport);
 	fwr->fp = cpu_to_be16(f->fs.val.fport);
diff --git a/drivers/net/cxgbe/l2t.c b/drivers/net/cxgbe/l2t.c
index 21f4019ae626..7721c7953ec0 100644
--- a/drivers/net/cxgbe/l2t.c
+++ b/drivers/net/cxgbe/l2t.c
@@ -82,7 +82,7 @@  static int write_l2e(struct rte_eth_dev *dev, struct l2t_entry *e, int sync,
 				  V_L2T_W_NOREPLY(!sync));
 	req->l2t_idx = cpu_to_be16(l2t_idx);
 	req->vlan = cpu_to_be16(e->vlan);
-	rte_memcpy(req->dst_mac, e->dmac, RTE_ETHER_ADDR_LEN);
+	memcpy(req->dst_mac, e->dmac, RTE_ETHER_ADDR_LEN);
 
 	if (loopback)
 		memset(req->dst_mac, 0, RTE_ETHER_ADDR_LEN);
@@ -155,7 +155,7 @@  static struct l2t_entry *t4_l2t_alloc_switching(struct rte_eth_dev *dev,
 			e->state = L2T_STATE_SWITCHING;
 			e->vlan = vlan;
 			e->lport = port;
-			rte_memcpy(e->dmac, eth_addr, RTE_ETHER_ADDR_LEN);
+			memcpy(e->dmac, eth_addr, RTE_ETHER_ADDR_LEN);
 			__atomic_store_n(&e->refcnt, 1, __ATOMIC_RELAXED);
 			ret = write_l2e(dev, e, 0, !L2T_LPBK, !L2T_ARPMISS);
 			if (ret < 0)
diff --git a/drivers/net/cxgbe/smt.c b/drivers/net/cxgbe/smt.c
index 4e14a73753de..a74b2e0794e6 100644
--- a/drivers/net/cxgbe/smt.c
+++ b/drivers/net/cxgbe/smt.c
@@ -55,26 +55,24 @@  static int write_smt_entry(struct rte_eth_dev *dev, struct smt_entry *e)
 		 */
 		if (e->idx & 1) {
 			req->pfvf1 = 0x0;
-			rte_memcpy(req->src_mac1, e->src_mac,
-				   RTE_ETHER_ADDR_LEN);
+			memcpy(req->src_mac1, e->src_mac, RTE_ETHER_ADDR_LEN);
 
 			/* fill pfvf0/src_mac0 with entry
 			 * at prev index from smt-tab.
 			 */
 			req->pfvf0 = 0x0;
-			rte_memcpy(req->src_mac0, s->smtab[e->idx - 1].src_mac,
-				   RTE_ETHER_ADDR_LEN);
+			memcpy(req->src_mac0, s->smtab[e->idx - 1].src_mac,
+			       RTE_ETHER_ADDR_LEN);
 		} else {
 			req->pfvf0 = 0x0;
-			rte_memcpy(req->src_mac0, e->src_mac,
-				   RTE_ETHER_ADDR_LEN);
+			memcpy(req->src_mac0, e->src_mac, RTE_ETHER_ADDR_LEN);
 
 			/* fill pfvf1/src_mac1 with entry
 			 * at next index from smt-tab
 			 */
 			req->pfvf1 = 0x0;
-			rte_memcpy(req->src_mac1, s->smtab[e->idx + 1].src_mac,
-				   RTE_ETHER_ADDR_LEN);
+			memcpy(req->src_mac1, s->smtab[e->idx + 1].src_mac,
+			       RTE_ETHER_ADDR_LEN);
 		}
 		row = (e->hw_idx >> 1);
 	} else {
@@ -87,8 +85,8 @@  static int write_smt_entry(struct rte_eth_dev *dev, struct smt_entry *e)
 
 		/* fill pfvf0/src_mac0 from smt-tab */
 		t6req->pfvf0 = 0x0;
-		rte_memcpy(t6req->src_mac0, s->smtab[e->idx].src_mac,
-			   RTE_ETHER_ADDR_LEN);
+		memcpy(t6req->src_mac0, s->smtab[e->idx].src_mac,
+		       RTE_ETHER_ADDR_LEN);
 		row = e->hw_idx;
 		req = (struct cpl_smt_write_req *)t6req;
 	}
@@ -158,7 +156,7 @@  static struct smt_entry *t4_smt_alloc_switching(struct rte_eth_dev *dev,
 		t4_os_lock(&e->lock);
 		if (__atomic_load_n(&e->refcnt, __ATOMIC_RELAXED) == 0) {
 			e->pfvf = pfvf;
-			rte_memcpy(e->src_mac, smac, RTE_ETHER_ADDR_LEN);
+			memcpy(e->src_mac, smac, RTE_ETHER_ADDR_LEN);
 			ret = write_smt_entry(dev, e);
 			if (ret) {
 				e->pfvf = 0;