dpdk.git
9 years agoeal: fix type casting of value to align
John McNamara [Mon, 16 Mar 2015 17:05:06 +0000 (17:05 +0000)]
eal: fix type casting of value to align

Fix a warning when the rte_common.h header is included in a compilation
using  -Wbad-function-cast, such as in Open vSwitch where the
following warning is emitted repeatedly:

    ../rte_common.h: In function 'rte_is_aligned':
    ../rte_common.h:184:9: warning: cast from function call of
    type 'uintptr_t' to non-matching type 'void *' [-Wbad-function-cast]

This change fixes the issue in rte_common.h by using the RTE_ALIGN_FLOOR
macro to get the aligned floor value with generic type casting.

Also removed the rte_align_floor_int() function and replaced it with
the RTE_PTR_ALIGN_FLOOR() macro.

Signed-off-by: John McNamara <john.mcnamara@intel.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
9 years agoeal: fix build with icc and gcc < 4.4
Thomas Monjalon [Mon, 16 Mar 2015 15:55:50 +0000 (16:55 +0100)]
eal: fix build with icc and gcc < 4.4

x86intrin.h cannot be directly included as it is not
always available.
rte_common_vect.h handles compiler differences.

Suggested-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
9 years agoeal: fix tailq init for uio and vfio resources
David Marchand [Wed, 11 Mar 2015 17:25:23 +0000 (18:25 +0100)]
eal: fix tailq init for uio and vfio resources

Commit a2348166ea18 ("tailq: move to dynamic tailq") introduced a bug in
uio/vfio resources list init.

These resources list were pointed at through a pointer initialised only once but
too early in the eal init (before tailqs init).

Fix this by "resolving" this pointer when used (which is well after tailqs
init).

Fixes: a2348166ea18 ("tailq: move to dynamic tailq")

Reported-by: Marvin Liu <yong.liu@intel.com>
Reported-by: Tetsuya Mukawa <mukawa@igel.co.jp>
Signed-off-by: David Marchand <david.marchand@6wind.com>
Tested-by: John McNamara <john.mcnamara@intel.com>
Tested-by: Tetsuya Mukawa <mukawa@igel.co.jp>
9 years agoapp/testpmd: fix incorrect port number check
Yong Liu [Wed, 11 Mar 2015 07:23:10 +0000 (15:23 +0800)]
app/testpmd: fix incorrect port number check

testpmd parameter "nb-port" mean the number of forwarding port.
It's incorrect to use function port_id_is_invalid to check number of ports.

Fixes: edab33b1c01d ("app/testpmd: support port hotplug")

Signed-off-by: Yong Liu <yong.liu@intel.com>
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
9 years agoscripts: remove useless build tools
Thomas Monjalon [Tue, 10 Mar 2015 16:55:25 +0000 (17:55 +0100)]
scripts: remove useless build tools

test-framework.sh is an old script to check building of some dependencies.
testhost is an old app used to check HOSTCC.

Let's clean the scripts directory.

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
9 years agomaintainers: claim responsibility for docs
Siobhan Butler [Fri, 27 Feb 2015 16:27:11 +0000 (16:27 +0000)]
maintainers: claim responsibility for docs

Signed-off-by: Siobhan Butler <siobhan.a.butler@intel.com>
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
9 years agomaintainers: claim ixgbe PMD
Konstantin Ananyev [Tue, 10 Mar 2015 00:53:14 +0000 (00:53 +0000)]
maintainers: claim ixgbe PMD

Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
9 years agomaintainers: claim responsibility for timers
Robert Sanford [Wed, 25 Feb 2015 20:18:05 +0000 (14:18 -0600)]
maintainers: claim responsibility for timers

Signed-off-by: Robert Sanford <rsanford@akamai.com>
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
9 years agodoc: update testpmd commands for flow director
Jingjing Wu [Fri, 6 Mar 2015 09:36:14 +0000 (17:36 +0800)]
doc: update testpmd commands for flow director

Because of the changing of unified flow type, commands for flow
director need to be updated.

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
9 years agoixgbe: fix supported flow types
Jingjing Wu [Fri, 6 Mar 2015 09:36:13 +0000 (17:36 +0800)]
ixgbe: fix supported flow types

Ixgbe doesn't support the ipv4-frag and ipv6-frag flow types, remove them.
Ixgbe doesn't support configure flex mask on each kind of flow type, this
patch uses RTE_ETH_FLOW_UNKNOWN to specify global flex mask setting.
This patch also changes the string "raw" to "none" to indicate flex mask
setting unrelated with flow type in testpmd for ixgbe.

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
9 years agoapp/testpmd: stop forwarding when quitting
Pablo de Lara [Fri, 27 Feb 2015 11:18:39 +0000 (11:18 +0000)]
app/testpmd: stop forwarding when quitting

When user quits testpmd, and there is traffic being forwarded,
that may produce a segmentation fault, due to ports being closed,
while they are still transmitting packets.

This patch prevents the issue from happening,
by stopping packet forwarding before closing the ports.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
9 years agoeal/bsd: enable contigmem blocks >1GB in size
Bruce Richardson [Mon, 2 Mar 2015 16:34:20 +0000 (16:34 +0000)]
eal/bsd: enable contigmem blocks >1GB in size

The contigmem module was using an "int" type for specifying the
size of blocks of memory to be reserved. A 2GB block was therefore
overflowing the signed 32-bit value, making 1GB the largest block
size that could be reserved as a single unit.
The fix is to change the type used for the buffer/block size to
an "int64_t" value.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
9 years agoexamples/l2fwd-jobstats: fix error handling in init sequence
Pawel Wodkowski [Mon, 9 Mar 2015 16:05:29 +0000 (17:05 +0100)]
examples/l2fwd-jobstats: fix error handling in init sequence

Fix check of returned values during application init phase.

Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
9 years agomlx4: avoid init errors when kernel modules are not loaded
Adrien Mazarguil [Fri, 27 Feb 2015 18:27:00 +0000 (19:27 +0100)]
mlx4: avoid init errors when kernel modules are not loaded

Mimic UIO/VFIO drivers behavior by not causing errors when a device cannot
be initialized due to missing or mismatching kernel modules. Display helpful
messages instead, such as:

 [...]
 EAL: PCI device 0000:83:00.0 on NUMA socket 1
 EAL:   probe driver: 15b3:1007 librte_pmd_mlx4
 PMD: librte_pmd_mlx4: PCI information matches, using device "mlx4_0" (VF: false)
 PMD: librte_pmd_mlx4: cannot use device, are drivers up to date?
 EAL: PCI device 0000:84:00.0 on NUMA socket 1
 EAL:   probe driver: 15b3:1007 librte_pmd_mlx4
 PMD: librte_pmd_mlx4: PCI information matches, using device "mlx4_1" (VF: false)
 PMD: librte_pmd_mlx4: cannot use device, are drivers up to date?
 EAL: No probed ethernet devices
 [...]

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
9 years agoixgbe: rename igb prefix
Stephen Hemminger [Sat, 7 Mar 2015 02:23:24 +0000 (18:23 -0800)]
ixgbe: rename igb prefix

To avoid any possible confusion or breakage, rename all the structures
of ixgbe driver to use ixgbe_ rather than igb_ because igb is a
different driver.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Changchun Ouyang <changchun.ouyang@intel.com>
9 years agoixgbe: prefix global function
Stephen Hemminger [Sat, 7 Mar 2015 02:23:23 +0000 (18:23 -0800)]
ixgbe: prefix global function

All global functions in a driver should use the same prefix
to avoid any future name collisions.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Reviewed-by: Bruce Richardson <bruce.richardson@intel.com>
[Bruce: one instance was missing]
Acked-by: Changchun Ouyang <changchun.ouyang@intel.com>
9 years agoixgbe: make bulk alloc static
Stephen Hemminger [Sat, 7 Mar 2015 02:23:22 +0000 (18:23 -0800)]
ixgbe: make bulk alloc static

Only used in this file, make it static.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Changchun Ouyang <changchun.ouyang@intel.com>
9 years agoixgbe: make register maps const
Stephen Hemminger [Sat, 7 Mar 2015 02:23:21 +0000 (18:23 -0800)]
ixgbe: make register maps const

These are const data structures, just put them in txt segment
rather than having compiler emit code to set them up on the stack.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Changchun Ouyang <changchun.ouyang@intel.com>
9 years agoixgbe: make txq_ops const
Stephen Hemminger [Sat, 7 Mar 2015 02:23:20 +0000 (18:23 -0800)]
ixgbe: make txq_ops const

All virtual function tables should be const so they are put
in text segment rather than data.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Changchun Ouyang <changchun.ouyang@intel.com>
9 years agoeal: remove useless errno
David Marchand [Wed, 4 Mar 2015 21:50:10 +0000 (22:50 +0100)]
eal: remove useless errno

There is no remaining reference to E_RTE_NO_TAILQ.

Signed-off-by: David Marchand <david.marchand@6wind.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
9 years agotailq: remove static slots
David Marchand [Wed, 4 Mar 2015 21:50:09 +0000 (22:50 +0100)]
tailq: remove static slots

No static entry remaining, the rte_tailq api is for "internal use" only, get rid
of the static slots.

Signed-off-by: David Marchand <david.marchand@6wind.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
9 years agotailq: move to dynamic tailq
David Marchand [Wed, 4 Mar 2015 21:50:08 +0000 (22:50 +0100)]
tailq: move to dynamic tailq

Use dynamic tailq rather than static entries.

Signed-off-by: David Marchand <david.marchand@6wind.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
9 years agotailq: introduce dynamic register system
David Marchand [Wed, 4 Mar 2015 21:50:07 +0000 (22:50 +0100)]
tailq: introduce dynamic register system

This register system makes it possible to reserve a tailq for the dpdk
libraries.
The "dynamic" tailqs are right after the "static" tailqs in shared mem.
Primary process is responsible for writing the tailq names, so that secondary
processes can find them.

This is a temp commit, "static" tailqs are removed after conversion of all
users in next commits.

Signed-off-by: David Marchand <david.marchand@6wind.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
9 years agotailq: remove unused macros
David Marchand [Wed, 4 Mar 2015 21:50:06 +0000 (22:50 +0100)]
tailq: remove unused macros

A lot of places just protect against concurrent access and I can not see the
gain of having those macros.

Signed-off-by: David Marchand <david.marchand@6wind.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
9 years agotailq: get rid of broken reserve api
David Marchand [Wed, 4 Mar 2015 21:50:05 +0000 (22:50 +0100)]
tailq: get rid of broken reserve api

The "reserve" macros and functions do not check if the requested entry is free.
They do nothing more than the lookup function (which itself "creates" entries
...).
The rte_tailq api is marked as "internal use" in documentation and these macros
are only used in test application, so just get rid of them.

Signed-off-by: David Marchand <david.marchand@6wind.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
9 years agotailq: use a single cast macro
David Marchand [Wed, 4 Mar 2015 21:50:04 +0000 (22:50 +0100)]
tailq: use a single cast macro

No need to cast everywhere, define a common macro for this, plus it can be used
in future commits.

Signed-off-by: David Marchand <david.marchand@6wind.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
9 years agotailq: remove unneeded inclusions
David Marchand [Wed, 4 Mar 2015 21:50:03 +0000 (22:50 +0100)]
tailq: remove unneeded inclusions

Only keep inclusion where really needed.

Signed-off-by: David Marchand <david.marchand@6wind.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
9 years agopci: use lookup tailq api
David Marchand [Wed, 4 Mar 2015 21:50:02 +0000 (22:50 +0100)]
pci: use lookup tailq api

There is no reason why we should use the "reserve" tailq api, since the pci
entry is already statically reserved.

Signed-off-by: David Marchand <david.marchand@6wind.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
9 years agoeal: remove remaining reference to pm
David Marchand [Wed, 4 Mar 2015 21:50:01 +0000 (22:50 +0100)]
eal: remove remaining reference to pm

