From: Chaoyong He <chaoyong.he@corigine.com>
To: dev@dpdk.org
Cc: oss-drivers@corigine.com, Chaoyong He <chaoyong.he@corigine.com>,
Peng Zhang <peng.zhang@corigine.com>
Subject: [PATCH v2 07/11] net/nfp: use the DPDK defined function
Date: Sat, 28 Oct 2023 14:53:11 +0800 [thread overview]
Message-ID: <20231028065315.1937188-8-chaoyong.he@corigine.com> (raw)
In-Reply-To: <20231028065315.1937188-1-chaoyong.he@corigine.com>
Use the DPDK defined function to replace the user defined macro, to make
the logic more standard.
Signed-off-by: Chaoyong He <chaoyong.he@corigine.com>
Reviewed-by: Peng Zhang <peng.zhang@corigine.com>
---
drivers/net/nfp/flower/nfp_flower_ctrl.c | 2 +-
drivers/net/nfp/nfp_rxtx.c | 4 ++--
drivers/net/nfp/nfp_rxtx.h | 3 ---
3 files changed, 3 insertions(+), 6 deletions(-)
diff --git a/drivers/net/nfp/flower/nfp_flower_ctrl.c b/drivers/net/nfp/flower/nfp_flower_ctrl.c
index d19b60bc69..c25487c277 100644
--- a/drivers/net/nfp/flower/nfp_flower_ctrl.c
+++ b/drivers/net/nfp/flower/nfp_flower_ctrl.c
@@ -109,7 +109,7 @@ nfp_flower_ctrl_vnic_recv(void *rx_queue,
/* Now resetting and updating the descriptor */
rxds->vals[0] = 0;
rxds->vals[1] = 0;
- dma_addr = rte_cpu_to_le_64(RTE_MBUF_DMA_ADDR_DEFAULT(new_mb));
+ dma_addr = rte_cpu_to_le_64(rte_mbuf_data_iova_default(new_mb));
rxds->fld.dd = 0;
rxds->fld.dma_addr_hi = (dma_addr >> 32) & 0xffff;
rxds->fld.dma_addr_lo = dma_addr & 0xffffffff;
diff --git a/drivers/net/nfp/nfp_rxtx.c b/drivers/net/nfp/nfp_rxtx.c
index 38ce83aa46..be1ac32c73 100644
--- a/drivers/net/nfp/nfp_rxtx.c
+++ b/drivers/net/nfp/nfp_rxtx.c
@@ -184,7 +184,7 @@ nfp_net_rx_fill_freelist(struct nfp_net_rxq *rxq)
return -ENOMEM;
}
- dma_addr = rte_cpu_to_le_64(RTE_MBUF_DMA_ADDR_DEFAULT(mbuf));
+ dma_addr = rte_cpu_to_le_64(rte_mbuf_data_iova_default(mbuf));
rxd = &rxq->rxds[i];
rxd->fld.dd = 0;
@@ -752,7 +752,7 @@ nfp_net_recv_pkts(void *rx_queue,
/* Now resetting and updating the descriptor */
rxds->vals[0] = 0;
rxds->vals[1] = 0;
- dma_addr = rte_cpu_to_le_64(RTE_MBUF_DMA_ADDR_DEFAULT(new_mb));
+ dma_addr = rte_cpu_to_le_64(rte_mbuf_data_iova_default(new_mb));
rxds->fld.dd = 0;
rxds->fld.dma_addr_hi = (dma_addr >> 32) & 0xffff;
rxds->fld.dma_addr_lo = dma_addr & 0xffffffff;
diff --git a/drivers/net/nfp/nfp_rxtx.h b/drivers/net/nfp/nfp_rxtx.h
index ff1019b690..5695a31636 100644
--- a/drivers/net/nfp/nfp_rxtx.h
+++ b/drivers/net/nfp/nfp_rxtx.h
@@ -10,9 +10,6 @@
#define NFP_DESC_META_LEN(d) ((d)->rxd.meta_len_dd & PCIE_DESC_RX_META_LEN_MASK)
-#define RTE_MBUF_DMA_ADDR_DEFAULT(mb) \
- ((uint64_t)((mb)->buf_iova + RTE_PKTMBUF_HEADROOM))
-
/* Maximum number of NFP packet metadata fields. */
#define NFP_META_MAX_FIELDS 8
--
2.39.1
next prev parent reply other threads:[~2023-10-28 6:54 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-28 6:15 [PATCH 00/11] Clean up NFP PMD Chaoyong He
2023-10-28 6:15 ` [PATCH 01/11] net/nfp: use the suitable helper macro Chaoyong He
2023-10-28 6:15 ` [PATCH 02/11] net/nfp: remove the unneeded call of underlying API Chaoyong He
2023-10-28 6:15 ` [PATCH 03/11] net/nfp: remove the unneeded check of process type Chaoyong He
2023-10-28 6:15 ` [PATCH 04/11] net/nfp: remove the unneeded data abstraction Chaoyong He
2023-10-28 6:15 ` [PATCH 05/11] net/nfp: remove the redundancy macro Chaoyong He
2023-10-28 6:15 ` [PATCH 06/11] net/nfp: remove redundancy logic of init control BAR Chaoyong He
2023-10-28 6:15 ` [PATCH 07/11] net/nfp: use the DPDK defined function Chaoyong He
2023-10-28 6:15 ` [PATCH 08/11] net/nfp: replace hard coded value Chaoyong He
2023-10-28 6:15 ` [PATCH 09/11] net/nfp: unify the PMD name with macro Chaoyong He
2023-10-28 6:15 ` [PATCH 10/11] net/nfp: extract a helper function Chaoyong He
2023-10-28 6:15 ` [PATCH 11/11] net/nfp: remove the redundancy logic of representor port Chaoyong He
2023-10-28 6:53 ` [PATCH v2 00/11] Clean up NFP PMD Chaoyong He
2023-10-28 6:53 ` [PATCH v2 01/11] net/nfp: use the suitable helper macro Chaoyong He
2023-10-28 6:53 ` [PATCH v2 02/11] net/nfp: remove the unneeded call of underlying API Chaoyong He
2023-10-28 6:53 ` [PATCH v2 03/11] net/nfp: remove the unneeded check of process type Chaoyong He
2023-10-28 6:53 ` [PATCH v2 04/11] net/nfp: remove the unneeded data abstraction Chaoyong He
2023-11-01 17:57 ` Ferruh Yigit
2023-11-02 1:25 ` Chaoyong He
2023-10-28 6:53 ` [PATCH v2 05/11] net/nfp: remove the redundancy macro Chaoyong He
2023-10-28 6:53 ` [PATCH v2 06/11] net/nfp: remove redundancy logic of init control BAR Chaoyong He
2023-10-28 6:53 ` Chaoyong He [this message]
2023-10-28 6:53 ` [PATCH v2 08/11] net/nfp: replace hard coded value Chaoyong He
2023-10-28 6:53 ` [PATCH v2 09/11] net/nfp: unify the PMD name with macro Chaoyong He
2023-10-28 6:53 ` [PATCH v2 10/11] net/nfp: extract a helper function Chaoyong He
2023-10-28 6:53 ` [PATCH v2 11/11] net/nfp: remove the redundancy logic of representor port Chaoyong He
2023-11-01 18:33 ` [PATCH v2 00/11] Clean up NFP PMD Ferruh Yigit
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20231028065315.1937188-8-chaoyong.he@corigine.com \
--to=chaoyong.he@corigine.com \
--cc=dev@dpdk.org \
--cc=oss-drivers@corigine.com \
--cc=peng.zhang@corigine.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).