X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=drivers%2Fnet%2Fbnxt%2Ftf_ulp%2Fulp_port_db.h;h=87de3bcbc69ccd839aaf1d1de30720016cd9fb5f;hb=eee264adc95ed049642a9c7d0e4b897d51ccaccf;hp=271c29a47549efee2ad405fc1b1e57a1adc2bed4;hpb=dc8ee8121ca04d6fab31b39451964e2ec53e54dd;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 271c29a475..87de3bcbc6 100644 --- a/drivers/net/bnxt/tf_ulp/ulp_port_db.h +++ b/drivers/net/bnxt/tf_ulp/ulp_port_db.h @@ -10,26 +10,22 @@ #define BNXT_PORT_DB_MAX_INTF_LIST 256 -/* enumeration of the interface types */ -enum bnxt_ulp_intf_type { - BNXT_ULP_INTF_TYPE_INVALID = 0, - BNXT_ULP_INTF_TYPE_PF = 1, - BNXT_ULP_INTF_TYPE_VF, - BNXT_ULP_INTF_TYPE_PF_REP, - BNXT_ULP_INTF_TYPE_VF_REP, - BNXT_ULP_INTF_TYPE_LAST -}; - /* Structure for the Port database resource information. */ struct ulp_interface_info { enum bnxt_ulp_intf_type type; uint16_t func_id; uint16_t func_svif; - uint16_t port_svif; + uint16_t func_spif; + uint16_t func_parif; uint16_t default_vnic; - uint8_t mac_addr[RTE_ETHER_ADDR_LEN]; - /* back pointer to the bnxt driver, it is null for rep ports */ - struct bnxt *bp; + uint16_t phy_port_id; +}; + +struct ulp_phy_port_info { + uint16_t port_svif; + uint16_t port_spif; + uint16_t port_parif; + uint16_t port_vport; }; /* Structure for the Port database */ @@ -39,6 +35,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[RTE_MAX_ETHPORTS]; }; /* @@ -71,7 +68,7 @@ int32_t ulp_port_db_deinit(struct bnxt_ulp_context *ulp_ctxt); * Returns 0 on success or negative number on failure. */ int32_t ulp_port_db_dev_port_intf_update(struct bnxt_ulp_context *ulp_ctxt, - struct bnxt *bp); + struct rte_eth_dev *eth_dev); /* * Api to get the ulp ifindex for a given device port. @@ -84,8 +81,7 @@ int32_t ulp_port_db_dev_port_intf_update(struct bnxt_ulp_context *ulp_ctxt, */ int32_t ulp_port_db_dev_port_to_ulp_index(struct bnxt_ulp_context *ulp_ctxt, - uint32_t port_id, - uint32_t *ifindex); + uint32_t port_id, uint32_t *ifindex); /* * Api to get the function id for a given ulp ifindex. @@ -98,11 +94,10 @@ ulp_port_db_dev_port_to_ulp_index(struct bnxt_ulp_context *ulp_ctxt, */ int32_t ulp_port_db_function_id_get(struct bnxt_ulp_context *ulp_ctxt, - uint32_t ifindex, - uint16_t *func_id); + uint32_t ifindex, uint16_t *func_id); /* - * Api to get the svid for a given ulp ifindex. + * Api to get the svif for a given ulp ifindex. * * ulp_ctxt [in] Ptr to ulp context * ifindex [in] ulp ifindex @@ -113,9 +108,36 @@ ulp_port_db_function_id_get(struct bnxt_ulp_context *ulp_ctxt, */ int32_t ulp_port_db_svif_get(struct bnxt_ulp_context *ulp_ctxt, - uint32_t ifindex, - uint32_t dir, - uint16_t *svif); + uint32_t ifindex, uint32_t dir, uint16_t *svif); + +/* + * Api to get the spif for a given ulp ifindex. + * + * ulp_ctxt [in] Ptr to ulp context + * ifindex [in] ulp ifindex + * dir [in] the direction for the flow. + * spif [out] the spif of the given ifindex. + * + * Returns 0 on success or negative number on failure. + */ +int32_t +ulp_port_db_spif_get(struct bnxt_ulp_context *ulp_ctxt, + uint32_t ifindex, uint32_t dir, uint16_t *spif); + + +/* + * Api to get the parif for a given ulp ifindex. + * + * ulp_ctxt [in] Ptr to ulp context + * ifindex [in] ulp ifindex + * dir [in] the direction for the flow. + * parif [out] the parif of the given ifindex. + * + * Returns 0 on success or negative number on failure. + */ +int32_t +ulp_port_db_parif_get(struct bnxt_ulp_context *ulp_ctxt, + uint32_t ifindex, uint32_t dir, uint16_t *parif); /* * Api to get the vnic id for a given ulp ifindex. @@ -128,7 +150,19 @@ ulp_port_db_svif_get(struct bnxt_ulp_context *ulp_ctxt, */ int32_t ulp_port_db_default_vnic_get(struct bnxt_ulp_context *ulp_ctxt, - uint32_t ifindex, - uint16_t *vnic); + uint32_t ifindex, uint16_t *vnic); + +/* + * Api to get the vport id for a given ulp ifindex. + * + * ulp_ctxt [in] Ptr to ulp context + * ifindex [in] ulp ifindex + * vport [out] the port of the given ifindex. + * + * Returns 0 on success or negative number on failure. + */ +int32_t +ulp_port_db_vport_get(struct bnxt_ulp_context *ulp_ctxt, + uint32_t ifindex, uint16_t *vport); #endif /* _ULP_PORT_DB_H_ */