dpdk.git
10 years agotimer: get TSC frequency from /proc/cpuinfo
Thomas Monjalon [Thu, 31 May 2012 17:00:31 +0000 (19:00 +0200)]
timer: get TSC frequency from /proc/cpuinfo

TSC frequency was guessed by reading CLOCK_MONOTONIC_RAW or sleeping 1 sec.
Now, read frequency from cpuinfo first.
Keep other methods as fallbacks.

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Acked-by: Ivan Boule <ivan.boule@6wind.com>
10 years agotimer: check TSC reliability
Ivan Boule [Thu, 31 May 2012 14:41:57 +0000 (16:41 +0200)]
timer: check TSC reliability

Read flags from /proc/cpuinfo and warn if constant_tsc or nonstop_tsc is
not found.

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Acked-by: Ivan Boule <ivan.boule@6wind.com>
10 years agospinlock: fix build with clang
Olivier Matz [Fri, 24 Jan 2014 15:29:06 +0000 (16:29 +0100)]
spinlock: fix build with clang

LLVM clang requires an explicitly sized "cmp" assembly instruction.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
10 years agohash: reverse the operand order to crc32
H. Peter Anvin [Tue, 25 Feb 2014 10:07:40 +0000 (02:07 -0800)]
hash: reverse the operand order to crc32

Checkin

a132a9cf2bcd440a974b9d3f5c44ba30b2c895a1 hash: use intrinsic

changed the rte_hash_crc.h from using the crc32 instruction via inline
assembly to using an intrinsic.  The intrinsic should allow for better
compiler performance, but the change did not account for the fact that
the inline assembly being in AT&T syntax used the opposite operand
order of the intrinsic.

This turns out to not matter for correctness, because the CRC32
operation is commutative.  However, it could potentially matter for
performance, because the loop is more efficient with the moving
pointer in the source operand and the accumulation in the destination
operand.

This was discovered by Jan Beulich when looking at the equivalent code
in the Linux kernel.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Reported-by: Jan Beulich <jbeulich@suse.com>
Reported-by: Pashupati Kumar <kumarp@brocade.com>
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
10 years agolog: remove app path from syslog id
Thomas Monjalon [Mon, 16 Sep 2013 10:36:20 +0000 (12:36 +0200)]
log: remove app path from syslog id

This reverts commit "log: get full path as syslog id" (494a02537f1)
and restore the original patch from Stephen Hemminger (04210699eee).

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
10 years agokvargs: add in doc
Thomas Monjalon [Tue, 4 Feb 2014 15:11:12 +0000 (16:11 +0100)]
kvargs: add in doc

Reference the new library in doxygen.
Move also some items from misc to a new basic section.

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
10 years agokvargs: add test case in app/test
Olivier Matz [Tue, 28 Jan 2014 15:06:44 +0000 (16:06 +0100)]
kvargs: add test case in app/test

Add a file app/test/test_kvargs.c that checks the rte_kvargs API.
The test passes:

  RTE>>kvargs
  == test valid case ==
  == test invalid case ==
  PMD: Error parsing device, invalid key <wrong-key>
  Test OK

I also tested that rte_eth_pcap runs with the following arguments:

  ./app/testpmd -c 0x15 -n 3 --proc-type=primary --huge-dir=/mnt/huge \
    --use-device="eth_pcap0;iface=ixgbe0" \
    -- -i --port-topology=chained

  ./app/testpmd -c 0x15 -n 3 --proc-type=primary --huge-dir=/mnt/huge \
    --use-device="eth_pcap0;rx_iface=ixgbe0;rx_iface=ixgbe1;tx_iface=ixgbe0" \
    -- -i --port-topology=chained

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
10 years agokvargs: make the NULL key to match all entries
Olivier Matz [Tue, 28 Jan 2014 16:06:43 +0000 (17:06 +0100)]
kvargs: make the NULL key to match all entries

In rte_kvargs_process() and rte_kvargs_count(), if the key_match
argument is NULL, process all entries.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
10 years agokvargs: add the key in handler pameters
Olivier Matz [Tue, 28 Jan 2014 16:06:42 +0000 (17:06 +0100)]
kvargs: add the key in handler pameters

This argument can be useful when rte_kvargs_process() is called with
key=NULL, in this case the handler is invoked for all entries of the
kvlist.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
10 years agokvargs: add const attribute in handler parameters
Olivier Matz [Tue, 28 Jan 2014 16:06:41 +0000 (17:06 +0100)]
kvargs: add const attribute in handler parameters

The "value" argument is read-only and should be const.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
10 years agokvargs: be strict when matching a key
Olivier Matz [Tue, 28 Jan 2014 16:06:40 +0000 (17:06 +0100)]
kvargs: be strict when matching a key

When we match a key in is_valid_key() and rte_kvargs_process(), do a
strict comparison (strcmp()) instead of using strstr(s1, s2) which tries
a find s1 in s2. This old behavior could lead to unexpected match, for
instance "cola" match "chocolate".

Surprisingly, no patch was needed on rte_kvargs_count() as it already
used strcmp().

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
10 years agokvargs: simpler parsing and allow duplicated keys
Olivier Matz [Tue, 28 Jan 2014 16:06:39 +0000 (17:06 +0100)]
kvargs: simpler parsing and allow duplicated keys

Remove the rte_kvargs_add_pair() function whose only role was to check
if a key is duplicated. Having duplicated keys is now allowed by kvargs
API.

Also replace rte_strsplit() by more a standard function strtok_r() that
is easier to understand for people already knowing the libc. It also
avoids useless calls to strnlen(). The delimiters macros become strings
instead of chars due to the strtok_r() API.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
10 years agokvargs: rework API to fix memory leak
Olivier Matz [Tue, 28 Jan 2014 16:06:38 +0000 (17:06 +0100)]
kvargs: rework API to fix memory leak

