src/dpdk/drivers/net/mlx4/mlx4_ethdev.c
int
mlx4_dev_infos_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *info)
{
	struct mlx4_priv *priv = dev->data->dev_private;
	unsigned int max;

	/* FIXME: we should ask the device for these values. */
	info->min_rx_bufsize = 32;
	info->max_rx_pktlen = 65536;
	/*
	 * Since we need one CQ per QP, the limit is the minimum number
	 * between the two values.
	 */
	max = ((priv->device_attr.max_cq > priv->device_attr.max_qp) ?
	       priv->device_attr.max_qp : priv->device_attr.max_cq);
	/* max_rx_queues is uint16_t. */
	max = RTE_MIN(max, (unsigned int)UINT16_MAX);
	info->max_rx_queues = max;
	info->max_tx_queues = max;
	info->max_mac_addrs = RTE_DIM(priv->mac);
	info->tx_offload_capa = mlx4_get_tx_port_offloads(priv);
	info->rx_queue_offload_capa = mlx4_get_rx_queue_offloads(priv);
	info->rx_offload_capa = (mlx4_get_rx_port_offloads(priv) |
				 info->rx_queue_offload_capa);
	info->if_index = priv->if_index;
	info->hash_key_size = MLX4_RSS_HASH_KEY_SIZE;
	info->speed_capa =
			ETH_LINK_SPEED_1G |
			ETH_LINK_SPEED_10G |
			ETH_LINK_SPEED_20G |
			ETH_LINK_SPEED_40G |
			ETH_LINK_SPEED_56G;
	info->flow_type_rss_offloads = mlx4_conv_rss_types(priv, 0, 1);

	return 0;
}
/**
 * DPDK callback to get information about the device.
 *
 * @param dev
 *   Pointer to Ethernet device structure.
 * @param[out] info
 *   Info structure output buffer.
 */
DPDK callback to get information about the device.
@param dev
Pointer to Ethernet device structure.
@param[out] info
Info structure output buffer.
DPDK callback to get information about the device . @param dev Pointer to Ethernet device structure . @param [ out ] info Info structure output buffer .
int
mlx4_dev_infos_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *info)
{
	struct mlx4_priv *priv = dev->data->dev_private;
	unsigned int max;
	info->min_rx_bufsize = 32;
	info->max_rx_pktlen = 65536;
	max = ((priv->device_attr.max_cq > priv->device_attr.max_qp) ?
	       priv->device_attr.max_qp : priv->device_attr.max_cq);
	max = RTE_MIN(max, (unsigned int)UINT16_MAX);
	info->max_rx_queues = max;
	info->max_tx_queues = max;
	info->max_mac_addrs = RTE_DIM(priv->mac);
	info->tx_offload_capa = mlx4_get_tx_port_offloads(priv);
	info->rx_queue_offload_capa = mlx4_get_rx_queue_offloads(priv);
	info->rx_offload_capa = (mlx4_get_rx_port_offloads(priv) |
				 info->rx_queue_offload_capa);
	info->if_index = priv->if_index;
	info->hash_key_size = MLX4_RSS_HASH_KEY_SIZE;
	info->speed_capa =
			ETH_LINK_SPEED_1G |
			ETH_LINK_SPEED_10G |
			ETH_LINK_SPEED_20G |
			ETH_LINK_SPEED_40G |
			ETH_LINK_SPEED_56G;
	info->flow_type_rss_offloads = mlx4_conv_rss_types(priv, 0, 1);
	return 0;
}
int mlx4_dev_infos_get ( struct rte_eth_dev * dev , struct rte_eth_dev_info * info ) { struct mlx4_priv * priv = dev -> data -> dev_private ; unsigned int max ; info -> min_rx_bufsize = 32 ; info -> max_rx_pktlen = 65536 ; max = ( ( priv -> device_attr . max_cq > priv -> device_attr . max_qp ) ? priv -> device_attr . max_qp : priv -> device_attr . max_cq ) ; max = RTE_MIN ( max , ( unsigned int ) UINT16_MAX ) ; info -> max_rx_queues = max ; info -> max_tx_queues = max ; info -> max_mac_addrs = RTE_DIM ( priv -> mac ) ; info -> tx_offload_capa = mlx4_get_tx_port_offloads ( priv ) ; info -> rx_queue_offload_capa = mlx4_get_rx_queue_offloads ( priv ) ; info -> rx_offload_capa = ( mlx4_get_rx_port_offloads ( priv ) | info -> rx_queue_offload_capa ) ; info -> if_index = priv -> if_index ; info -> hash_key_size = MLX4_RSS_HASH_KEY_SIZE ; info -> speed_capa = ETH_LINK_SPEED_1G | ETH_LINK_SPEED_10G | ETH_LINK_SPEED_20G | ETH_LINK_SPEED_40G | ETH_LINK_SPEED_56G ; info -> flow_type_rss_offloads = mlx4_conv_rss_types ( priv , 0 , 1 ) ; return 0 ; }
DPDK callback to get information about the device.
DPDK callback to get information about the device .
/* FIXME: we should ask the device for these values. */ /*
	 * Since we need one CQ per QP, the limit is the minimum number
	 * between the two values.
	 */ /* max_rx_queues is uint16_t. */