File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed
dpdk/drivers/net/mlx5/linux Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change 1414#include <linux/sockios.h>
1515#include <linux/ethtool.h>
1616#include <fcntl.h>
17+ #include <dlfcn.h>
1718
1819#include <rte_malloc.h>
1920#include <ethdev_driver.h>
@@ -2027,6 +2028,7 @@ mlx5_nl_esw_multiport_get(struct rte_pci_addr *pci_addr, int *enabled)
20272028
20282029#define SYSFS_MPESW_PARAM_MAX_LEN 16
20292030
2031+ static char * (* real_if_indextoname )(unsigned int , char * ) = NULL ;
20302032static int
20312033mlx5_sysfs_esw_multiport_get (struct ibv_device * ibv , struct rte_pci_addr * pci_addr , int * enabled )
20322034{
@@ -2056,7 +2058,16 @@ mlx5_sysfs_esw_multiport_get(struct ibv_device *ibv, struct rte_pci_addr *pci_ad
20562058 ifindex = mlx5_nl_ifindex (nl_rdma , ibv -> name , i );
20572059 if (!ifindex )
20582060 continue ;
2059- if (!if_indextoname (ifindex , ifname ))
2061+
2062+ // for ff tools
2063+ if (!real_if_indextoname ) {
2064+ real_if_indextoname = __extension__ (char * (* )(unsigned int , char * ))dlsym (RTLD_NEXT , "if_indextoname" );
2065+ if (!real_if_indextoname ) {
2066+ rte_errno = errno ;
2067+ return - rte_errno ;
2068+ }
2069+ }
2070+ if (!real_if_indextoname (ifindex , ifname ))
20602071 continue ;
20612072 MKSTR (sysfs_if_path , "/sys/class/net/%s" , ifname );
20622073 if (mlx5_get_pci_addr (sysfs_if_path , & if_pci_addr ))
You can’t perform that action at this time.
0 commit comments