dpdk.git
9 years agoeal/linux: rework loop in hugepage init
David Marchand [Thu, 9 Jul 2015 09:19:24 +0000 (11:19 +0200)]
eal/linux: rework loop in hugepage init

Replace this while loop with a for loop and simplify error handling.
Indent is broken on purpose, fixed in next commit.

Signed-off-by: David Marchand <david.marchand@6wind.com>
Acked-by: Sergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com>
9 years agoeal/linux: improve coding style of hugepage init
David Marchand [Thu, 9 Jul 2015 09:19:23 +0000 (11:19 +0200)]
eal/linux: improve coding style of hugepage init

Prepare for checkpatch compliance.

Signed-off-by: David Marchand <david.marchand@6wind.com>
Acked-by: Sergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com>
9 years agoeal/linux: remove useless casts in hugepage init
David Marchand [Thu, 9 Jul 2015 09:19:22 +0000 (11:19 +0200)]
eal/linux: remove useless casts in hugepage init

Rather than cast the huge pages number returned by get_num_hugepages, rework
this function so that it returns 0 when something goes wrong.
And no need for casts in log.

Signed-off-by: David Marchand <david.marchand@6wind.com>
Acked-by: Sergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com>
9 years agoeal/linux: remove useless process type check in hugepage init
David Marchand [Thu, 9 Jul 2015 09:19:21 +0000 (11:19 +0200)]
eal/linux: remove useless process type check in hugepage init

The code in eal_hugepage_info.c is not reachable by secondary processes.

Signed-off-by: David Marchand <david.marchand@6wind.com>
Acked-by: Sergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com>
9 years agohash: fix build on non-x86 arch
Bruce Liu [Wed, 8 Jul 2015 15:15:47 +0000 (23:15 +0800)]
hash: fix build on non-x86 arch

In the no-x86 branch, a parentheses is missing.
And need to include <limits.h> header to use CHAR_BIT.

Fixes: 49361c3f3cfa ("hash: remove duplicated code")

Signed-off-by: Bruce Liu <2103458176@qq.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
9 years agoapp/testpmd: show the hash key size
Helin Zhang [Fri, 12 Jun 2015 07:34:01 +0000 (15:34 +0800)]
app/testpmd: show the hash key size

As querying hash key size in byte was supported, it can be shown
in testpmd after getting the device information if not zero.

Signed-off-by: Helin Zhang <helin.zhang@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
9 years agoethdev: add the hash key size per device
Helin Zhang [Fri, 12 Jun 2015 07:33:56 +0000 (15:33 +0800)]
ethdev: add the hash key size per device

To support querying hash key size per port, an new field of
'hash_key_size' was added in 'struct rte_eth_dev_info' for storing
hash key size in bytes.

The correct hash key size in bytes should be filled into the
'struct rte_eth_dev_info', to support querying it.

Signed-off-by: Helin Zhang <helin.zhang@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
9 years agomk: enable next abi preview
Thomas Monjalon [Thu, 2 Jul 2015 21:03:40 +0000 (23:03 +0200)]
mk: enable next abi preview

When a change makes really hard to keep ABI compatibility,
instead of waiting next release to break the ABI, it is smoother
to introduce the new code as a preview and disable it when packaging.
The flag RTE_NEXT_ABI must be used to "ifdef" the new code.
When the release is out, a dynamically linked application can use
the new shared libraries with the old ABI while developpers can prepare
their application for the next ABI by reading the deprecation notice
and easily testing the new code.
When starting the next release cycle, the "ifdefs" will be removed
and the ABI break will be marked by incrementing LIBABIVER. The map
files will also be updated.

The default value is enabled to be developer compliant.
The packagers must disable it as done in pkg/dpdk.spec.
When enabled, all shared library numbers are incremented by appending
a minor .1 to the old ABI number. In the next release, only impacted
libraries will have a major +1 increment.
The impacted libraries must provide an alternative map file to use
with this option.

The ABI policy is updated.

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
9 years agomk: remove variables identical to config ones
Thomas Monjalon [Wed, 8 Jul 2015 10:34:26 +0000 (12:34 +0200)]
mk: remove variables identical to config ones

CONFIG_RTE_BUILD_SHARED_LIB and CONFIG_RTE_BUILD_COMBINE_LIBS does not
have quotes in their values (only y or n). That's why the variables
RTE_BUILD_SHARED_LIB and RTE_BUILD_COMBINE_LIBS are always identical to
their CONFIG_ counterpart, and are useless.
In order to have consistent naming of config options in the makefiles,
these options are removed and the "CONFIG_ prefixed" variables are used.

Fixes: e25e4d7ef16b ("mk: shared libraries")
Fixes: 4d3d79e7a5c6 ("mk: combined library")

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
9 years agonic_uio: probe and attach devices after unload
Raz Amir [Thu, 5 Mar 2015 16:24:23 +0000 (18:24 +0200)]
nic_uio: probe and attach devices after unload

Added code that saves the pointers to the detached devices, during
driver loading, and during driver unloading, go over the list,
and re-attach them by calling device_probe_and_attach
on each device.

Signed-off-by: Raz Amir <razamir22@gmail.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
9 years agoeal: enable port hotplug as default for linux and bsd
Tetsuya Mukawa [Tue, 30 Jun 2015 08:26:51 +0000 (17:26 +0900)]
eal: enable port hotplug as default for linux and bsd

This patch removes CONFIG_RTE_LIBRTE_EAL_HOTPLUG option, and enables it
as default in both Linux and BSD.
Also, to support port hotplug, rte_eal_pci_scan() and below missing
symbols should be exported to ethdev library.
 - rte_eal_parse_devargs_str()
 - rte_eal_pci_close_one()
 - rte_eal_pci_probe_one()
 - rte_eal_pci_scan()
 - rte_eal_vdev_init()
 - rte_eal_vdev_uninit()

Signed-off-by: Tetsuya Mukawa <mukawa@igel.co.jp>
9 years agopci: merge probing and closing functions for linux and bsd
Tetsuya Mukawa [Wed, 8 Jul 2015 10:34:53 +0000 (19:34 +0900)]
pci: merge probing and closing functions for linux and bsd

