* When a port is initialized by dpdk. This functions is called * and this function initializes the ULP context and rest of the * infrastructure associated with it. */
| 1604 | * infrastructure associated with it. |
| 1605 | */ |
| 1606 | static int32_t |
| 1607 | bnxt_ulp_init(struct bnxt *bp, |
| 1608 | struct bnxt_ulp_session_state *session) |
| 1609 | { |
| 1610 | int rc; |
| 1611 | uint32_t ulp_dev_id = BNXT_ULP_DEVICE_ID_LAST; |
| 1612 | |
| 1613 | /* Allocate and Initialize the ulp context. */ |
| 1614 | rc = ulp_ctx_init(bp, session); |
| 1615 | if (rc) { |
| 1616 | BNXT_TF_DBG(ERR, "Failed to create the ulp context\n"); |
| 1617 | goto jump_to_error; |
| 1618 | } |
| 1619 | |
| 1620 | rc = pthread_mutex_init(&bp->ulp_ctx->cfg_data->flow_db_lock, NULL); |
| 1621 | if (rc) { |
| 1622 | BNXT_TF_DBG(ERR, "Unable to initialize flow db lock\n"); |
| 1623 | goto jump_to_error; |
| 1624 | } |
| 1625 | |
| 1626 | /* Initialize ulp dparms with values devargs passed */ |
| 1627 | rc = ulp_dparms_init(bp, bp->ulp_ctx); |
| 1628 | if (rc) { |
| 1629 | BNXT_TF_DBG(ERR, "Failed to initialize the dparms\n"); |
| 1630 | goto jump_to_error; |
| 1631 | } |
| 1632 | |
| 1633 | /* create the port database */ |
| 1634 | rc = ulp_port_db_init(bp->ulp_ctx, bp->port_cnt); |
| 1635 | if (rc) { |
| 1636 | BNXT_TF_DBG(ERR, "Failed to create the port database\n"); |
| 1637 | goto jump_to_error; |
| 1638 | } |
| 1639 | |
| 1640 | /* Create the Mark database. */ |
| 1641 | rc = ulp_mark_db_init(bp->ulp_ctx); |
| 1642 | if (rc) { |
| 1643 | BNXT_TF_DBG(ERR, "Failed to create the mark database\n"); |
| 1644 | goto jump_to_error; |
| 1645 | } |
| 1646 | |
| 1647 | /* Create the flow database. */ |
| 1648 | rc = ulp_flow_db_init(bp->ulp_ctx); |
| 1649 | if (rc) { |
| 1650 | BNXT_TF_DBG(ERR, "Failed to create the flow database\n"); |
| 1651 | goto jump_to_error; |
| 1652 | } |
| 1653 | |
| 1654 | /* Create the eem table scope. */ |
| 1655 | rc = ulp_eem_tbl_scope_init(bp); |
| 1656 | if (rc) { |
| 1657 | BNXT_TF_DBG(ERR, "Failed to create the eem scope table\n"); |
| 1658 | goto jump_to_error; |
| 1659 | } |
| 1660 | |
| 1661 | rc = ulp_mapper_init(bp->ulp_ctx); |
| 1662 | if (rc) { |
| 1663 | BNXT_TF_DBG(ERR, "Failed to initialize ulp mapper\n"); |
no test coverage detected