net/nfp: remove unused struct fields

Message ID 20230605054525.3460673-1-chaoyong.he@corigine.com (mailing list archive)
State Accepted, archived
Delegated to: Ferruh Yigit
Headers
Series net/nfp: remove unused struct fields |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/loongarch-compilation success Compilation OK
ci/loongarch-unit-testing success Unit Testing PASS
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS
ci/intel-Functional success Functional PASS
ci/iol-testing warning apply patch failure

Commit Message

Chaoyong He June 5, 2023, 5:45 a.m. UTC
  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(-)
  

Comments

Ferruh Yigit June 6, 2023, 10:11 a.m. UTC | #1
On 6/5/2023 6:45 AM, Chaoyong He wrote:
> 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>
>

Applied to dpdk-next-net/main, thanks.
  

Patch

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);