From: Chaoyong He <chaoyong.he@corigine.com>
To: dev@dpdk.org
Cc: oss-drivers@corigine.com, niklas.soderlund@corigine.com,
Chaoyong He <chaoyong.he@corigine.com>
Subject: [PATCH] net/nfp: remove unused struct fields
Date: Mon, 5 Jun 2023 13:45:25 +0800 [thread overview]
Message-ID: <20230605054525.3460673-1-chaoyong.he@corigine.com> (raw)
Remove the data fields of nfp structure which are not used by anyone,
and modify the corresponding logics.
Signed-off-by: Chaoyong He <chaoyong.he@corigine.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@corigine.com>
---
drivers/net/nfp/flower/nfp_flower.c | 4 +---
drivers/net/nfp/nfp_common.h | 34 +----------------------------
drivers/net/nfp/nfp_ethdev_vf.c | 4 +---
3 files changed, 3 insertions(+), 39 deletions(-)
diff --git a/drivers/net/nfp/flower/nfp_flower.c b/drivers/net/nfp/flower/nfp_flower.c
index f7e0ba3b76..c5cc537790 100644
--- a/drivers/net/nfp/flower/nfp_flower.c
+++ b/drivers/net/nfp/flower/nfp_flower.c
@@ -438,9 +438,7 @@ nfp_flower_pf_recv_pkts(void *rx_queue,
rte_ring_enqueue(repr->ring, (void *)mb);
avail_multiplexed++;
} else if (repr != NULL) {
- PMD_RX_LOG(ERR, "[%u] No ring available for repr_port %s\n",
- hw->idx, repr->name);
- PMD_RX_LOG(DEBUG, "Adding the mbuf to the mbuf array passed by the app");
+ PMD_RX_LOG(ERR, "No ring available for repr_port %s", repr->name);
rx_pkts[avail++] = mb;
} else {
PMD_RX_LOG(DEBUG, "Adding the mbuf to the mbuf array passed by the app");
diff --git a/drivers/net/nfp/nfp_common.h b/drivers/net/nfp/nfp_common.h
index 56ea203d7e..2281445861 100644
--- a/drivers/net/nfp/nfp_common.h
+++ b/drivers/net/nfp/nfp_common.h
@@ -119,36 +119,14 @@ struct nfp_pf_dev {
/* The eth table reported by firmware */
struct nfp_eth_table *nfp_eth_table;
- /* Current values for control */
- uint32_t ctrl;
-
uint8_t *ctrl_bar;
- uint8_t *tx_bar;
- uint8_t *rx_bar;
-
- uint8_t *qcp_cfg;
- rte_spinlock_t reconfig_lock;
-
- uint16_t flbufsz;
- uint16_t device_id;
- uint16_t vendor_id;
- uint16_t subsystem_device_id;
- uint16_t subsystem_vendor_id;
-#if defined(DSTQ_SELECTION)
-#if DSTQ_SELECTION
- uint16_t device_function;
-#endif
-#endif
struct nfp_cpp *cpp;
struct nfp_cpp_area *ctrl_area;
struct nfp_cpp_area *hwqueues_area;
- struct nfp_cpp_area *msix_area;
uint8_t *hw_queues;
- union eth_table_entry *eth_table;
-
struct nfp_hwinfo *hwinfo;
struct nfp_rtsym_table *sym_tbl;
@@ -208,11 +186,6 @@ struct nfp_net_hw {
uint16_t vendor_id;
uint16_t subsystem_device_id;
uint16_t subsystem_vendor_id;
-#if defined(DSTQ_SELECTION)
-#if DSTQ_SELECTION
- uint16_t device_function;
-#endif
-#endif
struct rte_ether_addr mac_addr;
@@ -222,19 +195,14 @@ struct nfp_net_hw {
struct nfp_cpp *cpp;
struct nfp_cpp_area *ctrl_area;
- struct nfp_cpp_area *hwqueues_area;
- struct nfp_cpp_area *msix_area;
struct nfp_cpp_area *mac_stats_area;
uint8_t *mac_stats_bar;
uint8_t *mac_stats;
- uint8_t *hw_queues;
- /* Sequential physical port number */
+ /* Sequential physical port number, only valid for CoreNIC firmware */
uint8_t idx;
/* Internal port number as seen from NFP */
uint8_t nfp_idx;
-
- union eth_table_entry *eth_table;
};
struct nfp_net_adapter {
diff --git a/drivers/net/nfp/nfp_ethdev_vf.c b/drivers/net/nfp/nfp_ethdev_vf.c
index d4357ad115..71f5020ecd 100644
--- a/drivers/net/nfp/nfp_ethdev_vf.c
+++ b/drivers/net/nfp/nfp_ethdev_vf.c
@@ -402,7 +402,7 @@ nfp_netvf_init(struct rte_eth_dev *eth_dev)
if (eth_dev->data->mac_addrs == NULL) {
PMD_INIT_LOG(ERR, "Failed to space for MAC address");
err = -ENOMEM;
- goto dev_err_queues_map;
+ goto dev_err_ctrl_map;
}
nfp_netvf_read_mac(hw);
@@ -443,8 +443,6 @@ nfp_netvf_init(struct rte_eth_dev *eth_dev)
return 0;
-dev_err_queues_map:
- nfp_cpp_area_free(hw->hwqueues_area);
dev_err_ctrl_map:
nfp_cpp_area_free(hw->ctrl_area);
--
2.39.1
next reply other threads:[~2023-06-05 5:45 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-05 5:45 Chaoyong He [this message]
2023-06-06 10:11 ` 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=20230605054525.3460673-1-chaoyong.he@corigine.com \
--to=chaoyong.he@corigine.com \
--cc=dev@dpdk.org \
--cc=niklas.soderlund@corigine.com \
--cc=oss-drivers@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).