-#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);