This patch creates the framework to define the DPDK PCI functional
device by specifying the pci attributes like Vendor ID, Device ID,
Sub Vendor ID, Sub Device ID and Class.This enables a flexible way to
add DPDK function devices based on PCI attributes.
Crypto devices can belong to Encryption class(0x10) or Processor
class(0x0b) based on the vendor preference.
Using this framework, The above disparity can be encoded in the following
format
encryption_class = [{'Class': '10', 'Vendor': None,
'Device': None, 'SVendor': None, 'SDevice': None}]
intel_processor_class = [{'Class': '0b', 'Vendor': '8086', 'Device': None,
'SVendor': None, 'SDevice': None}]
crypto_devices = [encryption_class, intel_processor_class]
Signed-off-by: Guduri Prathyusha <gprathyusha@caviumnetworks.com>
Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
The current device bind model uses /sys/bus/pci/driver/new_id scheme to
bind devices to the driver. This scheme has following operations to bind
a device to the driver.
1) Write device ID and vendor ID to /sys/bus/pci/driver/new_id
2) Write PCI BDF number to /sys/bus/pci/driver/bind
3) On step (1), _All_ the devices that match the device ID and vendor ID
get bound to the driver
4) Except for requested devices, Unbind the remaining devices
In kernels >= 3.15, An alternative scheme driver_override can be used to
bind a device to driver.This scheme has following operations to bind a
device to driver.
1) Write driver to /sys/bus/pci/device/driver_override
2) Write PCI BDF number to /sys/bus/pci/driver/bind
This script detects the presence of /sys/bus/pci/device/driver_override,
if available use optimized bind scheme to bind it
Signed-off-by: Guduri Prathyusha <gprathyusha@caviumnetworks.com>
Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
lspci invoked twice over all the pci devices in the system.
The first pass is to extract Numeric IDs and second pass to get extended
device details.
As an optimization, Used lspci with -nn option in get_device_details()
to obtain Numeric ID and extended device details in one shot.
In addition to this, After binding the PCI device, lspci needs to be
invoked again to confirm the proper bind operation. Used a boolean
argument to express this case in get_pci_device_details()
Signed-off-by: Guduri Prathyusha <gprathyusha@caviumnetworks.com>
Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Identified and parameterized the common code in show_status() function as
show_device_status().This will enable to avoid code duplication when
additional devices added to the script.
Signed-off-by: Guduri Prathyusha <gprathyusha@caviumnetworks.com>
Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
get_nic_details() and get_crypto_details() shares a lot of common code.
Created a new unified get_device_details() function get the device details.
Signed-off-by: Guduri Prathyusha <gprathyusha@caviumnetworks.com>
Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Some platforms do not have core/socket info in /proc/cpuinfo.
Use /sys/devices/system/cpu instead.
Signed-off-by: Andriy Berestovskyy <andriy.berestovskyy@caviumnetworks.com>
license and copyright for hw and mc files are made consistent
as per the other dpaa2 dual licensed files.
Signed-off-by: Akhil Goyal <akhil.goyal@nxp.com>
Fixes following compilation error, using uint64_t type,
instead of int128_t unnecessarily:
In file included from ./common/lthread.c:82:0:
./common/lthread_timer.h: In function ‘_ns_to_clks’:
./common/lthread_timer.h:49:20: error: expected ‘=’, ‘,’, ‘;’,
‘asm’ or ‘__attribute__’ before ‘clkns’
compilation terminated due to -Wfatal-errors.
Fixes: 116819b9ed ("examples/performance-thread: add lthread subsystem")
Cc: stable@dpdk.org
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
When building any of the perf-thread examples, the output .o files were
placed in two separate directories for each app: the regular build dir and
a "common" build directory. This was due to the way the files to be built
were specified, using a relative path. Switching to use VPATH to find the
files causes Make to put all .o's into the one build directory.
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
This set of sample apps did not compile on FreeBSD due to use of a number
of Linux/glibc-specific APIs, or APIs which existed in different headers
on FreeBSD. Specifically, the following APIs has problems:
* sched_getcpu() is a glibc extension, so use rte_lcore_id() on BSD
* pthread_yield() returns int on Linux, but void on FreeBSD, so
we have to create two slightly different copies of the function.
* the type for managing cpu sets is cpuset_t on FreeBSD rather than
cpu_set_t as on Linux, so use rte_cpuset_t from rte_lcore.h.
* APIs for managing cpu affinity are in pthread_np.h on FreeBSD, rather
than in pthread.h, also fixed by including rte_lcore.h
Fixes: 433ba6228f ("examples/performance-thread: add pthread_shim app")
Fixes: d48415e1fe ("examples/performance-thread: add l3fwd-thread app")
Cc: stable@dpdk.org
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
The "examples_clean" top-level build target calls "make clean" for each
individual example. However, for a number of those which were linux-only
examples, the "if" condition only had a dummy "all" target i.e. no "clean"
target, causing an error with examples_clean.
Fixes: 3417cd687e ("examples: ignore linux apps on bsd")
Cc: stable@dpdk.org
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
On FreeBSD it's not necessary to use -ldl to link apps which use
dlopen. This error only showed up with a shared library gcc build,
not standard build using static libs.
Fixes: 1131cbf0fb ("net/ark: stub PMD for Atomic Rules Arkville")
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: John Miller <john.miller@atomicrules.com>
fix proc-info xstats-name description string
Fixes: 1223608adb ("app/proc-info: support xstats by ID")
Signed-off-by: Michal Jastrzebski <michalx.k.jastrzebski@intel.com>
Acked-by: Harry van Haaren <harry.van.haaren@intel.com>
Change comments for rte_flow_validate() function to indicate that flow
rule collision and resource validation is optional for PMDs and
therefore the return codes may have different meanings.
Fixes: b1a4b4cbc0 ("ethdev: introduce generic flow API")
Signed-off-by: John Daley <johndale@cisco.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
This patch adds missing backslash in host's testpmd command
line.
Without it the command works, but a single core is used
instead of four, which might create confusion.
Fixes: 58a2551a16 ("doc: introduce PVP reference benchmark")
Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
Lthread is awesome but it doesn't support C++.
So I write patch to support lthread to support C++.
Added "extern C {}" to lthread-headers
Signed-off-by: Hiroki Shirokura <slank.dev@gmail.com>
Acked-by: Keith Wiles <keith.wiles@intel.com>
Disable promiscuous mode by default since VLAN filter
does not work when promiscuous mode is enabled.
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Remy Horton <remy.horton@intel.com>
Some PMDs do not support 9,5K jumbo frames, so the example fails.
Limit the frame size to the maximum supported by the underlying NIC.
Signed-off-by: Andriy Berestovskyy <andriy.berestovskyy@caviumnetworks.com>
The code should return the actual number of packets read.
Fixes: 5a99f208 ("port: support file descriptor")
Signed-off-by: Andriy Berestovskyy <andriy.berestovskyy@caviumnetworks.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Makes code a bit cleaner and type-aware.
Signed-off-by: Andriy Berestovskyy <andriy.berestovskyy@caviumnetworks.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Some PMDs (mostly VFs) do not provide link up/down functionality.
Signed-off-by: Andriy Berestovskyy <andriy.berestovskyy@caviumnetworks.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
At the moment ip_pipeline example uses 32 during the initialization,
which leads to an error on systems with more than 32 CPUs.
Signed-off-by: Andriy Berestovskyy <andriy.berestovskyy@caviumnetworks.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Firewall ACL definition need to use same input index for source and
destination ports as these are 16 bits and would fit in one ACL
field of 32 bits. This is required as per librte_acl API. Without this
UDP/TCP source and destination ports filtering (and for that
matter ICMP type/code filtering) does not work.
Signed-off-by: Shyam Kumar Shrivastav <shrivastav.shyam@gmail.com>
Reviewed-by: Jasvinder Singh <jasvinder.singh@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
alloc_q and rx_q fifos holds physical address of the mbufs, and not able
to free those mbufs explicitly.
But kernel thread reads from rx_q and puts used mbufs into free_q (with
their virtual addresses.) And kernel thread stopped when application
close the /dev/kni file on exit. So rx_q has time to be consumed by
kernel thread but leak is technically possible.
Another fifo, alloc_q has physical addresses too, but all those coming
from same mempool provided by application, when application quit, all
mempool already returned back, so this leak can be ignored.
Added check and wait logic for rx_q to be sure kernel consumed the fifo,
an error message printed after some ammount of wait, and an explicit
mempool free added for alloc_q.
Fixes: 8451269e6d ("kni: remove continuous memory restriction")
Cc: stable@dpdk.org
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
There is little reason for NUMA support in testpmd to be off by default, so
enable it, and add in a new commandline parameter to disable it, if that is
wanted by users.
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
In the absence of traffic, it is possible for the bitrate moving average
to get stuck at a non-zero value, due to the calculated delta being less
than what an integer can represent.
Fixes: 2ad7ba9a65 ("bitrate: add bitrate statistics library")
Signed-off-by: Remy Horton <remy.horton@intel.com>
Occasionally, the distributor single-packet-at-a-time mode will
segfault because it inadvertently calls some burst mode code when
flushing packets.
This patch ensures that only the v20 (single mode) codepath is used, and
returns without falling through to the burst mode code.
Fixes: 775003ad2f ("distributor: add new burst-capable library")
Signed-off-by: David Hunt <david.hunt@intel.com>
Tested-by: Yong Liu <yong.liu@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Enable device removal event for PMD supporting it.
Add the --no-rmv-interrupt parameter to explicitly disable it.
Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>
Signed-off-by: Elad Persiko <eladpe@mellanox.com>
For drivers supporting the LSC event, enable it.
This allows to test LSC event support.
Add the --no-lsc-interrupt parameter to explicitly disable the link status
change interrupt.
Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>
This is a rather simple handler that prints a message with the name of
the current event. It can be used to check PMD callback registration and
triggers.
Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>
Extend the LSC event handling to support the device removal as well. The
Verbs library will send several related events, that can conflict
with the LSC event itself.
The event handling has thus been made capable of receiving and signaling
several event types at once.
Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>
Signed-off-by: Elad Persiko <eladpe@mellanox.com>
This new API allows reacting to a device removal.
A device removal is the sudden disappearance of a device from its
bus.
PMDs implementing support for this notification guarantee that the removal
of the underlying device does not incur a risk to the application.
In particular, Rx/Tx bursts and all other functions can still be called
(albeit likely returning errors) without triggering a crash, irrespective
of an application handling this event.
Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>
Signed-off-by: Elad Persiko <eladpe@mellanox.com>
To achieve functionality of retrieving only specific statistics
given by application there are two new functions added:
ixgbe_dev_xstats_get_by_ids() which retrieve
values of statistics specified by ids array
and ixgbe_dev_xstats_get_names_by_ids() which retrieve
names of statistics specified by ids array.
Signed-off-by: Jacek Piasecki <jacekx.piasecki@intel.com>
Signed-off-by: Kuba Kozak <kubax.kozak@intel.com>
Acked-by: Harry van Haaren <harry.van.haaren@intel.com>
To achieve functionality of retrieving only specific statistics
given by application there are two new functions added:
eth_igb_xstats_get_by_ids() which retrieve
values of statistics specified by ids array
and eth_igb_xstats_get_names_by_ids() which retrieve
names of statistics specified by ids array.
Signed-off-by: Jacek Piasecki <jacekx.piasecki@intel.com>
Signed-off-by: Kuba Kozak <kubax.kozak@intel.com>
Acked-by: Harry van Haaren <harry.van.haaren@intel.com>
There is a new argument --xstats-ids and --xstats-name
in proc_info command line to retrieve statistics given by ids
and by name.
E.g. --xstats-ids="1,3,5,7,8"
E.g. --xstats-name rx_errors
ethdev: mark functions as deprecated
Functions rte_eth_xstats_get_all and rte_eth_xstats_get_names_all
are marked as deprecated
Signed-off-by: Kuba Kozak <kubax.kozak@intel.com>
Acked-by: Harry van Haaren <harry.van.haaren@intel.com>
Introduced new function: rte_eth_xstats_get_id_by_name
to retrieve xstats ids by its names.
doc: added release note
Signed-off-by: Kuba Kozak <kubax.kozak@intel.com>
Acked-by: Harry van Haaren <harry.van.haaren@intel.com>
Extended xstats API in ethdev library to allow grouping of stats
logically so they can be retrieved per logical grouping managed
by the application.
Changed existing functions rte_eth_xstats_get_names and
rte_eth_xstats_get to use a new list of arguments: array of ids
and array of values. ABI versioning mechanism was used to
support backward compatibility.
Introduced two new functions rte_eth_xstats_get_all and
rte_eth_xstats_get_names_all which keeps functionality of the
previous ones (respectively rte_eth_xstats_get and
rte_eth_xstats_get_names) but use new API inside.
test-pmd: add support for new xstats API retrieving by id in
testpmd application: xstats_get() and
xstats_get_names() call with modified parameters.
doc: add description for modified xstats API
Documentation change for modified extended statistics API functions.
The old API only allows retrieval of *all* of the NIC statistics
at once. Given this requires a MMIO read PCI transaction per statistic
it is an inefficient way of retrieving just a few key statistics.
Often a monitoring agent only has an interest in a few key statistics,
and the old API forces wasting CPU time and PCIe bandwidth in retrieving
*all* statistics; even those that the application didn't explicitly
show an interest in.
The new, more flexible API allow retrieval of statistics per ID.
If a PMD wishes, it can be implemented to read just the required
NIC registers. As a result, the monitoring application no longer wastes
PCIe bandwidth and CPU time.
Signed-off-by: Jacek Piasecki <jacekx.piasecki@intel.com>
Signed-off-by: Kuba Kozak <kubax.kozak@intel.com>
Signed-off-by: Tomasz Kulasek <tomaszx.kulasek@intel.com>
Acked-by: Harry van Haaren <harry.van.haaren@intel.com>