This patch consolidates below functions, and implements these in common
eal code.
 - rte_eal_pci_probe_one_driver()
 - rte_eal_pci_close_one_driver()

Signed-off-by: Tetsuya Mukawa <mukawa@igel.co.jp>
Acked-by: David Marchand <david.marchand@6wind.com>
9 years agopci: merge mapping functions for linux and bsd
Tetsuya Mukawa [Wed, 8 Jul 2015 10:34:52 +0000 (19:34 +0900)]
pci: merge mapping functions for linux and bsd

The patch consolidates below functions, and implemented in common
eal code.
 - pci_map_device()
 - pci_unmap_device()

Signed-off-by: Tetsuya Mukawa <mukawa@igel.co.jp>
Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>
Acked-by: David Marchand <david.marchand@6wind.com>
9 years agopci: merge uio functions for linux and bsd
Tetsuya Mukawa [Wed, 8 Jul 2015 10:34:51 +0000 (19:34 +0900)]
pci: merge uio functions for linux and bsd

The patch consolidates below functions, and implement these
in eal_common_pci_uio.c.
 - pci_uio_map_secondary()
 - pci_uio_map_resource()
 - pci_uio_unmap()
 - pci_uio_find_resource()
 - pci_uio_unmap_resource()

Signed-off-by: Tetsuya Mukawa <mukawa@igel.co.jp>
Acked-by: David Marchand <david.marchand@6wind.com>
9 years agopci: merge resource mapping functions for linux and bsd
Tetsuya Mukawa [Wed, 8 Jul 2015 10:34:50 +0000 (19:34 +0900)]
pci: merge resource mapping functions for linux and bsd

The patch consolidates below functions, and implemented in common
eal code.
 - pci_map_resource()
 - pci_unmap_resource()

Signed-off-by: Tetsuya Mukawa <mukawa@igel.co.jp>
Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>
Acked-by: David Marchand <david.marchand@6wind.com>
9 years agopci: merge mapping structures for linux and bsd
Tetsuya Mukawa [Wed, 8 Jul 2015 10:34:49 +0000 (19:34 +0900)]
pci: merge mapping structures for linux and bsd

This patch consolidates below structures, and defines them in common code.
 - struct pci_map
 - struct mapped_pci_resources

Signed-off-by: Tetsuya Mukawa <mukawa@igel.co.jp>
Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>
Acked-by: David Marchand <david.marchand@6wind.com>
9 years agopci: introduce function to map uio resource by index
Tetsuya Mukawa [Wed, 8 Jul 2015 10:34:48 +0000 (19:34 +0900)]
pci: introduce function to map uio resource by index

This patch adds a new function called pci_uio_map_resource_by_index().
The function hides how to map uio resource in linuxapp and bsdapp.
With the function, pci_uio_map_resource() will be more abstracted.

Signed-off-by: Tetsuya Mukawa <mukawa@igel.co.jp>
Acked-by: David Marchand <david.marchand@6wind.com>
9 years agopci: introduce functions to alloc and free uio resource
Tetsuya Mukawa [Wed, 8 Jul 2015 10:34:47 +0000 (19:34 +0900)]
pci: introduce functions to alloc and free uio resource

This patch adds new functions called pci_uio_alloc_resource() and
pci_uio_free_resource().
The functions hides how to prepare or free uio resource in linuxapp
and bsdapp. With the function, pci_uio_map_resource() will be more
abstracted.

Signed-off-by: Tetsuya Mukawa <mukawa@igel.co.jp>
Acked-by: David Marchand <david.marchand@6wind.com>
9 years agopci: fix uio mapping differences between linux and bsd
Tetsuya Mukawa [Wed, 8 Jul 2015 10:34:46 +0000 (19:34 +0900)]
pci: fix uio mapping differences between linux and bsd

This patch fixes below.
- bsdapp
 - Use map_id in pci_uio_map_resource().
 - Fix interface of pci_map_resource().
 - Move path variable of mapped_pci_resource structure to pci_map.
- linuxapp
 - Remove redundant error message of linuxapp.

'pci_uio_map_resource()' is implemented in both linuxapp and bsdapp,
but interface is different. The patch fixes the function of bsdapp
to do same as linuxapp. After applying it, file descriptor should be
opened and closed out of pci_map_resource().

Signed-off-by: Tetsuya Mukawa <mukawa@igel.co.jp>
Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>
Acked-by: David Marchand <david.marchand@6wind.com>
9 years agopci/bsd: rename structures
Tetsuya Mukawa [Wed, 8 Jul 2015 10:34:45 +0000 (19:34 +0900)]
pci/bsd: rename structures

To merge pci code of linuxapp and bsdapp, this patch changes names
like below.
 - uio_map to pci_map
 - uio_resource to mapped_pci_resource
 - uio_res_list to mapped_pci_res_list

Signed-off-by: Tetsuya Mukawa <mukawa@igel.co.jp>
Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>
Acked-by: David Marchand <david.marchand@6wind.com>
9 years agopci: fix memory leaks and needless increment of map address
Tetsuya Mukawa [Wed, 8 Jul 2015 10:34:44 +0000 (19:34 +0900)]
pci: fix memory leaks and needless increment of map address

This patch fixes following memory leaks.
- When open() is failed, uio_res and fds won't be freed in
  pci_uio_map_resource().
- When pci_map_resource() is failed but path is allocated correctly,
  path and fds won't be freed in pci_uio_map_recource().
  Also, some mapped resources should be freed.
- When pci_uio_unmap() is called, path should be freed.

Also, fixes below.
- When pci_map_resource() is failed, mapaddr will be MAP_FAILED.
  In this case, pci_map_addr should not be incremented in
  pci_uio_map_resource().
- To shrink code, move close().
- Remove fail variable.

Signed-off-by: Tetsuya Mukawa <mukawa@igel.co.jp>
Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>
Acked-by: David Marchand <david.marchand@6wind.com>
9 years agopci: close file descriptor of uio configuration
Tetsuya Mukawa [Wed, 8 Jul 2015 10:34:43 +0000 (19:34 +0900)]
pci: close file descriptor of uio configuration

When pci_uio_unmap_resource() is called, a file descriptor that is used
for uio configuration should be closed.