Hopefully, this is the last reference to pm.

Signed-off-by: David Marchand <david.marchand@6wind.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
9 years agoethdev: remove useless parameter in init functions
Thomas Monjalon [Thu, 5 Mar 2015 18:24:59 +0000 (19:24 +0100)]
ethdev: remove useless parameter in init functions

The pointer to struct eth_driver is not used and is already set
in struct rte_eth_dev.

It's a small cleanup in PMD API which probably needs more
attention to make clear what is a driver, a PCI driver, an
ethernet driver, etc.

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
9 years agoapp/test: fix printf format
Michael Qiu [Fri, 6 Mar 2015 03:53:32 +0000 (11:53 +0800)]
app/test: fix printf format

test_hash.c: In function ‘test_crc32_hash_alg_equiv’:
error: format ‘%lu’ expects argument of type ‘long unsigned int’,
but argument 2 has type ‘size_t’ [-Werror=format]

According to C99, for size_t type should use format "%zu"

Signed-off-by: Michael Qiu <michael.qiu@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
9 years agohash: fix unsupported crc instruction in i686 platform
Michael Qiu [Mon, 9 Mar 2015 05:58:05 +0000 (13:58 +0800)]
hash: fix unsupported crc instruction in i686 platform

Error: unsupported instruction `crc32'

The root cause is that i686 platform does not support 'crc32q'
Need make it only available in x86_64 platform.

Signed-off-by: Michael Qiu <michael.qiu@intel.com>
Acked-by: Yerden Zhumabekov <yerden.zhumabekov@sts.kz>
9 years agoeal/x86: fix redeclaration of registers
Michael Qiu [Thu, 5 Mar 2015 13:57:43 +0000 (21:57 +0800)]
eal/x86: fix redeclaration of registers

include/rte_cpuflags.h:154:2: error: redeclaration of enumerator ‘REG_EAX’

In i686, from REG_EAX to REG_EDX are all defined in
/usr/include/sys/ucontext.h

Rename to RTE_REG_EAX to avoid this issue.

Signed-off-by: Michael Qiu <michael.qiu@intel.com>
Acked-by: David Marchand <david.marchand@6wind.com>
9 years agoeal: fix C++11 compilation
Konstantin Ananyev [Fri, 6 Mar 2015 15:59:47 +0000 (15:59 +0000)]
eal: fix C++11 compilation

When compiling C++11-code or above (--std=c++11), the build fails with
lots of

  rte_eth_ctrl.h:517:3: note: in expansion of macro RTE_ALIGN
    (RTE_ALIGN(RTE_ETH_FLOW_MAX, UINT32_BIT)/UINT32_BIT)
    ^

When reading the GCC info pages, I get the feeling that __typeof__ is
a better choice, and that indeed works when including the headers in
C++ files (--std=c++11).

Signed-off-by: Simon Kagstrom <simon.kagstrom@netinsight.net>
Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
9 years agodoc: more vlan offload commands in testpmd
Ouyang Changchun [Fri, 6 Mar 2015 08:10:06 +0000 (16:10 +0800)]
doc: more vlan offload commands in testpmd

Update the testpmd doc as there are new HW VLAN commands/options.

Signed-off-by: Changchun Ouyang <changchun.ouyang@intel.com>
Acked-by: Michael Qiu <michael.qiu@intel.com>
Acked-by: Siobhan Butler <siobhan.a.butler@intel.com>
9 years agoapp/testpmd: more vlan offload commands
Ouyang Changchun [Fri, 6 Mar 2015 08:10:05 +0000 (16:10 +0800)]
app/testpmd: more vlan offload commands

This patch enables testpmd user can config port hw_vlan with more fine granularity:
hw vlan filter, hw vlan strip, and hw vlan extend.

Don't remove the original command(hw-vlan) considering that some user still want to use
only one command to switch on/off all 3 options.

Signed-off-by: Changchun Ouyang <changchun.ouyang@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
9 years agoapp/testpmd: check vlan filter configuration
Michal Jastrzebski [Fri, 20 Feb 2015 10:26:12 +0000 (11:26 +0100)]
app/testpmd: check vlan filter configuration

This patch modifies testpmd behavior when setting:
rx_vlan add all vf_port (enabling all vlanids
to be passed thru rx filter on VF).
Rx_vlan_all_filter_set() function,
checks if the next vlanid can be enabled by the driver.
Number of vlanids is limited by the NIC and thus the NIC
do not allow to enable more vlanids than it can allocate
in VFTA table.

Signed-off-by: Michal Jastrzebski <michalx.k.jastrzebski@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
9 years agodoc: warn about limited number of vlan ids
Michal Jastrzebski [Fri, 20 Feb 2015 10:26:11 +0000 (11:26 +0100)]
doc: warn about limited number of vlan ids

This patch adds information to testpmd_funcs.rst file,
about limited number of vlan_ids possible to be enabled
in a filter. This is limited to the maximum number of entries
possible in the VFTA table.

Signed-off-by: Michal Jastrzebski <michalx.k.jastrzebski@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
9 years agoapp/testpmd: fix bond port creation
Michal Jastrzebski [Fri, 6 Mar 2015 07:38:59 +0000 (08:38 +0100)]
app/testpmd: fix bond port creation

When invoking creation of bonded device using:
create bonded device mode socket in testpmd the bonded port was not
enabled at the end of cmd_create_bonded_device_parsed function.
This caused commands 'show port info' and 'show port stats' not working
properly with bonding device. This patch fixed it.

Signed-off-by: Michal Jastrzebski <michalx.k.jastrzebski@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
9 years agoapp/testpmd: forbid actions on invalid port
Michael Qiu [Mon, 9 Mar 2015 06:05:47 +0000 (14:05 +0800)]
app/testpmd: forbid actions on invalid port

Currently, if try to start/stop/close one invalid port,
no error shows in testpmd.
This is a bug, need check the port number.

Signed-off-by: Michael Qiu <michael.qiu@intel.com>
Acked-by: Tetsuya Mukawa <mukawa@igel.co.jp>
9 years agoapp/testpmd: fix log with no bound device
Michael Qiu [Mon, 2 Mar 2015 08:31:37 +0000 (16:31 +0800)]
app/testpmd: fix log with no bound device

As hotplug has been enabled, start the testpmd with no nic binded
will show one error log "Please stop the ports first":

Interactive-mode selected
Please stop the ports first
Done
testpmd>

This issue is cause by the logic of check link status.

Signed-off-by: Michael Qiu <michael.qiu@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
9 years agovirtio: add default Tx configuration
Takuya Asada [Mon, 23 Feb 2015 07:51:25 +0000 (16:51 +0900)]
virtio: add default Tx configuration

When I tried to launch test-pmd on KVM guest of Fedora21, I got following error:

Configuring Port 0 (socket 0)
Fail to configure port 0 tx queues
EAL: Error - exiting with code: 1
  Cause: Start ports failed

I found that the error caused here, and actual error message was
"TX checksum offload not supported".

This patch adds default_txconf on virtio pmd, to avoid the error.

Signed-off-by: Takuya Asada <syuu@cloudius-systems.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
9 years agovhost: check file descriptor before closing
Huawei Xie [Fri, 6 Mar 2015 11:05:43 +0000 (19:05 +0800)]
vhost: check file descriptor before closing

This avoids closing -1 in our case.

Signed-off-by: Huawei Xie <huawei.xie@intel.com>
Acked-by: Changchun Ouyang <changchun.ouyang@intel.com>
Acked-by: Tetsuya Mukawa <mukawa@igel.co.jp>
9 years agovhost: fix file descriptors naming
Huawei Xie [Fri, 6 Mar 2015 10:39:18 +0000 (18:39 +0800)]
vhost: fix file descriptors naming

Previous vhost implementation wrongly name kickfd as callfd and callfd as kickfd.
It is functional correct, but causes confusion.
Exchange kickfd and callfd to avoid confusion.

Signed-off-by: Huawei Xie <huawei.xie@intel.com>
Acked-by: Changchun Ouyang <changchun.ouyang@intel.com>
Acked-by: Tetsuya Mukawa <mukawa@igel.co.jp>
9 years agovhost: use loop instead of goto
Huawei Xie [Fri, 6 Mar 2015 05:52:43 +0000 (13:52 +0800)]
vhost: use loop instead of goto

This patch reorder the code a bit to use loop instead of goto.
Besides, remove abudant check 'fd != -1'.

Signed-off-by: Huawei Xie <huawei.xie@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
9 years agovhost: combine select with sleep
Huawei Xie [Fri, 6 Mar 2015 05:52:27 +0000 (13:52 +0800)]
vhost: combine select with sleep

combine sleep into select when there is no file descriptors to be monitored.

Signed-off-by: Huawei Xie <huawei.xie@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
9 years agoixgbe: fix VF Tx for X550
Ouyang Changchun [Mon, 2 Mar 2015 12:25:45 +0000 (20:25 +0800)]
ixgbe: fix VF Tx for X550

X550 should use the correct macro to set the VFTDT and VFRDT register address.
This patch fixes the VF TX issue for Sageville.

Signed-off-by: Changchun Ouyang <changchun.ouyang@intel.com>
Acked-by: Cunming Liang <cunming.liang@intel.com>
9 years agoeal/x86: fix integer cast in memcpy
Michael Qiu [Fri, 6 Mar 2015 03:13:07 +0000 (11:13 +0800)]
eal/x86: fix integer cast in memcpy

./i686-native-linuxapp-gcc/include/rte_memcpy.h:592:23: error:
cast from pointer to integer of different size
[-Werror=pointer-to-int-cast]

  dstofss = 16 - (int)((long long)(void *)dst & 0x0F) + 16;

Type 'long long' is 64-bit in i686 platform while 'void *'
is 32-bit.

Signed-off-by: Michael Qiu <michael.qiu@intel.com>
Signed-off-by: Zhihong Wang <zhihong.wang@intel.com>
9 years agoeal/x86: fix strict aliasing rules
Zhihong Wang [Mon, 2 Mar 2015 09:03:50 +0000 (17:03 +0800)]
eal/x86: fix strict aliasing rules

Fixed strict-aliasing rules breaking errors for some GCC version.

Signed-off-by: Zhihong Wang <zhihong.wang@intel.com>
Acked-by: Cunming Liang <cunming.liang@intel.com>
Acked-by: Michael Qiu <michael.qiu@intel.com>
9 years agomk: move internal file
Keith Wiles [Wed, 4 Mar 2015 17:13:09 +0000 (11:13 -0600)]
mk: move internal file

Move the rte.extvars.mk to an internal directory and
update rte.vars.mk to find the file in the new location.

Signed-off-by: Keith Wiles <keith.wiles@intel.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
9 years agovhost: fix crash by removing device when requested
Huawei Xie [Tue, 3 Mar 2015 02:26:04 +0000 (10:26 +0800)]
vhost: fix crash by removing device when requested

This patch fixes the segfault issue in the case vhost receives
new VHOST_SET_MEM_TABLE message without VHOST_VRING_GET_VRING_BASE
(which we uses as the stop message).

Signed-off-by: Huawei Xie <huawei.xie@intel.com>
Acked-by: Tommy Long <thomas.long@intel.com>
9 years agoethdev: add missing symbol export for port release
Panu Matilainen [Wed, 4 Mar 2015 06:12:12 +0000 (08:12 +0200)]
ethdev: add missing symbol export for port release

Fixes: 36ec8585b298 ("ethdev: release port")

Signed-off-by: Panu Matilainen <pmatilai@redhat.com>
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
9 years agotools: fix binding to unsupported driver
Ouyang Changchun [Wed, 4 Mar 2015 02:55:35 +0000 (10:55 +0800)]
tools: fix binding to unsupported driver

The dpdk_nic_bind script will not allow ports to be bound or unbound if none of the
kernel modules supported by DPDK is loaded. This patch relaxes this restriction by
checking if a DPDK module is actually requested. The example below illustrates this
problem:

In virtio test, on the guest
1. Bind virtio port to igb_uio driver;
2. Remove igb_uio module;
3. Bind virtio port to virtio-pci driver, it fails and reports:
   "Error - no supported modules are loaded"

The script should check the to-be-bound driver flag, if it is dpdk driver(igb_uio, vfio etc),
and the corresponding module is not loaded, then exit, otherwise, just report a warning,
and continue to bind the non-dpdk driver(like virtio-pci) to dev.

Signed-off-by: Changchun Ouyang <changchun.ouyang@intel.com>
Tested-by: Qian Xu <qian.q.xu@intel.com>
Acked-by: Michael Qiu <michael.qiu@intel.com>
9 years agoethdev: fix hotplug check for Rx and Tx callbacks
Keith Wiles [Thu, 26 Feb 2015 14:00:32 +0000 (08:00 -0600)]
ethdev: fix hotplug check for Rx and Tx callbacks

Some checks with rte_eth_dev_is_valid_port() were missed when merging
hotplug and callbacks features.

Fixes: c282abd2a6cd ("ethdev: remove assumption that port will not be detached")

Signed-off-by: Keith Wiles <keith.wiles@intel.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
9 years agoixgbe: check rxd number to avoid mbuf leak
Cunming Liang [Mon, 2 Mar 2015 13:28:24 +0000 (21:28 +0800)]
ixgbe: check rxd number to avoid mbuf leak

The mbuf leak happens when the assigned number of rx descriptor is not
power of 2 in vector mode.
As it's presumed on vpmd rx (for rx_tail wrap), adding condition check
to prevent it.
The root cause reference code in *_recv_raw_pkts_vec* as below.
"rxq->rx_tail = (uint16_t)(rxq->rx_tail & (rxq->nb_rx_desc - 1));".

Reported-by: Stephen Hemminger <stephen@networkplumber.org>
Signed-off-by: Cunming Liang <cunming.liang@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
9 years agomk: fix config build on freebsd
Tetsuya Mukawa [Thu, 5 Mar 2015 07:31:01 +0000 (16:31 +0900)]
mk: fix config build on freebsd

The '-fdirectives-only' flag doesn't exist in cpp of FreeBSD.
To remove expanding macros when parsing the config files won't
add any issue.

Suggested-by: Olivier Matz <olivier.matz@6wind.com>
Signed-off-by: Tetsuya Mukawa <mukawa@igel.co.jp>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
9 years agoapp/test: remove unneeded casts
Stephen Hemminger [Sat, 14 Feb 2015 14:59:05 +0000 (09:59 -0500)]
app/test: remove unneeded casts

The malloc family returns void * and therefore cast is unnecessary.
Use calloc rather than zmalloc with multiply for array.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
9 years agoexamples: remove unneeded casts
Stephen Hemminger [Sat, 14 Feb 2015 14:59:10 +0000 (09:59 -0500)]
examples: remove unneeded casts

*alloc() routines return void * and therefore cast is not needed.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Reviewed-by: Bruce Richardson <bruce.richardson@intel.com>
[Thomas: reverse num and size parameters in vhost calloc]

9 years agoenic: remove useless cast
Stephen Hemminger [Sat, 14 Feb 2015 14:59:08 +0000 (09:59 -0500)]
enic: remove useless cast

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
9 years agoeal/linux: remove useless memset
Stephen Hemminger [Sat, 14 Feb 2015 14:59:09 +0000 (09:59 -0500)]
eal/linux: remove useless memset

The path variable is set via snprintf, and does not need to
memset before that.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
9 years agoeal/bsd: remove useless assignments
Stephen Hemminger [Sat, 14 Feb 2015 14:59:07 +0000 (09:59 -0500)]
eal/bsd: remove useless assignments

If variable is set in the next line, it doesn't need to be
initialized.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
9 years agocmdline: fix parameter type
Pawel Wodkowski [Wed, 25 Feb 2015 12:41:26 +0000 (13:41 +0100)]
cmdline: fix parameter type

Fix warning reported during static analysis about size_t to int cast
when passing parameters to parse_set_list().

This patch fix code formating errors that give checkpatch.pl errors
after generating patch.

Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
9 years agoring: fix memory leak
Pawel Wodkowski [Wed, 25 Feb 2015 12:41:25 +0000 (13:41 +0100)]
ring: fix memory leak

Free kvlist on function exit to avoid memory leak during devinit.

Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
9 years agokvargs: fix freeing behaviour for null
Pawel Wodkowski [Wed, 25 Feb 2015 12:41:24 +0000 (13:41 +0100)]
kvargs: fix freeing behaviour for null

By convention free() functions should ignore NULL parameter. This patch
add this behaviour for rte_kvargs_free().

Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
9 years agotimer: fix callback declaration inconsistency
Pawel Wodkowski [Wed, 25 Feb 2015 12:41:23 +0000 (13:41 +0100)]
timer: fix callback declaration inconsistency

This patch remove inconsistency between declaration of type
rte_timer_cb_t, field f in struct rte_timer and function
__rte_timer_reset().

Although compiler treat both of them the same, the static analysis tool
like complain about that.

Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
9 years agobond: remove debug function to fix link with shared lib
Thomas Monjalon [Tue, 3 Mar 2015 14:48:28 +0000 (15:48 +0100)]
bond: remove debug function to fix link with shared lib

The function print_client_stats was used in the example without being
clearly exported in the map file. So it breaks linking with shared library
when debug is enabled.
It's better to remove this function as it probably could be implemented
with statistics API.

Fixes: cc7e8ae84faa ("add example application for link bonding mode 6")

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Acked-by: Declan Doherty <declan.doherty@intel.com>
9 years agomlx4: mute auto config in quiet mode
Thomas Monjalon [Tue, 3 Mar 2015 11:29:45 +0000 (12:29 +0100)]
mlx4: mute auto config in quiet mode

If verbose is off, auto-config-h.sh script should be quiet.

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
9 years agomlx4: fix build with mempool debug enabled
Thomas Monjalon [Tue, 3 Mar 2015 14:29:25 +0000 (15:29 +0100)]
mlx4: fix build with mempool debug enabled

The mempool header forces error on -Wcast-qual and makes verbs.h failing.
Let's include verbs before as a system header.

Fixes: 7fae69eeff13 ("mlx4: new poll mode driver")

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
9 years agovirtio: fix build with debug enabled
Thomas Monjalon [Tue, 3 Mar 2015 15:04:59 +0000 (16:04 +0100)]
virtio: fix build with debug enabled

With CONFIG_RTE_LIBRTE_VIRTIO_DEBUG_INIT=y:
error: ‘devname’ undeclared (first use in this function)

Fixes: da978dfdc43b ("virtio: use port IO to get PCI resource")

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Acked-by: Changchun Ouyang <changchun.ouyang@intel.com>
9 years agovirtio: fix build with mempool debug enabled
Thomas Monjalon [Tue, 3 Mar 2015 14:58:37 +0000 (15:58 +0100)]
virtio: fix build with mempool debug enabled

The mempool header forces error on -Wcast-qual:
error: cast discards ‘const’ qualifier from pointer target type

Let's fix it by removing const qualifier of pci driver from commit
5e9f6d1340ff ("pci: reference driver structure for each device")
It's needed because the driver flags are changed depending on using uio or not.
Actually these driver flags should be directly attached to each device.

Fixes: da978dfdc43b ("virtio: use port IO to get PCI resource")

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Acked-by: Changchun Ouyang <changchun.ouyang@intel.com>
9 years agofm10k: fix build with debug enabled
Thomas Monjalon [Tue, 3 Mar 2015 10:45:02 +0000 (11:45 +0100)]
fm10k: fix build with debug enabled

error: implicit declaration of function ‘RTE_LOG’

Fixes: a6061d9e7075 ("fm10k: register PF driver")

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
9 years agomempool: fix build with debug enabled
Thomas Monjalon [Tue, 3 Mar 2015 10:31:25 +0000 (11:31 +0100)]
mempool: fix build with debug enabled

error: format ‘%p’ expects argument of type ‘void *’,
but argument 5 has type ‘const struct rte_mempool *’ [-Werror=format=]

mp type is (const struct rte_mempool *) and must be casted into a simpler
type to be printed.

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
9 years agoeal/linux: fix build
Thomas Monjalon [Tue, 3 Mar 2015 08:37:54 +0000 (09:37 +0100)]
eal/linux: fix build

Compilation fails in some distributions because of missing unistd.h
needed for pread/pwrite (seen with Suse):
lib/librte_eal/linuxapp/eal/eal_pci_uio.c:62:2:
error: implicit declaration of function ‘pread’

Fixes: 4a499c649590 ("eal/linux: enable uio_pci_generic support")

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Acked-by: David Marchand <david.marchand@6wind.com>
9 years agodevargs: fix null dereferencing on failure
Pawel Wodkowski [Mon, 2 Mar 2015 11:09:22 +0000 (12:09 +0100)]
devargs: fix null dereferencing on failure

On failure devargs->args should not be accessed if devargs is NULL.

Fixes: c07691ae1089 ("devargs: remove limit on parameters length")

Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Acked-by: David Marchand <david.marchand@6wind.com>
9 years agoeal: clean up export of socket id variable
Neil Horman [Fri, 27 Feb 2015 12:33:13 +0000 (07:33 -0500)]
eal: clean up export of socket id variable

Theres no need to export this variable.  Its set and queried from an API call
that doesn't exist in the hot path.  Instead just export the rte_socket_id
symbol and make the variable private to protect it from type changes.  We should
do this with the other exported variables too, but I think its too late in the
release cycle to do that.

tested using distributor_autotest (which uses rte_socket_id), successfully.
Only tested on linux, as I don't currently have a bsd system spun up, but the
changes are symmetric, and should be fine

Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
Acked-by: Cunming Liang <cunming.liang@intel.com>
Acked-by: David Marchand <david.marchand@6wind.com>
9 years agoi40e: advertise TSO capability
Jijiang Liu [Thu, 26 Feb 2015 03:37:24 +0000 (11:37 +0800)]
i40e: advertise TSO capability

Advertise the DEV_TX_OFFLOAD_TCP_TSO flag in the PMD features. It means
that the i40e PMD supports the offload of TSO.

Test report: http://www.dpdk.org/ml/archives/dev/2015-March/014467.html

Signed-off-by: Jijiang Liu <jijiang.liu@intel.com>
Signed-off-by: Miroslaw Walukiewicz <miroslaw.walukiewicz@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
Tested-by: Min Cao <min.cao@intel.com>
9 years agoi40e: enable TSO support
Jijiang Liu [Thu, 26 Feb 2015 03:37:23 +0000 (11:37 +0800)]
i40e: enable TSO support

This patch enables i40e TSO feature for both non-tunneling packet and
tunneling packet.

Test report: http://www.dpdk.org/ml/archives/dev/2015-March/014467.html

Signed-off-by: Jijiang Liu <jijiang.liu@intel.com>
Signed-off-by: Miroslaw Walukiewicz <miroslaw.walukiewicz@intel.com>
Signed-off-by: Grzegorz Galkowski <grzegorz.galkowski@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
Tested-by: Min Cao <min.cao@intel.com>
9 years agoi40e: move Tx offloads parameters to separate structure
Jijiang Liu [Thu, 26 Feb 2015 03:37:22 +0000 (11:37 +0800)]
i40e: move Tx offloads parameters to separate structure

The structure size is u64 so it could be used with single cpu operation.

Test report: http://www.dpdk.org/ml/archives/dev/2015-March/014467.html

Signed-off-by: Jijiang Liu <jijiang.liu@intel.com>
Signed-off-by: Miroslaw Walukiewicz <miroslaw.walukiewicz@intel.com>
Signed-off-by: Grzegorz Galkowski <grzegorz.galkowski@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
Tested-by: Min Cao <min.cao@intel.com>
9 years agoapp/testpmd: fix crash when portmask is specified
Tetsuya Mukawa [Fri, 27 Feb 2015 07:16:15 +0000 (16:16 +0900)]
app/testpmd: fix crash when portmask is specified

If testpmd is invoked with portmask option like below, segmentation
fault will occur. This patch fixes the issue.

Reported-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Signed-off-by: Tetsuya Mukawa <mukawa@igel.co.jp>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
9 years agonull: fix build with gcc-4.7
Tetsuya Mukawa [Fri, 27 Feb 2015 05:18:18 +0000 (14:18 +0900)]
null: fix build with gcc-4.7

This patch fixes following errors with gcc-4.7.
 lib/librte_pmd_null/rte_eth_null.c:302:28:
     error: array subscript is above array bounds

Reported-by: John McNamara <john.mcnamara@intel.com>
Reported-by: Stephen Hemminger <stephen@networkplumber.org>
Signed-off-by: Tetsuya Mukawa <mukawa@igel.co.jp>
Acked-by: John McNamara <john.mcnamara@intel.com>
9 years agonull: fix build with icc
Tetsuya Mukawa [Fri, 27 Feb 2015 05:19:35 +0000 (14:19 +0900)]
null: fix build with icc

This patch fixes following errors with icc.
 rte_eth_null.c(47): error #83:
     type qualifier specified more than once

Reported-by: John McNamara <john.mcnamara@intel.com>
Signed-off-by: Tetsuya Mukawa <mukawa@igel.co.jp>
Acked-by: John McNamara <john.mcnamara@intel.com>
9 years agoethdev: fix build with icc
Tetsuya Mukawa [Fri, 27 Feb 2015 05:20:34 +0000 (14:20 +0900)]
ethdev: fix build with icc

This patch fixes following errors with icc.
  error #188: enumerated type mixed with another type
    return -1;

Fixes: 92d94d3744d7 ("ethdev: attach or detach port")

Reported-by: John McNamara <john.mcnamara@intel.com>
Signed-off-by: Tetsuya Mukawa <mukawa@igel.co.jp>
Acked-by: John McNamara <john.mcnamara@intel.com>
9 years agovirtio: fix build on freebsd
Changchun Ouyang [Fri, 27 Feb 2015 02:30:10 +0000 (10:30 +0800)]
virtio: fix build on freebsd

This patch fixes the compilation issue on freebsd:
lib/librte_pmd_virtio/virtio_ethdev.c: In function 'virtio_resource_init':
lib/librte_pmd_virtio/virtio_ethdev.c:1071:56: error: unused parameter 'pci_dev' [-Werror=unused-parameter]

Fixes: da978dfdc43b ("virtio: use port IO to get PCI resource")

Signed-off-by: Changchun Ouyang <changchun.ouyang@intel.com>
Acked-by: Cunming Liang <cunming.liang@intel.com>
9 years agomlx4: fix build
Thomas Monjalon [Thu, 26 Feb 2015 16:56:34 +0000 (17:56 +0100)]
mlx4: fix build

There was a missing change due by hotplug integration.

Fixes: 9f1653e7b7e1 ("ethdev: add device type")

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
9 years agomlx4: remove old version compatibility
Thomas Monjalon [Thu, 26 Feb 2015 16:52:40 +0000 (17:52 +0100)]
mlx4: remove old version compatibility

No need to check DPDK version. It just has to work on HEAD.

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
9 years agoethdev: fix build without hotplug
Thomas Monjalon [Thu, 26 Feb 2015 10:46:52 +0000 (11:46 +0100)]
ethdev: fix build without hotplug

After setting CONFIG_RTE_LIBRTE_EAL_HOTPLUG=n, GCC stop compiling:
rte_ethdev.c:430:1: error: ‘rte_eth_dev_get_device_type’ defined but not used
rte_ethdev.c:438:1: error: ‘rte_eth_dev_save’ defined but not used
rte_ethdev.c:450:1: error: ‘rte_eth_dev_get_changed_port’ defined but not used
rte_ethdev.c:464:1: error: ‘rte_eth_dev_get_addr_by_port’ defined but not used
rte_ethdev.c:481:1: error: ‘rte_eth_dev_get_name_by_port’ defined but not used
rte_ethdev.c:503:1: error: ‘rte_eth_dev_is_detachable’ defined but not used

The hotplug option allows to build in environment (BSD) not yet
supported by this new feature.
It should be removed when BSD will be supported.
Waiting this day, let's fix build with hotplug disabled.

Reported-by: Stephen Hemminger <stephen@networkplumber.org>
Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
9 years agoversion: 2.0.0-rc1
Thomas Monjalon [Wed, 25 Feb 2015 23:41:57 +0000 (00:41 +0100)]
version: 2.0.0-rc1

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
9 years agonull: support port hotplug
Tetsuya Mukawa [Mon, 23 Feb 2015 05:12:35 +0000 (14:12 +0900)]
null: support port hotplug

This patch adds port hotplug support to Null PMD.

Signed-off-by: Tetsuya Mukawa <mukawa@igel.co.jp>
Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>
9 years agonull: new poll mode driver
Tetsuya Mukawa [Mon, 23 Feb 2015 05:12:34 +0000 (14:12 +0900)]
null: new poll mode driver

Null PMD is a driver of the virtual device particularly designed to measure
performance of DPDK PMDs. When an application call rx, Null PMD just allocates
mbufs and returns those. Also tx, the PMD just frees mbufs.

The PMD has following options.
- size: specify packe size allocated by RX. Default packet size is 64.
- copy: specify 1 or 0 to enable or disable copy while RX and TX.
Default value is 0(disabled).
This option is used for emulating more realistic data transfer.
Copy size is equal to packet size.

To use the PMD, enable CONFIG_RTE_BUILD_SHARED_LIB in config file. Then
compile the PMD as shared library. The library can be linked using '-d'
option when an application invokes.

Here is an example.
$ sudo ./testpmd -c f -n 4 -d librte_pmd_null.so \
--vdev 'eth_null0' --vdev 'eth_null1' -- -i --no-flush-rx

If testpmd is compiled with CONFIG_RTE_BUILD_SHARED_LIB, it may need to
specify more libraries using '-d' option.

Signed-off-by: Tetsuya Mukawa <mukawa@igel.co.jp>
Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>
9 years agoapp/testpmd: support port hotplug
Tetsuya Mukawa [Wed, 25 Feb 2015 19:32:29 +0000 (04:32 +0900)]
app/testpmd: support port hotplug

The patch introduces following commands.
- port attach [ident]
- port detach [port_id]
 - attach: attaching a port
 - detach: detaching a port
 - ident: pci address of physical device.
          Or device name and parameters of virtual device.
         (ex. 0000:02:00.0, eth_pcap0,iface=eth0)
 - port_id: port identifier

Signed-off-by: Tetsuya Mukawa <mukawa@igel.co.jp>
Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>
9 years agopcap: support port hotplug
Tetsuya Mukawa [Wed, 25 Feb 2015 19:32:28 +0000 (04:32 +0900)]
pcap: support port hotplug

This patch adds finalization code to free resources allocated by the
PMD.

Signed-off-by: Tetsuya Mukawa <mukawa@igel.co.jp>
Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>
9 years agodoc: add port hotplug framework in programmers guide
Tetsuya Mukawa [Wed, 25 Feb 2015 19:32:27 +0000 (04:32 +0900)]
doc: add port hotplug framework in programmers guide

This patch adds a new section for describing port hotplug framework.

Signed-off-by: Tetsuya Mukawa <mukawa@igel.co.jp>
Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>
Acked-by: Michael Qiu <michael.qiu@intel.com>
9 years agoethdev: attach or detach port
Tetsuya Mukawa [Wed, 25 Feb 2015 19:32:26 +0000 (04:32 +0900)]
ethdev: attach or detach port

These functions are used for attaching or detaching a port.
When rte_eth_dev_attach() is called, the function tries to realize the
device name as pci address. If this is done successfully,
rte_eth_dev_attach() will attach physical device port. If not, attaches
virtual devive port.
When rte_eth_dev_detach() is called, the function gets the device type
of this port to know whether the port is come from physical or virtual.
And then specific detaching function will be called.

Signed-off-by: Tetsuya Mukawa <mukawa@igel.co.jp>
9 years agoethdev: add device type
Tetsuya Mukawa [Wed, 25 Feb 2015 19:32:24 +0000 (04:32 +0900)]
ethdev: add device type

This new parameter is needed to keep device type like PCI or virtual.
Port detaching processes are different between PCI device and virtual
device.
RTE_ETH_DEV_PCI indicates device type is PCI. RTE_ETH_DEV_VIRTUAL
indicates device is virtual.

Signed-off-by: Tetsuya Mukawa <mukawa@igel.co.jp>
9 years agoethdev: close device
Tetsuya Mukawa [Wed, 25 Feb 2015 19:32:21 +0000 (04:32 +0900)]
ethdev: close device

The patch adds function pointer to rte_pci_driver and eth_driver
structure. These function pointers are used when ports are detached.
Also, the patch adds rte_eth_dev_uninit(). So far, it's not called
by anywhere, but it will be called when port hotplug function is
implemented.

Signed-off-by: Tetsuya Mukawa <mukawa@igel.co.jp>
9 years agoethdev: release port
Tetsuya Mukawa [Wed, 25 Feb 2015 19:32:20 +0000 (04:32 +0900)]
ethdev: release port

This patch adds rte_eth_dev_release_port(). The function is used for
changing an attached status of the device that has specified name.

Signed-off-by: Tetsuya Mukawa <mukawa@igel.co.jp>
9 years agoethdev: remove assumption that port will not be detached
Tetsuya Mukawa [Wed, 25 Feb 2015 19:32:18 +0000 (04:32 +0900)]
ethdev: remove assumption that port will not be detached

To remove assumption, do like followings.

This patch adds "RTE_PCI_DRV_DETACHABLE" to drv_flags of rte_pci_driver
structure. The flags indicate the driver can detach devices at runtime.
Also, remove assumption that port will not be detached.

To remove the assumption.
- Add 'attached' member to rte_eth_dev structure.
  This member is used for indicating the port is attached, or not.
  DEV_ATTACHED indicates a port is attached.
  DEV_DETACHED indicates a port is detached.
- Add rte_eth_dev_allocate_new_port().
  This function is used for allocating new port.

Signed-off-by: Tetsuya Mukawa <mukawa@igel.co.jp>
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
9 years agoeal: add vdev init and uninit
Tetsuya Mukawa [Wed, 25 Feb 2015 19:32:25 +0000 (04:32 +0900)]
eal: add vdev init and uninit

The patch adds following functions.
- rte_eal_vdev_init();
- rte_eal_vdev_uninit();
- rte_eal_parse_devargs_str().
These functions are used for driver initialization and finalization.

Signed-off-by: Tetsuya Mukawa <mukawa@igel.co.jp>
9 years agopci: probe or close device
Tetsuya Mukawa [Wed, 25 Feb 2015 19:32:23 +0000 (04:32 +0900)]
pci: probe or close device

- Add pci_close_all_drivers()
  The function tries to find a driver for the specified device, and
  then close the driver.
- Add rte_eal_pci_probe_one() and rte_eal_pci_close_one()
  The functions are used for probe and close a device.
  First the function tries to find a device that has the specified
  PCI address. Then, probe or close the device.

Signed-off-by: Tetsuya Mukawa <mukawa@igel.co.jp>
9 years agopci: unmap igb_uio resources
Tetsuya Mukawa [Wed, 25 Feb 2015 19:32:22 +0000 (04:32 +0900)]
pci: unmap igb_uio resources

The patch adds functions for unmapping igb_uio resources. The patch is only
for Linux and igb_uio environment. VFIO and BSD are not supported.

Signed-off-by: Tetsuya Mukawa <mukawa@igel.co.jp>