src/dpdk/drivers/net/hinic/hinic_pmd_ethdev.c
static int
hinic_dev_infos_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *info)
{
	struct hinic_nic_dev *nic_dev = HINIC_ETH_DEV_TO_PRIVATE_NIC_DEV(dev);

	info->max_rx_queues  = nic_dev->nic_cap.max_rqs;
	info->max_tx_queues  = nic_dev->nic_cap.max_sqs;
	info->min_rx_bufsize = HINIC_MIN_RX_BUF_SIZE;
	info->max_rx_pktlen  = HINIC_MAX_JUMBO_FRAME_SIZE;
	info->max_mac_addrs  = HINIC_MAX_UC_MAC_ADDRS;
	info->min_mtu = HINIC_MIN_MTU_SIZE;
	info->max_mtu = HINIC_MAX_MTU_SIZE;
	info->max_lro_pkt_size = HINIC_MAX_LRO_SIZE;

	hinic_get_speed_capa(dev, &info->speed_capa);
	info->rx_queue_offload_capa = 0;
	info->rx_offload_capa = DEV_RX_OFFLOAD_VLAN_STRIP |
				DEV_RX_OFFLOAD_IPV4_CKSUM |
				DEV_RX_OFFLOAD_UDP_CKSUM |
				DEV_RX_OFFLOAD_TCP_CKSUM |
				DEV_RX_OFFLOAD_VLAN_FILTER |
				DEV_RX_OFFLOAD_SCATTER |
				DEV_RX_OFFLOAD_JUMBO_FRAME |
				DEV_RX_OFFLOAD_TCP_LRO |
				DEV_RX_OFFLOAD_RSS_HASH;

	info->tx_queue_offload_capa = 0;
	info->tx_offload_capa = DEV_TX_OFFLOAD_VLAN_INSERT |
				DEV_TX_OFFLOAD_IPV4_CKSUM |
				DEV_TX_OFFLOAD_UDP_CKSUM |
				DEV_TX_OFFLOAD_TCP_CKSUM |
				DEV_TX_OFFLOAD_SCTP_CKSUM |
				DEV_TX_OFFLOAD_OUTER_IPV4_CKSUM |
				DEV_TX_OFFLOAD_TCP_TSO |
				DEV_TX_OFFLOAD_MULTI_SEGS;

	info->hash_key_size = HINIC_RSS_KEY_SIZE;
	info->reta_size = HINIC_RSS_INDIR_SIZE;
	info->flow_type_rss_offloads = HINIC_RSS_OFFLOAD_ALL;
	info->rx_desc_lim = hinic_rx_desc_lim;
	info->tx_desc_lim = hinic_tx_desc_lim;

	/* Driver-preferred Rx/Tx parameters */
	info->default_rxportconf.burst_size = HINIC_DEFAULT_BURST_SIZE;
	info->default_txportconf.burst_size = HINIC_DEFAULT_BURST_SIZE;
	info->default_rxportconf.nb_queues = HINIC_DEFAULT_NB_QUEUES;
	info->default_txportconf.nb_queues = HINIC_DEFAULT_NB_QUEUES;
	info->default_rxportconf.ring_size = HINIC_DEFAULT_RING_SIZE;
	info->default_txportconf.ring_size = HINIC_DEFAULT_RING_SIZE;

	return 0;
}
/**
 * DPDK callback to get information about the device.
 *
 * @param dev
 *   Pointer to Ethernet device structure.
 * @param info
 *   Pointer to Info structure output buffer.
 */