Signed-off-by: Tetsuya Mukawa <mukawa@igel.co.jp>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>
Acked-by: David Marchand <david.marchand@6wind.com>
9 years agopci: fix coding style
Tetsuya Mukawa [Wed, 8 Jul 2015 10:34:42 +0000 (19:34 +0900)]
pci: fix coding style

This patch fixes coding style of below files in linuxapp and bsdapp.
 - eal_pci.c
 - eal_pci_uio.c

Signed-off-by: Tetsuya Mukawa <mukawa@igel.co.jp>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: David Marchand <david.marchand@6wind.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>
9 years agoeal: add const in prefetch functions
Pablo de Lara [Wed, 8 Jul 2015 09:51:33 +0000 (10:51 +0100)]
eal: add const in prefetch functions

rte_prefetchX functions included volatile void *p as parameter,
but the function does not modify it,
so it should include the const keyword.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
9 years agoi40e: fix build with gcc 4.4
Jingjing Wu [Wed, 8 Jul 2015 06:37:19 +0000 (14:37 +0800)]
i40e: fix build with gcc 4.4

Fix the build warning reported like:
   error: dereferencing pointer 'cmd' does break strict-aliasing rules

Fixes: a4def5edf0fc ("i40e: enable port mirroring")

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
9 years agoapp/testpmd: add flow director for L2 payload
Jingjing Wu [Tue, 16 Jun 2015 03:43:46 +0000 (11:43 +0800)]
app/testpmd: add flow director for L2 payload

This patch extends flow director commands to support l2_payload flow type.

Test report: http://dpdk.org/ml/archives/dev/2015-June/020238.html

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
9 years agoi40e: add flow director for L2 payload
Jingjing Wu [Tue, 16 Jun 2015 03:43:45 +0000 (11:43 +0800)]
i40e: add flow director for L2 payload

This patch extends flow director to support l2_payload flow
type in i40e driver.

Test report: http://dpdk.org/ml/archives/dev/2015-June/020238.html

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
9 years agoethdev: add flow director for L2 payload
Jingjing Wu [Tue, 16 Jun 2015 03:43:44 +0000 (11:43 +0800)]
ethdev: add flow director for L2 payload

This patch adds a new struct rte_eth_l2_flow to support
l2_payload flow type.

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
9 years agoi40e: enable port mirroring
Jingjing Wu [Wed, 10 Jun 2015 06:24:32 +0000 (14:24 +0800)]
i40e: enable port mirroring

enable mirror functionality in i40e driver
.mirror_rule_set
.mirror_rule_reset

Test report: http://dpdk.org/ml/archives/dev/2015-June/019118.html

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Jijiang Liu <jijiang.liu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
9 years agoethdev: rename and extend the mirror type
Jingjing Wu [Wed, 10 Jun 2015 06:24:31 +0000 (14:24 +0800)]
ethdev: rename and extend the mirror type

This path renames the mirror type in rte_eth_mirror_conf and macros,
and rework the mirror set in ixgbe drivers by using new definition.
It also fixes some coding style.

Test report: http://dpdk.org/ml/archives/dev/2015-June/019118.html

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Jijiang Liu <jijiang.liu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
9 years agoethdev: rename port mirroring structure
Jingjing Wu [Wed, 10 Jun 2015 06:24:30 +0000 (14:24 +0800)]
ethdev: rename port mirroring structure

Rename rte_eth_vmdq_mirror_conf to rte_eth_mirror_conf and move
the maximum rule id check from ethdev level to driver.

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Jijiang Liu <jijiang.liu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
9 years agoexamples/ipv4_multicast: support double vlan stripping and insertion
Helin Zhang [Thu, 11 Jun 2015 07:03:59 +0000 (15:03 +0800)]
examples/ipv4_multicast: support double vlan stripping and insertion

The outer vlan should be copied from source packet buffer to
support double vlan stripping and insertion, as double vlan can be
stripped or inserted by some of NIC hardware.

Signed-off-by: Helin Zhang <helin.zhang@intel.com>
Acked-by: Jingjing Wu <jingjing.wu@intel.com>
9 years agoapp/testpmd: add qinq stripping and insertion
Helin Zhang [Thu, 11 Jun 2015 07:03:58 +0000 (15:03 +0800)]
app/testpmd: add qinq stripping and insertion

If double vlan is detected, its stripped flag and vlan tags can be
printed on rxonly mode. Test command of 'tx_vlan set' is expanded
to set both single and double vlan tags on TX side for each packets
to be sent out.

Signed-off-by: Helin Zhang <helin.zhang@intel.com>
Acked-by: Jingjing Wu <jingjing.wu@intel.com>
9 years agoi40evf: fix offload capability flags
Helin Zhang [Thu, 11 Jun 2015 07:03:57 +0000 (15:03 +0800)]
i40evf: fix offload capability flags

Add checksum offload capability flags which have already been
supported for a long time.

Signed-off-by: Helin Zhang <helin.zhang@intel.com>
Acked-by: Jingjing Wu <jingjing.wu@intel.com>
9 years agoi40e: support double vlan stripping and insertion
Helin Zhang [Thu, 11 Jun 2015 07:03:56 +0000 (15:03 +0800)]
i40e: support double vlan stripping and insertion

It configures specific registers to enable double vlan stripping
on RX side and insertion on TX side.
The RX descriptors will be parsed, the vlan tags and flags will be
saved to corresponding mbuf fields if vlan tag is detected.
The TX descriptors will be configured according to the
configurations in mbufs, to trigger the hardware insertion of
double vlan tags for each packets sent out.

Signed-off-by: Helin Zhang <helin.zhang@intel.com>
Acked-by: Jingjing Wu <jingjing.wu@intel.com>
9 years agombuf: use reserved space for double vlan
Helin Zhang [Thu, 11 Jun 2015 07:03:55 +0000 (15:03 +0800)]
mbuf: use reserved space for double vlan

Use the reserved 16 bits in rte_mbuf structure for the outer vlan,
also add QinQ offloading flags for both RX and TX sides.

Signed-off-by: Helin Zhang <helin.zhang@intel.com>
Acked-by: Jingjing Wu <jingjing.wu@intel.com>
9 years agoixgbe: remove a discarded source line
Helin Zhang [Thu, 11 Jun 2015 07:03:54 +0000 (15:03 +0800)]
ixgbe: remove a discarded source line

