Update l3fwd example usage and documentation with missing options.
Signed-off-by: Beilei Xing <beilei.xing@intel.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
crypto_statistics array was not big enough for storing
all the possible crypto device statistics, as its size was
RTE_MAX_ETHPORTS, but should be RTE_CRYPTO_MAX_DEVS, leading
this to a potential out-of-bounds issue.
Coverity issue: 120145
Fixes: 387259bd6c ("examples/l2fwd-crypto: add sample application")
Signed-off-by: Slawomir Mrozowicz <slawomirx.mrozowicz@intel.com>
Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Declan Doherty <declan.doherty@intel.com>
Crypto operations are enqueued in the crypto devices
when the crypto device buffers are full (MAX_PKT_BURST),
in order to be more efficient.
The problem is that operations might be stuck in those buffers,
if they never get full, and therefore, those operations
will never be performed.
Therefore, it is necessary to have a buffer flush mechanism,
similar to the one used for flush the TX buffers, so eventually,
all packets received are ciphered and sent out.
Fixes: 387259bd6c ("examples/l2fwd-crypto: add sample application")
Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Plaintexts and ciphertexts are dumped when debugging is enabled,
using TEST_HEXDUMP. For Snow3G and KASUMI, their lengths are in bits,
but TEST_HEXDUMP uses bytes, so lenghts are passed in bytes now.
Fixes: 47df73a1a6 ("app/test: use hexdump if debug log is enabled")
Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Signed-off-by: Deepak Kumar Jain <deepak.k.jain@intel.com>
Since commit f2bb7ae1d2, behavior of rss_fwd_config_setup() changed
and description of this function is wrong now.
Also, there is a type mismatch in a loop.
Fixes: f2bb7ae1d2 ("app/testpmd: handle all Rx queues in RSS setup")
Signed-off-by: Ilya Maximets <i.maximets@samsung.com>
Testpmd can stuck inside do while loop of the flush_fwd_rx_queues()
function. As non-zero packets are returned always by rte_eth_rx_burst()
function when compiled with no optimizations and if input line rate is
high. "do while" loop must exit at one stage to proceed further to
enable packet forwarding and forward the packets. So timer is set to
exit the do while loop after 1 second.
Fixes: af75078f ("first public release")
Signed-off-by: Reshma Pattan <reshma.pattan@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
In testpmd code, device id is used directly to check if bypass
is supported. But APP should not know the details of HW, the NIC
specific info should not be exposed here.
As every bypass API does know if it's supported, no need to check
that at first. So, this patch removes the *bypass_is_supported*.
Suggested-by: Jingjing Wu <jingjing.wu@intel.com>
Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
The older versions of rte_eth_bond_8023ad_conf_get and
rte_eth_bond_8023ad_setup were available in the old way since 2.0 - at
least according to the map file.
But versioning in the code was set to 16.04.
That breaks compatibility checks for 2.0 on that library.
For example with the dpdk abi checker:
http://people.canonical.com/~paelzer/compat_report.html
To fix, version the old symbols on the 2.0 version as they were
initially added to the map file.
See http://people.canonical.com/~paelzer/compat_report.html
Fixes: dc40f17a ("net/bonding: allow external state machine in mode 4")
Signed-off-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
Due to the hierarchy and the demand to keep the base config showing all
options, some config keys end up multiple times in the .config file.
Due to the way the actual config is sourced only the last entry is
important. That can confuse people changing values in .config which
are then ignored.
A suggested solution was to filter for duplicates at the end of the
actual config step which is implemented here.
Signed-off-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
We can now just OR the vfio_enabled sequentially and so adding new VFIO
subsystems (vfio_platform) is possible.
Signed-off-by: Jan Viktorin <viktorin@rehivetech.com>
The module eal_pci_vfio_mp_sync is quite generic so it shouldn't contain the
"pci" string in its name. The internal functions don't need the pci_* prefix.
Signed-off-by: Jan Viktorin <viktorin@rehivetech.com>
The vfio_cfg is a module-global variable and so together with this
variable, it is necessary to move functions:
* pci_vfio_get_group_fd
- renamed to vfio_get_group_fd
- pci_* version removed (no other call in EAL)
* pci_vfio_setup_device
- renamed as vfio_setup_device
* pci_vfio_enable
- renamed as vfio_enable
- generalized to check for a specific vfio driver presence
- pci_* specialization preserved as a wrapper
* pci_vfio_is_enabled
- renamed as vfio_is_enabled
- generalized to check for a specific vfio driver presence
to preserve the semantics of VFIO + PCI
- pci_* specialization preserved as a wrapper
* clear_current_group
- private function, just moved
To stop GCC complaining about "defined but not used", the private
function pci_vfio_get_group_no has been removed entirely.
Signed-off-by: Jan Viktorin <viktorin@rehivetech.com>
The setup logic access the global vfio_cfg variable that will be moved in the
following commits. We need to separate all accesses to this variable to a
general code.
Signed-off-by: Jan Viktorin <viktorin@rehivetech.com>
The pci_vfio_set_iommu_type is not PCI-specific and it is a private function
of the eal_pci_vfio.c. We just rename the function and make it available even
for non-PCI devices.
The pci_vfio_has_supported_extensions is not PCI-specific and it is a private
function of the eal_pci_vfio.c. We just rename the function and make it
available even for non-PCI devices.
The pci_vfio_get_container_fd is not PCI-specific. Move the implementation to
the eal_vfio.c as vfio_get_container_fd. No other code seems to call this
function.
Generalize the pci_vfio_get_group_no to not be PCI-specific. Move the general
implementation to the eal_vfio.c as vfio_get_group_no and leave the original
pci_vfio_get_group_no being a wrapper around this to preserve compilation
issues. The pci_vfio_get_group_no function will be removed later.
Signed-off-by: Jan Viktorin <viktorin@rehivetech.com>
We make the iommu_types public temporarily here until the depending stuff is
refactored. The iommu_types and dma_map functions will be changed to be private
inside the eal_vfio module later.
Signed-off-by: Jan Viktorin <viktorin@rehivetech.com>
This is for target i686-native-linuxapp-gcc and gcc6,
Compilation error is:
In file included from
include/rte_mempool.h:77:0, from
drivers/net/virtio/virtio_rxtx_simple.c:
In function `virtio_xmit_pkts_simple':
include/rte_memcpy.h:551:2: error:
array subscript is above array bounds
rte_mov16((uint8_t *)dst + 1 * 16, (const uint8_t *)src + 1 * 16);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Call stack is as following:
virtio_xmit_pkts_simple
virtio_xmit_cleanup
rte_mempool_put_bulk
rte_mempool_generic_put
__mempool_generic_put
rte_memcpy
The array used as source buffer in virtio_xmit_cleanup (free) is a
pointer array with 32 elements, in 32bit this makes 128 bytes.
in rte_memcpy() implementation, there a code piece as following:
if (size > 256) {
rte_move128(...);
rte_move128(...); <--- [1]
....
}
The compiler traces the array all through the call stack and knows the
size of array is 128 and generates a warning on above [1] which tries to
access beyond byte 128.
But unfortunately it ignores the "(size > 256)" check.
Giving a hint to compiler that variable "size" is related to the size of
the source buffer fixes compiler warning.
Fixes: 863bfb4744 ("mempool: optimize copy in cache")
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Fixes a bug where rte_eth_vhost_get_queue_event would not return enabled
queues after a guest application restart.
Fixes: ee584e9710 ("vhost: add driver on top of the library")
Signed-off-by: Rich Lane <rich.lane@bigswitch.com>
Acked-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
When the specified cores and memory lie on different NUMA socket with
physical NIC, vhost fails to set up Rx queue, and exits without any
hints. This could leads to confusion of users.
This patch fixes it by adding some error messages when calling ether
APIs returns errors.
Suggested-by: Yulong Pei <yulong.pei@intel.com>
Signed-off-by: Jianfeng Tan <jianfeng.tan@intel.com>
Acked-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
There is a logic bug in this code, that could lead to null pointer
dereference when cvq is NULL. Fix this problem by changing logic
&& to logic ||.
>> CID 127480: Null pointer dereferences (FORWARD_NULL)
>> Dereferencing null pointer "cvq".
if (!cvq && !cvq->vq) {
...
}
Coverity issue: 127480
Fixes: 01ad44fd37 ("net/virtio: split Rx/Tx queue")
Signed-off-by: Jianfeng Tan <jianfeng.tan@intel.com>
Acked-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
This patch explains current virtio PMD Rx/Tx callbacks, to help understand
what's the difference, and how to enable the right ones.
Signed-off-by: Zhihong Wang <zhihong.wang@intel.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
Acked-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
When use strcpy() to copy string with length exceeding the last
parameter of strcpy(), it may lead to the destination string
unterminated.
We replaced strncpy with snprintf to make sure it's NULL terminated.
Coverity issue: 127476
Fixes: ce2eabdd43 ("net/virtio-user: add virtual device")
Signed-off-by: Jianfeng Tan <jianfeng.tan@intel.com>
Acked-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
The return value by rte_kvargs_parse is not free(d), which leads
to memory leak.
Coverity issue: 127482
Fixes: ce2eabdd43 ("net/virtio-user: add virtual device")
Signed-off-by: Jianfeng Tan <jianfeng.tan@intel.com>
Acked-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
When parsing /proc/self/maps to get hugepage information, the string
was being copied with strcpy(), which could, theoretically but in fact
not possiblly, overflow the destination buffer. Anyway, to avoid the
false alarm, we replaced strncpy with snprintf for safely copying the
strings.
Coverity issue: 127484
Fixes: 6a84c37e39 ("net/virtio-user: add vhost-user adapter layer")
Signed-off-by: Jianfeng Tan <jianfeng.tan@intel.com>
Acked-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
When return values of function calls are not checked, Coverity will
report errors like:
if (rte_kvargs_count(kvlist, VIRTIO_USER_ARG_PATH) == 1)
>>> CID 127477: (CHECKED_RETURN)
>>> Calling "rte_kvargs_process" without checking return value
(as is done elsewhere 25 out of 30 times).
rte_kvargs_process(kvlist, VIRTIO_USER_ARG_PATH,
&get_string_arg, &path);
Coverity issue: 127477, 127478
Fixes: ce2eabdd43 ("net/virtio-user: add virtual device")
Fixes: 6a84c37e39 ("net/virtio-user: add vhost-user adapter layer")
Signed-off-by: Jianfeng Tan <jianfeng.tan@intel.com>
Acked-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
On some older systems, such as SUSE 11, the compiling error shows
as:
.../dpdk/drivers/net/virtio/virtio_user/virtio_user_dev.c:67:22:
error: ‘O_CLOEXEC’ undeclared (first use in this function)
The fix is to use EFD_CLOEXEC, which is defined in sys/eventfd.h,
instead of O_CLOEXEC which needs _GNU_SOURCE defined on some old
systems.
Fixes: 37a7eb2ae8 ("net/virtio-user: add device emulation layer")
Signed-off-by: Jianfeng Tan <jianfeng.tan@intel.com>
Acked-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
With current config structure, all configuration parameters put into
common_base with a default value, and overwritten in environment file
if required, CONFIG_RTE_VIRTIO_USER is missing in common_base.
This fix is simple, by adding CONFIG_RTE_VIRTIO_USER=n as the default
macro value.
Fixes: ce2eabdd43 ("net/virtio-user: add virtual device")
Reported-by: Ferruh Yigit <ferruh.yigit@intel.com>
Signed-off-by: Jianfeng Tan <jianfeng.tan@intel.com>
Acked-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Fix potential memory leak raised by Coverity.
>>> Variable "vsocket" going out of scope leaks the storage it
>>> points to.
Coverity issue: 127483
Fixes: e623e0c6d8 ("vhost: add reconnect ability")
Reported-by: John McNamara <john.mcnamara@intel.com>
Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Avoid submitting doorbell when:
* no packets have been submitted to TX
* no free resources have been submitted while RX
Sending doorbell without actual work to be performed by device
violates ENA specification and can lead to unpredictable behavior.
Fixes: 1173fca25a ("ena: add polling-mode driver")
Signed-off-by: Alexander Matushevsky <matua@amazon.com>
Signed-off-by: Jan Medala <jan@semihalf.com>
enic_set_mac_address() meant to remove the old MAC address before
setting the new one, but accidentally tried removing the new MAC
address before setting the new MAC address.
Fixes: fefed3d1e6 ("enic: new driver")
Signed-off-by: Nelson Escobar <neescoba@cisco.com>
Reviewed-by: John Daley <johndale@cisco.com>
enic_disable() removed the MAC address when a port was shut down but
enic_enable() didn't add the MAC address back when the port was
started again. Move where we set the MAC address for the adapter from
enic_setup_finish() to a enic_enable() so that port restarting works
properly.
Fixes: fefed3d1e6 ("enic: new driver")
Signed-off-by: Nelson Escobar <neescoba@cisco.com>
Reviewed-by: John Daley <johndale@cisco.com>
This patch adds support for extended statistics for BNX2X PMD.
Signed-off-by: Rasesh Mody <rasesh.mody@qlogic.com>
Acked-by: Remy Horton <remy.horton@intel.com>
This patch adds support for extended statistics for QEDE PMD.
Signed-off-by: Rasesh Mody <rasesh.mody@qlogic.com>
Acked-by: Remy Horton <remy.horton@intel.com>
Fixed issue could occur when Mbuf starvation happens in a middle of
reception of a segmented packet. In such a situation, the PMD has to
release all segments of that packet. The end condition was wrong
causing it to free an Mbuf still handled by the NIC.
Fixes: 9964b965ad ("net/mlx5: re-add Rx scatter support")
Reported-by: Yongseok Koh <yskoh@mellanox.com>
Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
In mlx5 rx function, the packet_type and ol_flags mbuf fields are not
properly initialized when no rx offload feature is enabled (checksum, l2
tun checksum, vlan_strip, crc). Thus, these fields can have a value
different of 0 depending on their value when the mbuf was freed.
This can result in an incorrect application behavior if invalid
ol_flags/ptype are set, or memory corruptions if IND_ATTACHED_MBUF is
set in ol_flags.
Fixes: 081f7eae24 ("mlx5: process offload flags only when requested")
Signed-off-by: Maxime Leroy <maxime.leroy@6wind.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
The enic PMD was using the same variables in the enic structure to
track two different things. Initially rq_count, wq_count, cq_count,
and intr_count were set to the values obtained from the VIC adapters
as the maximum resources allocated on the VIC, then in
enic_set_vnic_res(), they were set to the counts of resources actually
used, discarding the initial values. The checks in enic_set_vnic_res()
were technically incorrect if it is called more than once on a port,
which happens when using bonding, but were harmless in practice as the
checks couldn't fail on the second call.
The enic rx-scatter patch misunderstood the subtleties of
enic_set_vnic_res(), and naively added a multiply by two to the
rq_count check. This resulted in the rq_count check failing when
enic_set_vnic_res() was called a second time, ie when using bonding.
This patch adds new variables to the enic structure to track the
maximum resources the VIC is configured to provide so that the
information isn't later lost and calls to enic_set_vnic_res() do
the expected thing.
Fixes: 856d7ba7ed ("net/enic: support scattered Rx")
Signed-off-by: Nelson Escobar <neescoba@cisco.com>
Update the 'High Performance of Small Packets on 40G NIC' section of the
Getting Started Guide (GSG) as the firmware version referenced for a NIC
using the i40e driver was version 4.2.5 which is no longer validated.
Instruct users to consult release notes for current validated firmware
versions.
Signed-off-by: Ian Stokes <ian.stokes@intel.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
When calling i40e_flowtype_to_pctype in i40e_get_hash_filter_global_config
and i40e_set_hash_filter_global_config, function i40e_flowtype_to_pctype
will be possibly make an out-of-bounds access, because size of the array
is 15. So check the flow type is valid before calling
i40e_flowtype_to_pctype.
In the process fix other occurances of the same problem
Coverity issue: 37793, 37794
Fixes: 782c8c92f1 ("i40e: add hash configuration")
Fixes: f2b2e2354b ("i40e: split function for hash and flow director input")
Fixes: 98f0557076 ("i40e: configure input fields for RSS or flow director")
Signed-off-by: Beilei Xing <beilei.xing@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Null-checking vsi suggests that it may be null, but it
has been dereferenced before null-checking. So move the
check to before the assignment statement using the pointer.
Coverity issue: 119265, 119266
Fixes: d0a349409b ("i40e: support AQ based RSS config")
Fixes: 647d1eaf75 ("i40evf: support AQ based RSS config")
Signed-off-by: Beilei Xing <beilei.xing@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
The condition, "(pf->flags | I40E_FLAG_VMDQ)" will always be true,
regardless of the value of the flags operand, because I40E_FLAG_VMDQ
is 4ULL - meaning at least one bit will always be set in the result.
That will cause log error when VMDq is disabled.
Since the original intent behind the condition is to check if VMDq
is enabled, fix the code by changing "|" to "&".
Coverity issue: 13219, 13221
Fixes: 4805ed59e9 ("i40e: enhance mac address operations")
Signed-off-by: Beilei Xing <beilei.xing@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Currently we are wrongly setting HWRM_CFA_L2_SET_RX_MASK_INPUT_MASK_MCAST
flag in bnxt_hwrm_cfa_l2_set_rx_mask() which is preventing promiscuous
and multicast promiscuous settings from working correctly.
This patch fixes it.
Fixes: 244bc98b0d ("net/bnxt: set L2 Rx mask")
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Memory zones should be freed using the proper memzone_free function not
rte_free which is for malloc calls.
After allocating memzone it's required to zeroize memory in it, so do so
before storing the handle for later freeing.
Fixes: 9ba7981ec9 ("ena: add communication layer for DPDK")
Signed-off-by: Alexander Matushevsky <matua@amazon.com>
Signed-off-by: Jakub Palider <jpa@semihalf.com>
Signed-off-by: Jan Medala <jan@semihalf.com>
While allocating (coherent) memory, get information about calling node Id
and pass that as parameter when reserving a memzone.
Signed-off-by: Alexander Matushevsky <matua@amazon.com>
Signed-off-by: Jakub Palider <jpa@semihalf.com>
Signed-off-by: Jan Medala <jan@semihalf.com>
Depending on HW revision readless communcation between host and device
may be unavailable. In that case prevent PMD from setting up readless
communication mechanism.
"readless" refers to ability to read ENA registers without actually
issuing read request from host (x86). Instead, host programs 2 registers
on the device that triggers a DMA from device to host and reports a
register value. However, this functionality is not going to be available
in all types of devices. The decision if this mode is supported or not,
is taken from revision_id in pci configuration space.
Signed-off-by: Alexander Matushevsky <matua@amazon.com>
Signed-off-by: Jakub Palider <jpa@semihalf.com>
Signed-off-by: Jan Medala <jan@semihalf.com>