Before the patch, a call to rte_kvargs_tokenize() resulted in a call to
strdup() to allocate a modifiable copy of the argument string. This
string was never freed, excepted in the error cases of
rte_kvargs_tokenize() where rte_free() was wrongly called instead of
free(). In other cases, freeing this string was impossible as the
pointer not saved.

This patch introduces rte_kvargs_free() in order to free the structure
properly. The pointer to the duplicated string is now kept in the
rte_kvargs structure. A call to rte_kvargs_parse() directly allocates
the structure, making rte_kvargs_init() useless.

The only drawback of this API change is that a key/value associations
cannot be added to an existing kvlist. But it's not used today, and
there is not obvious use case for that.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
10 years agokvargs: remove useless size field
Olivier Matz [Tue, 28 Jan 2014 16:06:37 +0000 (17:06 +0100)]
kvargs: remove useless size field

This value was not very useful as the size of the table is fixed (equals
RTE_KVARGS_MAX).

By the way, the memset in the initialization function was wrong (size
too short). Even if it was not really an issue since we rely on the
"count" field, it is now fixed by this patch.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
10 years agokvargs: remove driver name in arguments
Olivier Matz [Tue, 28 Jan 2014 16:06:36 +0000 (17:06 +0100)]
kvargs: remove driver name in arguments

Now that rte_kvargs is a generic library, there is no need to have an argument
for the driver name in rte_kvargs_tokenize() and rte_kvargs_parse()
prototypes. This argument was only used to log the driver name in case of
error. Instead, we can add a log in init function of pmd_pcap and pmd_ring.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
10 years agokvargs: use the new library in pmd_pcap
Olivier Matz [Tue, 28 Jan 2014 15:06:35 +0000 (16:06 +0100)]
kvargs: use the new library in pmd_pcap

The rte_kvargs library is a reworked copy of rte_eth_pcap_arg_parser,
so it provides the same service. Therefore we can use it and remove the
code of rte_eth_pcap_arg_parser.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
10 years agokvargs: add a new library to parse key/value arguments
Olivier Matz [Tue, 28 Jan 2014 16:06:34 +0000 (17:06 +0100)]
kvargs: add a new library to parse key/value arguments

Copy the code from rte_eth_pcap_arg_parser.[ch], without any functional
modifications, only:
- rename functions and structure
- restyle (indentation)
- add comments (doxygen style)
- add "const" or "static" attributes, remove unneeded "inline"

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
10 years agoeal: remove unused macro for blacklist
Thomas Monjalon [Wed, 30 Oct 2013 15:26:14 +0000 (16:26 +0100)]
eal: remove unused macro for blacklist

This macro was used for blacklist parsing but is not used anymore
since commit 5a55b9ac91face71e9d665eecc716201d28745b0.

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
10 years agoeal: fix recording of detected/enabled logical cores
Ivan Boule [Fri, 8 Feb 2013 12:01:52 +0000 (13:01 +0100)]
eal: fix recording of detected/enabled logical cores

1) In the EAL initialization phase, invoke the function rte_eal_cpu_init
   to detect the set of running cores (and enable them by default) before
   processing the [enabled] core mask option that is performed during the
   parsing of EAL arguments.

2) In the function rte_eal_cpu_init():
   - to parse the set of all running logical cores on the machine, do not
     use the RTE_LCORE_FOREACH macro that considers the set of already
     detected cores...
     Instead, use a standard loop based on the RTE_MAX_LCORE constant.
   - explicitely set to ROLE_RTE the role of each detected logical core
     that is recorded in the EAL configuration, as all running cores are
     enabled by default.

3) In the function eal_parse_coremask(), update the "lcore_count" field
   of the EAL configuration with the effective number of logical cores
   that are set in the mask of enabled logical cores.

Signed-off-by: Ivan Boule <ivan.boule@6wind.com>
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
10 years agoeal: fix type of pointer arithmetic result
Thomas Monjalon [Fri, 12 Jul 2013 10:54:35 +0000 (12:54 +0200)]
eal: fix type of pointer arithmetic result

Adding or subtracting a value to a pointer makes a new pointer
of unknown type.
So typeof() is replaced by (void*) in RTE_PTR_ADD() and RTE_PTR_SUB().

But RTE_PTR_ALIGN_* macros have in their explicit API to return a pointer
of the same type. Since RTE_PTR_ALIGN_CEIL is based on RTE_PTR_ADD, a
typeof() is added to keep the original behaviour.

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
10 years agoeal: add support for shared object drivers
Damien Millescamps [Wed, 12 Jun 2013 05:51:27 +0000 (07:51 +0200)]
eal: add support for shared object drivers

Add an option to specify libraries to be loaded before probing the PCI.

For instance, testpmd -d librte_pmd_xxx.so can be used to enable xxx driver
support on testpmd without any recompilation of testpmd.

Plugins are loaded before creating threads because we want the threads to
inherit any property that could be set while loading a plugin, such as iopl().

Signed-off-by: Damien Millescamps <damien.millescamps@6wind.com>
Signed-off-by: Jean-Mickael Guerin <jean-mickael.guerin@6wind.com>
Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
10 years agomk: fix command-line dependency check for quoted strings
Adrien Mazarguil [Fri, 15 Nov 2013 14:38:52 +0000 (15:38 +0100)]
mk: fix command-line dependency check for quoted strings

Before recompiling a file, rte.compile-pre.mk checks whether the command
line is different from the previous one.

This is done by storing for each object file the entire command line in a
kind of dependency file with a .cmd extension (see obj2cmd). If that file
exists, the line is retrieved first and compared against $(C_TO_O_STR).
The object file gets recompiled if the file doesn't exist or if the line
is different.

