Age | Commit message (Collapse) | Author | Files | Lines |
|
more generic version of clib_sysfs_link_to_name with support for
format strings...
Type: improvement
Change-Id: I0cb263748970378c661415196eb7e08450370677
Signed-off-by: Damjan Marion <damarion@cisco.com>
|
|
Type: improvement
Change-Id: I4e2b2e4f227dfcb3df36166db13c8aa5c0b603f5
Signed-off-by: Damjan Marion <damarion@cisco.com>
|
|
Change-Id: Ieafbed6f2db3dec65e4b43d84a4661f6a1bbe891
Type: improvement
Signed-off-by: Damjan Marion <damarion@cisco.com>
|
|
The musl libc does not support closedir(0) resulting in a crash. Only
call closedir() if we successfully opened it.
Type: fix
Change-Id: I3198454f44735501047afc42b94b2fea273212f4
Signed-off-by: Benoît Ganne <bganne@cisco.com>
|
|
Type: improvement
Change-Id: Ifea4badd58f7e2b5e792d7506f6747851a08587f
Signed-off-by: Benoît Ganne <bganne@cisco.com>
|
|
Use correct signed type to allow testing for a failure (-1) from
readlinkat().
Type: fix
Fixes: 5714a49f14
Signed-off-by: Klement Sekera <ksekera@cisco.com>
Change-Id: I06f1c8d91e907c151012ff9758c6b52caca4d625
|
|
Fixes an number of coverity issues associated with the iio-bw feature.
Type: fix
Fixes: e15c999c3
Signed-off-by: Ray Kinsella <mdr@ashroe.eu>
Change-Id: I9ad2b336694132545d90a3483200a510226e9198
|
|
Type: refactor
Change-Id: Ic79e38aa6cf4ffe1eb677e7cef34351e7917d97b
Signed-off-by: Damjan Marion <damarion@cisco.com>
|
|
Original fix for this issue, allocated sufficent memory but didn't set the
vector length correctly.
Type: fix
Fixes: 7d0ca6af0
Signed-off-by: Ray Kinsella <mdr@ashroe.eu>
Change-Id: I3c8ce310d7a6266840a2d8d6b8620254acd042ab
|
|
Added a function to parse sysfs, determine the root bus & domain of a given pci
device.
Type: improvement
Signed-off-by: Ray Kinsella <mdr@ashroe.eu>
Change-Id: I36778116ecaa2d591617450fe5ae0bdb46b4424b
|
|
The pci device product_name array was being allocated with vec_validate, not
vec_alloc. This was allocating an additional byte at the end of the array, which
was causing a spurious '\0' to be returned in the middle of format strings.
Type: fix
Fixes: cef87f1a5e
Signed-off-by: Ray Kinsella <mdr@ashroe.eu>
Change-Id: I21e0aa4f0455ee03bd0acc675d0deae02eddea2b
|
|
struct dirent *e is freed when calling closedir(). Use ifname instead.
Type: fix
Change-Id: Icc9ca52c33ecc1dee7a9e28802149e4e3e4c8ac0
Signed-off-by: Benoît Ganne <bganne@cisco.com>
|
|
now startup.conf supports confuguration for VMBUS
devices as for PCI devices for whitelisting/blacklisting
dpdk { dev fa5a6e7a-cf3a-4b98-9569-addb479b84bc }
with sub-configuration as for PCI devices
dpdk { blacklist fa5a6e7a-cf3a-4b98-9569-addb479b84bc }
where fa5a6e7a-cf3a-4b98-9569-addb479b84bc - example of UUID
struct vlib_vmbus_addr_t changed to union with UUID described
fields
Added device_config_index_by_vmbus_addr
blacklist_by_vmbus_addr
to enumerate available device configs
hash_key is as_u32[0] field(last 4 bytes of UUID)
Lost of precision against full UUID, but 2^32 is enough
to handle all the devices available
Added is_blacklisted check while creating vnet devices in
order to supress creation of dev if it's blacklisted
Type: feature
Signed-off-by: Vladimir Ratnikov <vratnikov@netgate.com>
Change-Id: Id82611e54fed082190e488c7e5fbe14ecbe5b2ab
|
|
Make it easy to figure out why vpp didn't bind a particular hardware
interface in the most common case: the Linux interface is up.
Type: improvement
Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: I99534dd91e0030601c09171a9fbc9ad45af6bf08
|
|
This change mitigates software faults issued by some versions of the
linux kernel vfio-pci driver when VF PCI BARs are used without setting
the memory enable bit in the PCI configuration. This problem is
mentionned in https://lkml.org/lkml/2020/6/25/628
Change-Id: Idc177be4a5adb6ee467b4dd8f055f133ff267fe1
Type: improvement
Signed-off-by: Mohammed Hawari <mohammed@hawari.fr>
|
|
Type: improvement
Change-Id: Ibc15aa6f75e989b2b7caa9a57e3665b1ffc7cc18
Signed-off-by: Damjan Marion <damarion@cisco.com>
|
|
Type: improvement
Change-Id: I381fc3dec8580208d0e24637d791af69011aa83b
Signed-off-by: Damjan Marion <damarion@cisco.com>
|
|
Type: fix
Change-Id: Iab512ba8c72c9e20aeba2d4265276bcabf095d46
Signed-off-by: Benoît Ganne <bganne@cisco.com>
|
|
Type: improvement
Change-Id: Ic49a43651b80b79fa278e29964da5cb2ead2a818
Signed-off-by: Damjan Marion <damarion@cisco.com>
|
|
Type: fix
Ticket: VPP-1837
Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: I51660e4b02f449bd2db12a8cfd395c6c343d2dee
|
|
On SMP architecture, '/sys/bus/pci/devices/<devices id>/numa_node' file
will return -1 as a valid value if it does not have any NUMA node information.
Using -1 as a valid node id to access data structures will cause memory issue.
Fix the error by setting the value of numa_node to 0 if '/sys/bus/pci/devices/
<devices id>/numa_node' returns -1 and it is a SMP system.
Type: fix
Change-Id: Ib60e79c3656fe5b17e08fd9011122683e8b08b6f
Signed-off-by: Jieqiang Wang <jieqiang.wang@arm.com>
|
|
Type: fix
Change-Id: I6f25d9295b973ab7133071b6dc325ecd86386898
Signed-off-by: Benoît Ganne <bganne@cisco.com>
|
|
When VPP work with dpdk-plugin, linux_vfio_main_t->container_fd is always -1
since it never have chance to run open("/dev/vfio/vfio") to get the fd.
But this lead to a potential issue of VPP, that is, when start VPP without
uio-driver field setup in /etc/vpp/startup.conf, VPP will run to automatical
select uio driver in vlib_pci_bind_to_uio() and the function depend on
iommu_group value to decide to work on vfio or vfio-noiommu mode.
Since in vlib_pci_get_device_info() have the condition container_fd != -1,
so the iommu_group value will be always -1 at this scenario, this caused
that VPP mistake to run with vfio-noiommu driver on intel_iommu=on state.
Actually in order to get iommu_group and iommu_group/name value, no need to
depend on linux_vfio_main_t->container_fd value, so the fix remove the
condition lvm->container_fd != -1, then it can get the correct iommu_group
value.
Type: fix
Change-Id: I3f162fc4971b9a2b8717205f8f3b52e30c5e5b69
Signed-off-by: Yulong Pei <yulong.pei@intel.com>
|
|
If no Linux PCI driver module is loaded, then the driver_name in the PCI
info struct is NULL. This can triggers crash when checking driver name
eg. in vlib_pci_device_open().
Default to "<NONE>" as driver name, which should never match.
Type: fix
Change-Id: I9e69889a7566467bd8220b92bbbaa72ada957257
Signed-off-by: Benoît Ganne <bganne@cisco.com>
|
|
Program received signal SIGSEGV, Segmentation fault.
0x00007ffff4b71de0 in __strncmp_sse42 () from /lib64/libc.so.6
(gdb) up
up
vm=0x7ffff6664d40 <vlib_global_main>, addr=0x7fffb4bec6d0,
ids=0x7fffb31675f0 <avf_pci_device_ids>, handle=0x7fffb4bec594)
at /usr/src/debug/vpp-20.01/src/vlib/linux/pci.c:1250
1250 if (strncmp ("vfio-pci", (char *) di->driver_name, 8) == 0)
(gdb) p di
p di
$1 = (vlib_pci_device_info_t *) 0x7fffb6446164
(gdb) p di->driver_name
p di->driver_name
$2 = (u8 *) 0x0
(gdb)
driver_name may be null. strncmp is not forgiving. Change to use C11 safeC
version.
Type: fix
Signed-off-by: Steven Luong <sluong@cisco.com>
Change-Id: I1777a5966ceee7409d7bde86c30b14dc75534a5a
|
|
The vlib init function subsystem now supports a mix of procedural and
formally-specified ordering constraints. We should eliminate procedural
knowledge wherever possible.
The following schemes are *roughly* equivalent:
static clib_error_t *init_runs_first (vlib_main_t *vm)
{
clib_error_t *error;
... do some stuff...
if ((error = vlib_call_init_function (init_runs_next)))
return error;
...
}
VLIB_INIT_FUNCTION (init_runs_first);
and
static clib_error_t *init_runs_first (vlib_main_t *vm)
{
... do some stuff...
}
VLIB_INIT_FUNCTION (init_runs_first) =
{
.runs_before = VLIB_INITS("init_runs_next"),
};
The first form will [most likely] call "init_runs_next" on the
spot. The second form means that "init_runs_first" runs before
"init_runs_next," possibly much earlier in the sequence.
Please DO NOT construct sets of init functions where A before B
actually means A *right before* B. It's not necessary - simply combine
A and B - and it leads to hugely annoying debugging exercises when
trying to switch from ad-hoc procedural ordering constraints to formal
ordering constraints.
Change-Id: I5e4353503bf43b4acb11a45fb33c79a5ade8426c
Signed-off-by: Dave Barach <dave@barachs.net>
|
|
clib_file_index is 0 if it is not initialized result in
following assertion on deleteing the pci device.
vpp/src/vppinfra/file.h:122 (clib_file_del_by_index) assertion `! pool_is_free (um->file_pool, _e)' fails
This patch fixes the issue by initializing the clib_file_index to -1.
Change-Id: I51d23f18e7ccf3143a4765d05aafc1363a007737
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
|
|
Change-Id: Ifd34aed8692d5acaa370d4976d974ac573e43705
Signed-off-by: Dave Barach <dave@barachs.net>
|
|
If uio_hv_generic is not loaded, then the startup code will
fallback to the older failsafe/tap method of initialization
in DPDK. Therefore don't put out scary message in the log.
Also, reorder startup to avoid manipulating lower device until/unless
uio is going to work.
Change-Id: Ie1cc77b4b5359c04f00a93d01a772eccf3bbab37
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
|
|
VPP supports two DPDK drivers for managing netvsc devices on
Azure/Hyper-V. The new netvsc PMD looks a lot like other PCI-based
PMDs but it requires recently added kernel support (>=4.17). The
older vdev_netvsc is an abstraction that manages the mlx4 VF
and tap device underlying the netvsc interface using the failsafe PMD.
Distros with older kernels (e.g. RHEL/CentOS 7.x) have to use vdev_netvsc.
At startup, netvsc devices are processed and an attempt is made to
initialize them for management by the netvsc PMD. If that fails, then
vlib_vmbus_bind_to_uio() returns early and the device can be initialized
for management by vdev_netvsc.
The operation that is supposed to fail if the netvsc PMD cannot be used
is registration of the netvsc device type ID with the uio_hv_generic
driver. This operation is attempted exactly once so it does not fail
for netvsc devices processed after the first one and they end up in a
state where they cannot be initialized for use by vdev_netvsc.
Only unset uio_new_id_needed if uio_hv_generic registration succeeds.
Change-Id: I6be925d422b87ed24e0f4611304cc3a6b07a34fd
Signed-off-by: Matthew Smith <mgsmith@netgate.com>
|
|
Change-Id: I2cfb81b3c8809d027a3ee5f5f570668e60be08ef
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
|
|
Change-Id: I3bb1d9f83dd08f4b93acd4a281bfec0674e39c2e
Signed-off-by: Damjan Marion <damarion@cisco.com>
|
|
For some reason, GCC 8 in debian is pickier than GCC 8 in ubuntu. It complains
about things in strncpy like this
/home/sluong/vpp/src/vlib/linux/pci.c:485:7: error: ‘strncpy’ output may be
truncated copying 15 bytes from a string of length 255 [-Werror=stringop-truncation]
strncpy (ifr.ifr_name, e->d_name, sizeof (ifr.ifr_name) - 1);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/sluong/vpp/src/vlib/linux/pci.c: At top level:
It also complains similar things in string_test.c
The fix in pci.c is to convert strncpy to use clib_strncpy
The fix in string_test.c is condiational compile the complained code for GCC 8.
Change-Id: Ic9341ca54ed7407210502197a28283bc42c26662
Signed-off-by: Steven Luong <sluong@cisco.com>
|
|
The code that was manipulating interface names with ifreq was
causing warnings about possible truncation and non terminated
strings.
These are warnings only since kernel would allow a interface
name > 15 characters anyway.
Change-Id: I794a94fe310b8568403d4e3523c61d53468a6f02
Reported-by: Burt Silverman <burtms@gmail.com>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
|
|
Doing strncpy(ifr.ifr_name, s, sizeof(ifr.ifr_name)) will cause
a warning about string truncation with GCC 8 (and other tools).
Fix this by using sizeof(ifr.ifr_name) - 1. Also, there is no
need to manually zero the end of the string since the whole
ifr structure is already zeroed by memset.
Change-Id: I9440d602ecdd9f8592b69bab2e77479146d00d76
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
|
|
Change-Id: Ic56ee4ce83b282a5f0f5aed500721fe639b941b3
Signed-off-by: Damjan Marion <damarion@cisco.com>
|
|
This patch adds support for VMBus to the VPP infrastructure.
Since the only device that matters is the netvsc Poll Mode Driver
in DPDK, the infrastructure is much simpler than PCI.
Change-Id: Ie96c897ad9c426716c2398e4528688ce2217419b
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
|
|
Change-Id: Id4f37f5d4a03160572954a416efa1ef9b3d79ad1
Signed-off-by: Dave Barach <dave@barachs.net>
|
|
Change-Id: Iecceffe06a92660976ebb58cd3cbec4be8931db0
Signed-off-by: Damjan Marion <damarion@cisco.com>
|
|
Few devices provide PCI bar region(s) through I/O.
If any such device driver opens I/O "fd" to read and write,
needs to close it, when pci device is going to be deleted.
Change-Id: Iba104e56f76c6bf9ccd27bf2223bad39b1301763
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
|
|
Change-Id: I9d96e7782a12c2e19eacbb75edb1fb450cf33bed
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
|
|
Change-Id: Ic4c46bc733afae8bf0d8146623ed15633928de30
Signed-off-by: Damjan Marion <damarion@cisco.com>
|
|
Change-Id: Ied34720ca5a6e6e717eea4e86003e854031b6eab
Signed-off-by: Dave Barach <dave@barachs.net>
|
|
- logging
- pass vlib_main_t to all APIs
- open vfio container only when needed
Change-Id: I897e53e0af3f91c3a99f0c827401d1c0ec2e478a
Signed-off-by: Damjan Marion <damarion@cisco.com>
|
|
Change-Id: I2779626d745badb63386efcf729da7a094a4f297
Signed-off-by: Haiyang Tan <haiyangtan@tencent.com>
|
|
Change-Id: I21429ce084cfd39af6a9997b4c1e459f5a6ef672
Signed-off-by: Damjan Marion <damarion@cisco.com>
|
|
Change-Id: Iacdff0a5006a0617e3c9559ce7b258f26e256abb
Signed-off-by: Damjan Marion <damarion@cisco.com>
|
|
Change-Id: I4b6cdf95ac694c8408eb6cf3259b335a8148b5aa
Signed-off-by: Damjan Marion <damarion@cisco.com>
|
|
Configure w/ --enable-dlmalloc, see .../build-data/platforms/vpp.mk
src/vppinfra/dlmalloc.[ch] are slightly modified versions of the
well-known Doug Lea malloc. Main advantage: dlmalloc mspaces have no
inherent size limit.
Change-Id: I19b3f43f3c65bcfb82c1a265a97922d01912446e
Signed-off-by: Dave Barach <dave@barachs.net>
|
|
gcc8 introduced a new warning (Wstringop-truncation) which in our case
is being treated as error.
Disabling the warning globally might introduce bugs related to string
truncation which are not desired by the developer (e.g. bug).
Instead, this patch disables the warning only for those occurences
which have been verified to be non-bugs but the desired behaviour as per
developer will.
Change-Id: I0f04ff6b4fad44061e80a65af633fd7e0148a0c5
Signed-off-by: Marco Varlese <marco.varlese@suse.com>
|