Little endian to CPU order conversion had been added for reading
vlan tag from RX descriptor, while its original source line was
forgotten to delete. That's a discarded source line and should be
deleted.

Fixes: 23fcffe8ffac ("ixgbe: fix id and hash with flow director")

Signed-off-by: Helin Zhang <helin.zhang@intel.com>
Acked-by: Jingjing Wu <jingjing.wu@intel.com>
9 years agoethdev: fix check of threshold for Tx freeing
Zoltan Kiss [Tue, 23 Jun 2015 18:43:12 +0000 (19:43 +0100)]
ethdev: fix check of threshold for Tx freeing

The parameter tx_free_thresh is not consistent between the drivers:
some use it as rte_eth_tx_burst() requires, some release buffers when
the number of free descriptors drop below this value.
Let's use it as most fast-path code does, which is the latter, and update
comments throughout the code to reflect that.

Signed-off-by: Zoltan Kiss <zoltan.kiss@linaro.org>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
9 years agoixgbe: check mbuf refcnt when clearing a ring
Bruce Richardson [Fri, 3 Jul 2015 15:40:06 +0000 (16:40 +0100)]
ixgbe: check mbuf refcnt when clearing a ring

The function to clear the TX ring when a port was being closed, e.g. on
exit in testpmd, was not checking the mbuf refcnt before freeing it.
Since the function in the vector driver to clear the ring after TX does
not set the pointer to NULL post-free, this caused crashes if mbuf
debugging was turned on.

To reproduce the issue, ensure the follow config variables are set:
RTE_IXGBE_INC_VECTOR
RTE_LIBRTE_MBUF_DEBUG
Then compile up and run testpmd using 10G ports with the vector driver.
Start traffic and let some flow through, then type "stop" and "quit" at
the testpmd prompt, and crash will occur. Output below:

testpmd> quit
Stopping port 0...done
Stopping port 1...PANIC in rte_mbuf_sanity_check():
bad ref cnt
[New Thread 0x7fffabfff700 (LWP 145312)]
[New Thread 0x7fffb47fe700 (LWP 145311)]
[New Thread 0x7fffb4fff700 (LWP 145310)]
[New Thread 0x7ffff6cd5700 (LWP 145309)]
18: [/home/bruce/dpdk.org/x86_64-native-linuxapp-gcc/app/testpmd(_start+0x29)
<....snip for brevity...>
Program received signal SIGABRT, Aborted.
0x00007ffff7120a98 in raise () from /lib64/libc.so.6

A similar error occurs when clearing the RX ring, which is also fixed by
this patch.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
9 years agoixgbe: use cold attribute
Bruce Richardson [Fri, 3 Jul 2015 15:40:05 +0000 (16:40 +0100)]
ixgbe: use cold attribute

As well as the fast-path functions in the rxtx code, there are also
functions which set up and tear down the descriptor rings. Since these
are not performance critical functions, there is no need to have them
extensively optimized, so we add __attribute__((cold)) to their
definitions. This has the side-effect of making debugging them easier as
the compiler does not optimize them as heavily, so more variables are
accessible by default in gdb.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
9 years agodoc: fix sphinx build warning
John McNamara [Thu, 2 Jul 2015 14:15:22 +0000 (15:15 +0100)]
doc: fix sphinx build warning

Fix for a minor Sphinx build warning in the ABI guidelines docs:

    versioning.rst:126: WARNING: Bullet list ends without a
                        blank line; unexpected unindent.

Signed-off-by: John McNamara <john.mcnamara@intel.com>
9 years agomk: print target when reporting build complete
Bruce Richardson [Thu, 2 Jul 2015 10:35:37 +0000 (11:35 +0100)]
mk: print target when reporting build complete

When a target is finished building, it reports just "Build complete".
When building multiple targets simultaneously, e.g.
make install T=x86_64-native-linuxapp-*
and one target fails, it's not always obvious which of the builds
failed. To help this, we add the actual target that is completed to the
"Build complete" message.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
9 years agoethdev: introduce valid port helper
Stephen Hemminger [Sat, 27 Jun 2015 00:01:45 +0000 (17:01 -0700)]
ethdev: introduce valid port helper

The code pattern is repeated so many times, it is a good
idea to introduce template like other code here uses.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
9 years agoethdev: fix code style
Stephen Hemminger [Sat, 27 Jun 2015 00:01:44 +0000 (17:01 -0700)]
ethdev: fix code style

This fixes lots of complaints from checkpatch about whitespace
and other non-material things. Important to fix the old code now
befor more code does copy/paste of same junk.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
9 years agoethdev: fix comment spelling
Stephen Hemminger [Sat, 27 Jun 2015 00:01:43 +0000 (17:01 -0700)]
ethdev: fix comment spelling

Fix trivial spelling errors.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
9 years agoethdev: remove impossible condition
Stephen Hemminger [Sat, 27 Jun 2015 00:01:42 +0000 (17:01 -0700)]
ethdev: remove impossible condition

Since rte_eth_devices is in BSS, the address of rte_eth_devices
plus port_id can not ever be NULL for a valid port_id number.
Remove this unnecessary check and fix the code style.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
9 years agomaintainers: claim EAL of IBM POWER
Chao Zhu [Mon, 29 Jun 2015 03:08:00 +0000 (11:08 +0800)]
maintainers: claim EAL of IBM POWER

Signed-off-by: Chao Zhu <chaozhu@linux.vnet.ibm.com>
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
9 years agocfgfile: fix unitialised buffer
Daniel Mrzyglod [Mon, 29 Jun 2015 15:06:03 +0000 (17:06 +0200)]
cfgfile: fix unitialised buffer

Nature of the problem was not initialised buffer[256], there were probability
that operation system will provide previously used memory and on special condition
there were probability that string operations will work on random data that
could provide unexpected program behaviour.

Signed-off-by: Daniel Mrzyglod <danielx.t.mrzyglod@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
9 years agohash: add unit test for thash
Vladimir Medvedkin [Tue, 30 Jun 2015 23:41:13 +0000 (19:41 -0400)]
hash: add unit test for thash

Add unit test for thash library

Signed-off-by: Vladimir Medvedkin <medvedkinv@gmail.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
9 years agohash: add toeplitz algorithm used by RSS
Vladimir Medvedkin [Tue, 30 Jun 2015 23:40:20 +0000 (19:40 -0400)]
hash: add toeplitz algorithm used by RSS

Software implementation of the Toeplitz hash function used by RSS.
Can be used either for packet distribution on single queue NIC
or for simulating of RSS computation on specific NIC (for example
after GRE header decapsulating).

Signed-off-by: Vladimir Medvedkin <medvedkinv@gmail.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
9 years agohash: add missing symbol in version map
Pablo de Lara [Tue, 30 Jun 2015 18:37:11 +0000 (19:37 +0100)]
hash: add missing symbol in version map

rte_hash_hash is a public function but was not in
rte_hash_version.map

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Sergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com>
9 years agocxgbe: fix build with icc
Bruce Richardson [Wed, 1 Jul 2015 15:11:37 +0000 (16:11 +0100)]
cxgbe: fix build with icc

When compiling the cxgbe driver with icc, multiple errors about using
enums as integers appear across a number of files, including in the base
code and in the DPDK-specific driver code.

.../drivers/net/cxgbe/cxgbe_main.c(386): error #188: enumerated type mixed
with another type
                        t4_get_port_type_description(pi->port_type));
                                                     ^
