X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=drivers%2Fnet%2Fbnxt%2Ftf_ulp%2Fulp_port_db.h;h=740c186e120638cbd6a2cd22289f7af199a80437;hb=45633c460c223a67dd1a7cc084c3eceb5e17687c;hp=393d01b7cae50a1403bdb242c6cf7003f48c573b;hpb=77b359eea6ae9a66da33f9e0a42c768761b16520;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 393d01b7ca..740c186e12 100644 --- a/drivers/net/bnxt/tf_ulp/ulp_port_db.h +++ b/drivers/net/bnxt/tf_ulp/ulp_port_db.h @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause - * Copyright(c) 2014-2019 Broadcom + * Copyright(c) 2014-2021 Broadcom * All rights reserved. */ @@ -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, @@ -45,6 +46,9 @@ struct ulp_func_if_info { uint16_t func_spif; uint16_t func_parif; uint16_t func_vnic; + uint8_t func_mac[RTE_ETHER_ADDR_LEN]; + uint16_t func_parent_vnic; + uint8_t func_parent_mac[RTE_ETHER_ADDR_LEN]; uint16_t phy_port_id; uint16_t ifindex; }; @@ -258,4 +262,56 @@ 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); + +/* + * Api to get the parent mac address for a given port id. + * + * ulp_ctxt [in] Ptr to ulp context + * port_id [in] device port id + * mac_addr [out] mac address + * + * Returns 0 on success or negative number on failure. + */ +int32_t +ulp_port_db_parent_mac_addr_get(struct bnxt_ulp_context *ulp_ctxt, + uint32_t port_id, uint8_t **mac_addr); + +/* + * Api to get the mac address for a given port id. + * + * ulp_ctxt [in] Ptr to ulp context + * port_id [in] device port id + * mac_addr [out] mac address + * + * Returns 0 on success or negative number on failure. + */ +int32_t +ulp_port_db_drv_mac_addr_get(struct bnxt_ulp_context *ulp_ctxt, + uint32_t port_id, uint8_t **mac_addr); + +/* + * Api to get the parent vnic for a given port id. + * + * ulp_ctxt [in] Ptr to ulp context + * port_id [in] device port id + * vnic [out] parent vnic + * + * Returns 0 on success or negative number on failure. + */ +int32_t +ulp_port_db_parent_vnic_get(struct bnxt_ulp_context *ulp_ctxt, + uint32_t port_id, uint8_t **vnic); + #endif /* _ULP_PORT_DB_H_ */