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