summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/dpdk_nic_bind.py3
-rwxr-xr-xscripts/dpdk_setup_ports.py47
-rw-r--r--scripts/libibverbs.so.1bin0 -> 494224 bytes
-rwxr-xr-xscripts/trex-cfg4
4 files changed, 45 insertions, 9 deletions
diff --git a/scripts/dpdk_nic_bind.py b/scripts/dpdk_nic_bind.py
index 36d123f1..ad2fc3db 100755
--- a/scripts/dpdk_nic_bind.py
+++ b/scripts/dpdk_nic_bind.py
@@ -54,7 +54,8 @@ if needed_path not in PATH:
# Each device within this is itself a dictionary of device properties
devices = {}
# list of supported DPDK drivers
-dpdk_drivers = [ "igb_uio", "vfio-pci", "uio_pci_generic" ]
+#
+dpdk_drivers = [ "mlx5_core", "mlx5_ib","igb_uio", "vfio-pci", "uio_pci_generic" ]
# command-line arg flags
b_flag = None
diff --git a/scripts/dpdk_setup_ports.py b/scripts/dpdk_setup_ports.py
index f85dae5d..14065f8a 100755
--- a/scripts/dpdk_setup_ports.py
+++ b/scripts/dpdk_setup_ports.py
@@ -299,15 +299,19 @@ Other network devices
self.raise_error ('Error: port_limit should not be higher than number of interfaces in config file: %s\n' % fcfg)
- def do_bind_one (self,key):
- cmd='%s dpdk_nic_bind.py --bind=igb_uio %s ' % (sys.executable, key)
+ def do_bind_one (self,key,mellanox):
+ if mellanox:
+ drv="mlx5_core"
+ else:
+ drv="igb_uio"
+
+ cmd='%s dpdk_nic_bind.py --bind=%s %s ' % (sys.executable, drv,key)
print(cmd)
res=os.system(cmd);
if res!=0:
raise DpdkSetup('')
-
def pci_name_to_full_name (self,pci_name):
c='[0-9A-Fa-f]';
sp='[:]'
@@ -330,7 +334,7 @@ Other network devices
dpdk_nic_bind.get_nic_details()
self.m_devices= dpdk_nic_bind.devices
- def do_run (self):
+ def do_run (self,only_check_all_mlx=False):
self.run_dpdk_lspci ()
if map_driver.dump_interfaces is None or (map_driver.dump_interfaces == [] and map_driver.parent_cfg):
self.load_config_file()
@@ -343,17 +347,46 @@ Other network devices
if_list.append(dev['Slot'])
if_list = list(map(self.pci_name_to_full_name, if_list))
+
+
+ # check how many mellanox cards we have
+ Mellanox_cnt=0;
for key in if_list:
if key not in self.m_devices:
err=" %s does not exist " %key;
raise DpdkSetup(err)
+ if 'Vendor_str' not in self.m_devices[key]:
+ err=" %s does not have Vendor_str " %key;
+ raise DpdkSetup(err)
+
+ if self.m_devices[key]['Vendor_str'].find("Mellanox")>-1 :
+ Mellanox_cnt=Mellanox_cnt+1
+
+
+ if ((Mellanox_cnt>0) and (Mellanox_cnt!= len(if_list))):
+ err=" All driver should be from one vendor. you have at least one driver from Mellanox but not all ";
+ raise DpdkSetup(err)
+
+
+ if only_check_all_mlx:
+ if Mellanox_cnt >0:
+ exit(1);
+ else:
+ exit(0);
+
+ for key in if_list:
+ if key not in self.m_devices:
+ err=" %s does not exist " %key;
+ raise DpdkSetup(err)
if 'Driver_str' in self.m_devices[key]:
if self.m_devices[key]['Driver_str'] not in dpdk_nic_bind.dpdk_drivers :
- self.do_bind_one (key)
+ self.do_bind_one (key,(Mellanox_cnt>0))
+ pass;
else:
- self.do_bind_one (key)
+ self.do_bind_one (key,(Mellanox_cnt>0))
+ pass;
if if_list and map_driver.args.parent and dpdk_nic_bind.get_igb_uio_usage():
pid = dpdk_nic_bind.get_pid_using_pci(if_list)
@@ -684,7 +717,7 @@ To return to Linux the DPDK bound interfaces (for ifconfig etc.)
sudo ./dpdk_set_ports.py -l
To create TRex config file using interactive mode
- sudo ./dpdk_set_ports.py -l
+ sudo ./dpdk_set_ports.py -i
To create a default config file (example1)
sudo ./dpdk_setup_ports.py -c 02:00.0 02:00.1 -o /etc/trex_cfg.yaml
diff --git a/scripts/libibverbs.so.1 b/scripts/libibverbs.so.1
new file mode 100644
index 00000000..bd93569d
--- /dev/null
+++ b/scripts/libibverbs.so.1
Binary files differ
diff --git a/scripts/trex-cfg b/scripts/trex-cfg
index 714aea6c..19b12129 100755
--- a/scripts/trex-cfg
+++ b/scripts/trex-cfg
@@ -39,7 +39,9 @@ done
PATH=$PATH:/sbin:/usr/sbin
-if ! lsmod | grep -q igb_uio ; then
+#! lsmod | grep -q igb_uio ;
+# TBD need to fix this for Mellanox , need to check if all NICS are mellanox and not to do this
+if false ; then
echo "Loading kernel drivers for the first time"
modprobe uio
if [ $? -ne 0 ]; then