[v1,04/13] net/mlx5: move mlx5_get_ifname prototype under Linux
Checks
Commit Message
From: Ophir Munk <ophirmu@mellanox.com>
mlx5_get_ifname() prototype includes 'IF_NAMESIZE' definition from Linux
file net/if.h. Since this API is only used under Linux and to enable
compilation under non-Linux OS - move this prototype from shared file
mlx5.h to file linux/mlx5_os.h.
Signed-off-by: Ophir Munk <ophirmu@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>
---
drivers/net/mlx5/linux/mlx5_os.h | 6 ++++++
drivers/net/mlx5/mlx5.c | 1 -
drivers/net/mlx5/mlx5.h | 2 --
3 files changed, 6 insertions(+), 3 deletions(-)
@@ -6,6 +6,8 @@
#ifndef RTE_PMD_MLX5_OS_H_
#define RTE_PMD_MLX5_OS_H_
+#include <net/if.h>
+
/* verb enumerations translations to local enums. */
enum {
DEV_SYSFS_NAME_MAX = IBV_SYSFS_NAME_MAX + 1,
@@ -15,4 +17,8 @@ enum {
#define PCI_DRV_FLAGS (RTE_PCI_DRV_INTR_LSC | \
RTE_PCI_DRV_INTR_RMV | \
RTE_PCI_DRV_PROBE_AGAIN)
+
+/* mlx5_ethdev_os.c */
+
+int mlx5_get_ifname(const struct rte_eth_dev *dev, char (*ifname)[IF_NAMESIZE]);
#endif /* RTE_PMD_MLX5_OS_H_ */
@@ -9,7 +9,6 @@
#include <stdint.h>
#include <stdlib.h>
#include <errno.h>
-#include <net/if.h>
#include <sys/mman.h>
#include <linux/rtnetlink.h>
@@ -10,7 +10,6 @@
#include <stdbool.h>
#include <stdint.h>
#include <limits.h>
-#include <net/if.h>
#include <netinet/in.h>
#include <sys/queue.h>
@@ -813,7 +812,6 @@ int mlx5_dev_configure_rss_reta(struct rte_eth_dev *dev);
/* mlx5_ethdev_os.c */
-int mlx5_get_ifname(const struct rte_eth_dev *dev, char (*ifname)[IF_NAMESIZE]);
unsigned int mlx5_ifindex(const struct rte_eth_dev *dev);
int mlx5_get_mac(struct rte_eth_dev *dev, uint8_t (*mac)[RTE_ETHER_ADDR_LEN]);
int mlx5_get_mtu(struct rte_eth_dev *dev, uint16_t *mtu);