For the errors in the base driver code we use the CFLAGS_BASE_DRIVER
approach used by other drivers to disable warnings.

For errors in the DPDK-specific code, typecasts are used to fix the
errors in the code itself.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
9 years agofm10k: support Xen domain0
Shaopeng He [Fri, 15 May 2015 08:56:02 +0000 (16:56 +0800)]
fm10k: support Xen domain0

fm10k was failing to run in XEN domain0, as the physical
memory for DMA should be allocated and translated
in a different way for XEN domain0. So
rte_memzone_reserve_bounded() should be used for DMA
memory allocation, and rte_mem_phy2mch() should be used
for DMA memory address translation to support running
fm10k PMD in XEN domain0.

Signed-off-by: Shaopeng He <shaopeng.he@intel.com>
Acked-by: Jijiang Liu <jijiang.liu@intel.com>
9 years agomlx4: update documentation for MOFED 3.0
Adrien Mazarguil [Tue, 30 Jun 2015 09:28:09 +0000 (11:28 +0200)]
mlx4: update documentation for MOFED 3.0

- Add RX/TX L3/L4 checksum offloading and validation.
- Update kernel module parameters section.
- Update prerequisites for MOFED and firmware versions.
- Remove optimized external libraries section. MOFED now provides enhanced
  support directly without having to install modified libraries.

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
9 years agomlx4: disable multicast echo on PF device
Olga Shern [Tue, 30 Jun 2015 09:28:08 +0000 (11:28 +0200)]
mlx4: disable multicast echo on PF device

Multicast loopback must be disabled on PF devices to prevent the adapter
from sending frames back. Required with MOFED 3.0.

Signed-off-by: Olga Shern <olgas@mellanox.com>
Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
9 years agomlx4: add resource domain support for better performance
Alex Rosenbaum [Tue, 30 Jun 2015 09:28:07 +0000 (11:28 +0200)]
mlx4: add resource domain support for better performance

RDs are a new feature of MOFED 3.0 that makes Verbs aware of how CQ and QP
resources are being used for internal performance tuning.

Signed-off-by: Alex Rosenbaum <alexr@mellanox.com>
Signed-off-by: Olga Shern <olgas@mellanox.com>
Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
9 years agomlx4: add VXLAN checksum offload
Adrien Mazarguil [Tue, 30 Jun 2015 09:28:06 +0000 (11:28 +0200)]
mlx4: add VXLAN checksum offload

Depending on adapters features and VXLAN support in the kernel, VXLAN frames
can be automatically recognized, in which case checksum validation and
generation occurs on inner and outer L3 and L4.

Signed-off-by: Olga Shern <olgas@mellanox.com>
Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
9 years agomlx4: add L3/L4 checksum offload
Gilad Berman [Tue, 30 Jun 2015 09:28:05 +0000 (11:28 +0200)]
mlx4: add L3/L4 checksum offload

Mellanox ConnectX-3 adapters can handle L3 (IPv4) and L4 (TCP, UDP, TCP6,
UDP6) RX checksums validation and TX checksums generation, with and without
802.1Q (VLAN) headers.

Signed-off-by: Gilad Berman <giladb@mellanox.com>
Signed-off-by: Olga Shern <olgas@mellanox.com>
Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
9 years agomlx4: prefetch completed Tx mbufs before releasing them
Alex Rosenbaum [Tue, 30 Jun 2015 09:28:04 +0000 (11:28 +0200)]
mlx4: prefetch completed Tx mbufs before releasing them

Signed-off-by: Alex Rosenbaum <alexr@mellanox.com>
Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
9 years agomlx4: shrink Tx queue elements for better performance
Alex Rosenbaum [Tue, 30 Jun 2015 09:28:03 +0000 (11:28 +0200)]
mlx4: shrink Tx queue elements for better performance

TX queue elements (struct txq_elt) contain WR and SGE structures required by
ibv_post_send(). This commit replaces them with a single pointer to the
related TX mbuf considering that:

- There is no need to keep these structures around forever since the
  hardware doesn't access them after ibv_post_send() and send_pending*()
  have returned.

- The TX queue index stored in the WR ID field is not used for completions
  anymore since they use a separate counter (elts_comp_cd).

- The WR structure itself was only useful for ibv_post_send(), it is
  currently only used to store the mbuf data address and an offset to the
  mbuf structure in the WR ID field. send_pending*() callbacks only require
  SGEs or buffer pointers.

Therefore for single segment mbufs, send_pending() or send_pending_inline()
can be used directly without involving SGEs. For scattered mbufs, SGEs are
allocated on the stack and passed to send_pending_sg_list().

Signed-off-by: Alex Rosenbaum <alexr@mellanox.com>
Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
9 years agomlx4: move scattered Tx processing to helper function
Adrien Mazarguil [Tue, 30 Jun 2015 09:28:02 +0000 (11:28 +0200)]
mlx4: move scattered Tx processing to helper function

This commit makes scattered TX support entirely optional by moving it to a
separate function that is only available when MLX4_PMD_SGE_WR_N > 1.

Improves performance when scattered support is not needed.

Signed-off-by: Alex Rosenbaum <alexr@mellanox.com>
Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
9 years agomlx4: use MOFED 3.0 fast verbs interface for Tx operations
Adrien Mazarguil [Tue, 30 Jun 2015 09:28:01 +0000 (11:28 +0200)]
mlx4: use MOFED 3.0 fast verbs interface for Tx operations

The "raw" post send interface was experimental and has been deprecated. This
commit replaces it with a new low level interface that dissociates post and
flush (doorbell) operations for improved QP performance.

The CQ polling function is updated as well.

Signed-off-by: Alex Rosenbaum <alexr@mellanox.com>
Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
9 years agomlx4: avoid requesting Tx completion events to improve performance
Alex Rosenbaum [Tue, 30 Jun 2015 09:28:00 +0000 (11:28 +0200)]
mlx4: avoid requesting Tx completion events to improve performance

Instead of requesting a completion event for each TX burst, request it on a
fixed schedule once every MLX4_PMD_TX_PER_COMP_REQ (currently 64) packets to
improve performance.

Signed-off-by: Alex Rosenbaum <alexr@mellanox.com>
Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
9 years agomlx4: use MOFED 3.0 fast verbs interface for Rx operations
Alex Rosenbaum [Tue, 30 Jun 2015 09:27:59 +0000 (11:27 +0200)]
mlx4: use MOFED 3.0 fast verbs interface for Rx operations

This commit replaces the CQ polling and QP posting functions
(mlx4_rx_burst() only) with a new low level interface to improve
performance.

Signed-off-by: Alex Rosenbaum <alexr@mellanox.com>
Signed-off-by: Gilad Berman <giladb@mellanox.com>
Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
9 years agomlx4: query netdevice to get initial MAC address
Or Ami [Tue, 30 Jun 2015 09:27:58 +0000 (11:27 +0200)]
mlx4: query netdevice to get initial MAC address

Querying the netdevice instead of deriving the port's MAC address from its
GID is less prone to errors. There is no guarantee that the GID will always
contain it nor that the algorithm won't change.

Signed-off-by: Or Ami <ora@mellanox.com>
Signed-off-by: Olga Shern <olgas@mellanox.com>
Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
9 years agomlx4: fix support for multiple vlan filters
Olga Shern [Tue, 30 Jun 2015 09:27:57 +0000 (11:27 +0200)]
mlx4: fix support for multiple vlan filters

This commit fixes the "Multiple RX VLAN filters can be configured, but only
the first one works" bug. Since a single flow specification cannot contain
several VLAN definitions, the flows table is extended with MLX4_MAX_VLAN_IDS
possible specifications per configured MAC address.

Signed-off-by: Olga Shern <olgas@mellanox.com>
Signed-off-by: Or Ami <ora@mellanox.com>
Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
9 years agomlx4: remove provision for flow creation failure in DMFS A0 mode
Or Ami [Tue, 30 Jun 2015 09:27:56 +0000 (11:27 +0200)]
mlx4: remove provision for flow creation failure in DMFS A0 mode

Starting from MLNX_OFED 3.0 FW 2.34.5000 when working with optimized
steering mode (-7) QPs can be attached to the port's MAC, therefore no need
for the check.

Signed-off-by: Or Ami <ora@mellanox.com>
Signed-off-by: Olga Shern <olgas@mellanox.com>
Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
9 years agomlx4: fix error message for invalid number of descriptors
Or Ami [Tue, 30 Jun 2015 09:27:55 +0000 (11:27 +0200)]
mlx4: fix error message for invalid number of descriptors

The number of descriptors must be a multiple of MLX4_PMD_SGE_WR_N.

Signed-off-by: Or Ami <ora@mellanox.com>
Signed-off-by: Olga Shern <olgas@mellanox.com>
Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
9 years agomlx4: use MOFED 3.0 extended flow steering API
Alex Rosenbaum [Tue, 30 Jun 2015 09:27:54 +0000 (11:27 +0200)]
mlx4: use MOFED 3.0 extended flow steering API

This commit drops "exp" from related function and type names to stop using
the experimental API.

Signed-off-by: Olga Shern <olgas@mellanox.com>
Signed-off-by: Alex Rosenbaum <alexr@mellanox.com>
Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
9 years agomlx4: improve accuracy of link status information
Olga Shern [Tue, 30 Jun 2015 09:27:53 +0000 (11:27 +0200)]
mlx4: improve accuracy of link status information

Query interface properties using the ethtool API instead of Verbs
through ibv_query_port(). The returned information is more accurate for
Ethernet links since several link speeds cannot be mapped to Verbs
semantics.

Signed-off-by: Olga Shern <olgas@mellanox.com>
Signed-off-by: Alex Rosenbaum <alexr@mellanox.com>
Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
9 years agomlx4: allow application to partially fork
Olga Shern [Tue, 30 Jun 2015 09:27:52 +0000 (11:27 +0200)]
mlx4: allow application to partially fork

Although using the PMD from a forked process is still unsupported, this
commit makes Verbs safe enough for applications to call fork() for other
purposes.

Signed-off-by: Olga Shern <olgas@mellanox.com>
Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
9 years agomlx4: merge Rx queue setup functions
Alex Rosenbaum [Tue, 30 Jun 2015 09:27:51 +0000 (11:27 +0200)]
mlx4: merge Rx queue setup functions

Make rxq_setup_qp() handle inline support like rxq_setup_qp_rss() instead of
having two separate functions.

Signed-off-by: Alex Rosenbaum <alexr@mellanox.com>
Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
9 years agomlx4: avoid looking up work request id to improve Rx performance
Alex Rosenbaum [Tue, 30 Jun 2015 09:27:50 +0000 (11:27 +0200)]
mlx4: avoid looking up work request id to improve Rx performance

This is done by storing the current index in the RX queue structure.

Signed-off-by: Alex Rosenbaum <alexr@mellanox.com>
Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
9 years agomlx4: make sure experimental device query is implemented
Olga Shern [Tue, 30 Jun 2015 09:27:49 +0000 (11:27 +0200)]
mlx4: make sure experimental device query is implemented

HAVE_EXP_QUERY_DEVICE is used to check whether ibv_exp_query_device() can be
used. RSS and inline receive features depend on it.

