mirror of https://github.com/F-Stack/f-stack.git
MLX5: modify `if_indextoname` syscall to support F-Stack tools.
This commit is contained in:
parent
cf06e8b0b7
commit
16a456d6e0
|
@ -3,14 +3,13 @@
|
||||||
If you have a Redhat7.3 EC2 instance,and then execute the following cmds, you will get the F-Stack server in one minute
|
If you have a Redhat7.3 EC2 instance,and then execute the following cmds, you will get the F-Stack server in one minute
|
||||||
|
|
||||||
sudo -i
|
sudo -i
|
||||||
yum install -y git gcc openssl-devel kernel-devel-$(uname -r) bc numactl-devel mkdir make net-tools vim pciutils iproute pcre-devel zlib-devel elfutils-libelf-devel vim
|
yum install -y git gcc openssl-devel kernel-devel-$(uname -r) bc numactl-devel mkdir make net-tools vim pciutils iproute pcre-devel zlib-devel elfutils-libelf-devel meson
|
||||||
|
|
||||||
mkdir /data/f-stack
|
mkdir /data/f-stack
|
||||||
git clone https://github.com/F-Stack/f-stack.git /data/f-stack
|
git clone https://github.com/F-Stack/f-stack.git /data/f-stack
|
||||||
|
|
||||||
# Compile DPDK
|
# Compile DPDK
|
||||||
cd /data/f-stack/dpdk
|
cd /data/f-stack/dpdk
|
||||||
cd dpdk/
|
|
||||||
meson -Denable_kmods=true build
|
meson -Denable_kmods=true build
|
||||||
ninja -C build
|
ninja -C build
|
||||||
ninja -C build install
|
ninja -C build install
|
||||||
|
|
|
@ -23,6 +23,7 @@
|
||||||
#include <stdalign.h>
|
#include <stdalign.h>
|
||||||
#include <sys/un.h>
|
#include <sys/un.h>
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
|
#include <dlfcn.h>
|
||||||
|
|
||||||
#include <rte_ethdev_driver.h>
|
#include <rte_ethdev_driver.h>
|
||||||
#include <rte_bus_pci.h>
|
#include <rte_bus_pci.h>
|
||||||
|
@ -1027,6 +1028,7 @@ mlx5_sysfs_check_switch_info(bool device_dir,
|
||||||
* @return
|
* @return
|
||||||
* 0 on success, a negative errno value otherwise and rte_errno is set.
|
* 0 on success, a negative errno value otherwise and rte_errno is set.
|
||||||
*/
|
*/
|
||||||
|
static int (*real_if_indextoname)(unsigned int, char *);
|
||||||
int
|
int
|
||||||
mlx5_sysfs_switch_info(unsigned int ifindex, struct mlx5_switch_info *info)
|
mlx5_sysfs_switch_info(unsigned int ifindex, struct mlx5_switch_info *info)
|
||||||
{
|
{
|
||||||
|
@ -1046,7 +1048,16 @@ mlx5_sysfs_switch_info(unsigned int ifindex, struct mlx5_switch_info *info)
|
||||||
char c;
|
char c;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
if (!if_indextoname(ifindex, ifname)) {
|
// for ff tools
|
||||||
|
if (!real_if_indextoname) {
|
||||||
|
real_if_indextoname = dlsym(RTLD_NEXT, "if_indextoname");
|
||||||
|
if (!real_if_indextoname) {
|
||||||
|
rte_errno = errno;
|
||||||
|
return -rte_errno;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!real_if_indextoname(ifindex, ifname)) {
|
||||||
rte_errno = errno;
|
rte_errno = errno;
|
||||||
return -rte_errno;
|
return -rte_errno;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue