dpdk.git
8 years agombuf: enforce alignment of private area
Olivier Matz [Thu, 30 Jul 2015 16:22:17 +0000 (18:22 +0200)]
mbuf: enforce alignment of private area

It looks better to have a data buffer address that is aligned to
8 bytes. This is the case when there is no mbuf private area, but
if there is one, the alignment depends on the size of this area
that is located between the mbuf structure and the data buffer.

Indeed, some drivers expects to have the buffer address aligned
to an even address, and moreover an unaligned buffer may impact
the performance when accessing to network headers.

Add a check in rte_pktmbuf_pool_create() to verify the alignment
constraint before creating the mempool. For applications that use
the alternative way (direct call to rte_mempool_create), also
add an assertion in rte_pktmbuf_init().

By the way, also add the MBUF log type.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
8 years agomlx4: fix shared library dependency
Nelio Laranjeiro [Fri, 31 Jul 2015 13:14:18 +0000 (15:14 +0200)]
mlx4: fix shared library dependency

librte_pmd_mlx4.so needs to be linked with libibverbs otherwise, the PMD is
not able to open Mellanox devices and the following message is printed by
testpmd at startup
"librte_pmd_mlx4: cannot access device, is mlx4_ib loaded?".

Applications dependency on libibverbs are moved to be only valid in static
mode, in shared mode, applications do not depend on it anymore,
librte_pmd_mlx4.so keeps this dependency and thus is linked with libibverbs.

MLX4 cannot be supported in combined shared library because there is no clean
way of adding -libverbs to the combined library.

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
8 years agomk: set library dependencies in shared object file
Nelio Laranjeiro [Fri, 31 Jul 2015 13:14:17 +0000 (15:14 +0200)]
mk: set library dependencies in shared object file

Some .so libraries needs to be linked with external libraries.  For that the
LDLIBS and EXTRA_LDFLAGS variables should be present on the link line when
those .so files are created.  PMD Makefile is responsible for filling the
LDLIBS variable with the link to the external library it needs.

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
8 years agoeal: fix x32 build
Olivier Matz [Thu, 30 Jul 2015 20:26:48 +0000 (22:26 +0200)]
eal: fix x32 build

Compiling for dpdk x86_x32 gives the following error:

In file included from /usr/include/sys/sysctl.h:63:0,
                 from lib/librte_eal/common/eal_common_timer.c:39:
/usr/include/bits/sysctl.h:19:3: error: #error "sysctl system call is unsupported in x32 kernel"
 # error "sysctl system call is unsupported in x32 kernel"
   ^

Including sysctl.h was added by mistake when merging bsd and linux EAL
timer code. It can be safely removed in this file, fixing the
compilation.

Fixes: 040cf8a411 ("eal: deduplicate timer functions")

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
8 years agolog: use simple macro
Thomas Monjalon [Thu, 30 Jul 2015 18:03:19 +0000 (20:03 +0200)]
log: use simple macro

For consistency, RTE_LOG macro should be used instead of rte_log function.
The macro can be pruned at build time, though these logs have a high level
and should not pruned.

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
8 years agodrivers: allow pruning log during build
Stephen Hemminger [Thu, 9 Jul 2015 23:01:05 +0000 (16:01 -0700)]
drivers: allow pruning log during build

Some drivers was not following DPDK convention and
was leaving logging always in even if LOG_LEVEL was configured
to disable debug logs.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
[Thomas: apply same fix to i40e, fm10k and bnx2x]
Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
8 years agoixgbe: raise log level of significant events
Stephen Hemminger [Thu, 9 Jul 2015 23:01:04 +0000 (16:01 -0700)]
ixgbe: raise log level of significant events

Customers often screen off info level messages, so raise log
level of significant events.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
8 years agoixgbe: fix log level of debug messages
Stephen Hemminger [Thu, 9 Jul 2015 23:01:03 +0000 (16:01 -0700)]
ixgbe: fix log level of debug messages

All the debug chatter messages in the system log causes
complaints from users. Change the INFO messages to DEBUG
for normal startup kind of stuff.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
8 years agoe1000: raise log level of significant events
Stephen Hemminger [Thu, 9 Jul 2015 23:01:08 +0000 (16:01 -0700)]
e1000: raise log level of significant events

Any message about incorrect API usage should be at NOTICE
level or above.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
8 years agoe1000: fix log level of debug messages
Stephen Hemminger [Thu, 9 Jul 2015 23:01:07 +0000 (16:01 -0700)]
e1000: fix log level of debug messages

Any debug messages about hardware should be under debug (or removed)
and reduce customer visible log spam.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
8 years agoapp/testpmd: fix error message when closing port twice
Michael Qiu [Wed, 24 Jun 2015 07:56:25 +0000 (15:56 +0800)]
app/testpmd: fix error message when closing port twice

When close one port twice, testpmd will give out wrong messagse.

testpmd> port stop  0
Stopping ports...
Checking link statuses...
Port 0 Link Up - speed 0 Mbps - full-duplex
Port 1 Link Up - speed 0 Mbps - full-duplex
Done
testpmd> port close 0
Closing ports...
Done
testpmd> port close 0
Closing ports...
Port 0 is now not stopped
Done
testpmd>

Signed-off-by: Michael Qiu <michael.qiu@intel.com>
8 years agoapp/testpmd: fix crash when port id out of bound
Michael Qiu [Tue, 28 Jul 2015 18:32:15 +0000 (02:32 +0800)]
app/testpmd: fix crash when port id out of bound

In testpmd, when using "rx_vlan add 1 77", it will be a segment fault
Because the port ID should be less than 32.

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

Signed-off-by: Michael Qiu <michael.qiu@intel.com>
8 years agohash: fix build of toeplitz algorithm without SSE3
Vladimir Medvedkin [Wed, 29 Jul 2015 13:56:24 +0000 (09:56 -0400)]
hash: fix build of toeplitz algorithm without SSE3

Make thash library arch-independent.
Leave unaligned union rte_thash_tuple if no support for SSE3.
Makes 32bit compiler happy by adding ULL suffix.

Signed-off-by: Vladimir Medvedkin <medvedkinv@gmail.com>
8 years agoixgbe: fix Tx error stats by setting it to 0
Maryam Tahhan [Tue, 28 Jul 2015 15:38:09 +0000 (16:38 +0100)]
ixgbe: fix Tx error stats by setting it to 0

oerrors was txdgpc - hw_stats->gptc,
txdgpc is the number of packets DMA'ed by the host
and was being reset on every call to read stats so it could be < gptc.
Because we currently have no way to add txdgpc to struct hw_stats so
that we can maintain a persistent value per port oerrors has now been
set to 0. References to txdgpc is now removed as we don't use it. This
patch also removes rxnfgpc as it's not used anywhere.

Fixes: afebc86be134 ("ixgbe: refactor stats register reads")

Signed-off-by: Maryam Tahhan <maryam.tahhan@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
8 years agoixgbe: fix number of segments with vector scattered Rx
Konstantin Ananyev [Tue, 28 Jul 2015 11:39:23 +0000 (12:39 +0100)]
ixgbe: fix number of segments with vector scattered Rx

Fixes: cf4b4708a88a (ixgbe: improve slow-path perf with vector scattered Rx)

Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
8 years agoixgbe: fix scalar scattered Rx with CRC
Konstantin Ananyev [Tue, 28 Jul 2015 11:39:22 +0000 (12:39 +0100)]
ixgbe: fix scalar scattered Rx with CRC

For 2.1 release, in attempt to minimize number of RX routines to support,
ixgbe scatter and ixgbe LRO RX routines were merged into one
that can handle both cases.
Though I completely missed the fact, that while LRO could only be used
when HW CRC strip is enabled, scatter RX should work for both cases
(HW CRC strip on/off).
That patch restores missed functionality.

Fixes: 9d8a92628f21 ("ixgbe: remove simple scalar scattered Rx method")

Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
8 years agoixgbe: fix data access on big endian cpu
Xuelin Shi [Wed, 29 Jul 2015 06:38:20 +0000 (14:38 +0800)]
ixgbe: fix data access on big endian cpu

1. cpu use data owned by ixgbe must use rte_le_to_cpu_xx(...)
2. cpu fill data to ixgbe must use rte_cpu_to_le_xx(...)
3. checking pci status with converted constant

Signed-off-by: Xuelin Shi <xuelin.shi@freescale.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
8 years agoi40evf: fix crash when setup Tx queues
Jingjing Wu [Wed, 29 Jul 2015 00:54:57 +0000 (08:54 +0800)]
i40evf: fix crash when setup Tx queues

This patch fixes the issue:
Testpmd crashed with Segmentation fault when setup tx queues on vf
Steps for reproduce:
  - create one vf device from i40e driver
  - bind vf device to igb_uio and start testpmd

With debugging tools, we saw the struct i40e_vf is cleared after
memcpy(&dev->data->dev_conf, dev_conf, sizeof(dev->data->dev_conf)) in
rte_eth_dev_configure, which should not happen, and the pointer to
i40e_vf isn't in the range of i40e_adapter.

The root cause is the dev_private_size in i40e virtual function driver
struct rte_i40evf_pmd was set incorrectly.

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Tested-by: Marvin Liu <yong.liu@intel.com>
8 years agoeal/linux: fix build with extra pci config
Helin Zhang [Tue, 28 Jul 2015 22:48:27 +0000 (06:48 +0800)]
eal/linux: fix build with extra pci config

Build log:
lib/librte_eal/common/eal_common_pci.c:188:4: error:
implicit declaration of function pci_config_space_set

The function rte_eal_pci_probe_one_driver, which calls
pci_config_space_set, was moved to eal_common_pci.c,
but pci_config_space_set was left in eal_pci.c with static specifier.

Fixes: 4d4ebca4 ("pci: merge probing and closing functions for linux and bsd")

Signed-off-by: Helin Zhang <helin.zhang@intel.com>
8 years agoconfig: disable bnx2x driver
Thomas Monjalon [Tue, 28 Jul 2015 16:22:39 +0000 (18:22 +0200)]
config: disable bnx2x driver

This driver has too many issues:
- too big
- bad coding style
- no git history (dropped in 2 patches)
- no documentation
- no BSD support
- no maintainer
And the biggest one, constraining this disabling:
- many build issues

If the last 4 issues are not fixed in the next release 2.2,
the driver must be removed.

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
8 years agohash: fix crash when adding already inserted keys
Xavier Simonart [Tue, 28 Jul 2015 14:54:39 +0000 (16:54 +0200)]
hash: fix crash when adding already inserted keys

When adding with cuckoo hash a key which was already inserted
a new slot is dequeued and then enqueued back, but the enqueue
operation was not done properly.

Fixes: 48a399119619 ("hash: replace with cuckoo hash implementation")

Signed-off-by: Xavier Simonart <xavier.simonart@intel.com>
Acked-by: Sergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com>
8 years agodoc: update port hotplug in testpmd guide
Bernard Iremonger [Thu, 11 Jun 2015 14:33:27 +0000 (15:33 +0100)]
doc: update port hotplug in testpmd guide

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
Acked-by: Tetsuya Mukawa <mukawa@igel.co.jp>
8 years agoeal/bsd: fix build
Thomas Monjalon [Tue, 28 Jul 2015 08:29:51 +0000 (10:29 +0200)]
eal/bsd: fix build

The BSD function for contigmem init and attach must now use the same name
as Linux (hugepage prefix) to avoid code duplication.
The attach function was renamed but the init function was forgotten.

Fixes: d12b6da14bfa ("eal: deduplicate memory initialization")

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
8 years agoversion: 2.1.0-rc2
Thomas Monjalon [Mon, 27 Jul 2015 22:29:24 +0000 (00:29 +0200)]
version: 2.1.0-rc2

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
8 years agodoc: add a VXLAN sample guide
Jijiang Liu [Fri, 3 Jul 2015 06:58:17 +0000 (14:58 +0800)]
doc: add a VXLAN sample guide

Add a VXLAN sample guide in the sample_app_ug directory.
It includes:
    - Add the overlay networking picture with svg format.
    - Add the TEP termination framework picture with svg format.
    - Add the tep_termination.rst file
    - Change the index.rst file for the above pictures index.

Signed-off-by: Jijiang Liu <jijiang.liu@intel.com>
Signed-off-by: Thomas Long <thomas.long@intel.com>
Acked-by: Marvin Liu <yong.liu@intel.com>
8 years agodoc: comment testpmd checksum option
Jijiang Liu [Fri, 17 Jul 2015 08:12:37 +0000 (16:12 +0800)]
doc: comment testpmd checksum option

Add a comment for outer-ip option in csum command.
Set outer-ip option only when the packet is a IPv4 packet.

Signed-off-by: Jijiang Liu <jijiang.liu@intel.com>
Acked-by: Marvin Liu <yong.liu@intel.com>
8 years agodoc: fix kni command line
Bernard Iremonger [Wed, 10 Jun 2015 15:12:32 +0000 (16:12 +0100)]
doc: fix kni command line

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
8 years agoexamples/l3fwd-power: enable one-shot Rx interrupt and polling switch
Cunming Liang [Mon, 20 Jul 2015 03:02:29 +0000 (11:02 +0800)]
examples/l3fwd-power: enable one-shot Rx interrupt and polling switch

The patch demonstrates how to handle per rx queue interrupt in a NAPI-like
implementation in userspace. The working thread mainly runs in polling mode
and switch to interrupt mode only if there is no packet received in recent polls.
The working thread returns to polling mode immediately once it receives an
interrupt notification caused by the incoming packets.
The sample keeps running in polling mode if the binding PMD hasn't supported
the rx interrupt yet. Now only ixgbe(pf/vf) and igb support it.

Signed-off-by: Danny Zhou <danny.zhou@intel.com>
Signed-off-by: Cunming Liang <cunming.liang@intel.com>
8 years agoigb: enable Rx queue interrupts for PF
Cunming Liang [Mon, 20 Jul 2015 03:02:28 +0000 (11:02 +0800)]
igb: enable Rx queue interrupts for PF

The patch does below for igb PF:
- Setup NIC to generate MSI-X interrupts
- Set the IVAR register to map interrupt causes to vectors
- Implement interrupt enable/disable functions

Signed-off-by: Danny Zhou <danny.zhou@intel.com>
Signed-off-by: Cunming Liang <cunming.liang@intel.com>
8 years agoixgbe: enable Rx queue interrupts for PF and VF
Cunming Liang [Mon, 20 Jul 2015 03:02:27 +0000 (11:02 +0800)]
ixgbe: enable Rx queue interrupts for PF and VF

The patch does below things for ixgbe PF and VF:
- Setup NIC to generate MSI-X interrupts
- Set the IVAR register to map interrupt causes to vectors
- Implement interrupt enable/disable functions

Signed-off-by: Danny Zhou <danny.zhou@intel.com>
Signed-off-by: Yong Liu <yong.liu@intel.com>
Signed-off-by: Cunming Liang <cunming.liang@intel.com>
8 years agoethdev: add Rx interrupt control functions
Cunming Liang [Mon, 20 Jul 2015 03:02:26 +0000 (11:02 +0800)]
ethdev: add Rx interrupt control functions

The patch adds two dev_ops functions to enable and disable rx queue
interrupts.
In addition, it adds rte_eth_dev_rx_intr_ctl/rx_intr_q to support
per port or per queue rx intr event set.

Signed-off-by: Danny Zhou <danny.zhou@intel.com>
Signed-off-by: Cunming Liang <cunming.liang@intel.com>
8 years agoeal/linux: add interrupt API for drivers
Cunming Liang [Mon, 20 Jul 2015 03:02:22 +0000 (11:02 +0800)]
eal/linux: add interrupt API for drivers

The patch exposes intr event fd create and release for PMD.
The device driver can assign the number of event associated with interrupt vector.
It also provides misc functions to check 1) allows other slowpath intr(e.g. lsc);
2) intr event on fastpath is enabled or not.

Signed-off-by: Cunming Liang <cunming.liang@intel.com>
8 years agoeal/linux: fix link status interrupt with uio_pci_generic
Cunming Liang [Mon, 20 Jul 2015 03:02:23 +0000 (11:02 +0800)]
eal/linux: fix link status interrupt with uio_pci_generic

The intr handle type(RTE_INTR_HANDLE_UIO_INTX) was introduced by UIO pci generic.
When turning on the lsc interrupt, it complains fd read error.
The patch uses the correct read size in the case of RTE_INTR_HANDLE_UIO_INTX.

Fixes: 3f313bef3467 ("eal/linux: fix irq handling with igb_uio")

Reported-by: Yong Liu <yong.liu@intel.com>
Signed-off-by: Cunming Liang <cunming.liang@intel.com>
8 years agoeal/linux: map eventfd to vfio MSI-X vector
Cunming Liang [Mon, 20 Jul 2015 03:02:21 +0000 (11:02 +0800)]
eal/linux: map eventfd to vfio MSI-X vector

The patch maps each of the eventfd to the interrupt vector of VFIO MSI-X.

Signed-off-by: Danny Zhou <danny.zhou@intel.com>
Signed-off-by: Cunming Liang <cunming.liang@intel.com>
8 years agoeal/linux: fix comments on vfio MSI
Cunming Liang [Mon, 20 Jul 2015 03:02:20 +0000 (11:02 +0800)]
eal/linux: fix comments on vfio MSI

Signed-off-by: Cunming Liang <cunming.liang@intel.com>
8 years agoeal/linux: add Rx interrupt control function
Cunming Liang [Mon, 20 Jul 2015 03:02:19 +0000 (11:02 +0800)]
eal/linux: add Rx interrupt control function

The patch adds 'rte_intr_rx_ctl' to add or delete interrupt vector
events monitor on specified epoll instance.

Signed-off-by: Cunming Liang <cunming.liang@intel.com>
8 years agoeal/linux: add epoll wrappers
Cunming Liang [Mon, 20 Jul 2015 03:02:18 +0000 (11:02 +0800)]
eal/linux: add epoll wrappers

The patch adds 'rte_epoll_wait' and 'rte_epoll_ctl' for async event wakeup.
It defines 'struct rte_epoll_event' as the event param.
When the event fds add to a specified epoll instance, 'eptrs' will hold
the rte_epoll_event object pointer.
The 'op' uses the same enum as epoll_wait/ctl does.
The epoll event support to carry a raw user data and to register a callback
which is executed during wakeup.

Signed-off-by: Cunming Liang <cunming.liang@intel.com>
8 years agoeal/linux: add interrupt vectors
Cunming Liang [Mon, 20 Jul 2015 03:02:17 +0000 (11:02 +0800)]
eal/linux: add interrupt vectors

The patch adds interrupt vectors support in rte_intr_handle.
'vec_en' is set when interrupt vectors are detected and associated
event fds are set. Those event fds are stored in efds[].
'intr_vec' is reserved for device driver to initialize the vector
mapping table.

Signed-off-by: Danny Zhou <danny.zhou@intel.com>
Signed-off-by: Cunming Liang <cunming.liang@intel.com>
8 years agoeal/bsd: fix inappropriate header guards
Cunming Liang [Mon, 20 Jul 2015 03:02:25 +0000 (11:02 +0800)]
eal/bsd: fix inappropriate header guards

Signed-off-by: Cunming Liang <cunming.liang@intel.com>
8 years agodoc: add bonding hotplug example in testpmd guide
Bernard Iremonger [Mon, 27 Jul 2015 15:54:37 +0000 (16:54 +0100)]
doc: add bonding hotplug example in testpmd guide

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
8 years agoapp/testpmd: fix bonding start
Bernard Iremonger [Mon, 27 Jul 2015 15:54:35 +0000 (16:54 +0100)]
app/testpmd: fix bonding start

When the bonded port is started it also starts the slave port,
but the slave port status is not set. A slave_flag has been
added to struct rte_port to resolve this issue.

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
Acked-by: Declan Doherty <declan.doherty@intel.com>
8 years agobonding: free queue memory when closing
Bernard Iremonger [Mon, 27 Jul 2015 15:54:36 +0000 (16:54 +0100)]
bonding: free queue memory when closing

Add function bond_ethdev_free_queues() and call from the
bond_ethdev_close() function.

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
8 years agobonding: support port hotplug
Bernard Iremonger [Mon, 27 Jul 2015 15:54:34 +0000 (16:54 +0100)]
bonding: support port hotplug

This patch depends on the Port Hotplug Framework.
It implements the rte_dev_uninit_t() function for the link bonding pmd.

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
Acked-by: Declan Doherty <declan.doherty@intel.com>
8 years agoexamples/l3fwd: increase lookup burst size to 8
Pablo de Lara [Thu, 23 Jul 2015 16:12:07 +0000 (17:12 +0100)]
examples/l3fwd: increase lookup burst size to 8

With the new hash implementation, the minimum lookup burst size
to get good performance is 8, since its internal pipeline
consists of 4 stages of 2 entries each, so to avoid
duplication, burst size should be 8 or more entries.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
8 years agoexamples/ip_pipeline: fix cpu cores parsing
Maciej Gajdzica [Tue, 21 Jul 2015 14:39:00 +0000 (16:39 +0200)]
examples/ip_pipeline: fix cpu cores parsing

This patch fixes parsing value of core variable in pipeline config.
Before not every combination of cores (c), sockets (s) and
hyperthreading (h) was parsed correctly.

Signed-off-by: Maciej Gajdzica <maciejx.t.gajdzica@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
8 years agoixgbe: fix Rx queue reset
Konstantin Ananyev [Mon, 27 Jul 2015 13:28:16 +0000 (14:28 +0100)]
ixgbe: fix Rx queue reset

As Steve pointed out, the commit 11b220c6498d ("ixgbe: fix release queue mbufs")
is not complete.
As at queue stop we don't reset vector related rx queue fields to their
initial values.

Fixes: c95584dc2b18 ("ixgbe: new vectorized functions for Rx/Tx")

Reported-by: Cunming Liang <cunming.liang@intel.com>
Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
8 years agoigb_uio: fix build
Jan Viktorin [Fri, 24 Jul 2015 17:11:44 +0000 (19:11 +0200)]
igb_uio: fix build

The missing header prevents to build with linux v3.18.

The problem is with kzalloc and kfree which are undefined in the igb_uio
driver.

HOSTCC="/usr/bin/gcc" HOSTCFLAGS="" ARCH=arm
RTE_TARGET=arm-armv7-a-linuxapp-gcc
CROSS=arm-none-linux-gnueabi-
lib/librte_eal/linuxapp/igb_uio/igb_uio.c:
error: implicit declaration of function 'kzalloc'
error: implicit declaration of function 'kfree'

Signed-off-by: Jan Viktorin <viktorin@rehivetech.com>
8 years agofm10k: expose Tx checksum capability
Chen Jing D(Mark) [Mon, 27 Jul 2015 07:56:57 +0000 (15:56 +0800)]
fm10k: expose Tx checksum capability

fm10k has the capability to do checksum offload in TX side. This
change will expose the capability to application in infos_get
function.

Signed-off-by: Chen Jing D(Mark) <jing.d.chen@intel.com>
8 years agoconfig: fix ABI breakage in BSD build
Thomas Monjalon [Mon, 27 Jul 2015 02:01:57 +0000 (04:01 +0200)]
config: fix ABI breakage in BSD build

When reverting the max queues per port to fix an ABI breakage,
the BSD config was forgotten.

Fixes: 94c6cba001ae ("config: revert the max queues per port to 256")

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
8 years agoeal: fix tsc frequency
Sergio Gonzalez Monroy [Mon, 27 Jul 2015 12:17:55 +0000 (13:17 +0100)]
eal: fix tsc frequency

Fix error where TSC freq is 0.

The logical OR operator evaluates to 1 if any of its operands is
different than 0.

Error showed later while initializing PMD:
EAL: TSC frequency is ~0 KHz
<snip>
PMD: eth_ixgbe_dev_init(): Hardware Initialization Failure: -30
EAL: Error - exiting with code: 1
  Cause: Requested device 0000:84:00.0 cannot be used

Fixes: 040cf8a41187 ("eal: deduplicate timer functions")

Signed-off-by: Sergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
8 years agoring: support port hotplug
Bernard Iremonger [Tue, 7 Jul 2015 13:09:23 +0000 (14:09 +0100)]
ring: support port hotplug

This patch depends on the Port Hotplug Framework.
It implements the rte_dev_uninit_t() function for the ring pmd.

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
Acked-by: Bruce Richardson <bruce.ruchardson@intel.com>
8 years agobnx2x: enable PMD build
Stephen Hemminger [Mon, 20 Jul 2015 16:33:20 +0000 (09:33 -0700)]
bnx2x: enable PMD build

This is build infrastructure changes for bnx2x driver.
 - enable BNX2X poll mode driver in default config.
 - add it to mk
 - put entry in MAINTAINERS

Note: I intentionally did not list myself as maintainer of this
driver. QLogic has discussed taking over as maintainer.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Harish Patil <harish.patil@qlogic.com>
8 years agobnx2x: driver support routines
Stephen Hemminger [Mon, 20 Jul 2015 16:33:19 +0000 (09:33 -0700)]
bnx2x: driver support routines

More code for the Broadcom/Qlogic NetExtreme II poll mode driver.
Split into pieces for review and not to overwhelm mailers.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Harish Patil <harish.patil@qlogic.com>
8 years agobnx2x: driver core
Stephen Hemminger [Mon, 20 Jul 2015 16:33:18 +0000 (09:33 -0700)]
bnx2x: driver core

This is the first of several parts for a new driver supporting
Broadcom/Qlogic NetXtremeII 10 gigabit devices.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Harish Patil <harish.patil@qlogic.com>
8 years agoeal: provide functions to access PCI config
Stephen Hemminger [Mon, 20 Jul 2015 16:33:17 +0000 (09:33 -0700)]
eal: provide functions to access PCI config

Some drivers need ability to access PCI config (for example for power
management). This adds an abstraction to do this for both Linux
and BSD.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Harish Patil <harish.patil@qlogic.com>
8 years agoeal: deduplicate memory initialization
Ravi Kerur [Sat, 25 Jul 2015 19:36:29 +0000 (12:36 -0700)]
eal: deduplicate memory initialization

Move common functions from BSD/Linux to eal_common_memory.c file.
BSD uses contigmem kernel module and Linux uses /proc/self/pagemap file.

Signed-off-by: Ravi Kerur <rkerur@gmail.com>
Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
8 years agoeal: deduplicate timer functions
Ravi Kerur [Sat, 25 Jul 2015 19:36:28 +0000 (12:36 -0700)]
eal: deduplicate timer functions

Move common functions from BSD/Linux to eal_common_timer.c.
BSD uses sysctl and Linux uses CLOCK_MONOTIC_RAW to calibrate TSC.
HPET is specific to Linux and not integrated in the common init.

Signed-off-by: Ravi Kerur <rkerur@gmail.com>
Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
8 years agoeal: deduplicate lcore initialization
Ravi Kerur [Sat, 25 Jul 2015 19:36:27 +0000 (12:36 -0700)]
eal: deduplicate lcore initialization

Implement cpu_detected() for BSD.
Move common function in eal_lcore.c to eal_common_lcore.c file.

Signed-off-by: Ravi Kerur <rkerur@gmail.com>
8 years agoeal: remove useless PCI id header inclusions
David Marchand [Thu, 23 Jul 2015 07:15:32 +0000 (09:15 +0200)]
eal: remove useless PCI id header inclusions

Signed-off-by: David Marchand <david.marchand@6wind.com>
[Thomas: move inclusion used by ixgbe bypass]
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
8 years agoeal: remove dependency on drivers
David Marchand [Thu, 23 Jul 2015 07:15:31 +0000 (09:15 +0200)]
eal: remove dependency on drivers

There is no reason why eal should depend on drivers.
Remove remaining (unused) references.

Signed-off-by: David Marchand <david.marchand@6wind.com>
8 years agombuf: fix tunnel flags check
Thomas Monjalon [Wed, 15 Jul 2015 23:50:12 +0000 (01:50 +0200)]
mbuf: fix tunnel flags check

A packet is tunnelled if the tunnel type is identified or if it has
an inner part.

Fix also some typos in RTE_PTYPE_INNER_L3_MASK and IP comments.

Fixes: f295a00a2b44 ("mbuf: add definitions of unified packet types")

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
8 years agomempool: fix trailer address
Yuichi Nakai [Wed, 22 Jul 2015 13:57:00 +0000 (22:57 +0900)]
mempool: fix trailer address

__mempool_get_trailer() calculated header's address.
The address of trailer should set after element area.
This patch fixes this calculating.

Fixes: 97e7e685bfcd ("mempool: add structure for object trailers")

Signed-off-by: Yuichi Nakai <xoxyuxu@gmail.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
8 years agoethdev: fix C linkage type of latest functions
Konstantin Ananyev [Fri, 24 Jul 2015 15:18:25 +0000 (16:18 +0100)]
ethdev: fix C linkage type of latest functions

Move #ifdef __cplusplus to the end of the file.

Fixes: 64b7acd861b1 ("ethdev: add multicast address filtering")

Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
8 years agoe1000: enable jumbo frame for 82583V device
Klaus Degner [Wed, 22 Jul 2015 09:07:43 +0000 (11:07 +0200)]
e1000: enable jumbo frame for 82583V device

This patch enables jumbo frame support for the 82583V.
It has been tested ( rx and tx ) with real HW.

Signed-off-by: Klaus Degner <kd@allegro-packets.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
8 years agoixgbe: fix check for split packets
Bruce Richardson [Wed, 22 Jul 2015 09:13:30 +0000 (10:13 +0100)]
ixgbe: fix check for split packets

The check for split packets to be reassembled in the vector ixgbe PMD
was incorrectly only checking the first 16 elements of the array instead
of all 32. This is fixed by changing the uint32_t values to be uint64_t
instead.

Fixes: cf4b4708a88a ("ixgbe: improve slow-path perf with vector scattered Rx")

