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 A82B443BAE; Fri, 1 Mar 2024 00:07:35 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C11A14343E; Fri, 1 Mar 2024 00:02:00 +0100 (CET) Received: from mail-pj1-f44.google.com (mail-pj1-f44.google.com [209.85.216.44]) by mails.dpdk.org (Postfix) with ESMTP id 320A443254 for ; Fri, 1 Mar 2024 00:00:51 +0100 (CET) Received: by mail-pj1-f44.google.com with SMTP id 98e67ed59e1d1-299dba8fd24so1099520a91.2 for ; Thu, 29 Feb 2024 15:00:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1709247650; x=1709852450; 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=Yn99g5KkjD+cfYA9aLT9M1FloYyDLJ99IsLitOZ/W7c=; b=X1E/9M0XwYWw5xtz9PgwjtfRFAeAlmcgeB/VYeDkMtPR/jGAuyMLXJF14HlKRzNg/f qXc0gfT8LInae8jUbSkjXZoWTR/N//hj+zXwveJCKk3NMkANs+7x1H/uj9c7chnj1DDH 2Y3Ewbh+PXv5Y3Qb4mhFTAZGK4mUCcFNjT3kd8D+Tq6rDqaHh9LzWz1gHOcLWJJ1p8/m OQPX1SZfMRrCXzYvpdkjgEITWax+O+RbU4JViG8QDQkKv4LMn6rMXyqLpzshhs64rrbO TNs9476JZaAMBkWPhFB4hjG5s55IEsY56n4dUP0qvaOu8PZhz7h4bFem5VlATOW0Lr/I Ljww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709247650; x=1709852450; 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=Yn99g5KkjD+cfYA9aLT9M1FloYyDLJ99IsLitOZ/W7c=; b=UJw9xS909HB6oDH2tCZgnOnzGG4QXb4U2F7EZUz9ehSu4zIYW6OTqN4aXX7euf4tRB viZfSdj5i4FXhv/eW9V9gctc9VGsFYAJNoTT0aq1ECcJf/qnKcv/mcFa95yz/O7lPjVE //WgLYPnIV0K5XgD9h8+AwCXLnv+EScKs0Z7zVr7yh0R+g3vsC5joPFDPndMGCn0jFp3 hAJ5kweVf8wn/KFnfQmk6ADO9Ed4aea6HFDv4f+1V2h8o8X5egENndDrR6qEPrUq8SQV jenIFtgy1Lo6wr2FTuMbWBOR84LG34zNptLjO30HnVOfSOzfXyottGdzGQmS8khlcRdj zecw== X-Gm-Message-State: AOJu0YwBiOYfx6qXhom/W5WPwejwyI8GD4tbrvY3QINegzyWpYbcisDd Bi79xPnNczluPDeZ8ypegNdCKCoVeCY0aTKxFloEo/GFmYHJIdStX0Zq4QSdZLbY2l3IshEWkQO m X-Google-Smtp-Source: AGHT+IFEtoIer21yr2h4D06qUfHaMDaeAmhRxfm5PuLfWRZ+Gsb1QuLK3H3b6/M16OkPdmRgTKlszA== X-Received: by 2002:a17:90a:8c9:b0:299:3f2a:4309 with SMTP id 9-20020a17090a08c900b002993f2a4309mr39205pjn.18.1709247650340; Thu, 29 Feb 2024 15:00:50 -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.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Feb 2024 15:00:49 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Rahul Lakkireddy Subject: [PATCH 59/71] net/cxgbe: replace use of fixed size rte_memcpy Date: Thu, 29 Feb 2024 14:58:46 -0800 Message-ID: <20240229225936.483472-60-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/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(-) 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; -- 2.43.0