summaryrefslogtreecommitdiff
path: root/lib/librte_distributor
AgeCommit message (Collapse)Author
2018-01-30build: set compat lib as universal dependencyBruce Richardson
By making "compat" lib (which consists of a header only) a dependency of the EAL, we make the header file available to all other libs, drivers and apps, and thereby make it less work to do ABI versioning. Signed-off-by: Bruce Richardson <bruce.richardson@intel.com> Acked-by: Luca Boccassi <bluca@debian.org>
2018-01-30build: replace license text with SPDX tagBruce Richardson
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com> Reviewed-by: Luca Boccassi <bluca@debian.org>
2018-01-30lib: build with mesonBruce Richardson
Add non-EAL libraries to DPDK build. The compat lib is a special case, along with the previously-added EAL, but all other libs can be build using the same set of commands, where the individual meson.build files only need to specify their dependencies, source files, header files and ABI versions. Signed-off-by: Bruce Richardson <bruce.richardson@intel.com> Reviewed-by: Harry van Haaren <harry.van.haaren@intel.com> Acked-by: Keith Wiles <keith.wiles@intel.com> Acked-by: Luca Boccassi <luca.boccassi@gmail.com>
2018-01-05distributor: remove unnecessary parenthesisStephen Hemminger
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2018-01-04lib: use SPDX tag for Intel copyright filesBruce Richardson
Replace the BSD license header with the SPDX tag for files with only an Intel copyright on them. Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
2017-11-13lib: fix typosPavel Shirshov
Signed-off-by: Pavel Shirshov <pavel.shirshov@gmail.com>
2017-11-07distributor: fix some typosPavel Shirshov
Signed-off-by: Pavel Shirshov <pavel.shirshov@gmail.com>
2017-10-24mk: do not generate LDLIBS from directory dependenciesOlivier Matz
The list of libraries in LDLIBS was generated from the DEPDIRS-xyz variable. This is valid when the subdirectory name match the library name, but it's not always the case, especially for PMDs. The patches removes this feature and explicitly adds the proper libraries in LDLIBS. Some DEPDIRS-xyz variables become useless, remove them. Reported-by: Gage Eads <gage.eads@intel.com> Signed-off-by: Olivier Matz <olivier.matz@6wind.com> Reviewed-by: Gage Eads <gage.eads@intel.com>
2017-07-16lib: remove duplicate includesStephen Hemminger
Include files only need to be refrenced once per file. Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2017-07-04distributor: remove checks for SSE4Bruce Richardson
Since SSE4 is now part of the minimum requirements for DPDK, we now longer need this check. Signed-off-by: Bruce Richardson <bruce.richardson@intel.com> Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2017-07-03eal: switch to architecture specific pause functionJerin Jacob
Remove rte_pause() definition from rte_common.h and switchover to architecture specific rte_pause.h Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
2017-04-21distributor: fix crash in flushDavid Hunt
Occasionally, the distributor single-packet-at-a-time mode will segfault because it inadvertently calls some burst mode code when flushing packets. This patch ensures that only the v20 (single mode) codepath is used, and returns without falling through to the burst mode code. Fixes: 775003ad2f96 ("distributor: add new burst-capable library") Signed-off-by: David Hunt <david.hunt@intel.com> Tested-by: Yong Liu <yong.liu@intel.com> Acked-by: Bruce Richardson <bruce.richardson@intel.com>
2017-04-04distributor: fix creation error checksDavid Hunt
Coverity issue 143258: not freeing distributor instance Coverity issue 143254: not checking return code from malloc Fixes: 775003ad2f96 ("distributor: add new burst-capable library") Signed-off-by: David Hunt <david.hunt@intel.com>
2017-03-29distributor: add symbol versioningDavid Hunt
Signed-off-by: David Hunt <david.hunt@intel.com> Acked-by: Bruce Richardson <bruce.richardson@intel.com>
2017-03-29distributor: switch over to new APIDavid Hunt
This is the main switch over between the legacy API and the new burst API. We rename all the functions in rte_distributor.c to remove the _v1705, and we add in _v20 in the rte_distributor_v20.c We also rename the rte_distributor_next.h as rte_distributor.h, as this is now the public header. At the same time, we need the autotests and sample app to compile properly, hence those changes are in this patch also. Signed-off-by: David Hunt <david.hunt@intel.com> Acked-by: Bruce Richardson <bruce.richardson@intel.com>
2017-03-29distributor: add SIMD flow matchingDavid Hunt
Add an optimised version of the in-flight flow matching algorithm using SIMD instructions. This should give up to 1.5x over the scalar versions performance. Falls back to scalar version if SSE4.2 not available Signed-off-by: David Hunt <david.hunt@intel.com> Acked-by: Bruce Richardson <bruce.richardson@intel.com>
2017-03-29distributor: add new burst-capable libraryDavid Hunt
This patch includes the code for new burst-capable distributor library. It also includes the rte_distributor_next.h file which will be used as the public header once we add in the symbol versioning for v20 and v1705 APIs, at which stage we will rename it to rte_distributor.h. The new distributor code contains a very similar API to the legacy code, but now sends bursts of up to 8 mbufs to each worker. Flow ID's are reduced to 15 bits for an optimal flow matching algorithm. Signed-off-by: David Hunt <david.hunt@intel.com> Acked-by: Bruce Richardson <bruce.richardson@intel.com>
2017-03-29distributor: create private header fileDavid Hunt
We'll be adding internal implementation definitions in here that are common to both burst and legacy APIs. Signed-off-by: David Hunt <david.hunt@intel.com> Acked-by: Bruce Richardson <bruce.richardson@intel.com>
2017-03-29distributor: rename legacy filesDavid Hunt
Move files out of the way so that we can replace with new versions of the distributor library. Files are named in such a way as to match the symbol versioning that we will apply for backward ABI compatibility. Signed-off-by: David Hunt <david.hunt@intel.com> Acked-by: Bruce Richardson <bruce.richardson@intel.com>
2017-03-27mk: optimize directory dependenciesOlivier Matz
Before this patch, the management of dependencies between directories had several issues: - the generation of .depdirs, done at configuration is slow: it can take more than one minute on some slow targets (usually ~10s on a standard PC without -j). - for instance, it is possible to express a dependency like: - app/foo depends on lib/librte_foo - and lib/librte_foo depends on app/bar But this won't work because the directories are traversed with a depth-first algorithm, so we have to choose between doing 'app' before or after 'lib'. - the script depdirs-rule.sh is too complex. - we cannot use "make -d" for debug, because the output of make is used for the generation of .depdirs. This patch moves the DEPDIRS-* variables in the upper Makefile, making the dependencies much easier to calculate. A DEPDIRS variable is still used to process library dependencies in LDLIBS. After this commit, "make config" is almost immediate. Signed-off-by: Olivier Matz <olivier.matz@6wind.com> Tested-by: Robin Jarry <robin.jarry@6wind.com> Tested-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
2015-05-11distributor: remove inclusion of mbuf headerBruce Richardson
The distributor header file includes the mbuf header file, but it does not need to do so as it only uses pointers to the struct rte_mbuf type, and does not use any of the mbuf internals, nor any of the mbuf functions or macros. Therefore the inclusion is unnecessary, and can be replaced by a forward declaration of the mbuf type. Signed-off-by: Bruce Richardson <bruce.richardson@intel.com> Acked-by: Olivier Matz <olivier.matz@6wind.com>
2015-03-10tailq: move to dynamic tailqDavid Marchand
Use dynamic tailq rather than static entries. Signed-off-by: David Marchand <david.marchand@6wind.com> Acked-by: Neil Horman <nhorman@tuxdriver.com>
2015-03-10tailq: remove unneeded inclusionsDavid Marchand
Only keep inclusion where really needed. Signed-off-by: David Marchand <david.marchand@6wind.com> Acked-by: Neil Horman <nhorman@tuxdriver.com>
2015-02-03mk: add library version extensionNeil Horman
To differentiate libraries that break ABI, we add a library version number suffix to the library, which must be incremented when a given libraries ABI is broken. This patch enforces that addition, sets the initial abi soname extension to 1 for each library and creates a symlink to the base SONAME so that the test applications will link properly. Signed-off-by: Neil Horman <nhorman@tuxdriver.com> Acked-by: Sergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com>
2015-02-03lib: provide initial versioningNeil Horman
Add linker version script files to each DPDK library to put a stake in the ground from which we can start cleaning up API's Signed-off-by: Neil Horman <nhorman@tuxdriver.com> Acked-by: Sergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com>
2014-12-11lib: fix cache alignment of structuresJia Yu
Include rte_memory.h for lib files that use __rte_cache_aligned attribute. Consider the following code: struct per_core_foo { ... } __rte_cache_aligned; struct global_foo { struct per_core_foo foo[RTE_MAX_CORE]; }; If __rte_cache_aligned is not defined (rte_memory.h is not included), the code compiles but the structure is not aligned... it defines the structure and creates a global variable called __rte_cache_aligned. And this can lead to really bad things if this code is in a .h that is included by files that may or may not include rte_memory.h Signed-off-by: Jia Yu <jyu@vmware.com> Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
2014-11-27add prefix to cache line macrosSergio Gonzalez Monroy
CACHE_LINE_SIZE is a macro defined in machine/param.h in FreeBSD and conflicts with DPDK macro version. Adding RTE_ prefix to avoid conflicts. CACHE_LINE_MASK and CACHE_LINE_ROUNDUP are also prefixed. Signed-off-by: Sergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com> [Thomas: updated on HEAD, including PPC]
2014-11-13distributor: enhance and fix tag matchingQinglai Xiao
With introduction of in_flight_bitmask, the whole 32 bits of tag can be used. Further more, this patch fixed the integer overflow when finding the matched tags. The maximum number workers is now defined as 64, which is length of double-word. The link between number of workers and RTE_MAX_LCORE is now removed. Compile time check is added to ensure the RTE_DISTRIB_MAX_WORKERS is less than or equal to size of double-word. Signed-off-by: Qinglai Xiao <jigsaw@gmail.com> Acked-by: Bruce Richardson <bruce.richardson@intel.com>
2014-11-13mbuf: add usr alias for hashQinglai Xiao
This field is added for librte_distributor. User of librte_distributor is advocated to set value of mbuf->hash.usr before calling rte_distributor_process. The value of usr is the tag which stands as identifier of flow. Signed-off-by: Qinglai Xiao <jigsaw@gmail.com> Acked-by: Bruce Richardson <bruce.richardson@intel.com>
2014-11-07distributor: add commentsBruce Richardson
Add in some additional comments around more complex areas of the code so as to make the code easier to read and understand. Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
2014-09-17mbuf: remove the rte_pktmbuf structureOlivier Matz
The rte_pktmbuf structure was initially included in the rte_mbuf structure. This was needed when there was 2 types of mbuf (ctrl and packet). As the control mbuf has been removed, we can merge the rte_pktmbuf into the rte_mbuf structure. Advantages of doing this: - the access to mbuf fields is easier (ex: m->data instead of m->pkt.data) - make the structure more consistent: for instance, there was no reason to have the ol_flags field in rte_mbuf - it will allow a deeper reorganization of the rte_mbuf structure in the next commits, allowing to gain several bytes in it Signed-off-by: Olivier Matz <olivier.matz@6wind.com> [Bruce: updated for latest code and new example apps] Signed-off-by: Bruce Richardson <bruce.richardson@intel.com> Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
2014-06-27eal: deprecate rte_snprintfStephen Hemminger
The function rte_snprintf serves no useful purpose. It is the same as snprintf() for all valid inputs. Deprecate it and replace all uses in current code. Leave the tests for the deprecated function in place. Signed-off-by: Stephen Hemminger <stephen@networkplumber.org> Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
2014-06-20distributor: split get_pkt into request and pollBruce Richardson
Take the existing get_pkt API and split out the parts for requesting a new packet from the part to poll for arrival of a new packet. These individual functions can then be used independently of the get function, which still acts as before. The split functions for request and poll will allow a worker to pull packets from multiple distributors, or to act as multiple workers with a single distributor if needed for better performance. Signed-off-by: Bruce Richardson <bruce.richardson@intel.com> Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
2014-06-12distributor: new packet distributor libraryBruce Richardson
This adds the code for a new Intel DPDK library for packet distribution. The distributor is a component which is designed to pass packets one-at-a-time to workers, with dynamic load balancing. Using the RSS field in the mbuf as a tag, the distributor tracks what packet tag is being processed by what worker and then ensures that no two packets with the same tag are in-flight simultaneously. Once a tag is not in-flight, then the next packet with that tag will be sent to the next available core. Signed-off-by: Bruce Richardson <bruce.richardson@intel.com> Acked-by: Neil Horman <nhorman@tuxdriver.com> Tested-by: Waterman Cao <waterman.cao@intel.com> [Thomas: add doxygen @file comment]