net/bnxt: provide switch info if VFR are configured
Some applications need switch_info of the device to be returned as a part of eth_dev_info_get(). The offload logic in such applications could use this info. Pass this info to the when VF representors are configured. Fixes: 322bd6e70272 ("net/bnxt: add port representor infrastructure") Cc: stable@dpdk.org Signed-off-by: Sriharsha Basavapatna <sriharsha.basavapatna@broadcom.com> Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
This commit is contained in:
parent
7ecfe8521f
commit
9b842a93e2
@ -908,6 +908,14 @@ static int bnxt_dev_info_get_op(struct rte_eth_dev *eth_dev,
|
||||
dev_info->tx_desc_lim.nb_min = BNXT_MIN_RING_DESC;
|
||||
dev_info->tx_desc_lim.nb_max = BNXT_MAX_TX_RING_DESC;
|
||||
|
||||
if (BNXT_PF(bp) || BNXT_VF_IS_TRUSTED(bp)) {
|
||||
dev_info->switch_info.name = eth_dev->device->name;
|
||||
dev_info->switch_info.domain_id = bp->switch_domain_id;
|
||||
dev_info->switch_info.port_id =
|
||||
BNXT_PF(bp) ? BNXT_SWITCH_PORT_ID_PF :
|
||||
BNXT_SWITCH_PORT_ID_TRUSTED_VF;
|
||||
}
|
||||
|
||||
/* *INDENT-ON* */
|
||||
|
||||
/*
|
||||
|
@ -500,6 +500,11 @@ int bnxt_vf_rep_dev_info_get_op(struct rte_eth_dev *eth_dev,
|
||||
dev_info->tx_offload_capa = BNXT_DEV_TX_OFFLOAD_SUPPORT;
|
||||
dev_info->flow_type_rss_offloads = BNXT_ETH_RSS_SUPPORT;
|
||||
|
||||
dev_info->switch_info.name = eth_dev->device->name;
|
||||
dev_info->switch_info.domain_id = rep_bp->switch_domain_id;
|
||||
dev_info->switch_info.port_id =
|
||||
rep_bp->vf_id & BNXT_SWITCH_PORT_ID_VF_MASK;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -12,6 +12,13 @@
|
||||
#define BNXT_MAX_CFA_CODE 65536
|
||||
#define BNXT_VF_IDX_INVALID 0xffff
|
||||
|
||||
/* Switchdev Port ID Mapping (Per switch domain id).
|
||||
* Lower 15 bits map the VFs (VF_ID). Upper bit maps the PF.
|
||||
*/
|
||||
#define BNXT_SWITCH_PORT_ID_PF 0x8000
|
||||
#define BNXT_SWITCH_PORT_ID_TRUSTED_VF 0x0
|
||||
#define BNXT_SWITCH_PORT_ID_VF_MASK 0x7FFF
|
||||
|
||||
uint16_t
|
||||
bnxt_vfr_recv(uint16_t port_id, uint16_t queue_id, struct rte_mbuf *mbuf);
|
||||
int bnxt_vf_representor_init(struct rte_eth_dev *eth_dev, void *params);
|
||||
|
Loading…
x
Reference in New Issue
Block a user