};
unsigned int vf;
int i;
+ char ifname[IF_NAMESIZE];
(void)pci_drv;
err = mlx4_init_once();
mac.addr_bytes[4], mac.addr_bytes[5]);
/* Register MAC address. */
priv->mac[0] = mac;
-#ifndef NDEBUG
- {
- char ifname[IF_NAMESIZE];
-
- if (mlx4_get_ifname(priv, &ifname) == 0)
- DEBUG("port %u ifname is \"%s\"",
- priv->port, ifname);
- else
- DEBUG("port %u ifname is unknown", priv->port);
+
+ if (mlx4_get_ifname(priv, &ifname) == 0) {
+ DEBUG("port %u ifname is \"%s\"",
+ priv->port, ifname);
+ priv->if_index = if_nametoindex(ifname);
+ } else {
+ DEBUG("port %u ifname is unknown", priv->port);
}
-#endif
+
/* Get actual MTU if possible. */
mlx4_mtu_get(priv, &priv->mtu);
DEBUG("port %u MTU is %u", priv->port, priv->mtu);
struct ibv_device_attr device_attr; /**< Device properties. */
struct ibv_pd *pd; /**< Protection Domain. */
/* Device properties. */
+ unsigned int if_index; /**< Associated network device index */
uint16_t mtu; /**< Configured MTU. */
uint8_t port; /**< Physical port number. */
uint32_t started:1; /**< Device started, flows enabled. */
{
struct mlx4_priv *priv = dev->data->dev_private;
unsigned int max;
- char ifname[IF_NAMESIZE];
/* FIXME: we should ask the device for these values. */
info->min_rx_bufsize = 32;
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);
- if (mlx4_get_ifname(priv, &ifname) == 0)
- info->if_index = if_nametoindex(ifname);
+ info->if_index = priv->if_index;
info->hash_key_size = MLX4_RSS_HASH_KEY_SIZE;
info->speed_capa =
ETH_LINK_SPEED_1G |