Reported-by: Zoltan Kiss <zoltan.kiss@linaro.org>
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
8 years agoixgbe: remove Rx bulk allocation option
Pablo de Lara [Thu, 23 Jul 2015 14:29:41 +0000 (15:29 +0100)]
ixgbe: remove Rx bulk allocation option

RTE_LIBRTE_IXGBE_RX_ALLOW_BULK_ALLOC config option is not really
necessary, as bulk alloc rx function can be used anyway, as long as the
necessary conditions are satisfied, which are checked already
in the library.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
8 years agoixgbe: remove awkward typecasts
Konstantin Ananyev [Fri, 24 Jul 2015 13:58:15 +0000 (14:58 +0100)]
ixgbe: remove awkward typecasts

The vector/SSE pmd used a different element type for the tx queue sw_ring
entries. This led to lots of typecasts in the code which required specific
use of bracketing, leading to subtle errors.
For example, in the original code:
txe = (struct ixgbe_tx_entry_v *)&txq->sw_ring[i];
instead needs to be written as:
txe = &((struct ixgbe_tx_entry_v *)txq->sw_ring)[i];

We can eliminate this problem, by having two software ring pointers in the
structure for the two different element types.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
8 years agoixgbe: rename Tx queue release function
Konstantin Ananyev [Fri, 24 Jul 2015 13:58:14 +0000 (14:58 +0100)]
ixgbe: rename Tx queue release function

The function inside the vector/SSE poll-mode driver for releasing
the mbufs on the TX queues had the same name as another function
inside the regular PMD. To keep consistency and avoid confusion,
rename the vector PMD version to have a "_vec" suffix.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
8 years agoixgbe: fix release queue mbufs
Konstantin Ananyev [Fri, 24 Jul 2015 13:58:13 +0000 (14:58 +0100)]
ixgbe: fix release queue mbufs

The calculations of what mbufs were valid in the RX and TX queues were
incorrect when freeing the mbufs for the vector PMD. This led to crashes
due to invalid reference counts when mbuf debugging was turned on, and
possibly other more subtle problems (such as mbufs being freed when in use)
in other cases.

To fix this, the following changes were made:
* correct counts and post-loop values in the TX release function for the
  vector code.
* create a new separate RX release function for the RX vector code, since the
  tracking of what mbufs are valid or not is different for that code path

Fixes: c95584dc2b18 ("ixgbe: new vectorized functions for Rx/Tx")

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
8 years agoixgbe: revert mbuf refcnt check when clearing a ring
Konstantin Ananyev [Fri, 24 Jul 2015 13:58:11 +0000 (14:58 +0100)]
ixgbe: revert mbuf refcnt check when clearing a ring

The bug fix was incorrect as it did not take account of the fact that
the mbufs that were previously freed may have since be re-allocated.

Reverts: b35d0d80f0a8 ("ixgbe: check mbuf refcnt when clearing a ring")

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
8 years agoixgbe: fix comments on Rx queue fields
Konstantin Ananyev [Fri, 24 Jul 2015 13:58:12 +0000 (14:58 +0100)]
ixgbe: fix comments on Rx queue fields

The two fields for vector RX rearming in the rx queue structure were
incorrectly labelled. Switching the comments on each around makes things
clearer.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
8 years agoixgbe: fix Rx error stats
Maryam Tahhan [Mon, 20 Jul 2015 12:28:29 +0000 (13:28 +0100)]
ixgbe: fix Rx error stats

Bug fix to remove (rxnfgpc - hw_stats->gprc) which does not account
for phy errors.
hw_stats->gprc is the Number of good (non-erred) Rx packets (from the
network) that pass L2 filtering and has a legal length as defined by
LongPacketEnable. While rxnfgpc is the Number of good (non-erred with
legal length) Rx packets (from the network) regardless of packet
filtering and receive enablement. Thus hw_stats->gprc can be > rxnfgpc
and this calculation should be removed from the calculation of ierrors.
Validated with testpmd by sending packets to the interface without
forwarding enabled - packets should be dropped and the error counters
incremented.

Fixes: f6bf669b9900 ("ixgbe: account more Rx errors")

Signed-off-by: Maryam Tahhan <maryam.tahhan@intel.com>
Acked-by: Balazs Nemeth <balazs.nemeth@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Tested-by: Marvin Liu <yong.liu@intel.com>
8 years agokni: remove needless casts
Stephen Hemminger [Thu, 16 Jul 2015 23:47:24 +0000 (16:47 -0700)]
kni: remove needless casts

This fixes cases in KNI where kernel allocation function return value
is needlessly casted.

Detected with coccinelle:
lib/librte_eal/linuxapp/kni/ethtool/igb/igb_main.c:3181:25-28:
WARNING: casting value returned by memory allocation function to (u32 *) is useless.
lib/librte_eal/linuxapp/kni/kni_vhost.c:690:9-28:
WARNING: casting value returned by memory allocation function to (struct rte_kni_fifo *) is useless.
lib/librte_eal/linuxapp/kni/kni_vhost.c:684:13-27:
WARNING: casting value returned by memory allocation function to (struct sk_buff *) is useless

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
8 years agoethdev: fix crash if malloc of user callback fails
Stephen Hemminger [Thu, 16 Jul 2015 23:47:23 +0000 (16:47 -0700)]
ethdev: fix crash if malloc of user callback fails

Found by coccinelle script.
If rte_zmalloc() failed in rte_eth_dev_callback_register
then NULL pointer would be dereferenced.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
[Thomas: restore pointer comparison style]

8 years agocxgbe: update doc for FreeBSD support
Rahul Lakkireddy [Mon, 20 Jul 2015 17:31:37 +0000 (23:01 +0530)]
cxgbe: update doc for FreeBSD support

Update cxgbe documentation to include support for FreeBSD:
1. Add instructions on how to compile CXGBE PMD in FreeBSD.
2. Add instructions on how to flash firmware image on Chelsio T5 cards in
   FreeBSD.
3. Add sample application usage for FreeBSD.
4. Add an extra step to reload kernel module in Linux in order for the new
   firmware to be loaded.
