aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/dpdk/device/init.c
AgeCommit message (Collapse)AuthorFilesLines
2018-10-24dpdk: fix hugepage pre-allocDamjan Marion1-1/+2
Change-Id: I88577615bfd3cddca834a7b881979ab32bfd5574 Signed-off-by: Damjan Marion <damarion@cisco.com>
2018-10-24vppinfra: autodetect default hugepage sizeDamjan Marion1-3/+5
Change-Id: I5ff713ad0b254c74c5622e3b9425cca365b5ee97 Signed-off-by: Damjan Marion <damarion@cisco.com>
2018-10-23dpdk: support 18.11 changes to CRC flagsStephen Hemminger1-7/+7
In DPDK 18.11 the device flags for keeping/stripping CRC flags has changed. The old strip flag is gone, and replaced by a CRC keep flag. Change-Id: Iaa162854862a2a0855b418ee8029383fc116d3a2 Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2018-10-23c11 safe string handling supportDave Barach1-2/+2
Change-Id: Ied34720ca5a6e6e717eea4e86003e854031b6eab Signed-off-by: Dave Barach <dave@barachs.net>
2018-10-22vlib: pci improvementsDamjan Marion1-2/+3
- 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>
2018-10-22vppinfra: use log2 page size in hugepage functionsDamjan Marion1-1/+1
Change-Id: Ibec32c6df32f4cd9889d378e244f170c93ad295b Signed-off-by: Damjan Marion <damarion@cisco.com>
2018-10-20dpdk: add netvsc PMDStephen Hemminger1-0/+33
Teach DPDK plugin about the netvsc Poll Mode Driver. The speed of the Netvsc device matches the speed of the external port on the underlying vswitch. Therefore 1G, 10G, 25G, 56G and even 100G are possible. Change-Id: I14ab6907b7d8d350b63a083409d45fb9c348a364 Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2018-10-15dpdk: only look at PCI information on PCI devicesStephen Hemminger1-1/+2
The rte_device is use as a base type of all DPDK devices. It is not valid to use container_of to find PCI information unless the bus of the rte_device is pci. Otherwise, the pointer is looking at some other data, which may or may not be zero. This change introduces a helper function to get rte_pci_device pointer. If device is on PCI bus it returns pointer to rte_pci_device info, otherwise it returns NULL. Change-Id: Ia7446006bb93a7a54844969f3b3dd3b918890dfd Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2018-09-24Trivial: Clean up some typos.Paul Vinciguerra1-2/+2
Change-Id: I085615fde1f966490f30ed5d32017b8b088cfd59 Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
2018-09-19dpdk: mask and warn if rx/tx offload is not availableDamjan Marion1-24/+7
Warning messsage is displayed in system log: vpp# show log 1970/ 1/ 1 01:00:01:198 warn dpdk unsupported rx offloads requested on port 0: scatter Change-Id: I40021066daf2d37ca5233e3adce55e412f0d3932 Signed-off-by: Damjan Marion <damarion@cisco.com>
2018-09-18disable scatter/gather for ENA with DPDK 18.08Matthew Smith1-1/+5
The scatter/gather rxmode flag was set for ENA when building against DPDK >= 18.08. ENA does not support this, so disable it. It looks like enabling it was a copy/paste error. Also, after offloads are adjusted based on whether "no-multi-seg" is set, those configurations are overwritten by copying port_conf_template over the port config. That should only happen for versions of DPDK older than 18.08 because 18.08 and newer make changes directly on the port config instead of making changes to the template. Make the clib_memcpy() conditional on the DPDK version being less than 18.08. After doing so, compiler errors complain about port_conf_template being declared but not used, so make it's declaration conditional. Change-Id: If81980d71c379a565b51dd700b953f8c811a8703 Signed-off-by: Matthew Smith <mgsmith@netgate.com>
2018-09-10dpdk-plugin: do not request SCTP offload, some cards do not support it while ↵Andrew Yourtchenko1-2/+2
supporting TCP/UDP The DPDK plugin sets all of the offload flags, which may cause an initialization failure on the NICs that do not support SCTP offload. The VPP code does not deal with the SCTP offload at the moment at all, so after discussing with Damjan, we agreed the best approach to fix the issue is to not request the SCTP offload. The output of "show hardware" for the NIC in question before this patch: Name Idx Link Hardware GigabitEthernet1/0/0 1 down GigabitEthernet1/0/0 Ethernet address 00:e0:67:09:90:4b Intel 82540EM (e1000) carrier down flags: pmd pmd-init-fail maybe-multiseg tx-offload intel-phdr-cksum rx queues 1, rx desc 1024, tx queues 1, tx desc 1024 cpu socket 0 Errors: rte_eth_dev_configure[port:0, errno:-22]: Unknown error -22 And the excerpt from "show log": 1970/ 1/ 1 00:00:00:739 notice dpdk Ethdev port_id=0 requested Tx offloads 0x1c doesn't match Tx offloads capabilities 0xf in rte_eth_dev_configure() Change-Id: I159d65c02fc3f044441972205f1f0ac08e52050c Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
2018-09-03Deprecate old buffer replication schemeDamjan Marion1-3/+0
Change-Id: I1f54b994425c58776e1445c8d9fe142e7a644d3d Signed-off-by: Damjan Marion <damarion@cisco.com>
2018-08-21VPP-1268: Add option for memory channels DPDK usesJessica Tallon1-0/+2
This adds a `num-mem-channels` option for DPDK enabling support for choosing the number of memory channels used. Change-Id: I1663dd866ac60592b6dd02261af66d87c64acdb1 Signed-off-by: Jessica Tallon <tsyesika@igalia.com>
2018-08-16dpdk: fix rss hash function handlingDamjan Marion1-1/+11
DPDK 18.08 verifies if all set bits are supported and fails if not.... Change-Id: Ia87242fcda11147dff3bebe2e2bef32f0a8891fb Signed-off-by: Damjan Marion <damarion@cisco.com>
2018-08-13dpdk: support for DPDK 18.08Damjan Marion1-23/+60
Change-Id: If1b93341c222160b9a08f127620c024620e55c37 Signed-off-by: Damjan Marion <damarion@cisco.com>
2018-07-19dpdk: fix Mellanox Connect-X3 VF IDMatthew Smith1-1/+1
Fix a typo from previous patch. Change 0x104 to 0x1004. Change-Id: I82230a8a0ec01567eb1d4bc12ac02062c2a98347 Signed-off-by: Matthew Smith <mgsmith@netgate.com>
2018-07-19dpdk: set log write fd to non-blockingMatthew Smith1-7/+15
If a PMD writes too many log messages using rte_vlog(), the pipe for logging can fill and then rte_vlog() will block on fflush() while it waits for something to read from the other side of the pipe. That will never happen since the process node that would read the other side of the pipe runs in the same thread. Set the write fd to non-blocking before the call to rte_openlog_stream(). If the pipe is full, calls to write() or fflush() will fail but execution will continue. Change-Id: I0e5d710629633acda5617ff29897d6582c255d57 Signed-off-by: Matthew Smith <mgsmith@netgate.com>
2018-07-19dpdk: add device IDs for Mellanox ConnectX-3Matthew Smith1-1/+6
Recognize the PF and VF device IDs for the Mellanox adapter used on Azure. Change-Id: Ic7b36b37ac93db2b696354ffe6fa2b6d62ee3801 Signed-off-by: Matthew Smith <mgsmith@netgate.com>
2018-07-18DPDK: coverity scan warningsMarco Varlese1-4/+2
This patch addresses the coverity scan warnings reported for the DPDK plugin. Change-Id: Ie7ac7ffcf4a6c63245eae0f9910a193ab1e318a8 Signed-off-by: Marco Varlese <marco.varlese@suse.de>
2018-07-13Add QEDE poll mode driver (librte_pmd_qede)Igor Mikhailov (imichail)1-3/+4
The driver implements Cavium QLogic FastLinQ QL4xxxx 10G/25G/40G/50G/100G Intelligent Ethernet Adapters (IEA) and Converged Network Adapters (CNA) (doc/guides/nics/qede.rst) Change-Id: If17e8cb572eb8c0585085be1c7cfdfa159eb6e68 Signed-off-by: Igor Mikhailov (imichail) <imichail@cisco.com>
2018-07-10Remove unused variablesIgor Mikhailov (imichail)1-4/+0
Change-Id: If4da80c7eefe55905594eaaba0946d75f0892da5 Signed-off-by: Igor Mikhailov (imichail) <imichail@cisco.com>
2018-06-21VPP-1042: Fix the DPDK no-hugetbl flagsJessica Tallon1-5/+8
Change-Id: I7c611d3fa7fabe82294fc22a61d5a3927a2da39d Signed-off-by: Jessica Tallon <tsyesika@igalia.com>
2018-06-21configurable per-dispatch-cycle sleepDave Barach1-3/+0
Workaround for lack of driver interrupt support. Also quite handy for home gateway, laptop/vagrant, other use-cases not requiring maximum vectors/second for proper operation. Change-Id: Ifc4b98112450664beef67b89ab8a6940a3bf24b5 Signed-off-by: Dave Barach <dave@barachs.net>
2018-06-21FastLinQ QL41000 Series PCI vendor and device idsIgor Mikhailov (imichail)1-0/+3
Change-Id: I23caebf602e3e6ff45fdec106a0da88f6de7a284 Signed-off-by: Igor Mikhailov (imichail) <imichail@cisco.com>
2018-06-12MTU assigning to itself (Coverity)Ole Troan1-4/+0
Change-Id: Iee8de25ab3c68ae3698c79852195dc336050914c Signed-off-by: Ole Troan <ot@cisco.com>
2018-06-11MTU: Software interface / Per-protocol MTU supportOle Troan1-10/+5
This patch separates setting of hardware interfaec and software interface MTU. Software MTU is L2 payload MTU (i.e. not including L2 header). Per-protocol MTU for IPv4, IPv6 and MPLS can also be set. Currently only IP4, IP6 are enabled in adjacency / rewrite code. Documentation in src/vnet/MTU.md Change-Id: Iee2fd6f0bbc8210748dd8e073ab9fab87d323690 Signed-off-by: Ole Troan <ot@cisco.com>
2018-06-07dpdk: fix interface naming issueDamjan Marion1-2/+9
... introduced with dpdk 18.05 support patch Change-Id: Idf2283888f81d7652599651c0d65476e451f9343 Signed-off-by: Damjan Marion <damarion@cisco.com>
2018-06-07dpdk: failsafe PMD initialization codeRui Cai1-0/+25
Added code to initialize failsafe PMD This is part of initial effort to enable vpp running over dpdk on failsafe PMD in Microsoft Azure(4/4). Change-Id: Ia2469c7087ca4b5c7881dfb11ec5c4fcebaa1d04 Signed-off-by: Rui Cai <rucai@microsoft.com>
2018-06-07Add support for DPDK 18.05Damjan Marion1-10/+36
Change-Id: I205932bc727c990011bbbe1dc6c0cf5349d19806 Signed-off-by: Damjan Marion <damarion@cisco.com>
2018-06-04Configure or deduce CLIB_LOG2_CACHE_LINE_BYTES (VPP-1064)Dave Barach1-0/+2
Added configure argument "--with-log2-cache-line-bytes=5|6|7|auto" AKA 32, 64, or 128 bytes, or use the inferred value from the build host. produces build-xxx/vpp/vppinfra/config.h, which .../src/vppinfra/cache.h Kernels which implement the following pseudo-file (aka x86_64) are easy: /sys/devices/system/cpu/cpu0/cache/index0/coherency_line_size Otherwise, extract the cpuid from /proc/cpuinfo and map it to the cache line size. Change-Id: I7ff861e042faf82c3901fa1db98864fbdea95b74 Signed-off-by: Dave Barach <dave@barachs.net> Signed-off-by: Nitin Saxena <nitin.saxena@cavium.com>
2018-05-31dpdk: Decoupling the meaning of xd->device_index in dpdk_pluginRui Cai1-13/+24
Prior to the change, dpdk plugin assumes xd->device_index is used both as index for internal dpdk_main->devices array and DPDK port index to call into DPDK APIs. However, when running on top of Failsafe PMDs, DPDK port index range may no longer be contiguous (as noted: http://dpdk.org/ml/archives/dev/2018-March/092375.html for related changes in DPDK). Because this, dpdk plugin can no longer iterate through all available DPDK ports with a for 0->rte_eth_dev_count() loop and the assumption of device_index no longer holds. This is part of initial effort to enable vpp running over dpdk on failsafe PMD in Microsoft Azure(3/4). Change-Id: I416fd80f2d40e12e139f8f3492814da98343eae7 Signed-off-by: Rui Cai <rucai@microsoft.com>
2018-05-30vppinfra: explicitely state for signed types that they are signedDamjan Marion1-2/+2
This fixes some compilation warnings with clang on AArch64. Change-Id: Idb941944e3f199f483c80e143a9e5163a031c4aa Signed-off-by: Damjan Marion <damarion@cisco.com>
2018-05-30dpdk: rename port_id to *_instance_numDamjan Marion1-5/+5
port_id be used for dpdk port_id Change-Id: Ia7d8cdc5dec2ad658c11f9c0f3ef8005a470ac3c Signed-off-by: Damjan Marion <damarion@cisco.com>
2018-05-29dpdk: Add PMD type for Cavium LiquidIO II CN23XXchuhong yao1-0/+7
1、Adding PMD type for support Cavium LiquidIO II CN23XX NIC; 2、Our company is using VPP + DPDK +Cavium LiquidIO II CN23XX NIC, Unfortunately, the latest VPP code does not support Cavium LiquidIO II CN23XX pci. So I increased the PMD type to support LiquidIO NIC, and can run normally, we most subsequent projects are based on VPP + DPDK + Cavium LiquidIO II CN23XX NIC model, so I hope VPP team can adopt this requirement, thanks a lot. Change-Id: I604ae444d69b37c2e26962bfe4ccdfe983b75041 Signed-off-by: chuhong yao <ych@panath.cn>
2018-05-26dpdk: enable RX for no-multi-segZhiyong Yang1-0/+5
The option no-multi-seg doesn't take effect for RX since MTU which is too large is passed to DPDK lib, Which causes PMDs are running XXX_scattered_rx function. The patch fixes the issue. Change-Id: I91a6fb23fd118e872c8a52a6c35c36a86cb2c02b Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com>
2018-05-21dpdk:enable flow director perfect modeEyal Bari1-3/+0
when flows are enabled on the device Change-Id: I971764988d5a9e7078468f627205b3fa60736263 Signed-off-by: Eyal Bari <ebari@cisco.com>
2018-05-16dpdk: fix rte_eth_dev_set_mtu callsites to use same mtu valueRui Cai1-1/+1
During dpdk_lib_init, it calculates MRU and MTU and later calls rte_eth_dev_set_mtu with calculated MTU value. However, dpdk_device_setup calls rte_eth_dev_set_mtu with hi->max_packet_bytes, which is set to be MRU value in dpdk_lib_init earlier. Most of the time, MRU != MTU in dpdk_lib_init and it looks like hi->max_packet_bytes is treated as MTU in other parts of vpp codebase. Therefore, dpdk_lib_init should be consistent and use MTU instead of MRU for hi->max_packet_bytes. Change-Id: I23ff2a6cd45d6bc819b6f64d5f0fc0490b8a44de Signed-off-by: Rui Cai <rucai@microsoft.com>
2018-05-11dpdk: fix Unknown interface with Mellanox NICSteve Shin1-1/+1
When port_type_from_speed_capa() is called before the port link update isn't completed, xd->port_type becomes VNET_DPDK_PORT_TYPE_UNKNOWN. This happens with Mellanox NIC without lsc interrupt. Calling rte_eth_link_get before getting dev_info will ensure the link state is up-to-date. Change-Id: I83a59654778eb4bf0c65a4a4e225a326227b9641 Signed-off-by: Steve Shin <jonshin@cisco.com>
2018-05-10vnet: device flow offload infraDamjan Marion1-0/+8
Change-Id: Ibea4a96bdec5e368301a03d8b11a0712fa0265e0 Signed-off-by: Damjan Marion <damarion@cisco.com>
2018-05-09dpdk: tx code reworkDamjan Marion1-10/+0
Change-Id: Ifea9c772e8784642433b92091f5769eb9ec06890 Signed-off-by: Damjan Marion <damarion@cisco.com>
2018-04-25dpdk: complete rework of the dpdk-input nodeDamjan Marion1-19/+9
Change-Id: If174d189de40e6f9ffae99997bba93a2519d9fda Signed-off-by: Damjan Marion <damarion@cisco.com>
2018-04-18dpdk: improve loggingDamjan Marion1-22/+66
- use of vlib_log for non-dataplane logging - redirect of dpdk logs trough unix pipe into vlib_log - "show dpdk physmem" cli Change-Id: I5da70f9c130273072a8cc80d169df31fc216b2c2 Signed-off-by: Damjan Marion <damarion@cisco.com>
2018-04-18dpdk: resurrect removed code [VPP-1245]Steven1-0/+4
https://gerrit.fd.io/r/#/c/7701/ accidentally removed 3 lines of code in dpdk/device/init.c which were added by https://gerrit.fd.io/r/#/c/7826/ case VNET_DPDK_PMD_VHOST_ETHER: xd->port_type = VNET_DPDK_PORT_TYPE_VHOST_ETHER; break; Those lines were needed to recognize vhost-user interface which is created via vdev command in dpdk and display VhostEthernet. Without them, UnknownEthernet is displayed. Change-Id: I6d7ee6aecc6a415fbb7308595d515649475bcd5f Signed-off-by: Steven <sluong@cisco.com>
2018-04-13Revert "MTU: Setting of MTU on software interface (instead of hardware ↵Damjan Marion1-14/+14
interface)" This reverts commit 70083ee74c3141bbefb185525315f1b34497dcaa. Reverting as this patch is causing following crash: 0: /home/damarion/cisco/vpp3/build-data/../src/vnet/devices/devices.h:131 (vnet_get_device_input_thread_index) assertion `queue_id < vec_len (hw->input_node_thread_index_by_queue)' fails Aborted Change-Id: Ie2a365032110b1f67be7a9d832885b9899813d39 Signed-off-by: Damjan Marion <damarion@cisco.com>
2018-04-13MTU: Setting of MTU on software interface (instead of hardware interface)Ole Troan1-14/+14
Change-Id: I98bd454a761a1032738a21edeb0fe847e801f901 Signed-off-by: Ole Troan <ot@cisco.com>
2018-03-22VPP-1204: Fix coverity warningDave Barach1-2/+5
Change-Id: Iacb32e6e855f7b77108154d956ef27ee141bbde0 Signed-off-by: Dave Barach <dave@barachs.net>
2018-03-09Coordinate known Ethernet speeds with Linux kernel and DPDKLee Roberts1-0/+23
Linux kernel and DPDK recognize the following Ethernet speeds: 10M, 100M, 1G, 2.5G, 5G, 10G, 20G, 25G, 40G, 50G, 56G and 100G. Add consistent Ethernet speeds to VPP. Change-Id: I4cfcf378fb34425c1206db5aa2f6bdcc66e0a6ab Signed-off-by: Lee Roberts <lee.roberts@hpe.com>
2018-02-26vnet: add 25G interface speed flagDamjan Marion1-0/+6
Change-Id: I1d3ede2b043e1fd4abc54f540bb1d3ac9863016e Signed-off-by: Damjan Marion <damarion@cisco.com>
2018-02-23Disable scatter-gather for ENAMatthew Smith1-0/+1
ENA doesn't support scatter-gather. The PMD started failing rte_eth_dev_rx_queue_config() in DPDK 18.02 if the flag to enable it is set. Turn the flag off in dpdk_lib_init(). Change-Id: Ifdd9f188c89b46efe82412c75fb935a92436da1c Signed-off-by: Matthew Smith <mgsmith@netgate.com>