net/nfp: remove unused struct fields
Checks
Commit Message
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
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.
@@ -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");
@@ -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 {
@@ -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);