DPDK callback to get information about the device.
@param dev
Pointer to Ethernet device structure.
@param info
Pointer to Info structure output buffer.
DPDK callback to get information about the device . @param dev Pointer to Ethernet device structure . @param info Pointer to Info structure output buffer .
static int
hinic_dev_infos_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *info)
{
	struct hinic_nic_dev *nic_dev = HINIC_ETH_DEV_TO_PRIVATE_NIC_DEV(dev);
	info->max_rx_queues  = nic_dev->nic_cap.max_rqs;
	info->max_tx_queues  = nic_dev->nic_cap.max_sqs;
	info->min_rx_bufsize = HINIC_MIN_RX_BUF_SIZE;
	info->max_rx_pktlen  = HINIC_MAX_JUMBO_FRAME_SIZE;
	info->max_mac_addrs  = HINIC_MAX_UC_MAC_ADDRS;
	info->min_mtu = HINIC_MIN_MTU_SIZE;
	info->max_mtu = HINIC_MAX_MTU_SIZE;
	info->max_lro_pkt_size = HINIC_MAX_LRO_SIZE;
	hinic_get_speed_capa(dev, &info->speed_capa);
	info->rx_queue_offload_capa = 0;
	info->rx_offload_capa = DEV_RX_OFFLOAD_VLAN_STRIP |
				DEV_RX_OFFLOAD_IPV4_CKSUM |
				DEV_RX_OFFLOAD_UDP_CKSUM |
				DEV_RX_OFFLOAD_TCP_CKSUM |
				DEV_RX_OFFLOAD_VLAN_FILTER |
				DEV_RX_OFFLOAD_SCATTER |
				DEV_RX_OFFLOAD_JUMBO_FRAME |
				DEV_RX_OFFLOAD_TCP_LRO |
				DEV_RX_OFFLOAD_RSS_HASH;
	info->tx_queue_offload_capa = 0;
	info->tx_offload_capa = DEV_TX_OFFLOAD_VLAN_INSERT |
				DEV_TX_OFFLOAD_IPV4_CKSUM |
				DEV_TX_OFFLOAD_UDP_CKSUM |
				DEV_TX_OFFLOAD_TCP_CKSUM |
				DEV_TX_OFFLOAD_SCTP_CKSUM |
				DEV_TX_OFFLOAD_OUTER_IPV4_CKSUM |
				DEV_TX_OFFLOAD_TCP_TSO |
				DEV_TX_OFFLOAD_MULTI_SEGS;
	info->hash_key_size = HINIC_RSS_KEY_SIZE;
	info->reta_size = HINIC_RSS_INDIR_SIZE;
	info->flow_type_rss_offloads = HINIC_RSS_OFFLOAD_ALL;
	info->rx_desc_lim = hinic_rx_desc_lim;
	info->tx_desc_lim = hinic_tx_desc_lim;
	info->default_rxportconf.burst_size = HINIC_DEFAULT_BURST_SIZE;
	info->default_txportconf.burst_size = HINIC_DEFAULT_BURST_SIZE;
	info->default_rxportconf.nb_queues = HINIC_DEFAULT_NB_QUEUES;
	info->default_txportconf.nb_queues = HINIC_DEFAULT_NB_QUEUES;
	info->default_rxportconf.ring_size = HINIC_DEFAULT_RING_SIZE;
	info->default_txportconf.ring_size = HINIC_DEFAULT_RING_SIZE;
	return 0;
}
static int hinic_dev_infos_get ( struct rte_eth_dev * dev , struct rte_eth_dev_info * info ) { struct hinic_nic_dev * nic_dev = HINIC_ETH_DEV_TO_PRIVATE_NIC_DEV ( dev ) ; info -> max_rx_queues = nic_dev -> nic_cap . max_rqs ; info -> max_tx_queues = nic_dev -> nic_cap . max_sqs ; info -> min_rx_bufsize = HINIC_MIN_RX_BUF_SIZE ; info -> max_rx_pktlen = HINIC_MAX_JUMBO_FRAME_SIZE ; info -> max_mac_addrs = HINIC_MAX_UC_MAC_ADDRS ; info -> min_mtu = HINIC_MIN_MTU_SIZE ; info -> max_mtu = HINIC_MAX_MTU_SIZE ; info -> max_lro_pkt_size = HINIC_MAX_LRO_SIZE ; hinic_get_speed_capa ( dev , & info -> speed_capa ) ; info -> rx_queue_offload_capa = 0 ; info -> rx_offload_capa = DEV_RX_OFFLOAD_VLAN_STRIP | DEV_RX_OFFLOAD_IPV4_CKSUM | DEV_RX_OFFLOAD_UDP_CKSUM | DEV_RX_OFFLOAD_TCP_CKSUM | DEV_RX_OFFLOAD_VLAN_FILTER | DEV_RX_OFFLOAD_SCATTER | DEV_RX_OFFLOAD_JUMBO_FRAME | DEV_RX_OFFLOAD_TCP_LRO | DEV_RX_OFFLOAD_RSS_HASH ; info -> tx_queue_offload_capa = 0 ; info -> tx_offload_capa = DEV_TX_OFFLOAD_VLAN_INSERT | DEV_TX_OFFLOAD_IPV4_CKSUM | DEV_TX_OFFLOAD_UDP_CKSUM | DEV_TX_OFFLOAD_TCP_CKSUM | DEV_TX_OFFLOAD_SCTP_CKSUM | DEV_TX_OFFLOAD_OUTER_IPV4_CKSUM | DEV_TX_OFFLOAD_TCP_TSO | DEV_TX_OFFLOAD_MULTI_SEGS ; info -> hash_key_size = HINIC_RSS_KEY_SIZE ; info -> reta_size = HINIC_RSS_INDIR_SIZE ; info -> flow_type_rss_offloads = HINIC_RSS_OFFLOAD_ALL ; info -> rx_desc_lim = hinic_rx_desc_lim ; info -> tx_desc_lim = hinic_tx_desc_lim ; info -> default_rxportconf . burst_size = HINIC_DEFAULT_BURST_SIZE ; info -> default_txportconf . burst_size = HINIC_DEFAULT_BURST_SIZE ; info -> default_rxportconf . nb_queues = HINIC_DEFAULT_NB_QUEUES ; info -> default_txportconf . nb_queues = HINIC_DEFAULT_NB_QUEUES ; info -> default_rxportconf . ring_size = HINIC_DEFAULT_RING_SIZE ; info -> default_txportconf . ring_size = HINIC_DEFAULT_RING_SIZE ; return 0 ; }
DPDK callback to get information about the device.
DPDK callback to get information about the device .
/* Driver-preferred Rx/Tx parameters */