5. Typo fixes.

Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
Signed-off-by: Kumar Sanghvi <kumaras@chelsio.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
8 years agocxgbe: enable build on FreeBSD
Rahul Lakkireddy [Mon, 20 Jul 2015 17:31:36 +0000 (23:01 +0530)]
cxgbe: enable build on FreeBSD

Fix "MACRO redefined" and "function redefined" compilation errors in FreeBSD
by adding CXGBE prefix to them.  Also remove reference to a linux header
linux/if_ether.h and use DPDK macros directly.  Finally, enable CXGBE PMD
for FreeBSD.

Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
Signed-off-by: Kumar Sanghvi <kumaras@chelsio.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
8 years agonic_uio: allow to bind any device
Rahul Lakkireddy [Mon, 20 Jul 2015 17:31:35 +0000 (23:01 +0530)]
nic_uio: allow to bind any device

nic_uio requires the pci ids to be present in rte_pci_dev_ids.h in order to
bind the devices to nic_uio.  However, it's better to remove this whitelist
of pci ids, and instead rely on hw.nic_uio.bdfs kenv parameter to allow
binding any device to nic_uio.

Suggested-by: David Marchand <david.marchand@6wind.com>
Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
Signed-off-by: Kumar Sanghvi <kumaras@chelsio.com>
Acked-by: David Marchand <david.marchand@6wind.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
8 years agofm10k: fix interrupt fault handling
Stephen Hemminger [Fri, 17 Jul 2015 00:33:22 +0000 (17:33 -0700)]
fm10k: fix interrupt fault handling

The fm10k driver was reading the interrupt cause register but then
using the interrupt mask register defines to look at the bits.
The result is that if a fault happens, the driver would never clear
the fault and would get into an infinite cycle of interrupts.

Note: I don't work for Intel or have the hardware manuals (probably
requires NDA anyway), but this looks logical and matches how the
known working Linux driver handles these bits.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Jing Chen <jing.d.chen@intel.com>
8 years agofm10k: remove useless code
Stephen Hemminger [Thu, 16 Jul 2015 22:05:17 +0000 (15:05 -0700)]
fm10k: remove useless code

The return in fm10k_dev_handle_fault has useless conditional
since it always returns 0 here.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Jing Chen <jing.d.chen@intel.com>
8 years agofm10k: fix missing newline in debug log
Stephen Hemminger [Thu, 16 Jul 2015 21:06:40 +0000 (14:06 -0700)]
fm10k: fix missing newline in debug log

If FM10K_DEBUG_DRIVER is enabled, then the log messages about
function entry are missing newline causing extremely long lines.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Jing Chen <jing.d.chen@intel.com>
8 years agoapp/testpmd: fix ieee1588 32-bit timestamp log
Pablo de Lara [Wed, 22 Jul 2015 08:06:48 +0000 (09:06 +0100)]
app/testpmd: fix ieee1588 32-bit timestamp log

In ieee1588fwd.c, timestamp.tv_sec is a time_t variable,
which is a long int, but it was being printed with PRIu64,
causing an issue on 32 bits.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
8 years agoixgbe: fix build with bulk alloc disabled
Pablo de Lara [Wed, 22 Jul 2015 09:50:11 +0000 (10:50 +0100)]
ixgbe: fix build with bulk alloc disabled

ixgbe_recv_pkts_lro uses field rx_free_trigger
in structure ixgbe_rx_queue, but that field is only defined
if IXGBE_RX_ALLOW_BULK_ALLOC is enabled, so even though
that field is not used when it is disabled,
compiler complains about it.
Therefore, the lines of code that use that field
have been ifdef.

Fixes: 8eecb329 ("ixgbe: add LRO support")

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
8 years agohash: move struct field to keep ABI stable
Pablo de Lara [Tue, 21 Jul 2015 14:10:19 +0000 (15:10 +0100)]
hash: move struct field to keep ABI stable

In order to keep the ABI consistent with the old hash library,
hash_func_init_val field has been moved, so it remains
at the same offset as previously, since hash_func and
hash_func_init_val are fields accessed by the public function
rte_hash_hash and must keep the same offset as older versions.

Fixes: 48a399119619 ("hash: replace with cuckoo hash implementation")

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
8 years agovirtio: small cleanups
Stephen Hemminger [Mon, 20 Jul 2015 18:40:46 +0000 (11:40 -0700)]
virtio: small cleanups

Some minor cleanups.
  * pass constant to virtio_dev_queue_setup
  * fix message on rx_queue_setup
  * get rid of extra double spaces

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Changchun Ouyang <changchun.ouyang@intel.com>
8 years agovirtio: fix queue size and number of descriptors
Stephen Hemminger [Mon, 20 Jul 2015 18:40:45 +0000 (11:40 -0700)]
virtio: fix queue size and number of descriptors

The virtual queue ring size and the number of slots actually usable
are separate parameters. In the most common environment (QEMU)
the virtual queue ring size is 256, but some environments the
ring maybe much larger.

The ring size comes from the host and the driver must use the
actual size passed.

The number of descriptors can be either zero to use the whole
available ring, or some value smaller. This is used to limit
the number of mbufs allocated for the receive ring. If more
descriptors are requested than available the size is silently
truncated.

Note: the ring size (from host) must be a power of two, but
the number of descriptors used can be any size from 1 to the
size of the virtual ring.

Fixes: d78deadae4dc ("virtio: fix ring size negotiation")

Reported-by: Changchun Ouyang <changchun.ouyang@intel.com>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Changchun Ouyang <changchun.ouyang@intel.com>
8 years agomalloc: fix combined lib build
Sergio Gonzalez Monroy [Tue, 21 Jul 2015 10:33:17 +0000 (11:33 +0100)]
malloc: fix combined lib build

Malloc was moved to the EAL and dummy malloc library was left
to not break apps that had a librte_malloc.so dependency.
Note that the dummy library will be removed in the next release.

When building a combined library, all objects are copied to the same
directory before creating the library itself.

There are a few issues:
 - CONFIG_RTE_LIBRTE_MALLOC is not a valid option anymore resulting
 in wrong syntax and a compilation failure. Fix it by replacing it
 with CONFIG_RTE_LIBRTE_EAL.
 - As we kept a dummy library, there are now two objects with the
 same name. This means that the proper rte_malloc.o object in eal gets
 overwritten by an empty rte_malloc.o object from the dummy malloc lib.
 Fix it by changing the name of rte_malloc.o object in the dummy
 library.
 - Update the copyright year.