The problem is that sometimes, files are recompiled for no apparent reason.

The check doesn't work properly when a command line contains double-quoted
strings such as -DFOO='"bar"' because the shell interprets and strips them.
This is fixed by protecting C_TO_O_CMD with simple quotes, knowing that
such quotes are already escaped in C_TO_O_STR.

Moreover, because simple quotes are escaped in C_TO_O_STR, the retrieved
command should be compared against C_TO_O instead.

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
10 years agomk: fix EXTRA_LDFLAGS override
Julien Courtat [Fri, 15 Nov 2013 14:22:37 +0000 (15:22 +0100)]
mk: fix EXTRA_LDFLAGS override

The GCC prefix -Wl was ignored because the command line value has higher priority.
It ended in impossibilty for GCC to pass parameters to LD.
The prefixed value must override the command line one.

Signed-off-by: Julien Courtat <julien.courtat@6wind.com>
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
10 years agomk: allow to build shared libraries
Didier Pallard [Fri, 4 Jan 2013 17:00:11 +0000 (18:00 +0100)]
mk: allow to build shared libraries

Add mk/rte.shared.mk and mk/rte.extshared.mk in framework to
   allow shared libraries compilation through framework

Signed-off-by: Didier Pallard <didier.pallard@6wind.com>
Acked-by: Ivan Boule <ivan.boule@6wind.com>
10 years agomk: allow to specify DESTDIR in build rule
Olivier Matz [Wed, 30 Jan 2013 15:32:15 +0000 (16:32 +0100)]
mk: allow to specify DESTDIR in build rule

This will install the binary sdk (bin + modules + libs + headers + mk)
in the specified directory.
This directory can be used as RTE_SDK by external applications.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
10 years agomk: in install rule, don't overwrite .config if it already exists
Olivier Matz [Wed, 30 Jan 2013 15:30:19 +0000 (16:30 +0100)]
mk: in install rule, don't overwrite .config if it already exists

This allows the user to prepare a configuration with make config
before using make install.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
10 years agomk: allow to specify O= in install rule
Olivier Matz [Wed, 30 Jan 2013 15:29:43 +0000 (16:29 +0100)]
mk: allow to specify O= in install rule

This variable $(O) can be used to specify a build directory
when doing an "install" procedure. The default is ".", which
means that targets will be built in the source dpdk.

This option is useful to compile outside of the source tree that may be
read-only.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
10 years agomk: rule help
Thomas Monjalon [Tue, 7 May 2013 13:46:58 +0000 (15:46 +0200)]
mk: rule help

The goal of this rule is to show which rules/options are available from a
"make" command.
Let's start by printing short doc about SDK building.

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Reviewed-by: Olivier Matz <olivier.matz@6wind.com>
10 years agomk: add rule to list configs
Thomas Monjalon [Tue, 7 May 2013 13:43:57 +0000 (15:43 +0200)]
mk: add rule to list configs

Allow to list configs in config/ directory with a simple make rule.

The rule showconfigs is reused in config error.
In the same time, "echo -n" is replaced by the more portable "printf".

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Reviewed-by: Olivier Matz <olivier.matz@6wind.com>
10 years agodoc: how to build
Thomas Monjalon [Tue, 7 May 2013 15:00:52 +0000 (17:00 +0200)]
doc: how to build

This is a cheat sheet to build DPDK and can be used for a "make help".
It is explicitly described as a build help in order to concatenate it
with other helps such as test commands.

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
10 years agomk: insert version number in doxygen config
Thomas Monjalon [Fri, 19 Jul 2013 14:06:26 +0000 (16:06 +0200)]
mk: insert version number in doxygen config

The parameter PROJECT_NUMBER is used in the HTML header
via the template variable $projectnumber.

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Acked-by: Vincent Jardin <vincent.jardin@6wind.com>
10 years agomk: add rule to print version number
Thomas Monjalon [Fri, 19 Jul 2013 13:53:08 +0000 (15:53 +0200)]
mk: add rule to print version number

The version string is extracted from rte_version.h.
RTE_VER_* macros are concatenated and separators " . . r " are inserted.

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Acked-by: Vincent Jardin <vincent.jardin@6wind.com>
10 years agodoc: fix some doxygen comments
Thomas Monjalon [Fri, 22 Mar 2013 15:34:54 +0000 (16:34 +0100)]
doc: fix some doxygen comments

