diff options
Diffstat (limited to 'scripts')
6 files changed, 59 insertions, 119 deletions
diff --git a/scripts/automation/regression/setups/trex17/benchmark.yaml b/scripts/automation/regression/setups/trex17/benchmark.yaml index c6f588e6..3e1f7c9b 100644 --- a/scripts/automation/regression/setups/trex17/benchmark.yaml +++ b/scripts/automation/regression/setups/trex17/benchmark.yaml @@ -23,7 +23,7 @@ test_routing_imix_64: test_static_routing_imix_asymmetric: - multiplier : 0.8 + multiplier : 0.7 cores : 1 bw_per_core : 9.635 diff --git a/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_stats.py b/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_stats.py index 06009ac3..132d34ee 100644 --- a/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_stats.py +++ b/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_stats.py @@ -1089,19 +1089,20 @@ class CLatencyStats(CTRexStats): output[int_pg_id]['err_cntrs'] = current_pg['err_cntrs'] output[int_pg_id]['latency'] = {} - output[int_pg_id]['latency']['last_max'] = current_pg['latency']['last_max'] - output[int_pg_id]['latency']['jitter'] = current_pg['latency']['jitter'] - if current_pg['latency']['h'] != "": - output[int_pg_id]['latency']['average'] = current_pg['latency']['h']['s_avg'] - output[int_pg_id]['latency']['total_max'] = current_pg['latency']['h']['max_usec'] - output[int_pg_id]['latency']['histogram'] = {elem['key']: elem['val'] - for elem in current_pg['latency']['h']['histogram']} - zero_count = current_pg['latency']['h']['cnt'] - current_pg['latency']['h']['high_cnt'] - if zero_count != 0: - output[int_pg_id]['latency']['total_min'] = 1 - output[int_pg_id]['latency']['histogram'][0] = zero_count - elif output[int_pg_id]['latency']['histogram']: - output[int_pg_id]['latency']['total_min'] = min(output[int_pg_id]['latency']['histogram'].keys()) + if 'latency' in current_pg: + for field in ['jitter', 'average', 'total_max', 'last_max']: + if field in current_pg['latency']: + output[int_pg_id]['latency'][field] = current_pg['latency'][field] + else: + output[int_pg_id]['latency'][field] = StatNotAvailable(field) + + if 'histogram' in current_pg['latency']: + output[int_pg_id]['latency']['histogram'] = {int(elem): current_pg['latency']['histogram'][elem] + for elem in current_pg['latency']['histogram']} + min_val = min(output[int_pg_id]['latency']['histogram'].keys()) + if min_val == 0: + min_val = 2 + output[int_pg_id]['latency']['total_min'] = min_val else: output[int_pg_id]['latency']['total_min'] = StatNotAvailable('total_min') diff --git a/scripts/external_libs/scapy-2.3.1/python2/scapy/arch/linux.py b/scripts/external_libs/scapy-2.3.1/python2/scapy/arch/linux.py index 32f0a2d1..729ab3fd 100644 --- a/scripts/external_libs/scapy-2.3.1/python2/scapy/arch/linux.py +++ b/scripts/external_libs/scapy-2.3.1/python2/scapy/arch/linux.py @@ -69,13 +69,14 @@ RTF_REJECT = 0x0200 LOOPBACK_NAME="lo" -with os.popen("tcpdump -V 2> /dev/null") as _f: - if _f.close() >> 8 == 0x7f: - log_loading.warning("Failed to execute tcpdump. Check it is installed and in the PATH") - TCPDUMP=0 - else: - TCPDUMP=1 -del(_f) +#with os.popen("tcpdump -V 2> /dev/null") as _f: +# if _f.close() >> 8 == 0x7f: +# log_loading.warning("Failed to execute tcpdump. Check it is installed and in the PATH") +# TCPDUMP=0 +# else: +# TCPDUMP=1 +#del(_f) +TCPDUMP=0 def get_if_raw_hwaddr(iff): diff --git a/scripts/external_libs/scapy-2.3.1/python3/scapy/arch/linux.py b/scripts/external_libs/scapy-2.3.1/python3/scapy/arch/linux.py index 3eab16c6..40ff9e35 100644 --- a/scripts/external_libs/scapy-2.3.1/python3/scapy/arch/linux.py +++ b/scripts/external_libs/scapy-2.3.1/python3/scapy/arch/linux.py @@ -71,13 +71,14 @@ PCAP_ERRBUF_SIZE=256 LOOPBACK_NAME="lo" -with os.popen("tcpdump -V 2> /dev/null") as _f: - if _f.close() >> 8 == 0x7f: - log_loading.warning("Failed to execute tcpdump. Check it is installed and in the PATH") - TCPDUMP=0 - else: - TCPDUMP=1 -del(_f) +#with os.popen("tcpdump -V 2> /dev/null") as _f: +# if _f.close() >> 8 == 0x7f: +# log_loading.warning("Failed to execute tcpdump. Check it is installed and in the PATH") +# TCPDUMP=0 +# else: +# TCPDUMP=1 +#del(_f) +TCPDUMP=0 def get_if_raw_hwaddr(iff): diff --git a/scripts/ko/src/igb_uio.c b/scripts/ko/src/igb_uio.c index faeb0b68..27bec6a3 100755 --- a/scripts/ko/src/igb_uio.c +++ b/scripts/ko/src/igb_uio.c @@ -31,6 +31,7 @@ #include <linux/io.h> #include <linux/msi.h> #include <linux/version.h> +#include <linux/slab.h> #ifdef CONFIG_XEN_DOM0 #include <xen/xen.h> @@ -39,15 +40,6 @@ #include "compat.h" -#ifdef RTE_PCI_CONFIG -#define PCI_SYS_FILE_BUF_SIZE 10 -#define PCI_DEV_CAP_REG 0xA4 -#define PCI_DEV_CTRL_REG 0xA8 -#define PCI_DEV_CAP_EXT_TAG_MASK 0x20 -#define PCI_DEV_CTRL_EXT_TAG_SHIFT 8 -#define PCI_DEV_CTRL_EXT_TAG_MASK (1 << PCI_DEV_CTRL_EXT_TAG_SHIFT) -#endif - /** * A structure describing the private information for a uio device. */ @@ -57,22 +49,15 @@ struct rte_uio_pci_dev { enum rte_intr_mode mode; }; -static char *intr_mode = NULL; +static char *intr_mode; static enum rte_intr_mode igbuio_intr_mode_preferred = RTE_INTR_MODE_MSIX; -static inline struct rte_uio_pci_dev * -igbuio_get_uio_pci_dev(struct uio_info *info) -{ - return container_of(info, struct rte_uio_pci_dev, info); -} - /* sriov sysfs */ static ssize_t show_max_vfs(struct device *dev, struct device_attribute *attr, char *buf) { - return snprintf(buf, 10, "%u\n", - pci_num_vf(container_of(dev, struct pci_dev, dev))); + return snprintf(buf, 10, "%u\n", dev_num_vf(dev)); } static ssize_t @@ -81,7 +66,7 @@ store_max_vfs(struct device *dev, struct device_attribute *attr, { int err = 0; unsigned long max_vfs; - struct pci_dev *pdev = container_of(dev, struct pci_dev, dev); + struct pci_dev *pdev = to_pci_dev(dev); if (0 != kstrtoul(buf, 0, &max_vfs)) return -EINVAL; @@ -100,19 +85,9 @@ store_max_vfs(struct device *dev, struct device_attribute *attr, static ssize_t show_extended_tag(struct device *dev, struct device_attribute *attr, char *buf) { - struct pci_dev *pci_dev = container_of(dev, struct pci_dev, dev); - uint32_t val = 0; - - pci_read_config_dword(pci_dev, PCI_DEV_CAP_REG, &val); - if (!(val & PCI_DEV_CAP_EXT_TAG_MASK)) /* Not supported */ - return snprintf(buf, PCI_SYS_FILE_BUF_SIZE, "%s\n", "invalid"); - - val = 0; - pci_bus_read_config_dword(pci_dev->bus, pci_dev->devfn, - PCI_DEV_CTRL_REG, &val); + dev_info(dev, "Deprecated\n"); - return snprintf(buf, PCI_SYS_FILE_BUF_SIZE, "%s\n", - (val & PCI_DEV_CTRL_EXT_TAG_MASK) ? "on" : "off"); + return 0; } static ssize_t @@ -121,36 +96,9 @@ store_extended_tag(struct device *dev, const char *buf, size_t count) { - struct pci_dev *pci_dev = container_of(dev, struct pci_dev, dev); - uint32_t val = 0, enable; - - if (strncmp(buf, "on", 2) == 0) - enable = 1; - else if (strncmp(buf, "off", 3) == 0) - enable = 0; - else - return -EINVAL; - - pci_cfg_access_lock(pci_dev); - pci_bus_read_config_dword(pci_dev->bus, pci_dev->devfn, - PCI_DEV_CAP_REG, &val); - if (!(val & PCI_DEV_CAP_EXT_TAG_MASK)) { /* Not supported */ - pci_cfg_access_unlock(pci_dev); - return -EPERM; - } - - val = 0; - pci_bus_read_config_dword(pci_dev->bus, pci_dev->devfn, - PCI_DEV_CTRL_REG, &val); - if (enable) - val |= PCI_DEV_CTRL_EXT_TAG_MASK; - else - val &= ~PCI_DEV_CTRL_EXT_TAG_MASK; - pci_bus_write_config_dword(pci_dev->bus, pci_dev->devfn, - PCI_DEV_CTRL_REG, val); - pci_cfg_access_unlock(pci_dev); + dev_info(dev, "Deprecated\n"); - return count; + return 0; } static ssize_t @@ -158,10 +106,9 @@ show_max_read_request_size(struct device *dev, struct device_attribute *attr, char *buf) { - struct pci_dev *pci_dev = container_of(dev, struct pci_dev, dev); - int val = pcie_get_readrq(pci_dev); + dev_info(dev, "Deprecated\n"); - return snprintf(buf, PCI_SYS_FILE_BUF_SIZE, "%d\n", val); + return 0; } static ssize_t @@ -170,18 +117,9 @@ store_max_read_request_size(struct device *dev, const char *buf, size_t count) { - struct pci_dev *pci_dev = container_of(dev, struct pci_dev, dev); - unsigned long size = 0; - int ret; - - if (0 != kstrtoul(buf, 0, &size)) - return -EINVAL; - - ret = pcie_set_readrq(pci_dev, (int)size); - if (ret < 0) - return ret; + dev_info(dev, "Deprecated\n"); - return count; + return 0; } #endif @@ -243,7 +181,7 @@ igbuio_msix_mask_irq(struct msi_desc *desc, int32_t state) static int igbuio_pci_irqcontrol(struct uio_info *info, s32 irq_state) { - struct rte_uio_pci_dev *udev = igbuio_get_uio_pci_dev(info); + struct rte_uio_pci_dev *udev = info->priv; struct pci_dev *pdev = udev->pdev; pci_cfg_access_lock(pdev); @@ -253,8 +191,13 @@ igbuio_pci_irqcontrol(struct uio_info *info, s32 irq_state) else if (udev->mode == RTE_INTR_MODE_MSIX) { struct msi_desc *desc; +#if (LINUX_VERSION_CODE < KERNEL_VERSION(4, 3, 0)) list_for_each_entry(desc, &pdev->msi_list, list) igbuio_msix_mask_irq(desc, irq_state); +#else + list_for_each_entry(desc, &pdev->dev.msi_list, list) + igbuio_msix_mask_irq(desc, irq_state); +#endif } pci_cfg_access_unlock(pdev); @@ -268,7 +211,7 @@ igbuio_pci_irqcontrol(struct uio_info *info, s32 irq_state) static irqreturn_t igbuio_pci_irqhandler(int irq, struct uio_info *info) { - struct rte_uio_pci_dev *udev = igbuio_get_uio_pci_dev(info); + struct rte_uio_pci_dev *udev = info->priv; /* Legacy mode need to mask in hardware */ if (udev->mode == RTE_INTR_MODE_LEGACY && @@ -333,7 +276,7 @@ igbuio_pci_setup_iomem(struct pci_dev *dev, struct uio_info *info, unsigned long addr, len; void *internal_addr; - if (sizeof(info->mem) / sizeof(info->mem[0]) <= n) + if (n >= ARRAY_SIZE(info->mem)) return -EINVAL; addr = pci_resource_start(dev, pci_bar); @@ -358,7 +301,7 @@ igbuio_pci_setup_ioport(struct pci_dev *dev, struct uio_info *info, { unsigned long addr, len; - if (sizeof(info->port) / sizeof(info->port[0]) <= n) + if (n >= ARRAY_SIZE(info->port)) return -EINVAL; addr = pci_resource_start(dev, pci_bar); @@ -403,7 +346,7 @@ igbuio_setup_bars(struct pci_dev *dev, struct uio_info *info) iom = 0; iop = 0; - for (i = 0; i != sizeof(bar_names) / sizeof(bar_names[0]); i++) { + for (i = 0; i < ARRAY_SIZE(bar_names); i++) { if (pci_resource_len(dev, i) != 0 && pci_resource_start(dev, i) != 0) { flags = pci_resource_flags(dev, i); @@ -562,23 +505,17 @@ fail_free: static void igbuio_pci_remove(struct pci_dev *dev) { - struct uio_info *info = pci_get_drvdata(dev); - struct rte_uio_pci_dev *udev = igbuio_get_uio_pci_dev(info); - - if (info->priv == NULL) { - pr_notice("Not igbuio device\n"); - return; - } + struct rte_uio_pci_dev *udev = pci_get_drvdata(dev); sysfs_remove_group(&dev->dev.kobj, &dev_attr_grp); - uio_unregister_device(info); - igbuio_pci_release_iomem(info); + uio_unregister_device(&udev->info); + igbuio_pci_release_iomem(&udev->info); if (udev->mode == RTE_INTR_MODE_MSIX) pci_disable_msix(dev); pci_release_regions(dev); pci_disable_device(dev); pci_set_drvdata(dev, NULL); - kfree(info); + kfree(udev); } static int diff --git a/scripts/stl/flow_stats_latency.py b/scripts/stl/flow_stats_latency.py index 334406e5..e1541272 100644 --- a/scripts/stl/flow_stats_latency.py +++ b/scripts/stl/flow_stats_latency.py @@ -9,11 +9,11 @@ class STLS1(object): def get_streams (self, direction = 0, **kwargs): return [STLStream(packet = STLPktBuilder(pkt = os.path.join(CP, "yaml/udp_64B_no_crc.pcap")), # path relative to pwd mode = STLTXCont(pps=1000), - flow_stats = STLFlowLatencyStats(pg_id = 7)), + flow_stats = STLFlowLatencyStats(pg_id = 1 + kwargs['port_id'])), STLStream(packet = STLPktBuilder(pkt = os.path.join(CP, "yaml/udp_594B_no_crc.pcap")), # path relative to pwd mode = STLTXCont(pps=5000), - flow_stats = STLFlowLatencyStats(pg_id = 12)) + flow_stats = STLFlowLatencyStats(pg_id = 50 + kwargs['port_id'])) ] |