X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=drivers%2Fnet%2Fbnxt%2Ftf_ulp%2Fulp_port_db.h;h=7b85987a0ccc5708fd1ff61ad1defbc031c94f3f;hb=bd885ab120e2335f978a28ee0aa4303017390e15;hp=b1419a34cff10e62d2a14fd747720353b5e548b6;hpb=45e8e1d406b7a5ecd2698f9977e63fcdc4acb145;p=dpdk.git diff --git a/drivers/net/bnxt/tf_ulp/ulp_port_db.h b/drivers/net/bnxt/tf_ulp/ulp_port_db.h index b1419a34cf..7b85987a0c 100644 --- a/drivers/net/bnxt/tf_ulp/ulp_port_db.h +++ b/drivers/net/bnxt/tf_ulp/ulp_port_db.h @@ -10,6 +10,7 @@ #define BNXT_PORT_DB_MAX_INTF_LIST 256 #define BNXT_PORT_DB_MAX_FUNC 2048 +#define BNXT_ULP_FREE_PARIF_BASE 11 enum bnxt_ulp_svif_type { BNXT_ULP_DRV_FUNC_SVIF = 0, @@ -46,6 +47,7 @@ struct ulp_func_if_info { uint16_t func_parif; uint16_t func_vnic; uint16_t phy_port_id; + uint16_t ifindex; }; /* Structure for the Port database resource information. */ @@ -71,6 +73,7 @@ struct bnxt_ulp_port_db { /* dpdk device external port list */ uint16_t dev_port_list[RTE_MAX_ETHPORTS]; struct ulp_phy_port_info *phy_port_list; + uint16_t phy_port_cnt; struct ulp_func_if_info ulp_func_id_tbl[BNXT_PORT_DB_MAX_FUNC]; }; @@ -203,4 +206,70 @@ int32_t ulp_port_db_vport_get(struct bnxt_ulp_context *ulp_ctxt, uint32_t ifindex, uint16_t *vport); +/* + * Api to get the vport for a given physical port. + * + * ulp_ctxt [in] Ptr to ulp context + * phy_port [in] physical port index + * out_port [out] the port of the given physical index + * + * Returns 0 on success or negative number on failure. + */ +int32_t +ulp_port_db_phy_port_vport_get(struct bnxt_ulp_context *ulp_ctxt, + uint32_t phy_port, + uint16_t *out_port); + +/* + * Api to get the svif for a given physical port. + * + * ulp_ctxt [in] Ptr to ulp context + * phy_port [in] physical port index + * svif [out] the svif of the given physical index + * + * Returns 0 on success or negative number on failure. + */ +int32_t +ulp_port_db_phy_port_svif_get(struct bnxt_ulp_context *ulp_ctxt, + uint32_t phy_port, + uint16_t *svif); + +/* + * Api to get the port type for a given ulp ifindex. + * + * ulp_ctxt [in] Ptr to ulp context + * ifindex [in] ulp ifindex + * + * Returns port type. + */ +enum bnxt_ulp_intf_type +ulp_port_db_port_type_get(struct bnxt_ulp_context *ulp_ctxt, + uint32_t ifindex); + +/* + * Api to get the ulp ifindex for a given function id. + * + * ulp_ctxt [in] Ptr to ulp context + * func_id [in].device func id + * ifindex [out] ulp ifindex + * + * Returns 0 on success or negative number on failure. + */ +int32_t +ulp_port_db_dev_func_id_to_ulp_index(struct bnxt_ulp_context *ulp_ctxt, + uint32_t func_id, uint32_t *ifindex); + +/* + * Api to get the function id for a given port id. + * + * ulp_ctxt [in] Ptr to ulp context + * port_id [in] dpdk port id + * func_id [out] the function id of the given ifindex. + * + * Returns 0 on success or negative number on failure. + */ +int32_t +ulp_port_db_port_func_id_get(struct bnxt_ulp_context *ulp_ctxt, + uint16_t port_id, uint16_t *func_id); + #endif /* _ULP_PORT_DB_H_ */