- rte_panic must be before rte_panic_ to be associated to its doc
- marker /**< must be used when commenting after the declaration only
- fix rte_string_fns.h title
- typos

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
10 years agodoc: fix doxygen parsing of __attribute__
Thomas Monjalon [Tue, 5 Nov 2013 11:09:12 +0000 (12:09 +0100)]
doc: fix doxygen parsing of __attribute__

Ignore __attribute__ because it was wrongly parsed as an identifier.
This configuration is described in
http://www.stack.nl/~dimitri/doxygen/manual/preprocessing.html

Reported-by: Cyril Cressent <cyril.cressent@intel.com>
Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
10 years agodoc: add mbuf cloning functions in doxygen
Thomas Monjalon [Thu, 24 Oct 2013 08:26:02 +0000 (10:26 +0200)]
doc: add mbuf cloning functions in doxygen

Some functions are available only if RTE_MBUF_SCATTER_GATHER is enabled.
So it must be configured for doxygen parser.

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
10 years agodoc: generate HTML for API with doxygen
Thomas Monjalon [Fri, 19 Apr 2013 10:34:40 +0000 (12:34 +0200)]
doc: generate HTML for API with doxygen

- add index page
- add doxygen configuration for API
- add doxygen CSS customization applied by a script
- HTML generation via make rules

The configuration is splitted in a static file and a make rule in order to
dynamically configure output format and path.

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: David Marchand <david.marchand@6wind.com>
10 years agomk: clean dead doc rules
Thomas Monjalon [Fri, 19 Apr 2013 10:59:25 +0000 (12:59 +0200)]
mk: clean dead doc rules

It seems that doc/ has been removed so these rules are useless.
This clean-up is preliminary to generate some doc.

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
10 years agomk: factorize some rules
Thomas Monjalon [Fri, 19 Apr 2013 12:46:35 +0000 (14:46 +0200)]
mk: factorize some rules

rte.sdkroot.mk is mainly calling other makefiles.
These redirecting rules can be factorized by called makefile.

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
10 years agoconfig: remove unused KNI debug option
Thomas Monjalon [Wed, 30 Oct 2013 15:22:04 +0000 (16:22 +0100)]
config: remove unused KNI debug option

The option RTE_LIBRTE_KNI_DEBUG has no effect so it should be removed.
The right options are:
- RTE_KNI_KO_DEBUG
- RTE_KNI_VHOST_DEBUG_RX
- RTE_KNI_VHOST_DEBUG_TX

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
10 years agoconfig: disable KNI for 32-bit because cannot work
Jean-Mickael Guerin [Mon, 4 Mar 2013 16:48:25 +0000 (16:48 +0000)]
config: disable KNI for 32-bit because cannot work

This is not supported, disable to avoid compilation error like:
lib/librte_eal/linuxapp/kni/kni_misc.c:304:2: error:
format '%llx' expects argument of type 'long long unsigned int',
but argument 2 has type 'phys_addr_t' [-Werror=format]

Signed-off-by: Jean-Mickael Guerin <jean-mickael.guerin@6wind.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
10 years agoversion: 1.6.0
Bruce Richardson [Wed, 5 Feb 2014 12:39:22 +0000 (12:39 +0000)]
version: 1.6.0

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
10 years agoexamples/netmap_compat: import netmap compatibility example
Bruce Richardson [Tue, 11 Feb 2014 13:47:39 +0000 (13:47 +0000)]
examples/netmap_compat: import netmap compatibility example

This provides a sample application and library showing how to use the
Intel(R) DPDK with basic netmap applications.

The Netmap compatibility library provides a minimal set of APIs to give the ability to
programs written against the Netmap APIs to be run with minimal changes to their
source code, using the Intel® DPDK to perform the actual packet I/O.
Since Netmap applications use regular system calls, like open(), ioctl() and
mmap() to communicate with the Netmap kernel module performing the packet I/O,
the compat_netmap library provides a set of similar APIs to use in place of those
system calls, effectively turning a Netmap application into a Intel(R) DPDK one.
The provided library is currently minimal and doesn’t support all the features that
Netmap supports, but is enough to run simple applications, such as the
bridge example included.

The application requires a single command line option:
 -i INTERFACE is the number of a valid Intel(R) DPDK port to use.
If a single -i parameter is given, the interface will send back all the traffic it
receives. If two -i parameters are given, the two interfaces form a bridge, where
traffic received on one interface is replicated and sent by the other interface.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
10 years agoexamples/l2fwd-ivshmem: import sample application
Bruce Richardson [Tue, 11 Feb 2014 11:31:03 +0000 (11:31 +0000)]
examples/l2fwd-ivshmem: import sample application

This provides a new sample application which demonstrates how
the ivshmem library and EAL capabilities can be used to create
a zero-copy fast-path for packet communication between host
machine and guest vm.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
10 years agoexamples/vhost: import userspace vhost application
Bruce Richardson [Mon, 10 Feb 2014 13:57:48 +0000 (13:57 +0000)]
examples/vhost: import userspace vhost application

The vhost sample application demonstrates integration of the Intel(R) Data Plane
Development Kit (Intel(R) DPDK) with the Linux KVM hypervisor by implementing the
vhost-net offload API. The sample application performs simple packet switching
between virtual machines based on Media Access Control (MAC) address or Virtual
Local Area Network (VLAN) tag. The splitting of ethernet traffic from an external switch
is performed in hardware by the Virtual Machine Device Queues (VMDQ) and Data
Center Bridging (DCB) features of the Intel(R) 82599 10 Gigabit Ethernet Controller.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
10 years agoexamples/dpdk-qat: various updates
Bruce Richardson [Mon, 10 Feb 2014 13:33:44 +0000 (13:33 +0000)]
examples/dpdk-qat: various updates

Updates including support for Intel® Communications Chipset
8925 to 8955 Series.
Add support for the wireless KASUMI algorithm.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
10 years agoexamples: minor changes
Bruce Richardson [Tue, 11 Feb 2014 15:35:19 +0000 (15:35 +0000)]
examples: minor changes

A series of minor changes to example applications included in the
Intel DPDK 1.6 release.
* changes to NIC configuration flags, e.g. specifying RSS
* replacing local "DIM" macro with common "RTE_DIM" macro
* minor whitespace changes for alignment.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
10 years agoapp/testpmd: disable RSS when in SRIOV
Bruce Richardson [Tue, 18 Feb 2014 10:23:55 +0000 (11:23 +0100)]
app/testpmd: disable RSS when in SRIOV

Hardware does not support RSS in SRIOV setups.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Signed-off-by: David Marchand <david.marchand@6wind.com>
10 years agoapp/testpmd: fix RSS by setting mq_mode
Daniel Kan [Thu, 16 Jan 2014 00:31:39 +0000 (16:31 -0800)]
app/testpmd: fix RSS by setting mq_mode

The mq_mode was not set when rxq is > 0; it's defaulted to ETH_MQ_RX_NONE.
As a result, RSS remains inactive. The fix is to set mq_mode to ETH_MQ_RX_RSS
when hf is non-zero.

This bug was introduced by commit 243db2ddee3094a2cb39fdd4b17e26df4e7735e1
igb/ixgbe: ETH_MQ_RX_NONE should disable RSS

Signed-off-by: Daniel Kan <dan@nyansa.com>
Acked-by: Maxime Leroy <maxime.leroy@6wind.com>
10 years agoapp/testpmd: added new macfwd-retry mode
Bruce Richardson [Wed, 12 Feb 2014 16:09:58 +0000 (16:09 +0000)]
app/testpmd: added new macfwd-retry mode

This adds a new forwarding mode to testpmd, whereby it will forward
packets, but on a transmit failure, it will wait a small amount of time
before retrying the transmit again. This mode can be useful in some
cases to set a zero-packet loss rate at the cost of overall throughput,
especially in cases where TX ring size/buffering is constrained, such as
with virtio.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
10 years agoapp/test: fixes to python control script
Bruce Richardson [Tue, 11 Feb 2014 12:03:26 +0000 (12:03 +0000)]
app/test: fixes to python control script

* Change behaviour to spread the memory specified across all sockets
  rather than duplicating the memory for each one. This way the memory
  size specified is the total memory needed by the test.
* Minor reordering of test cases, to ensure that ring autotest is the
  final test run.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
10 years agoapp/test: remove all-autotests option
Bruce Richardson [Mon, 10 Feb 2014 11:47:38 +0000 (11:47 +0000)]
app/test: remove all-autotests option

It's no longer possible to run all autotests in
a single go and have them pass, so remove that option.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
10 years agoapp/test: minor cleanup in test_acl
Bruce Richardson [Tue, 11 Feb 2014 15:50:01 +0000 (15:50 +0000)]
app/test: minor cleanup in test_acl

Minor chanes including replacing local DIM macro with more standard
RTE_DIM macro from rte_common.h.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
10 years agoapp/test: conditionalize on timer enabled
Bruce Richardson [Tue, 11 Feb 2014 16:33:41 +0000 (16:33 +0000)]
app/test: conditionalize on timer enabled

don't compile the timer autotests unless timer library is turned on in
the compile-time configuration.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
10 years agoapp/test: minor updates
Bruce Richardson [Wed, 12 Feb 2014 16:05:56 +0000 (16:05 +0000)]
app/test: minor updates

Minor fixes/updates to the autotest app, including:
* replace hard-coded values with #defines in rte_power.h
* replace local DIM() macro with common RTE_DIM

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
10 years agoixgbe: fix vf irq storm when running on Xen Dom0.
Bruce Richardson [Mon, 17 Feb 2014 18:57:55 +0000 (19:57 +0100)]
ixgbe: fix vf irq storm when running on Xen Dom0.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Signed-off-by: David Marchand <david.marchand@6wind.com>
10 years agoixgbe: prepare for vector pmd
Bruce Richardson [Wed, 12 Feb 2014 16:34:33 +0000 (16:34 +0000)]
ixgbe: prepare for vector pmd

The following changes are included in this patch for ixgbe:
* Support for a separate Vector Poll-Mode Driver component
* Refactoring to extract out definitions from .c file to separate .h

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
10 years agoixgbe: minor rework offloading bits fix
Bruce Richardson [Mon, 17 Feb 2014 17:27:46 +0000 (18:27 +0100)]
ixgbe: minor rework offloading bits fix

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Signed-off-by: David Marchand <david.marchand@6wind.com>
10 years agoixgbe: fix offloading bits when Rx bulk alloc is used
Bryan Benson [Fri, 8 Nov 2013 19:47:22 +0000 (19:47 +0000)]
ixgbe: fix offloading bits when Rx bulk alloc is used

This is a fix for the ixgbe hardware offload flags not being set
when bulk alloc RX is used. The issue was caused by masking off
the bits that store the hardware offload values in the status_error
field to retrieve the done bit for the descriptor.

Commit 7431041062b9fd0555bac7ca4abebc99e3379fa5 in DPDK-1.3.0
introduced bulk dequeue, which included the bug.

Signed-off-by: Bryan Benson <bmbenson@amazon.com>
Acked-by: Ivan Boule <ivan.boule@6wind.com>
10 years agoixgbe: query assignment of VF queues
Qinglai Xiao [Mon, 21 Oct 2013 14:11:14 +0000 (17:11 +0300)]
ixgbe: query assignment of VF queues

Physical Function assignes Tx/Rx queues to each Virtual Function
according to different schemes[1]. By querying through mailbox,
VF is able to get number of Tx/Rx queues assigned to it.

Note that current Intel ixgbe driver ixgbe-3.18.7 does not fully
support mailbox message IXGBE_VF_GET_QUEUES. The service routine
for IXGBE_VF_GET_QUEUES must be fixed, otherwise PF always return
1 as Tx/Rx queue number.

[1] See section 7.2.1.2.1, 7.1.2.2 and 7.10.2.7.2 of Intel 82599 10
    Gbe Controller Datasheet.

Signed-off-by: Qinglai Xiao <jigsaw@gmail.com>
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
10 years agoixgbe: fix disabling loopback mode
Bruce Richardson [Mon, 17 Feb 2014 18:55:26 +0000 (19:55 +0100)]
ixgbe: fix disabling loopback mode

Following introduction of loopback mode, this mode should be explicitely
disabled in ixgbe_dev_rx_init() if not enabled.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Signed-off-by: David Marchand <david.marchand@6wind.com>
10 years agoixgbe: add Tx->Rx loopback mode for 82599
Qinglai Xiao [Thu, 26 Sep 2013 13:34:44 +0000 (16:34 +0300)]
ixgbe: add Tx->Rx loopback mode for 82599

82599 has two loopback operation modes, Tx->Rx and Rx->Tx.
For the time being only Tx->Rx is supported.

The new field lpbk_mode added in struct rte_eth_conf defines loopback
operation mode for certain ethernet controller. By default the value
of lpbk_mode is 0, meaning loopback mode disabled.

Since each ethernet controller has its own definition of loopback modes,
API user has to check both datasheet and implementation of certain driver
so as to understand what are valid values to be set, and what are the
expected behaviors.

Check IXGBE_LPBK_82599_XXX which are defined in ixgbe_ethdev.h
for valid values of 82599 loopback mode.

Signed-off-by: Qinglai Xiao <jigsaw@gmail.com>
Acked-by: Ivan Boule <ivan.boule@6wind.com>
Acked-by: Venky Venkatesan <venky.venkatesan@intel.com>
10 years agoigb: fix dual vlan ethertype
Bruce Richardson [Mon, 17 Feb 2014 20:21:03 +0000 (21:21 +0100)]
igb: fix dual vlan ethertype

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Signed-off-by: David Marchand <david.marchand@6wind.com>
10 years agoigb: restore workaround errata with wthresh on 82576
Stephen Hemminger [Thu, 30 May 2013 17:12:35 +0000 (10:12 -0700)]
igb: restore workaround errata with wthresh on 82576

The 82576 has known issues which require the write threshold to be set to 1.
See:
http://download.intel.com/design/network/specupdt/82576_SPECUPDATE.pdf

If not then single packets will hang in transmit ring until more arrive.
Simple tests like ping will fail.

The workaround was in the wrong file (commit a30ebfbb8c3a).
Move it in igb one to restore original patch (7e9e49feea).

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
10 years agoigb/ixgbe: remove useless header inclusion
Bruce Richardson [Mon, 17 Feb 2014 12:42:33 +0000 (13:42 +0100)]
igb/ixgbe: remove useless header inclusion

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Signed-off-by: David Marchand <david.marchand@6wind.com>
10 years agoigb/ixgbe: allow RSS with only one Rx queue
Maxime Leroy [Mon, 2 Sep 2013 15:14:10 +0000 (17:14 +0200)]
igb/ixgbe: allow RSS with only one Rx queue

It should be possible to enable RSS with one Rx queue.
RSS hash can be useful independently of the number of Rx queues.
Applications can use RSS hash to identify different IP flows.

Signed-off-by: Maxime Leroy <maxime.leroy@6wind.com>
Acked-by: Ivan Boule <ivan.boule@6wind.com>
10 years agoigb/ixgbe: ETH_MQ_RX_NONE should disable RSS
Maxime Leroy [Mon, 2 Sep 2013 15:07:55 +0000 (17:07 +0200)]
igb/ixgbe: ETH_MQ_RX_NONE should disable RSS

As explained in rte_ethdev.h, ETH_MQ_RX_NONE allows to not choose RSS, DCB
or VMDQ mode.

But the igb/ixgbe code always silently select the RSS mode with ETH_MQ_RX_NONE.
This patch fixes this incoherence between the API and the implementation.

Signed-off-by: Maxime Leroy <maxime.leroy@6wind.com>
Acked-by: Ivan Boule <ivan.boule@6wind.com>
10 years agopcap: add missing dependency on malloc
Bruce Richardson [Mon, 10 Feb 2014 14:52:22 +0000 (14:52 +0000)]
pcap: add missing dependency on malloc

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
10 years agovirtio: mark functions as always inline
Bruce Richardson [Wed, 12 Feb 2014 16:44:00 +0000 (16:44 +0000)]
virtio: mark functions as always inline

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
10 years agovirtio: various improvements
Bruce Richardson [Wed, 12 Feb 2014 16:44:00 +0000 (16:44 +0000)]
virtio: various improvements

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
10 years agovirtio: add close function
Bruce Richardson [Wed, 12 Feb 2014 16:44:44 +0000 (16:44 +0000)]
virtio: add close function

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
10 years agovmxnet3: import new vmxnet3 poll mode driver implementation
Bruce Richardson [Mon, 10 Feb 2014 15:27:26 +0000 (15:27 +0000)]
vmxnet3: import new vmxnet3 poll mode driver implementation

Poll Mode Driver for Paravirtual VMXNET3 NIC.
As a PMD, the VMXNET3 driver provides the packet reception and transmission
callbacks, vmxnet3_recv_pkts and vmxnet3_xmit_pkts. It does not support
scattered packet reception as part of vmxnet3_recv_pkts and
vmxnet3_xmit_pkts. Also, it does not support scattered packet reception as part of
the device operations supported.

The VMXNET3 PMD handles all the packet buffer memory allocation and resides in
guest address space and it is solely responsible to free that memory when not needed.
The packet buffers and features to be supported are made available to hypervisor via
VMXNET3 PCI configuration space BARs. During RX/TX, the packet buffers are
exchanged by their GPAs, and the hypervisor loads the buffers with packets in the RX
case and sends packets to vSwitch in the TX case.

The VMXNET3 PMD is compiled with vmxnet3 device headers. The interface is similar
to that of the other PMDs available in the Intel(R) DPDK API. The driver pre-allocates the
packet buffers and loads the command ring descriptors in advance. The hypervisor fills
those packet buffers on packet arrival and write completion ring descriptors, which are
eventually pulled by the PMD. After reception, the Intel(R) DPDK application frees the
descriptors and loads new packet buffers for the coming packets. The interrupts are
disabled and there is no notification required. This keeps performance up on the RX
side, even though the device provides a notification feature.

In the transmit routine, the Intel(R) DPDK application fills packet buffer pointers in the
descriptors of the command ring and notifies the hypervisor. In response the hypervisor
takes packets and passes them to the vSwitch. It writes into the completion descriptors
ring. The rings are read by the PMD in the next transmit routine call and the buffers
and descriptors are freed from memory.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
10 years agopci: add pci ids for vmxnet3 devices
Bruce Richardson [Tue, 11 Feb 2014 15:42:33 +0000 (15:42 +0000)]
pci: add pci ids for vmxnet3 devices

pci ids for vmxnet3 devices added.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
10 years agokni: update kernel driver ethtool baseline
Bruce Richardson [Tue, 11 Feb 2014 12:25:54 +0000 (12:25 +0000)]
kni: update kernel driver ethtool baseline

Update the KNI kernel driver so it can compile on more modern kernels
Also, rebaseline the ethtool support off updated igb kernel drivers
so that we get the latest bug fixes and device support.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
10 years agokni: fix packet loss in loopback mode
Bruce Richardson [Wed, 12 Feb 2014 16:23:00 +0000 (16:23 +0000)]
kni: fix packet loss in loopback mode

kni_net fixed to prevent losing packet bytes when doing loopback.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Reported-by: Daniel Kaminsky <daniel.kaminsky@infinitelocality.com>
10 years agokni: add kni close function
Bruce Richardson [Wed, 12 Feb 2014 16:23:56 +0000 (16:23 +0000)]
kni: add kni close function

KNI close function added.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
10 years agoxen: import xenvirt pmd and vhost_xen
Bruce Richardson [Wed, 12 Feb 2014 15:50:11 +0000 (15:50 +0000)]
xen: import xenvirt pmd and vhost_xen

This provides a para-virtualization packet switching solution, based on the
Xen hypervisor’s Grant Table, which provides simple and fast packet
switching capability between guest domains and host domain based on
MAC address or VLAN tag.

This solution is comprised of two components; a Poll Mode Driver (PMD)
as the front end in the guest domain and a switching back end in the
host domain.  XenStore is used to exchange configure information
between the PMD front end and switching back end,
including grant reference IDs for shared Virtio RX/TX rings, MAC
address, device state, and so on.

The front end PMD can be found in the Intel DPDK directory lib/
librte_pmd_xenvirt and back end example in examples/vhost_xen.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
10 years agoxen: core library changes
Bruce Richardson [Wed, 12 Feb 2014 15:32:25 +0000 (15:32 +0000)]
xen: core library changes

Core support for using the Intel DPDK with Xen Dom0 - including EAL
changes and mempool changes. These changes encompass how memory mapping
is done, including support for initializing a memory pool inside an
already-allocated block of memory.
KNI sample app updated to use KNI close function when used with Xen.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
10 years agoivshmem: library changes for mmaping using ivshmem
Bruce Richardson [Tue, 11 Feb 2014 10:28:51 +0000 (10:28 +0000)]
ivshmem: library changes for mmaping using ivshmem

These library changes provide a new Intel DPDK feature for communicating
with virtual machines using QEMU's IVSHMEM mechanism.

The feature works by providing a command line for QEMU to map several hugepages
into a single IVSHMEM device. For the guest to know what is inside any given IVSHMEM
device (and to distinguish between Intel(R) DPDK and non-Intel(R) DPDK IVSHMEM
devices), a metadata file is also mapped into the IVSHMEM segment. No work needs to
be done by the guest application to map IVSHMEM devices into memory; they are
automatically recognized by the Intel(R) DPDK Environment Abstraction Layer (EAL).

Changes in this patch:
* Changes to EAL to allow mapping of all hugepages in a memseg into a single file
* Changes to EAL to allow ivshmem devices to be transparently mapped in
  the process running on the guest.
* New ivshmem library to create and manage metadata exported to guest VM's
* New ivshmem compilation targets
* Mempool and ring changes to allow export of structures to a VM and allow
  a VM to attach to those structures.
* New autotests to unit tests this functionality.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
10 years agomem: add bounded reserve function
Bruce Richardson [Tue, 11 Feb 2014 16:24:25 +0000 (16:24 +0000)]
mem: add bounded reserve function

For certain functionality, e.g. Xen Dom0 support, it is required that
we can guarantee that memzones for descriptor rings won't cross 2M
boundaries. So add new memzone reserve function where we can pass in a
boundary condition parameter.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
10 years agomem: remove duplicated lines
Pei Chao [Thu, 2 Jan 2014 13:05:42 +0000 (21:05 +0800)]
mem: remove duplicated lines

Extra space for future alignment was reserved twice.
It was introduced in version 1.3.0 (commit 916e4f4f4e45a1d3cdd473cf9ef).

Signed-off-by: Pei Chao <peichao85@gmail.com>
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
10 years agomem: fix log for --no-huge
Thomas Monjalon [Mon, 8 Apr 2013 16:13:06 +0000 (18:13 +0200)]
mem: fix log for --no-huge

In some cases, it is possible to not use hugepages.
So a simple malloc is used to initialize DPDK memory.

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Acked-by: Damien Millescamps <damien.millescamps@6wind.com>
10 years agomem: allow virtual memory address hinting
Bruce Richardson [Wed, 12 Feb 2014 13:38:45 +0000 (13:38 +0000)]
mem: allow virtual memory address hinting

For multi-process applications, it can sometimes occur that part of the
address ranges used for memory mapping in the primary process are not
free in the secondary process, which causes the secondary processes to
abort on startup.
This patch adds in a memory hinting mechanism, where you can hint a
starting base address to the primary process for where you would like
the hugepage memory to be mapped. It is just a hint, so the memory will
not always go exactly where requested, but it should allow the memory
addresses used by a primary process to be adjusted up or down a little,
thereby fixing issues with secondary process startup.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
10 years agombuf: rework check on mbuf freeing
Bruce Richardson [Mon, 17 Feb 2014 19:15:19 +0000 (20:15 +0100)]
mbuf: rework check on mbuf freeing

Allow poll-mode drivers to maintain their own caches of mbufs, by allowing them
to check if it's ok to free an mbuf (to their local cache) without actually
freeing it back to the memory pool itself.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Signed-off-by: David Marchand <david.marchand@6wind.com>
10 years agosched: use common macro RTE_DIM
Bruce Richardson [Wed, 12 Feb 2014 16:26:03 +0000 (16:26 +0000)]
sched: use common macro RTE_DIM

Replace local DIM() macro with RTE_DIM in rte_red.c

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
10 years agotimer: missing optimization flag in compile
Bruce Richardson [Tue, 11 Feb 2014 12:11:44 +0000 (12:11 +0000)]
timer: missing optimization flag in compile

Timer library was missing the -O3 compile-time flag. This has been
added.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
10 years agoeal: fix printf format
Bruce Richardson [Wed, 12 Feb 2014 16:46:12 +0000 (16:46 +0000)]
eal: fix printf format

Fix some format indicators in printf.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
10 years agoeal: cleanup on mempool and memzone object names
Bruce Richardson [Tue, 18 Feb 2014 09:51:16 +0000 (10:51 +0100)]
eal: cleanup on mempool and memzone object names

Cleanup mempool and memzone object names so that we can more easily rename them
from headers.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Signed-off-by: David Marchand <david.marchand@6wind.com>
10 years agoeal: fix build with some gcc 4.4 toolchains
Bruce Richardson [Wed, 12 Feb 2014 17:04:33 +0000 (17:04 +0000)]
eal: fix build with some gcc 4.4 toolchains

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Signed-off-by: David Marchand <david.marchand@6wind.com>
10 years agoeal: fix typo for RTE_EAL_ALLOW_INV_SOCKET_ID
Bruce Richardson [Mon, 17 Feb 2014 20:04:44 +0000 (21:04 +0100)]
eal: fix typo for RTE_EAL_ALLOW_INV_SOCKET_ID

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Signed-off-by: David Marchand <david.marchand@6wind.com>
10 years agoeal: fix support for older gcc versions
Bruce Richardson [Tue, 11 Feb 2014 15:40:49 +0000 (15:40 +0000)]
eal: fix support for older gcc versions

older versions of gcc don't support the cold attribute so make its
presence conditional.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
10 years agoeal: fix cpuflags for latest microarch
Bruce Richardson [Tue, 11 Feb 2014 15:38:29 +0000 (15:38 +0000)]
eal: fix cpuflags for latest microarch

Ensure that support for AVX2, HLE and RTM works with cpuflags.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
10 years agoeal: new common macros added
Bruce Richardson [Tue, 11 Feb 2014 10:08:43 +0000 (10:08 +0000)]
eal: new common macros added

Added the following new macros/inline functions, which are both
generally useful and needed for later functionality:
* rte_align64pow2: aligns a 64bit parameter to next power of 2
* RTE_LEN2MASK: create mask of type <tp> with the first <ln> bits
* RTE_DIM: return the number of elements in an array.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
10 years agoeal: add rte_compiler_barrier() macro
Bruce Richardson [Mon, 10 Feb 2014 14:43:44 +0000 (14:43 +0000)]
eal: add rte_compiler_barrier() macro

The rte_ring functions used a compiler barrier to stop the compiler
reordering certain expressions. This is generally useful so is moved
to the common header file with the other barriers.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
10 years agomk: compilation fixes
Bruce Richardson [Tue, 11 Feb 2014 12:10:16 +0000 (12:10 +0000)]
mk: compilation fixes

Missing _GNU_SOURCE define for compilation of a number of files.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
10 years agomk: add haswell target
Bruce Richardson [Mon, 17 Feb 2014 12:56:37 +0000 (13:56 +0100)]
mk: add haswell target

Add support for haswell based systems.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Signed-off-by: David Marchand <david.marchand@6wind.com>
10 years agomk: rework cpu flags detection
Bruce Richardson [Mon, 17 Feb 2014 12:46:06 +0000 (13:46 +0100)]
mk: rework cpu flags detection

For cases where the compilation microarchitecture is explicitly given, we
extract the cpu-flags to use from the compiler rather than hard-coding. This
means that we will only ever use instruction sets supported by the compiler,
rather than having a case where the uarch and the Intel DPDK both support a
given instruction-set, but the compiler does not.
In the case where 'native' uarch support is requested, the same mechanism is
also used to detect the instruction-sets supported

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Signed-off-by: David Marchand <david.marchand@6wind.com>
10 years agoconfig: remove deprecated opt for unbinding ports
Bruce Richardson [Tue, 11 Feb 2014 16:46:00 +0000 (16:46 +0000)]
config: remove deprecated opt for unbinding ports

Remove the unbind ports option from the config files as this
has been deprecated since 1.4 release.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
10 years agoconfig: fix combined/shared lib
Thomas Monjalon [Wed, 23 Oct 2013 09:40:56 +0000 (11:40 +0200)]
config: fix combined/shared lib

- Configuration for combined and shared library was only in the template
defconfig_x86_64-default-linuxapp-gcc.
- CONFIG_RTE_LIBNAME was in the wrong section
- RTE_LIBNAME had no quote in "C context" (include/rte_config.h)
- and then CONFIG_RTE_LIBNAME quotes were not properly removed in "make context"

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
10 years agoadd FreeBSD support
Bruce Richardson [Mon, 10 Feb 2014 11:49:10 +0000 (11:49 +0000)]
add FreeBSD support

Changes to allow compilation and use on FreeBSD. Includes:
* contigmem and nic_uio driver for FreeBSD
* new EAL instance
* new "bsdapp" compilation target
* various compilation fixes due to differences between linux and freebsd

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
10 years agoupdate Intel copyright years to 2014
Bruce Richardson [Mon, 10 Feb 2014 11:46:50 +0000 (11:46 +0000)]
update Intel copyright years to 2014

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>