summaryrefslogtreecommitdiff
path: root/lib/netdev-dpdk.h
Commit message (Collapse)AuthorAgeFilesLines
* dpdk: New module with some code from netdev-dpdk.Daniele Di Proietto2016-10-121-32/+4
| | | | | | | | | | | | | | | | | | | | There's a lot of code in netdev-dpdk which is not at all related to the netdev interface, mostly the library initialization code. This commit moves it to a new 'dpdk' module, to simplify 'netdev-dpdk'. Also a new module 'dpdk-stub' is introduced to implement some functions when DPDK is not available. This replaces the old 'netdev-nodpdk' module. Some redundant includes are removed or reorganized as a consequence. No functional change. CC: Aaron Conole <aconole@redhat.com> Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com> Acked-by: Aaron Conole <aconole@redhat.com> Tested-by: Aaron Conole <aconole@redhat.com>
* netdev-dpdk.h: Add missing copyright.Daniele Di Proietto2016-10-121-0/+16
| | | | | | | | | | | Looks like we forgot to add the copyright headers to netdev-dpdk.h. Looking at the contribution history of the file, this commit adds the header with Nicira copyright. Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com> Acked-by: Ben Pfaff <blp@ovn.org> Acked-by: Aaron Conole <aconole@redhat.com> Tested-by: Aaron Conole <aconole@redhat.com>
* ovs-numa: Introduce function to set current thread affinity.Daniele Di Proietto2016-06-071-4/+4
| | | | | | | | | | | | | | | This commit moves the code that sets the pmd threads affinity from netdev-dpdk to ovs-numa. There's one small part left in netdev-dpdk, to set the lcore_id. Now dpif-netdev will call both modules (ovs-numa and netdev-dpdk) when starting a pmd thread. This change will allow having a dummy implementation of the set affinity call, for testing purposes. Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com> Acked-by: Ilya Maximets <i.maximets@samsung.com>
* netdev-dpdk: Convert initialization from cmdline to dbAaron Conole2016-04-291-10/+4
| | | | | | | | | | | | | | | | Existing DPDK integration is provided by use of command line options which must be split out and passed to librte in a special manner. However, this forces any configuration to be passed by way of a special DPDK flag, and interferes with ovs+dpdk packaging solutions. This commit delays dpdk initialization until after the OVS database connection is established, at which point ovs initializes librte. It pulls all of the config data from the OVS database, and assembles a new argv/argc pair to be passed along. Signed-off-by: Aaron Conole <aconole@redhat.com> Acked-by: Kevin Traynor <kevin.traynor@intel.com> Acked-by: Daniele Di Proietto <diproiettod@vmware.com>
* netdev-dpdk: Properly support non pmd threads.Daniele Di Proietto2015-05-221-12/+4
| | | | | | | | | | | | | We used to reserve DPDK lcore 0 for non pmd operations, making it difficult to use core 0 for packet processing. DPDK 2.0 properly support non EAL threads with lcore LCORE_ID_ANY. Using non EAL threads for non pmd threads, we do not need to reserve any core for non pmd operations Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com> Signed-off-by: Ethan Jackson <ethan@nicira.com> Acked-by: Ethan Jackson <ethan@nicira.com>
* ovs-numa: Change 'core_id' to unsigned.Daniele Di Proietto2015-05-221-2/+2
| | | | | | | | | | DPDK lcore_id is unsigned. We need to support big values like LCORE_ID_ANY (=UINT32_MAX). Therefore I am changing the type everywhere in OVS. Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com> Signed-off-by: Ethan Jackson <ethan@nicira.com> Acked-by: Ethan Jackson <ethan@nicira.com>
* dpif_packet: Rename to dp_packetPravin B Shelar2015-03-031-3/+3
| | | | | | | | dp_packet is short and better name for datapath packet structure. Signed-off-by: Pravin B Shelar <pshelar@nicira.com> Acked-by: Jarno Rajahalme <jrajahalme@nicira.com>
* netdev-dpdk: Allow changing NON_PMD_CORE_ID for testing purpose.Alex Wang2015-02-101-0/+5
| | | | | | | | | | | | For testing purpose, developers may want to change the NON_PMD_CORE_ID and use a different core for non-pmd threads. Since the netdev-dpdk module is hard-coded to assert the non-pmd threads using core 0, such change will cause abortion of OVS. This commit fixes the assertion and allows changing NON_PMD_CORE_ID. Signed-off-by: Alex Wang <alexw@nicira.com> Acked-by: Pravin B Shelar <pshelar@nicira.com>
* ovs-vswitchd: Better diagnose errors in DPDK command-line options.Ben Pfaff2014-09-301-1/+6
| | | | | | | | | | | | | With DPDK compiled in, when the --dpdk option was given other than as the first command-line argument, ovs-vswitchd silently ignored it. Without DPDK compiled in, when the --dpdk option was given anywhere, ovs-vswitchd silently ignored it. However, in each case any options following --dpdk were not ignored, and since --dpdk is normally followed by additional DPDK-specific options, this caused even more confusing trouble. Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Daniele Di Proietto <ddiproietto@vmware.com> Tested-by: Daniele Di Proietto <ddiproietto@vmware.com>
* netdev-dpdk: Fix race condition with DPDK mempools in non pmd threadsDaniele Di Proietto2014-07-201-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | DPDK mempools rely on rte_lcore_id() to implement a thread-local cache. Our non pmd threads had rte_lcore_id() == 0. This allowed concurrent access to the "thread-local" cache, causing crashes. This commit resolves the issue with the following changes: - Every non pmd thread has the same lcore_id (0, for management reasons), which is not shared with any pmd thread (lcore_id for pmd threads now start from 1) - DPDK mbufs must be allocated/freed in pmd threads. When there is the need to use mempools in non pmd threads, like in dpdk_do_tx_copy(), a mutex must be held. - The previous change does not allow us anymore to pass DPDK mbufs to handler threads: therefore this commit partially revert 143859ec63d45e. Now packets are copied for upcall processing. We can remove the extra memcpy by processing upcalls in the pmd thread itself. With the introduction of the extra locking, the packet throughput will be lower in the following cases: - When using internal (tap) devices with DPDK devices on the same datapath. Anyway, to support internal devices efficiently, we needed DPDK KNI devices, which will be proper pmd devices and will not need this locking. - When packets are processed in the slow path by non pmd threads. This overhead can be avoided by handling the upcalls directly in pmd threads (a change that has already been proposed by Ryan Wilson) Also, the following two fixes have been introduced: - In dpdk_free_buf() use rte_pktmbuf_free_seg() instead of rte_mempool_put(). This allows OVS to run properly with CONFIG_RTE_LIBRTE_MBUF_DEBUG DPDK option - Do not bulk free mbufs in a transmission queue. They may belong to different mempools Signed-off-by: Daniele Di Proietto <ddiproietto@vmware.com> Acked-by: Pravin B Shelar <pshelar@nicira.com>
* netdev-dpdk: add dpdk rings to netdev-dpdkmaryam.tahhan2014-07-161-0/+1
| | | | | | | | | | | | | | | | | Shared memory ring patch This patch enables the client dpdk rings within the netdev-dpdk. It adds a new dpdk device called dpdkr (other naming suggestions?). This allows for the use of shared memory to communicate with other dpdk applications, on the host or within a virtual machine. Instructions for use are in INSTALL.DPDK. This has been tested on Intel multi-core platforms and with the client application within the host. Signed-off-by: Gerald Rogers <gerald.rogers@intel.com> Signed-off-by: Maryam Tahhan <maryam.tahhan@intel.com> Acked-by: Pravin B Shelar <pshelar@nicira.com>
* dpif-netdev: use dpif_packet structure for packetsDaniele Di Proietto2014-06-231-2/+4
| | | | | | | | | | This commit introduces a new data structure used for receiving packets from netdevs and passing them to dpifs. The purpose of this change is to allow storing some private data for each packet. The subsequent commits make use of it. Signed-off-by: Daniele Di Proietto <ddiproietto@vmware.com> Acked-by: Pravin B Shelar <pshelar@nicira.com>
* dpif-netdev: Fix a compilation warningAndy Zhou2014-03-241-7/+26
| | | | | | | | | | | | | | | Building OVS tree without DPDK produced the following warning message: lib/dpif-netdev.c:1868:5: error: statement with no effect This error message is complaining the return value of the following macro not being used. #define pmd_thread_setaffinity_cpu(c) (0) The patch fixed this warnning by making the stub functions as inline funtions. Signed-off-by: Andy Zhou <azhou@nicira.com> Acked-by: Pravin B Shelar <pshelar@nicira.com>
* netdev-dpdk: Use multiple core for dpdk IO.Pravin2014-03-211-0/+2
| | | | | | | DPDK need to set _lcore_id for using multiple core. Signed-off-by: Pravin B Shelar <pshelar@nicira.com> Acked-by: Thomas Graf <tgraf@redhat.com>
* dpif-netdev: Add DPDK netdev.Pravin2014-03-211-0/+32
Following patch adds DPDK netdev-class to userspace datapath. Now OVS can use DPDK port for IO by just configuring DPDK port and then adding dpdk type port to userspace datapath. Refer to INSTALL.DPDK doc for further info. This is based a patch from Gerald Rogers. Signed-off-by: Gerald Rogers <gerald.rogers@intel.com> Signed-off-by: Pravin B Shelar <pshelar@nicira.com> Acked-by: Thomas Graf <tgraf@redhat.com>