Fixes: 2f9d47013e4dbb738 ("mem: move librte_malloc to eal/common")

Reported-by: Alin Rauta <alin.rauta@intel.com>
Signed-off-by: Sergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com>
8 years agoversion: 2.1.0-rc1
Thomas Monjalon [Mon, 20 Jul 2015 01:44:18 +0000 (03:44 +0200)]
version: 2.1.0-rc1

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
8 years agodevargs: fix crash on failure
Stephen Hemminger [Fri, 15 May 2015 16:37:40 +0000 (09:37 -0700)]
devargs: fix crash on failure

This problem was discovered when passing invalid PCI id to the
blacklist API in devargs.

Any failures in rte_devargs_add would cause a core dump because
it would call rte_log() before the the EAL log environment was
initialized.  Rather than try and log just remove the messages
and leave it up to the caller to check the return value.

Most of the other failure possibilities are when malloc() fails, and if
that happens any logging that used malloc() would also fail.

This failure was not caught by the standalone tests to devargs
because the tests are run after calling rte_eal_init (which is not
how devargs is intended to be used).

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
8 years agobonding: fix name and port validation
Stephen Hemminger [Wed, 10 Jun 2015 22:06:25 +0000 (15:06 -0700)]
bonding: fix name and port validation

Cleanup the code in bonding that checks ports.
  * Use standard rte_eth_dev_is_valid_port
  * Change name of driver string to avoid variable namespace conflicts
  * Get rid of unnecessary string comparison stuff. A simple pointer
    check is enough here.
  * Get rid of unnecessary assignment of driver_name, it is already
    done by common code.
  * Don't generate unnecessary log messages on error.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Declan Doherty <declan.doherty@intel.com>
8 years agoethdev: export function to check port validity
Stephen Hemminger [Wed, 10 Jun 2015 22:06:24 +0000 (15:06 -0700)]
ethdev: export function to check port validity

The function rte_eth_dev_is_valid_port is good way to have all
drivers using same function and solves several hotplug related
bugs from drivers not checking attached flag.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
8 years agoeal/linux: change log severity levels
Stephen Hemminger [Fri, 15 May 2015 17:10:47 +0000 (10:10 -0700)]
eal/linux: change log severity levels

Change the log level of startup messages. Anything that is
just normal activity (like getting virtual areas) is changed
to debug level. Anything that is a failure should be NOTICE
or ERR severity.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
8 years agoeal/linux: handle signal on event read
Stephen Hemminger [Wed, 15 Jul 2015 17:16:16 +0000 (10:16 -0700)]
eal/linux: handle signal on event read

The read for events in the interrupt thread may get interrupted
by signals from application. Avoid generating stray log message.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
8 years agoi40e: fix registers access from big endian CPU
Zhe Tao [Fri, 17 Jul 2015 07:25:40 +0000 (15:25 +0800)]
i40e: fix registers access from big endian CPU

Signed-off-by: Zhe Tao <zhe.tao@intel.com>
Acked-by: Chao Zhu <chaozhu@linux.vnet.ibm.com>
8 years agoi40evf: fix RSS with less Rx queues than Tx queues
Jingjing Wu [Mon, 13 Jul 2015 01:21:41 +0000 (09:21 +0800)]
i40evf: fix RSS with less Rx queues than Tx queues

I40e VF driver uses the num_queue_pairs in vf structure to construct
queue index look up table. When the nb_rx_queue is less than nb_tx_queue,
num_queue_pairs is equal to nb_tx_queue. It will make the table use
invalid queue index, then application cannot poll packets on these queues.

This patch also moves the inline function i40e_align_floor from
i40e_ethdev.c to i40e_ethdev.h.

Test report: http://dpdk.org/ml/archives/dev/2015-July/021838.html

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
Tested-by: Qian Xu <qian.q.xu@intel.com>
8 years agoi40e: fix SCTP flow director
Jingjing Wu [Tue, 7 Jul 2015 07:58:31 +0000 (15:58 +0800)]
i40e: fix SCTP flow director

Due to the NIC's firmware update, the input set of sctp flow is changed
to source IP, destination IP, source port, destination port and
Verification-Tag. This patch adds the sport and dport in the programming
packet of flow director.

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Tested-by: Marvin Liu <yong.liu@intel.com>
8 years agoethdev: add ports to SCTP flow director
Jingjing Wu [Tue, 7 Jul 2015 07:58:30 +0000 (15:58 +0800)]
ethdev: add ports to SCTP flow director

Add sport and dport into the input set of sctp flow.

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
8 years agoapp/testpmd: fix port detaching with virtio
Bernard Iremonger [Wed, 15 Jul 2015 13:51:05 +0000 (14:51 +0100)]
app/testpmd: fix port detaching with virtio

At this point the stop() and close() functions have already been called.
The rte_eth_promiscuous_disable() function does not return on the VM.

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
8 years agovirtio: free queue memory when closing
Bernard Iremonger [Wed, 15 Jul 2015 13:51:03 +0000 (14:51 +0100)]
virtio: free queue memory when closing

Add function virtio_free_queues() and call from virtio_dev_close()
Use virtio_dev_rx_queue_release() and virtio_dev_tx_queue_release()

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
8 years agovirtio: add queue release
Bernard Iremonger [Wed, 15 Jul 2015 13:51:02 +0000 (14:51 +0100)]
virtio: add queue release

Add functions virtio_dev_queue_release(), virtio_dev_rx_queue_release() and
virtio_dev_tx_queue_release().

Use queue_release in virtio_dev_uninit().

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
8 years agovirtio: check virtqueue parameter when detaching
Bernard Iremonger [Wed, 15 Jul 2015 13:51:01 +0000 (14:51 +0100)]
virtio: check virtqueue parameter when detaching

If vq is NULL, there is a segmentation fault.

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
Acked-by: Changchun Ouyang <changchun.ouyang@intel.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>