Age | Commit message (Collapse) | Author | Files | Lines |
|
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
|
|
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: 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: 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>
|
|
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>
|
|
Change-Id: Id4f37f5d4a03160572954a416efa1ef9b3d79ad1
Signed-off-by: Dave Barach <dave@barachs.net>
|
|
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>
|
|
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>
|
|
Minor bug fixes
CID 183000: double close
CID 180996: dead code
CID 180995: NULL deref
CID 181957: NULL deref
CID 182676: NULL deref
CID 182675: NULL deref
Change-Id: Id35e391c95fafb8cd771984ee8a1a6e597056d37
Signed-off-by: Chris Luke <chrisy@flirble.org>
|
|
Change-Id: Ic83971d8d9d8d0bb90a35932e60761cd728457f3
Signed-off-by: Damjan Marion <damarion@cisco.com>
|
|
Old code was only allowing PCIdevices to be scanned during startup,
now driver can open and close device without restart of vpp.
Change-Id: I1a06511e3f16f896101b43dac2bad420b6e6c35e
Signed-off-by: Damjan Marion <damarion@cisco.com>
|
|
Change-Id: I99cf3e7cc991aa7d32385a155c707a6516516117
Signed-off-by: Damjan Marion <damarion@cisco.com>
|
|
Change-Id: I6df5a01416993c213e06645a6d9b48dfe77c8227
Signed-off-by: Damjan Marion <damarion@cisco.com>
|
|
Change-Id: Iae2ddf93d1705354175e3dcae26b66e6f98a5c32
Signed-off-by: Damjan Marion <damarion@cisco.com>
|
|
Change-Id: Ib94e9e9e9fcdad9cdb0e3402b3de7d78bd644abe
Signed-off-by: Damjan Marion <damarion@cisco.com>
|
|
While comment properly says that only first 64 bytes can be read, actual
code was returning error instead being happy with 64 bytes received.
Change-Id: I09c0d1d5c9fc8e1f6c59c093d81bb1ce1924281b
Signed-off-by: Damjan Marion <damarion@cisco.com>
|
|
Change-Id: Id5c76a529ab9969334207790babcdc420a9c58ad
Signed-off-by: Damjan Marion <damarion@cisco.com>
|
|
Change-Id: I2b8c1ad5c594aeca5dc44647ab8f8061362c9284
Signed-off-by: Damjan Marion <damarion@cisco.com>
|
|
Change-Id: Ib4012ff598698924484525932d041988cc4c63f6
Signed-off-by: Damjan Marion <damarion@cisco.com>
|
|
Change-Id: I8acc5c419b6ad01937c3aecec42801463d4a119a
Signed-off-by: Damjan Marion <damarion@cisco.com>
|
|
Also fixes old ixge driver, so it works with recent physmem changes and
vfio.
Change-Id: Id4be74b34daed47cd281a77eec43d6692340d882
Signed-off-by: Damjan Marion <damarion@cisco.com>
|
|
Change-Id: Iff33694fc42cc3bcc73cf1372339053a6365039c
Signed-off-by: Damjan Marion <damarion@cisco.com>
|
|
This will allow us to use this code in client libraries without vlib.
Change-Id: I8557b752496841ba588aa36b6082cbe2cd1867fe
Signed-off-by: Damjan Marion <damarion@cisco.com>
|
|
Change-Id: Id79d2c2be7a98e15416a537c890a8f2dd6d4464d
Signed-off-by: Damjan Marion <damarion@cisco.com>
|