summaryrefslogtreecommitdiff
path: root/drivers/net/mlx5/mlx5_ethdev.c
diff options
context:
space:
mode:
authorNĂ©lio Laranjeiro <nelio.laranjeiro@6wind.com>2018-04-05 17:07:19 +0200
committerFerruh Yigit <ferruh.yigit@intel.com>2018-04-14 00:41:44 +0200
commitccdcba53a3f4d12583c4378e7d8b702ce91e0499 (patch)
tree662bc815df87fc5f15a8f64c2ff1708294ca7625 /drivers/net/mlx5/mlx5_ethdev.c
parenta7082768655a16294a78b68be97e6997be59d778 (diff)
downloaddpdk-ccdcba53a3f4d12583c4378e7d8b702ce91e0499.zip
dpdk-ccdcba53a3f4d12583c4378e7d8b702ce91e0499.tar.gz
dpdk-ccdcba53a3f4d12583c4378e7d8b702ce91e0499.tar.xz
net/mlx5: use Netlink to add/remove MAC addresses
VF devices are not able to receive traffic unless it fully requests it though Netlink. This will cause the request to be processed by the PF which will add/remove the MAC address to the VF table if the VF is trusted. Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com> Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Diffstat (limited to 'drivers/net/mlx5/mlx5_ethdev.c')
-rw-r--r--drivers/net/mlx5/mlx5_ethdev.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/drivers/net/mlx5/mlx5_ethdev.c b/drivers/net/mlx5/mlx5_ethdev.c
index 982d821..19bf4d4 100644
--- a/drivers/net/mlx5/mlx5_ethdev.c
+++ b/drivers/net/mlx5/mlx5_ethdev.c
@@ -178,6 +178,33 @@ try_dev_id:
}
/**
+ * Get the interface index from device name.
+ *
+ * @param[in] dev
+ * Pointer to Ethernet device.
+ *
+ * @return
+ * Interface index on success, a negative errno value otherwise and
+ * rte_errno is set.
+ */
+int
+mlx5_ifindex(const struct rte_eth_dev *dev)
+{
+ char ifname[IF_NAMESIZE];
+ int ret;
+
+ ret = mlx5_get_ifname(dev, &ifname);
+ if (ret)
+ return ret;
+ ret = if_nametoindex(ifname);
+ if (ret == -1) {
+ rte_errno = errno;
+ return -rte_errno;
+ }
+ return ret;
+}
+
+/**
* Perform ifreq ioctl() on associated Ethernet device.
*
* @param[in] dev