Signed-off-by: Olga Shern <olgas@mellanox.com>
Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
9 years agomlx4: add MOFED 3.0 compatibility to interface name retrieval
Adrien Mazarguil [Tue, 30 Jun 2015 09:27:48 +0000 (11:27 +0200)]
mlx4: add MOFED 3.0 compatibility to interface name retrieval

Since Mellanox OFED 3.0 and Linux 3.15, interface port numbers are stored
in dev_port instead of dev_id sysfs files.

Signed-off-by: Or Ami <ora@mellanox.com>
Signed-off-by: Nitzan Weller <nitzanwe@mellanox.com>
Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
9 years agomlx4: fix possible crash on scattered mbuf allocation failure
Adrien Mazarguil [Tue, 30 Jun 2015 09:27:47 +0000 (11:27 +0200)]
mlx4: fix possible crash on scattered mbuf allocation failure

When failing to allocate a segment, mlx4_rx_burst_sp() may call
rte_pktmbuf_free() on an incomplete scattered mbuf whose next pointer
in the last segment is not set.

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
9 years agocxgbe: fix build with clang
Thomas Monjalon [Tue, 30 Jun 2015 22:14:25 +0000 (00:14 +0200)]
cxgbe: fix build with clang

GCC_VERSION is empty in case of clang:
/bin/sh: line 0: test: -ge: unary operator expected

It cannot be quoted because an integer is expected.
So the fix is to check empty value in a separate test.

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
9 years agocxgbe: add documentation
Rahul Lakkireddy [Mon, 29 Jun 2015 23:28:42 +0000 (04:58 +0530)]
cxgbe: add documentation

Adds cxgbe poll mode driver documentation under the usual doc/guides/nics/
directory with the rest of the drivers.  The documentation covers cxgbe
implementation details, features and limitations, prerequisites,
configuration, and a sample application usage.

Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
Signed-off-by: Kumar Sanghvi <kumaras@chelsio.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
9 years agocxgbe: add flow control functions
Rahul Lakkireddy [Mon, 29 Jun 2015 23:28:41 +0000 (04:58 +0530)]
cxgbe: add flow control functions

Adds flow control related eth_dev_ops for cxgbe poll mode driver.

Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
Signed-off-by: Kumar Sanghvi <kumaras@chelsio.com>
9 years agocxgbe: add link related functions
Rahul Lakkireddy [Mon, 29 Jun 2015 23:28:40 +0000 (04:58 +0530)]
cxgbe: add link related functions

Adds link update, promiscuous and multicast related eth_dev_ops for
cxgbe poll mode driver.

Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
Signed-off-by: Kumar Sanghvi <kumaras@chelsio.com>
9 years agocxgbe: add port statistics
Rahul Lakkireddy [Mon, 29 Jun 2015 23:28:39 +0000 (04:58 +0530)]
cxgbe: add port statistics

Adds stats_get() and stats_reset() eth_dev_ops for cxgbe poll mode driver.

Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
Signed-off-by: Kumar Sanghvi <kumaras@chelsio.com>
9 years agocxgbe: add device related operations
Rahul Lakkireddy [Mon, 29 Jun 2015 23:28:38 +0000 (04:58 +0530)]
cxgbe: add device related operations

Adds dev_start(), dev_stop(), and dev_close() eth_dev_ops for cxgbe poll
mode driver.

Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
Signed-off-by: Kumar Sanghvi <kumaras@chelsio.com>
9 years agocxgbe: add Tx support
Rahul Lakkireddy [Mon, 29 Jun 2015 23:28:37 +0000 (04:58 +0530)]
cxgbe: add Tx support

Adds TX support for the cxgbe poll mode driver.  This patch:

1. Adds tx queue related eth_dev_ops.
2. Adds tx_pkt_burst for transmitting packets.

Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
Signed-off-by: Kumar Sanghvi <kumaras@chelsio.com>
9 years agocxgbe: add device configuration and Rx support
Rahul Lakkireddy [Mon, 29 Jun 2015 23:28:36 +0000 (04:58 +0530)]
cxgbe: add device configuration and Rx support

Adds RX support for the cxgbe poll mode driver.  This patch:

1. Adds rx queue related eth_dev_ops.
2. Adds RSS support.
3. Adds dev_configure() and dev_infos_get() eth_dev_ops.
4. Adds rx_pkt_burst for receiving packets.

Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
Signed-off-by: Kumar Sanghvi <kumaras@chelsio.com>
9 years agocxgbe: add pmd skeleton
Rahul Lakkireddy [Mon, 29 Jun 2015 23:28:35 +0000 (04:58 +0530)]
cxgbe: add pmd skeleton

Adds cxgbe poll mode driver for DPDK under drivers/net/cxgbe directory.
This patch:

1. Adds the Makefile to compile cxgbe pmd.
2. Registers and initializes the cxgbe pmd driver.

Enable cxgbe PMD for compilation and linking with changes to:
1. config/common_linuxapp to add macros for cxgbe pmd.
2. drivers/net/Makefile to add cxgbe pmd to the compile list.
3. mk/rte.app.mk to add cxgbe pmd to link.

Update MAINTAINERS file to claim responsibility for the cxgbe PMD.

Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
Signed-off-by: Kumar Sanghvi <kumaras@chelsio.com>
[Thomas: add disabled config for bsdapp]

9 years agocxgbe/base: add hardware API for Chelsio T5 series adapters
Rahul Lakkireddy [Mon, 29 Jun 2015 23:28:34 +0000 (04:58 +0530)]
cxgbe/base: add hardware API for Chelsio T5 series adapters

Adds hardware specific api for all the Chelsio T5 adapters under
drivers/net/cxgbe/base directory.

Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
Signed-off-by: Kumar Sanghvi <kumaras@chelsio.com>
9 years agovhost: comment unwanted callback
Huawei Xie [Tue, 30 Jun 2015 09:20:50 +0000 (17:20 +0800)]
vhost: comment unwanted callback

add comment for potential unwanted callback on listenfds

Signed-off-by: Huawei Xie <huawei.xie@intel.com>
9 years agovhost: cleanup unix socket
Huawei Xie [Tue, 30 Jun 2015 09:20:48 +0000 (17:20 +0800)]
vhost: cleanup unix socket

