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 05/11] net/nfp: remove the redundancy macro
Date: Sat, 28 Oct 2023 14:15:52 +0800 [thread overview]
Message-ID: <20231028061558.1842855-6-chaoyong.he@corigine.com> (raw)
In-Reply-To: <20231028061558.1842855-1-chaoyong.he@corigine.com>
Macro 'NFP_HASH_OFFSET' and 'NFP_HASH_TYPE_OFFSET' are unused, so remove
them.
Macro 'NFP_MAX_PHYPORTS' and 'MAX_FLOWER_PHYPORTS' are redundancy, so
just keep the first one.
Macro 'NFP_NET_CFG_SPARE_ADDR', 'NFP_NET_CFG_RX_OFFSET_ADDR' and
'NFP_NET_CFG_RX_OFFSET' are redundancy, we just keep the final one.
Remove the unneeded macro 'NFP_NET_DEV_PRIVATE_TO_PF', and adjust the
related logic, to make it easier to read.
Signed-off-by: Chaoyong He <chaoyong.he@corigine.com>
Reviewed-by: Peng Zhang <peng.zhang@corigine.com>
---
drivers/common/nfp/nfp_common_ctrl.h | 17 -----------------
drivers/net/nfp/flower/nfp_flower.h | 3 +--
drivers/net/nfp/nfp_ethdev.c | 12 ++++--------
drivers/net/nfp/nfp_net_common.c | 2 +-
drivers/net/nfp/nfp_net_common.h | 3 ---
drivers/net/nfp/nfp_rxtx.h | 3 ---
6 files changed, 6 insertions(+), 34 deletions(-)
diff --git a/drivers/common/nfp/nfp_common_ctrl.h b/drivers/common/nfp/nfp_common_ctrl.h
index f92ce50fc0..7033c8ea00 100644
--- a/drivers/common/nfp/nfp_common_ctrl.h
+++ b/drivers/common/nfp/nfp_common_ctrl.h
@@ -196,11 +196,6 @@ struct nfp_net_fw_ver {
#define NFP_NET_CFG_START_TXQ 0x0048
#define NFP_NET_CFG_START_RXQ 0x004c
-/*
- * NFP-3200 workaround (0x0050 - 0x0058)
- * @NFP_NET_CFG_SPARE_ADDR: DMA address for ME code to use (e.g. YDS-155 fix)
- */
-#define NFP_NET_CFG_SPARE_ADDR 0x0050
/*
* NFP6000/NFP4000 - Prepend configuration
*/
@@ -210,18 +205,6 @@ struct nfp_net_fw_ver {
/* Start anchor of the TLV area */
#define NFP_NET_CFG_TLV_BASE 0x0058
-/**
- * Reuse spare address to contain the offset from the start of
- * the host buffer where the first byte of the received frame
- * will land. Any metadata will come prior to that offset. If the
- * value in this field is 0, it means that the metadata will
- * always land starting at the first byte of the host buffer and
- * packet data will immediately follow the metadata. As always,
- * the RX descriptor indicates the presence or absence of metadata
- * along with the length thereof.
- */
-#define NFP_NET_CFG_RX_OFFSET_ADDR 0x0050
-
#define NFP_NET_CFG_VXLAN_PORT 0x0060
#define NFP_NET_CFG_VXLAN_SZ 0x0008
diff --git a/drivers/net/nfp/flower/nfp_flower.h b/drivers/net/nfp/flower/nfp_flower.h
index 7d442e3cb2..a989c4a8b8 100644
--- a/drivers/net/nfp/flower/nfp_flower.h
+++ b/drivers/net/nfp/flower/nfp_flower.h
@@ -31,7 +31,6 @@
*/
#define FLOWER_PKT_DATA_OFFSET (NFP_NET_META_HEADER_SIZE + NFP_NET_META_FIELD_SIZE)
-#define MAX_FLOWER_PHYPORTS 8
#define MAX_FLOWER_VFS 64
/* Forward declaration */
@@ -78,7 +77,7 @@ struct nfp_app_fw_flower {
uint64_t ctrl_vnic_tx_count;
/** Array of phyport representors */
- struct nfp_flower_representor *phy_reprs[MAX_FLOWER_PHYPORTS];
+ struct nfp_flower_representor *phy_reprs[NFP_MAX_PHYPORTS];
/** Array of VF representors */
struct nfp_flower_representor *vf_reprs[MAX_FLOWER_VFS];
diff --git a/drivers/net/nfp/nfp_ethdev.c b/drivers/net/nfp/nfp_ethdev.c
index 8e69fa67b2..7c5b780e82 100644
--- a/drivers/net/nfp/nfp_ethdev.c
+++ b/drivers/net/nfp/nfp_ethdev.c
@@ -56,7 +56,7 @@ nfp_net_start(struct rte_eth_dev *dev)
struct rte_intr_handle *intr_handle = pci_dev->intr_handle;
net_hw = dev->data->dev_private;
- pf_dev = NFP_NET_DEV_PRIVATE_TO_PF(dev->data->dev_private);
+ pf_dev = net_hw->pf_dev;
app_fw_nic = NFP_PRIV_TO_APP_FW_NIC(pf_dev->app_fw_priv);
hw = &net_hw->super;
@@ -261,8 +261,8 @@ nfp_net_close(struct rte_eth_dev *dev)
if (rte_eal_process_type() != RTE_PROC_PRIMARY)
return 0;
- pf_dev = NFP_NET_DEV_PRIVATE_TO_PF(dev->data->dev_private);
hw = dev->data->dev_private;
+ pf_dev = hw->pf_dev;
pci_dev = RTE_ETH_DEV_TO_PCI(dev);
app_fw_nic = NFP_PRIV_TO_APP_FW_NIC(pf_dev->app_fw_priv);
@@ -482,9 +482,10 @@ nfp_net_init(struct rte_eth_dev *eth_dev)
struct nfp_app_fw_nic *app_fw_nic;
pci_dev = RTE_ETH_DEV_TO_PCI(eth_dev);
+ net_hw = eth_dev->data->dev_private;
/* Use backpointer here to the PF of this eth_dev */
- pf_dev = NFP_NET_DEV_PRIVATE_TO_PF(eth_dev->data->dev_private);
+ pf_dev = net_hw->pf_dev;
/* Use backpointer to the CoreNIC app struct */
app_fw_nic = NFP_PRIV_TO_APP_FW_NIC(pf_dev->app_fw_priv);
@@ -495,11 +496,6 @@ nfp_net_init(struct rte_eth_dev *eth_dev)
return -ENODEV;
}
- /*
- * Use PF array of physical ports to get pointer to
- * this specific port.
- */
- net_hw = app_fw_nic->ports[port];
hw = &net_hw->super;
PMD_INIT_LOG(DEBUG, "Working with physical port number: %hu, "
diff --git a/drivers/net/nfp/nfp_net_common.c b/drivers/net/nfp/nfp_net_common.c
index 1260b9a3b1..e3c3fa9985 100644
--- a/drivers/net/nfp/nfp_net_common.c
+++ b/drivers/net/nfp/nfp_net_common.c
@@ -1172,7 +1172,7 @@ nfp_net_common_init(struct rte_pci_device *pci_dev,
if (hw->ver.major < 2)
hw->rx_offset = NFP_NET_RX_OFFSET;
else
- hw->rx_offset = nn_cfg_readl(&hw->super, NFP_NET_CFG_RX_OFFSET_ADDR);
+ hw->rx_offset = nn_cfg_readl(&hw->super, NFP_NET_CFG_RX_OFFSET);
hw->super.ctrl = 0;
hw->stride_rx = stride;
diff --git a/drivers/net/nfp/nfp_net_common.h b/drivers/net/nfp/nfp_net_common.h
index a23b5be968..829e9c5333 100644
--- a/drivers/net/nfp/nfp_net_common.h
+++ b/drivers/net/nfp/nfp_net_common.h
@@ -238,9 +238,6 @@ int nfp_net_firmware_version_get(struct rte_eth_dev *dev, char *fw_version, size
int nfp_repr_firmware_version_get(struct rte_eth_dev *dev, char *fw_version, size_t fw_size);
bool nfp_net_is_valid_nfd_version(struct nfp_net_fw_ver version);
-#define NFP_NET_DEV_PRIVATE_TO_PF(dev_priv)\
- (((struct nfp_net_hw *)dev_priv)->pf_dev)
-
#define NFP_PRIV_TO_APP_FW_NIC(app_fw_priv)\
((struct nfp_app_fw_nic *)app_fw_priv)
diff --git a/drivers/net/nfp/nfp_rxtx.h b/drivers/net/nfp/nfp_rxtx.h
index 956cc7a0d2..ff1019b690 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 NFP_HASH_OFFSET ((uint8_t *)mbuf->buf_addr + mbuf->data_off - 4)
-#define NFP_HASH_TYPE_OFFSET ((uint8_t *)mbuf->buf_addr + mbuf->data_off - 8)
-
#define RTE_MBUF_DMA_ADDR_DEFAULT(mb) \
((uint64_t)((mb)->buf_iova + RTE_PKTMBUF_HEADROOM))
--
2.39.1
next prev parent reply other threads:[~2023-10-28 6:17 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 ` Chaoyong He [this message]
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 ` [PATCH v2 07/11] net/nfp: use the DPDK defined function Chaoyong He
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=20231028061558.1842855-6-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).