summaryrefslogtreecommitdiffstats
path: root/src/plugins/dpdk/device/device.c
AgeCommit message (Collapse)AuthorFilesLines
2022-01-05dpdk: remove "convenience" varsDamjan Marion1-4/+3
It is actually longer and slower... Type: refactor Change-Id: I0f126d4cdb13ecc60a2d370409f23820d7f7eb72 Signed-off-by: Damjan Marion <damarion@cisco.com>
2021-11-05dpdk: remove dead codeDamjan Marion1-4/+1
Type: refactor Change-Id: I76ccf8970ebb3f180ce745d8b515c5e0724784d6 Signed-off-by: Damjan Marion <damarion@cisco.com>
2021-09-16dpdk: fix checksum offloadFlorin Coras1-2/+1
Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I89fb738903ee74ffcb7c77a041391f0388df6991
2021-09-16dpdk: add support for outer udp and ipv4 checksumsMohsin Kazmi1-7/+31
Type: improvement Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com> Change-Id: I10141033030342881298d70742fa5bdea402b4c9
2021-07-15misc: replace CLIB_PREFETCH with clib_prefetch_{load,store}Damjan Marion1-5/+5
Type: refactor Change-Id: Id10cbf52e8f2dd809080a228d8fa282308be84ac Signed-off-by: Damjan Marion <damarion@cisco.com>
2021-05-10dpdk: do not crash when failing to bring interface upBenoît Ganne1-5/+9
If dpdk device starts failed for some reason, we should not try to get stats and the interface must remain down. Type: fix Change-Id: I0079f89d3b43a9b47553991347da8ed4ce6ede8d Signed-off-by: Benoît Ganne <bganne@cisco.com>
2021-05-06vlib: fix the offload flags sizeMohsin Kazmi1-1/+2
Type: fix Change-Id: I433fe3799975fe3ba00fa30226f6e8dae34e88fc Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
2021-05-05vlib: move offload flags to 1st cacheline in vlib_buffer_tMohsin Kazmi1-1/+1
Type: improvement Some tests i.e. ipsec see performance regression when offload flags are moved to 2nd cacheline. This patch moves them back to 1st cacheline. Change-Id: I6ead45ff6d2c467b0d248f409e27c2ba31758741 Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
2021-05-01vlib: refactor trajectory trace debug featureBenoît Ganne1-9/+0
trajectory trace has been broken for a while because we used to save the buffer trajectory in a vector pointed to in opaque2. This does not work well when opaque2 is copied (eg. because of a clone) as 2 buffers end up sharing the same vector. This dedicates a full cacheline in the buffer metadata instead when trajectory is compiled in. No dynamic allocation, no sharing, no tears. Type: refactor Change-Id: I6a028ca1b48d38f393a36979e5e452c2dd48ad3f Signed-off-by: Benoît Ganne <bganne@cisco.com>
2021-03-18dpdk: don't mask interrupts for some driversMohammed Hawari1-2/+19
It is well known that for some NICs, masking interrupts results in delaying desc writebacks, which breaks poll mode. This fix introduces an "int-unmaskable" dpdk device flag to identify such devices (typically Intel FVL). For such devices, interrupts are masked by a call to file_update(...,UNIX_FILE_UPDATE_DELETE) instead of rte_eth_dev_rx_intr_disable (...) Change-Id: Ifbc701aebe8572319b7aae19382bd683a47fc3cf Type: fix Fixes: 19ff0c3699342b512c03362b3815df684a661f49 Signed-off-by: Mohammed Hawari <mohammed@hawari.fr>
2021-03-15dpdk: implement interrupt modeMohammed Hawari1-0/+20
Change-Id: I6ababc99ecf559327a4370914580c98d32680175 Type: feature Signed-off-by: Mohammed Hawari <mohammed@hawari.fr>
2021-02-15vlib: refactor checksum offload supportMohsin Kazmi1-12/+9
Type: refactor This patch refactors the offload flags in vlib_buffer_t. There are two main reasons behind this refactoring. First, offload flags are insufficient to represent outer and inner headers offloads. Second, room for these flags in first cacheline of vlib_buffer_t is also limited. This patch introduces a generic offload flag in first cacheline. And detailed offload flags in 2nd cacheline of the structure for performance optimization. Change-Id: Icc363a142fb9208ec7113ab5bbfc8230181f6004 Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
2021-01-21dpdk: do not use TSO for small packetsSomnath Kotur1-2/+5
Asking for TSO (TCP Segmentation Offload) on packets that are already smaller than (headers + MSS) does not make sense and may not work on some HW. Fix to only set the TSO flag when a segmentation offload is really required, i.e when packet is large enough. Type: improvement Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com> Change-Id: I7830ae8474581c8e518fb4910f7863e10346bb62 Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com>
2020-12-14misc: refactor clib_bitmap_foreach macroDamjan Marion1-2/+2
Type: refactor Change-Id: I077110e1a422722e20aa546a6f3224c06ab0cde5 Signed-off-by: Damjan Marion <damarion@cisco.com>
2020-10-21dpdk: Disable VLAN filtering for VLAN sub-interface in i40e driverDimitrios Markou1-2/+2
When creating a VLAN sub-interface on a Fortville i40e DPDK VF, the data plane does not work properly. Enabling vlan filter offload overrides the VLAN strip offload setting to on. The VLAN strip offload must be disabled for VPP VLAN sub-interfaces to work. Ticket: https://jira.fd.io/browse/VPP-1933 Type: fix Signed-off-by: Dimitrios Markou <dimitrios.markou@est.tech> Change-Id: I02c6980e3b01870b69a9375f281125ad48477827
2020-09-11dpdk: fix coverity defect #214232, #182930Chenmin Sun1-0/+7
Type: fix Signed-off-by: Chenmin Sun <chenmin.sun@intel.com> Change-Id: Ie328834159687cdb4314c37d36697f2fb9081fbd
2020-09-09interface: support configuring RSS steering queuesChenmin Sun1-0/+104
This patch adds the RSS steering queues set interface, and it's implementation in DPDK device: /* Interface to set rss queues of the interface */ typedef clib_error_t *(vnet_interface_rss_queues_set_t) (struct vnet_main_t * vnm, struct vnet_hw_interface_t * hi, clib_bitmap_t *bitmap); This patch also introduces a command line to set the RSS queues: set interface rss queues <interface> <list <queue-list>> To display the rss queues, use "show hardware-interfaces" Below is the example to configure rss queues for interface Gig0: vpp# set interface rss queues Gig0 list 0,2,4-7 vpp# show hardware-interfaces brief Name Idx Link Hardware VirtualFunctionEthernet18/1/0 1 down VirtualFunctionEthernet18/1/0 Link speed: unknown RSS queues: 0 2 4 5 6 7 local0 0 down local0 Link speed: unknown vpp# Users can also configure the rss queues on a dpdk interface in startup.conf: dpdk { dev 0000:18:01.0 { rss-queues 0,2,5-7 } } Type: feature Signed-off-by: Chenmin Sun <chenmin.sun@intel.com> Change-Id: I1835595a1c54016a84eabee9fd62ce137935385d
2020-09-01dpdk: fix mac address length was wrongjiangxiaoming1-1/+1
Type: fix Signed-off-by: jiangxiaoming <jiangxiaoming@outlook.com> Change-Id: I87c6f423ea8fdd9fb764693055eb1509f994d6f1
2020-07-09dpdk: add txq struct and fix dpdk tx lockBenoît Ganne1-4/+4
This introduces a txq structure mirroring the rxq structure. This fixes the case when #txq > #rxq, because lock must be per txq. Type: fix Fixes: dfb19cabe20ccf1cbd1aa714f493ccd322839b91 Change-Id: Ic1bce64d2b08b9a98c8242a1ba1bfcdbda322bec Signed-off-by: Benoît Ganne <bganne@cisco.com>
2020-06-04dpdk: cleanup, add rx queue structDamjan Marion1-16/+5
Type: improvement Change-Id: I3defde103ab245404de42d2be7abcb2c43d49a60 Signed-off-by: Damjan Marion <damarion@cisco.com>
2020-04-29misc: switch to clang-9Damjan Marion1-1/+1
Type: improvement Change-Id: Iebf77a63c0c19b130a3fbd26b5293304a9fed4c1 Signed-off-by: Damjan Marion <damarion@cisco.com>
2020-04-27vlib: deprecate i2c and cjDave Barach1-1/+0
i2c follows its only use case - the original 82599 driver - into extras/deprecated. cj is/was an emergency debug tool unused in several years. Move to extras/deprecated/vlib Type: refactor Signed-off-by: Dave Barach <dave@barachs.net> Change-Id: Ib55b65373f62630db295c562974bd8f2456c3107
2020-01-30misc: deprecate dpdk hqosDamjan Marion1-15/+0
Not in functional state for a long time ... Type: refactor Change-Id: I2cc1525a6d49518cbc94faf6afbf0d2d0d515f56 Signed-off-by: Damjan Marion <damarion@cisco.com>
2020-01-14dpdk: enforce max tx retriesBenoît Ganne1-0/+1
n_retry was never decremented and so never enforced. Type: fix Change-Id: I71d60a72c156286f7e5b82b1c77a723361317c69 Signed-off-by: Benoît Ganne <bganne@cisco.com>
2019-10-16dpdk: add function to add/del extra MAC addrsMatthew Smith1-0/+24
Type: feature Add a callback to install or remove an additional MAC address on a DPDK-managed device. Note that some PMDs don't have support for this so YMMV. Change-Id: I7b0cb3fb0af0d66fbdb7b894a712897f889520a5 Signed-off-by: Matthew Smith <mgsmith@netgate.com>
2019-09-11dpdk: apply dual loop unrolling in DPDK TXLijian.Zhang1-0/+57
Too many prefetches within loop unrollings induce bottleneck and performance degradation on some CPUs which have less cache line fill buffers, e.g, Arm Cortex-A72. Apply dual loop unrolling and tune prefetches manually to remove hot-spot with prefetch instructions, to get throughput improvement. It brings about 1% throughput improvement and saves 8% clocks with the target node on Cortex-A72. Type: feature Change-Id: If3a64a04a77e90cd0240bc4d1186dbb09dac7df0 Signed-off-by: Lijian Zhang <Lijian.Zhang@arm.com>
2019-08-21dpdk: bump DPDK version to 19.08Damjan Marion1-2/+1
Type: feature Change-Id: I16b8cdf0b6af6715a5f01ad84365a8c8a1b76237 Signed-off-by: Damjan Marion <damarion@cisco.com>
2019-08-19dpdk: add TSO support in dpdk plugin.Chenmin Sun1-1/+10
Type: feature You can enable tso in starup.conf like this: dev 0000:86:00.0{ tso on } TSO is disabled by default. Change-Id: Ifdbaf5322f768c384aa54e532d7bf45e810ca01c Signed-off-by: Chenmin Sun <chenmin.sun@intel.com>
2019-07-24dpdk: Prefetch correct size of rte_mbufNitin Saxena1-1/+1
sizeof(rte_mbuf) is 128 byte but 2* CLIB_CACHE_LINE_BYTES is 256 byte for ThunderX/OCTEONTx targets. Type: fix Change-Id: If6893b168cf1c55c44bf4669a888ce858f2ef487 Signed-off-by: Nitin Saxena <nsaxena@marvell.com>
2019-06-06dpdk: fix clear hw statsFilip Tehlar1-0/+1
.. and remove helper stat struct for keeping last cleared stats. This is not needed anymore as dpdk lib provides rte_eth_dev_reset(). Change-Id: I78076e689aac7ca70836ce688dfa8e704f64cd84 Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
2019-06-04dpdk: rework extended statsFilip Tehlar1-11/+1
Change-Id: I421192e1921d4c9c5486a6dcca745582aebf4e3e Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
2019-05-29dpdk: make sure each segment have initalized rte_mbufDamjan Marion1-12/+4
Change-Id: I0e28d059143fb7489d27a10c5b4a152d0d7dfb1f Signed-off-by: Damjan Marion <damarion@cisco.com>
2019-02-26Move pcap rx/tx trace code out of the dpdk pluginDave Barach1-21/+0
Moved code to the ethernet input node, and the interface output path(s). Since we no longer skip ethernet-input, there's no reason for device drivers to know anything about pcap rx tracing, etc. Change-Id: I08d32fb1b90cbee1bd4f609837d533e047b36fa4 Signed-off-by: Dave Barach <dave@barachs.net>
2019-02-02dpdk: bump to dpdk 19.02Damjan Marion1-1/+4
HQoS requires fixes to work with dpdk 19.02 so code is disabled and pending deprecation unless active maintainer is found. Change-Id: I3569c4287b6dfdd2c29e02375eb53bf01fa6ae84 Signed-off-by: Damjan Marion <damarion@cisco.com>
2019-01-30buffers: major cleanup and improvementsDamjan Marion1-5/+3
This patch introduces following changes: - deprecated free lists which are not used and not compatible with external buffer managers (i.e. DPDK) - introduces native support for per-numa buffer pools - significantly improves performance of buffer alloc and free Change-Id: I4a8e723ae47056717afd6cac0efe87cb731b5be7 Signed-off-by: Damjan Marion <damarion@cisco.com>
2019-01-20dpdk: add buffer.hDamjan Marion1-1/+1
Change-Id: I998658ad7860b23425444e218ce2e1ec655b885a Signed-off-by: Damjan Marion <damarion@cisco.com>
2018-11-14Remove c-11 memcpy checks from perf-critical codeDave Barach1-10/+11
Change-Id: Id4f37f5d4a03160572954a416efa1ef9b3d79ad1 Signed-off-by: Dave Barach <dave@barachs.net>
2018-10-19vppinfra: add atomic macros for __sync builtinsSirshak Das1-2/+2
This is first part of addition of atomic macros with only macros for __sync builtins. - Based on earlier patch by Damjan (https://gerrit.fd.io/r/#/c/10729/) Additionally - clib_atomic_release macro added and used in the absence of any memory barrier. - clib_atomic_bool_cmp_and_swap added Change-Id: Ie4e48c1e184a652018d1d0d87c4be80ddd180a3b Original-patch-by: Damjan Marion <damarion@cisco.com> Signed-off-by: Sirshak Das <sirshak.das@arm.com> Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com> Reviewed-by: Ola Liljedahl <ola.liljedahl@arm.com> Reviewed-by: Steve Capper <steve.capper@arm.com>
2018-09-12device flags will set in dpdk_update_link_state.Khers1-2/+0
Change-Id: If74acb0168bed2201d2a8b47bf3f860540d1574b Signed-off-by: Khers <s3m2e1.6star@gmail.com>
2018-09-08L2 BVI/FIB: Update L2 FIB table when BVI's MAC changesNeale Ranns1-1/+2
also some moving of l2 headers to reduce dependencies Change-Id: I7a700a411a91451ef13fd65f9c90de2432b793bb Signed-off-by: Neale Ranns <nranns@cisco.com>
2018-09-03Deprecate old buffer replication schemeDamjan Marion1-98/+1
Change-Id: I1f54b994425c58776e1445c8d9fe142e7a644d3d Signed-off-by: Damjan Marion <damarion@cisco.com>
2018-08-13Multiarch handling in different constructor macrosDamjan Marion1-9/+2
This significantly reduces need for ... in multiarch code. Simply constructor macros will jost create static unused entry if CLIB_MARCH_VARIANT is defined and that will be optimized out by compiler. Change-Id: I17d1c4ac0c903adcfadaa4a07de1b854c7ab14ac Signed-off-by: Damjan Marion <damarion@cisco.com>
2018-08-11Multiversioning: Device (tx) function constructorMohsin Kazmi1-17/+3
Change-Id: I39f87ca161c891fb22462a23188982fef7c3243f Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
2018-05-31dpdk: Decoupling the meaning of xd->device_index in dpdk_pluginRui Cai1-10/+10
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-29Add VLIB_NODE_FN() macro to simplify multiversioning of node functionsDamjan Marion1-3/+3
Change-Id: Ibab5e27277f618ceb2d543b9d6a1a5f191e7d1db Signed-off-by: Damjan Marion <damarion@cisco.com>
2018-05-25Add interface rx pcap tracingDave Barach1-4/+5
Should cost at most 1 clock per frame when not enabled. Add "pcap rx trace..." debug CLI, refactored "pcap tx trace" debug CLI to avoid duplicating code. Change-Id: I19ac75d1cf94a6a24c98facbf0753381d37963ea Signed-off-by: Dave Barach <dbarach@cisco.com>
2018-05-17Add buffer pointer-to-index and index-to-pointer array functionsDamjan Marion1-46/+4
Change-Id: Ib3fcc3ceb7f315389bcdecbb7d9632540a5dd6ba Signed-off-by: Damjan Marion <damarion@cisco.com>
2018-05-10vnet: device flow offload infraDamjan Marion1-0/+2
Change-Id: Ibea4a96bdec5e368301a03d8b11a0712fa0265e0 Signed-off-by: Damjan Marion <damarion@cisco.com>
2018-05-10dpdk:fix tx countEyal Bari1-1/+2
Change-Id: I921465ea64b59d42674cc8f19069ed04e3b25026 Signed-off-by: Eyal Bari <ebari@cisco.com>
2018-05-09dpdk: fix free of tx dropped packetsFlorin Coras1-1/+1
Change-Id: I3669068f694614f8555b33bf0b703c41e45363ef Signed-off-by: Florin Coras <fcoras@cisco.com>