rte_vhost_driver_unregister API will remove the listenfd from event list,
and then close it.

Signed-off-by: Huawei Xie <huawei.xie@intel.com>
Signed-off-by: Peng Sun <peng.a.sun@intel.com>
9 years agovhost: fix race for connection fd
Huawei Xie [Tue, 30 Jun 2015 09:20:47 +0000 (17:20 +0800)]
vhost: fix race for connection fd

In the event handler of connection fd, the connection fd could be possibly
closed. The event dispatch loop would then try to remove the fd from fdset.
Between these two actions, another thread might register a new listenfd
reusing the val of just closed fd, so we couldn't call fdset_del which would
wrongly clean up the new listenfd. A new function fdset_del_slot is provided
to cleanup the fd at the specified location.

Signed-off-by: Huawei Xie <huawei.xie@intel.com>
9 years agovhost: turn on by default
Huawei Xie [Mon, 29 Jun 2015 15:58:53 +0000 (23:58 +0800)]
vhost: turn on by default

Previous vhost-cuse implementation requires fuse development package.
Now that we have vhost-user implementation, which is enabled by default
and doesn't require additional library to build, we could turn on vhost.

Signed-off-by: Huawei Xie <huawei.xie@intel.com>
9 years agovhost: realloc device and queues to same numa node as vring desc
Huawei Xie [Thu, 25 Jun 2015 05:47:37 +0000 (13:47 +0800)]
vhost: realloc device and queues to same numa node as vring desc

When we get the address of vring descriptor table in VHOST_SET_VRING_ADDR
message, will try to reallocate vhost device and virt queue to the same
numa node.

Signed-off-by: Huawei Xie <huawei.xie@intel.com>
9 years agovhost: use rte_malloc to allocate device and queues
Huawei Xie [Thu, 25 Jun 2015 05:47:36 +0000 (13:47 +0800)]
vhost: use rte_malloc to allocate device and queues

use rte_malloc to allocate vhost device and queues

Signed-off-by: Huawei Xie <huawei.xie@intel.com>
9 years agolib: remove redundant definition of local symbols
Thomas Monjalon [Mon, 29 Jun 2015 16:25:13 +0000 (18:25 +0200)]
lib: remove redundant definition of local symbols

The new version nodes inherit from the previous ones which
already include a default catch-all line for not exported symbols.

Reported-by: Helin Zhang <helin.zhang@intel.com>
Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
9 years agodoc: link ABI policy to release notes
Thomas Monjalon [Mon, 29 Jun 2015 14:58:09 +0000 (16:58 +0200)]
doc: link ABI policy to release notes

When moving ABI policy to guidelines, the new doc was referred
without using sphinx link.

Fixes: f1ef9794f9bd ("doc: add ABI guidelines")

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
9 years agodoc: add ABI guidelines
Neil Horman [Mon, 29 Jun 2015 13:59:40 +0000 (09:59 -0400)]
doc: add ABI guidelines

People have been asking for ways to use the ABI macros, heres some docs to
clarify their use.  Included is:

* An overview of what ABI is
* Details of the ABI deprecation process
* Details of the versioning macros
* Examples of their use
* Details of how to use the ABI validator

Thanks to John Mcnamara, who duplicated much of this effort at Intel while I was
working on it.  Much of the introductory material was gathered and cleaned up by
him.

Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
CC: John McNamara <john.mcnamara@intel.com>
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
9 years agocompat: remove unneeded macro
Neil Horman [Mon, 29 Jun 2015 13:59:39 +0000 (09:59 -0400)]
compat: remove unneeded macro

BASE_SYMBOL was only here for completelness.
DPDK currently doesn't need it, so lets remove it.

Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
9 years agocompat: add macro to map symbol in static build
Neil Horman [Mon, 29 Jun 2015 13:59:38 +0000 (09:59 -0400)]
compat: add macro to map symbol in static build

It was pointed out in my examples that doing shared library symbol versioning by
partitioning symbols to version specific functions (as opposed to leaving the
latest symol version at the base symbol name), neglects to take into account
static builds.  Add a macro to handle that.  If you choose a versioning approach
that uniquely names every version of the symbol, then this macro lets you map
your symbol choice to the base name when building a static library

Also, while I'm at it, since we're documenting this in the guide, take the
abbreviated example out of the header

Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
[Thomas: remove remaining part of old example]
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
9 years agocompat: clean up
Neil Horman [Mon, 29 Jun 2015 13:59:37 +0000 (09:59 -0400)]
compat: clean up

Clean up some macro definition typos and comments

Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
9 years agomk: fix static build on Fedora 22
Bruce Richardson [Tue, 9 Jun 2015 12:51:01 +0000 (13:51 +0100)]
mk: fix static build on Fedora 22

On Fedora 22, the "ar" binary operates by default in deterministic mode,
making the "u" parameter irrelevant, and leading to warning messages
getting printed in the build output like below.

  INSTALL-LIB librte_kvargs.a
ar: `u' modifier ignored since `D' is the default (see `U')

There are two options to remove these warnings:
* add in the "U" flag to make "ar" non-deterministic again
* remove the "u" flag to have all objects always updated

This patch takes the second approach. It also explicitly adds in the "D"
flag to make behaviour consistent across different distributions which
may have different defaults.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
9 years agoeal: fix pedantic build of mlx4 debug mode
Adrien Mazarguil [Mon, 29 Jun 2015 09:34:52 +0000 (11:34 +0200)]
eal: fix pedantic build of mlx4 debug mode

Since the commit below includes rte_cpuflags.h in rte_spinlock.h,
compilation of the mlx4 driver fails when CONFIG_RTE_LIBRTE_MLX4_DEBUG=y.

This mode adds -pedantic to the compiler's command line for mlx4, which
complains about the static definition of an empty cpu_feature_table[] in
common rte_cpuflags.h, then about its redefinition as a larger array in
arch-specific rte_cpuflags.h.

While DPDK does not officially support -pedantic internally, external
applications may enable it and include rte_spinlock.h from the public API.

Instead of removing -pedantic from mlx4, this commit fixes rte_cpuflags.h.

Fixes: ba7468997ea6 ("spinlock: add HTM lock elision for x86")

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: David Marchand <david.marchand@6wind.com>