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>
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* */
/*
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;
}
#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);