Remove unused functions from the code. Specifically the following functions are being removed. void bnxt_get_iface_mac(uint16_t port, enum bnxt_ulp_intf_type type, uint8_t *mac, uint8_t *parent_mac); uint16_t bnxt_get_vnic_id(uint16_t port, enum bnxt_ulp_intf_type type); uint16_t bnxt_get_parent_vnic_id(uint16_t port, enum bnxt_ulp_intf_type type); struct bnxt *bnxt_get_bp(uint16_t port); uint16_t bnxt_get_svif(uint16_t port_id, bool func_svif, enum bnxt_ulp_intf_type type); uint16_t bnxt_get_fw_func_id(uint16_t port, enum bnxt_ulp_intf_type type); uint16_t bnxt_get_parif(uint16_t port, enum bnxt_ulp_intf_type type); uint16_t bnxt_get_phy_port_id(uint16_t port); uint16_t bnxt_get_vport(uint16_t port); enum bnxt_ulp_intf_type bnxt_get_interface_type(uint16_t port); Signed-off-by: Ajit Khaparde --- drivers/net/bnxt/bnxt.h | 13 --- drivers/net/bnxt/bnxt_ethdev.c | 203 --------------------------------- 2 files changed, 216 deletions(-) diff --git a/drivers/net/bnxt/bnxt.h b/drivers/net/bnxt/bnxt.h index 97e281a2fc..4ab9ebd049 100644 --- a/drivers/net/bnxt/bnxt.h +++ b/drivers/net/bnxt/bnxt.h @@ -1054,19 +1054,6 @@ int32_t bnxt_ulp_create_vfr_default_rules(struct rte_eth_dev *vfr_ethdev); int32_t bnxt_ulp_delete_vfr_default_rules(struct bnxt_representor *vfr); -void bnxt_get_iface_mac(uint16_t port, enum bnxt_ulp_intf_type type, - uint8_t *mac, uint8_t *parent_mac); -uint16_t bnxt_get_vnic_id(uint16_t port, enum bnxt_ulp_intf_type type); -uint16_t bnxt_get_parent_vnic_id(uint16_t port, enum bnxt_ulp_intf_type type); -struct bnxt *bnxt_get_bp(uint16_t port); -uint16_t bnxt_get_svif(uint16_t port_id, bool func_svif, - enum bnxt_ulp_intf_type type); -uint16_t bnxt_get_fw_func_id(uint16_t port, enum bnxt_ulp_intf_type type); -uint16_t bnxt_get_parif(uint16_t port, enum bnxt_ulp_intf_type type); -uint16_t bnxt_get_phy_port_id(uint16_t port); -uint16_t bnxt_get_vport(uint16_t port); -enum bnxt_ulp_intf_type -bnxt_get_interface_type(uint16_t port); int bnxt_rep_dev_start_op(struct rte_eth_dev *eth_dev); void bnxt_cancel_fc_thread(struct bnxt *bp); diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c index 257e6b0d6a..2ab0cf3784 100644 --- a/drivers/net/bnxt/bnxt_ethdev.c +++ b/drivers/net/bnxt/bnxt_ethdev.c @@ -5047,209 +5047,6 @@ static void bnxt_config_vf_req_fwd(struct bnxt *bp) BNXT_HWRM_CMD_TO_FORWARD(HWRM_OEM_CMD); } -struct bnxt * -bnxt_get_bp(uint16_t port) -{ - struct bnxt *bp; - struct rte_eth_dev *dev; - - if (!rte_eth_dev_is_valid_port(port)) { - PMD_DRV_LOG(ERR, "Invalid port %d\n", port); - return NULL; - } - - dev = &rte_eth_devices[port]; - if (!is_bnxt_supported(dev)) { - PMD_DRV_LOG(ERR, "Device %d not supported\n", port); - return NULL; - } - - bp = (struct bnxt *)dev->data->dev_private; - if (!BNXT_TRUFLOW_EN(bp)) { - PMD_DRV_LOG(ERR, "TRUFLOW not enabled\n"); - return NULL; - } - - return bp; -} - -uint16_t -bnxt_get_svif(uint16_t port_id, bool func_svif, - enum bnxt_ulp_intf_type type) -{ - struct rte_eth_dev *eth_dev; - struct bnxt *bp; - - eth_dev = &rte_eth_devices[port_id]; - if (BNXT_ETH_DEV_IS_REPRESENTOR(eth_dev)) { - struct bnxt_representor *vfr = eth_dev->data->dev_private; - if (!vfr) - return 0; - - if (type == BNXT_ULP_INTF_TYPE_VF_REP) - return vfr->svif; - - eth_dev = vfr->parent_dev; - } - - bp = eth_dev->data->dev_private; - - return func_svif ? bp->func_svif : bp->port_svif; -} - -void -bnxt_get_iface_mac(uint16_t port, enum bnxt_ulp_intf_type type, - uint8_t *mac, uint8_t *parent_mac) -{ - struct rte_eth_dev *eth_dev; - struct bnxt *bp; - - if (type != BNXT_ULP_INTF_TYPE_TRUSTED_VF && - type != BNXT_ULP_INTF_TYPE_PF) - return; - - eth_dev = &rte_eth_devices[port]; - bp = eth_dev->data->dev_private; - memcpy(mac, bp->mac_addr, RTE_ETHER_ADDR_LEN); - - if (type == BNXT_ULP_INTF_TYPE_TRUSTED_VF) - memcpy(parent_mac, bp->parent->mac_addr, RTE_ETHER_ADDR_LEN); -} - -uint16_t -bnxt_get_parent_vnic_id(uint16_t port, enum bnxt_ulp_intf_type type) -{ - struct rte_eth_dev *eth_dev; - struct bnxt *bp; - - if (type != BNXT_ULP_INTF_TYPE_TRUSTED_VF) - return 0; - - eth_dev = &rte_eth_devices[port]; - bp = eth_dev->data->dev_private; - - return bp->parent->vnic; -} -uint16_t -bnxt_get_vnic_id(uint16_t port, enum bnxt_ulp_intf_type type) -{ - struct rte_eth_dev *eth_dev; - struct bnxt_vnic_info *vnic; - struct bnxt *bp; - - eth_dev = &rte_eth_devices[port]; - if (BNXT_ETH_DEV_IS_REPRESENTOR(eth_dev)) { - struct bnxt_representor *vfr = eth_dev->data->dev_private; - if (!vfr) - return 0; - - if (type == BNXT_ULP_INTF_TYPE_VF_REP) - return vfr->dflt_vnic_id; - - eth_dev = vfr->parent_dev; - } - - bp = eth_dev->data->dev_private; - - vnic = BNXT_GET_DEFAULT_VNIC(bp); - - return vnic->fw_vnic_id; -} - -uint16_t -bnxt_get_fw_func_id(uint16_t port, enum bnxt_ulp_intf_type type) -{ - struct rte_eth_dev *eth_dev; - struct bnxt *bp; - - eth_dev = &rte_eth_devices[port]; - if (BNXT_ETH_DEV_IS_REPRESENTOR(eth_dev)) { - struct bnxt_representor *vfr = eth_dev->data->dev_private; - if (!vfr) - return 0; - - if (type == BNXT_ULP_INTF_TYPE_VF_REP) - return vfr->fw_fid; - - eth_dev = vfr->parent_dev; - } - - bp = eth_dev->data->dev_private; - - return bp->fw_fid; -} - -enum bnxt_ulp_intf_type -bnxt_get_interface_type(uint16_t port) -{ - struct rte_eth_dev *eth_dev; - struct bnxt *bp; - - eth_dev = &rte_eth_devices[port]; - if (BNXT_ETH_DEV_IS_REPRESENTOR(eth_dev)) - return BNXT_ULP_INTF_TYPE_VF_REP; - - bp = eth_dev->data->dev_private; - if (BNXT_PF(bp)) - return BNXT_ULP_INTF_TYPE_PF; - else if (BNXT_VF_IS_TRUSTED(bp)) - return BNXT_ULP_INTF_TYPE_TRUSTED_VF; - else if (BNXT_VF(bp)) - return BNXT_ULP_INTF_TYPE_VF; - - return BNXT_ULP_INTF_TYPE_INVALID; -} - -uint16_t -bnxt_get_phy_port_id(uint16_t port_id) -{ - struct bnxt_representor *vfr; - struct rte_eth_dev *eth_dev; - struct bnxt *bp; - - eth_dev = &rte_eth_devices[port_id]; - if (BNXT_ETH_DEV_IS_REPRESENTOR(eth_dev)) { - vfr = eth_dev->data->dev_private; - if (!vfr) - return 0; - - eth_dev = vfr->parent_dev; - } - - bp = eth_dev->data->dev_private; - - return BNXT_PF(bp) ? bp->pf->port_id : bp->parent->port_id; -} - -uint16_t -bnxt_get_parif(uint16_t port_id, enum bnxt_ulp_intf_type type) -{ - struct rte_eth_dev *eth_dev; - struct bnxt *bp; - - eth_dev = &rte_eth_devices[port_id]; - if (BNXT_ETH_DEV_IS_REPRESENTOR(eth_dev)) { - struct bnxt_representor *vfr = eth_dev->data->dev_private; - if (!vfr) - return 0; - - if (type == BNXT_ULP_INTF_TYPE_VF_REP) - return vfr->fw_fid - 1; - - eth_dev = vfr->parent_dev; - } - - bp = eth_dev->data->dev_private; - - return BNXT_PF(bp) ? bp->fw_fid - 1 : bp->parent->fid - 1; -} - -uint16_t -bnxt_get_vport(uint16_t port_id) -{ - return (1 << bnxt_get_phy_port_id(port_id)); -} - static void bnxt_alloc_error_recovery_info(struct bnxt *bp) { struct bnxt_error_recovery_info *info = bp->recovery_info; -- 2.30.1 (Apple Git-130)