dpdk.git
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>
8 years agovirtio: support port hotplug
Bernard Iremonger [Wed, 15 Jul 2015 13:51:00 +0000 (14:51 +0100)]
virtio: support port hotplug

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

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
8 years agofm10k: support port hotplug
Michael Qiu [Tue, 14 Jul 2015 12:45:45 +0000 (20:45 +0800)]
fm10k: support port hotplug

Add hotplug support for fm10k.

Signed-off-by: Michael Qiu <michael.qiu@intel.com>
Acked-by: Jing Chen <jing.d.chen@intel.com>
8 years agofm10k: free queue memory when closing
Michael Qiu [Tue, 14 Jul 2015 12:45:44 +0000 (20:45 +0800)]
fm10k: free queue memory when closing

When close a port, lots of memory should be released,
such as software rings, queues, etc.

Signed-off-by: Michael Qiu <michael.qiu@intel.com>
8 years agoi40e: free queue memory when closing
Bernard Iremonger [Fri, 3 Jul 2015 14:04:00 +0000 (15:04 +0100)]
i40e: free queue memory when closing

Add i40e_dev_free_queues() function and call it from close() functions.

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
8 years agoi40e: check Rx queue parameter when resetting
Bernard Iremonger [Fri, 3 Jul 2015 14:03:59 +0000 (15:03 +0100)]
i40e: check Rx queue parameter when resetting

There is a segmentation fault if rxq is NULL.

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
8 years agoi40evf: clear queues when stopping
Bernard Iremonger [Fri, 3 Jul 2015 14:03:58 +0000 (15:03 +0100)]
i40evf: clear queues when stopping

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
8 years agoi40evf: clear command when error occurs
Bernard Iremonger [Fri, 3 Jul 2015 14:03:57 +0000 (15:03 +0100)]
i40evf: clear command when error occurs

_clear_cmd() was not being called in failure situations,
resulting in the next command also failing.
Fix several typos.

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
8 years agoi40evf: increase messaging wait time
Bernard Iremonger [Fri, 3 Jul 2015 14:03:56 +0000 (15:03 +0100)]
i40evf: increase messaging wait time

Increase delay from 50 * 10 to 100 * 20 to avoid i40evf_read_pfmsg() failures.

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
8 years agoi40e: free vmdq vsi when closing
Bernard Iremonger [Fri, 3 Jul 2015 14:03:55 +0000 (15:03 +0100)]
i40e: free vmdq vsi when closing

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
8 years agoi40e: support port hotplug
Bernard Iremonger [Fri, 3 Jul 2015 14:03:54 +0000 (15:03 +0100)]
i40e: support port hotplug

This patch depends on the Port Hotplug Framework.
It implements the eth_dev_uninit functions for rte_i40e_pmd and
rte_i40evf_pmd.

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
8 years agoixgbe: free queue memory when closing
Bernard Iremonger [Thu, 2 Jul 2015 14:36:51 +0000 (15:36 +0100)]
ixgbe: free queue memory when closing

Add ixgbe_dev_free_queues() function and call it from close() functions.

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
8 years agoixgbe: support port hotplug
Bernard Iremonger [Thu, 2 Jul 2015 14:36:49 +0000 (15:36 +0100)]
ixgbe: support port hotplug

This patch depends on the Port Hotplug Framework.
It implements the eth_dev_uninit functions for rte_ixgbe_pmd and
rte_ixgbevf_pmd.

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
8 years agoe1000: free queue memory when closing
Bernard Iremonger [Fri, 3 Jul 2015 14:38:27 +0000 (15:38 +0100)]
e1000: free queue memory when closing

Queues were freed in clear function called in stop function.
Split clearing and freeing in separate functions to
move queue freeing from stop to close function.

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
8 years agoe1000: support port hotplug
Bernard Iremonger [Fri, 3 Jul 2015 14:38:26 +0000 (15:38 +0100)]
e1000: support port hotplug

This patch depends on the Port Hotplug Framework.
It implements the eth_dev_uninit functions for rte_em_pmd,
rte_igb_pmd and rte_igbvf_pmd.

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
8 years agoethdev: free queue array when closing
Bernard Iremonger [Mon, 13 Jul 2015 13:04:05 +0000 (14:04 +0100)]
ethdev: free queue array when closing

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
Acked-by: Michael Qiu <michael.qiu@intel.com>
8 years agoethdev: fix doxygen internal comments
Thomas Monjalon [Sat, 18 Jul 2015 18:04:13 +0000 (20:04 +0200)]
ethdev: fix doxygen internal comments

The internal functions must be marked with the doxygen command @internal.

The allocate and release_port functions are not restricted only to dummy
drivers.

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
8 years agoethdev: refactor port release
Thomas Monjalon [Sat, 18 Jul 2015 17:46:20 +0000 (19:46 +0200)]
ethdev: refactor port release

Use DEV_DETACHED constant and deduplicate code in init.

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
8 years agopci: fix detach and uninit naming
Thomas Monjalon [Sat, 18 Jul 2015 18:35:57 +0000 (20:35 +0200)]
pci: fix detach and uninit naming

There are close and detach functions in ethdev.
To keep a consistent naming, PCI functions called by ethdev detach
must be named "detach" instead of "close".
Fix also comments which mix close and uninit names.

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
8 years agodoc: rename ABI chapter to deprecation
Thomas Monjalon [Sat, 18 Jul 2015 19:08:58 +0000 (21:08 +0200)]
doc: rename ABI chapter to deprecation

This chapter is for ABI and API. That's why a renaming is required.

Remove also the examples which are now in the referenced guidelines.

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
8 years agohash: fix build for non-x86 arch
Pablo de Lara [Fri, 17 Jul 2015 09:17:58 +0000 (10:17 +0100)]
hash: fix build for non-x86 arch

Hash library uses optimized compare functions that use
x86 intrinsics, therefore non-x86 systems could not build
the library. In that case, the compare function is set
to the generic memcmp.

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

Reported-by: Zhigang Lu <zlu@ezchip.com>
Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Zhigang Lu <zlu@ezchip.com>
8 years agoexamples/vhost: fix driver unregistering
Ouyang Changchun [Mon, 6 Jul 2015 02:26:53 +0000 (10:26 +0800)]
examples/vhost: fix driver unregistering

The following commit broke vhost sample when it runs in second time:
292959c71961acde0cda6e77e737bb0a4df1559c

It should call api to unregister vhost driver when sample exit/quit, then
the socket file will be removed(by calling unlink), and thus make vhost sample
work correctly in the second time startup.

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

Fixes: 292959c71961 ("vhost: cleanup unix socket")

Signed-off-by: Changchun Ouyang <changchun.ouyang@intel.com>
Acked-by: Huawei Xie <huawei.xie@intel.com>
8 years agoexamples/vhost: fix comment and log
Ouyang Changchun [Mon, 6 Jul 2015 02:26:52 +0000 (10:26 +0800)]
examples/vhost: fix comment and log

It fixes the wrong log info when failing to unregister vhost driver.

Signed-off-by: Changchun Ouyang <changchun.ouyang@intel.com>
Acked-by: Huawei Xie <huawei.xie@intel.com>
8 years agovhost: add log on socket bind failure
Ouyang Changchun [Mon, 6 Jul 2015 02:26:51 +0000 (10:26 +0800)]
vhost: add log on socket bind failure

It adds more readable log info if a socket fails to bind to
local socket file name.

Signed-off-by: Changchun Ouyang <changchun.ouyang@intel.com>
Acked-by: Huawei Xie <huawei.xie@intel.com>
8 years agoapp: replace dump_cfg by proc_info
Maryam Tahhan [Wed, 15 Jul 2015 13:11:32 +0000 (14:11 +0100)]
app: replace dump_cfg by proc_info

proc_info displays statistics information including extended stats for
given DPDK ports and dumps the memory information for DPDK.

Signed-off-by: Maryam Tahhan <maryam.tahhan@intel.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
8 years agoixgbe: account more Rx errors
Maryam Tahhan [Wed, 15 Jul 2015 13:11:31 +0000 (14:11 +0100)]
ixgbe: account more Rx errors

ierrors only included a base set of error statistics, this patch adds
additional error registers to ierrors.

Signed-off-by: Maryam Tahhan <maryam.tahhan@intel.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
8 years agoixgbe: add specific stats
Maryam Tahhan [Wed, 15 Jul 2015 13:11:30 +0000 (14:11 +0100)]
ixgbe: add specific stats

Add the NIC/HW specific stats that were removed from rte_ethdev.c to
the extended stats in ixgbe.

Signed-off-by: Maryam Tahhan <maryam.tahhan@intel.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
8 years agoethdev: remove driver specific stats
Maryam Tahhan [Wed, 15 Jul 2015 13:11:29 +0000 (14:11 +0100)]
ethdev: remove driver specific stats

Remove non generic stats in rte_stats_strings and mark the relevant
fields in struct rte_eth_stats as deprecated.

Signed-off-by: Maryam Tahhan <maryam.tahhan@intel.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
8 years agoethdev: expose generic and driver specific stats in xstats
Maryam Tahhan [Wed, 15 Jul 2015 13:11:28 +0000 (14:11 +0100)]
ethdev: expose generic and driver specific stats in xstats

Extend rte_eth_xstats_get to retrieve additional stats from the device
driver as well the ethdev generic stats.

Signed-off-by: Maryam Tahhan <maryam.tahhan@intel.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
8 years agoixgbe: add xstats
Maryam Tahhan [Wed, 15 Jul 2015 13:11:27 +0000 (14:11 +0100)]
ixgbe: add xstats

Implement ixgbe_dev_xstats_reset and ixgbe_dev_xstats_get.

Signed-off-by: Maryam Tahhan <maryam.tahhan@intel.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
8 years agoixgbe: refactor stats register reads
Maryam Tahhan [Wed, 15 Jul 2015 13:11:26 +0000 (14:11 +0100)]
ixgbe: refactor stats register reads

Move stats register reads to ixgbe_read_stats_registers() as it will be
used by the functions to retrieve stats and extended stats.

Signed-off-by: Maryam Tahhan <maryam.tahhan@intel.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
8 years agosched: hide structure of port hierarchy
Stephen Hemminger [Thu, 16 Jul 2015 21:34:35 +0000 (14:34 -0700)]
sched: hide structure of port hierarchy

Right now the scheduler hierarchy is encoded as a bitfield
that is visible as part of the ABI. This creates an barrier
limiting future expansion of the hierarchy.

As a transistional step. hide the actual layout of the hierarchy
and mark the exposed structure as deprecated. This will allow for
expansion in later release.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
8 years agosched: fix level of log messages
Stephen Hemminger [Thu, 16 Jul 2015 21:34:34 +0000 (14:34 -0700)]
sched: fix level of log messages

The setup messages should be at DEBUG level since they are not
important for normal operation of system. The messages about
problems should be at NOTICE or ERR level.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
8 years agosched: remove tabs from log messages
Stephen Hemminger [Thu, 16 Jul 2015 21:34:33 +0000 (14:34 -0700)]
sched: remove tabs from log messages

syslog does not like tabs in log messages; tab gets translated to #011

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
8 years agosched: make RED optional at runtime
Stephen Hemminger [Thu, 16 Jul 2015 21:34:32 +0000 (14:34 -0700)]
sched: make RED optional at runtime

Want to be able to build with RTE_SCHED_RED enabled but
allow disabling RED on a per-queue basis at runtime.

RED is disabled unless min/max thresholds set.

Signed-off-by: Stephen Hemmminger <stephen@networkplumber.org>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
8 years agoixgbe: add access to specific device info
Liang-Min Larry Wang [Thu, 16 Jul 2015 13:25:35 +0000 (09:25 -0400)]
ixgbe: add access to specific device info

add function to support ethtool ops:
- get_reg_length
- get_regs
- get_eeprom_length
- get_eeprom
- set_eeprom

Signed-off-by: Liang-Min Larry Wang <liang-min.wang@intel.com>
Acked-by: Andrew Harvey <agh@cisco.com>
Acked-by: David Harton <dharton@cisco.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
8 years agoigb: add access to specific device info
Liang-Min Larry Wang [Thu, 16 Jul 2015 13:25:36 +0000 (09:25 -0400)]
igb: add access to specific device info

add function to support ethtool ops:
- get_reg_length
- get_regs
- get_eeprom_length
- get_eeprom
- set_eeprom

Signed-off-by: Liang-Min Larry Wang <liang-min.wang@intel.com>
Acked-by: Andrew Harvey <agh@cisco.com>
Acked-by: David Harton <dharton@cisco.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
8 years agoethdev: add access to specific device info
Liang-Min Larry Wang [Thu, 16 Jul 2015 13:25:34 +0000 (09:25 -0400)]
ethdev: add access to specific device info

add new apis:
- rte_eth_dev_get_reg_length
- rte_eth_dev_get_reg_info
- rte_eth_dev_get_eeprom_length
- rte_eth_dev_get_eeprom
- rte_eth_dev_set_eeprom

to enable reading device parameters (register and
eeprom) based upon ethtool alike data parameter specification.

Signed-off-by: Liang-Min Larry Wang <liang-min.wang@intel.com>
Acked-by: Andrew Harvey <agh@cisco.com>
Acked-by: David Harton <dharton@cisco.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
8 years agoixgbe: add default mac address modifier
Liang-Min Larry Wang [Thu, 16 Jul 2015 13:25:35 +0000 (09:25 -0400)]
ixgbe: add default mac address modifier

- set_mac_addr

Signed-off-by: Liang-Min Larry Wang <liang-min.wang@intel.com>
Acked-by: Andrew Harvey <agh@cisco.com>
Acked-by: David Harton <dharton@cisco.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
8 years agoigb: add default mac address modifier
Liang-Min Larry Wang [Thu, 16 Jul 2015 13:25:36 +0000 (09:25 -0400)]
igb: add default mac address modifier

- set_mac_addr

Signed-off-by: Liang-Min Larry Wang <liang-min.wang@intel.com>
Acked-by: Andrew Harvey <agh@cisco.com>
Acked-by: David Harton <dharton@cisco.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
8 years agoethdev: add default mac address modifier
Liang-Min Larry Wang [Thu, 16 Jul 2015 13:25:33 +0000 (09:25 -0400)]
ethdev: add default mac address modifier

Add new api:
- rte_eth_dev_default_mac_addr_set

The new api, rte_eth_dev_default_mac_addr_set, uses the
existing dev_op, mac_addr_set, to enable setting mac
addr from ethdev level.

Signed-off-by: Liang-Min Larry Wang <liang-min.wang@intel.com>
Acked-by: Andrew Harvey <agh@cisco.com>
Acked-by: David Harton <dharton@cisco.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
8 years agoethdev: fix error returned for invalid port id
Liang-Min Larry Wang [Wed, 15 Jul 2015 17:22:40 +0000 (13:22 -0400)]
ethdev: fix error returned for invalid port id

Fix return value, using the macro input instead of -EINVAL.

Fixes: 75acd57ad025 ("ethdev: introduce valid port helper")

Signed-off-by: Liang-Min Larry Wang <liang-min.wang@intel.com>
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
8 years agokni: fix build on SLES 12
Pablo de Lara [Wed, 15 Jul 2015 15:13:07 +0000 (16:13 +0100)]
kni: fix build on SLES 12

SLES 12 has kernel 3.12, which original does not have skb_set_hash,
but SuSE has added that function to the kernel integrated on it.
Therefore, the function is not declared when compiling on this OS.

Reported-by: Sotiris Salloumis <sotiris.salloumis@ericsson.com>
Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
8 years agohash: fix build without SSE4.1
Pablo de Lara [Thu, 16 Jul 2015 09:00:54 +0000 (10:00 +0100)]
hash: fix build without SSE4.1

_mm_test_all_zeros is not available for CPUs with no SSE4.1,
therefore, DPDK would not build.
This patch adds an alternative for this, using _mm_cmpeq_epi32 and
_mm_movemask_epi8.

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

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
8 years agohash: fix build with gcc 4.4 and 4.5
Pablo de Lara [Wed, 15 Jul 2015 12:40:42 +0000 (13:40 +0100)]
hash: fix build with gcc 4.4 and 4.5

gcc 4.4 and 4.5 throws following error:
rte_cuckoo_hash.c:145: error: flexible array member in otherwise empty struct.

This is due to empty length in flexible array, which has been changed to use
size 0 in the declaration of the array.

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

Reported-by: Olga Shern <olgas@mellanox.com>
Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
8 years agohash: fix out of bounds array access
Pablo de Lara [Wed, 15 Jul 2015 12:40:41 +0000 (13:40 +0100)]
hash: fix out of bounds array access

When encountering a loop while adding a new entry,
element out of bounds of array was being unnecessarily resetted.

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

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
8 years agombuf: clarify comment on adding Tx offload flags
Bruce Richardson [Thu, 9 Jul 2015 13:22:39 +0000 (14:22 +0100)]
mbuf: clarify comment on adding Tx offload flags

The comment for TX offload flags stated that those flags started at bit
55 and then were added to the right of that, leaving 8 bits reserved for
generic mbuf (i.e. non-offload) use. This comment may not have been
clear as 5 of the 8 flags which were reserved have now been used for TX
offloads.
This patch:
* updates the description so that it now reflects reality that
only three flags are available for generic mbuf use
* reserved the final generic flag so that it can't be taken over for TX
offload in future
* clarifies the comment for TX flags to indicate that they should be
counting downwards not upwards.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
8 years agodoc: announce deprecation of librte_malloc
Sergio Gonzalez Monroy [Wed, 15 Jul 2015 16:32:27 +0000 (17:32 +0100)]
doc: announce deprecation of librte_malloc

Announce the creation of dummy malloc library for 2.1 and removal of
such library, now integrated in librte_eal, for 2.2 release.

Signed-off-by: Sergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com>
8 years agodoc: update malloc guide
Sergio Gonzalez Monroy [Thu, 16 Jul 2015 07:37:11 +0000 (08:37 +0100)]
doc: update malloc guide

Update malloc documentation to reflect new implementation details.

Signed-off-by: Sergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com>
8 years agomem: introduce memzone freeing
Sergio Gonzalez Monroy [Wed, 15 Jul 2015 16:32:25 +0000 (17:32 +0100)]
mem: introduce memzone freeing

Implement rte_memzone_free which, as its name implies, would free a
memzone.

Currently memzone are tracked in an array and cannot be free.
To be able to reuse the same array to track memzones, we have to
change how we keep track of reserved memzones.

With this patch, any memzone with addr NULL is not used, so we also need
to change how we look for the next memzone entry free.

Add new unit test for rte_memzone_free API.

Signed-off-by: Sergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com>
8 years agoapp/test: update malloc and memzone unit tests
Sergio Gonzalez Monroy [Wed, 15 Jul 2015 16:32:22 +0000 (17:32 +0100)]
app/test: update malloc and memzone unit tests

Some unit test are not relevant anymore. It is the case of those malloc
UTs that checked corner cases when allocating MALLOC_MEMZONE_SIZE
chunks, and the case of those memzone UTs relaying of specific free
memsegs of rhte reserved memzone.

Other UTs just need to be update, for example, to calculate maximum free
block size available.

Signed-off-by: Sergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com>
8 years agomem: rework memzone to be allocated by malloc
Sergio Gonzalez Monroy [Wed, 15 Jul 2015 16:32:21 +0000 (17:32 +0100)]
mem: rework memzone to be allocated by malloc

In the current memory hierarchy, memsegs are groups of physically
contiguous hugepages, memzones are slices of memsegs and malloc further
slices memzones into smaller memory chunks.

This patch modifies malloc so it partitions memsegs instead of memzones.
Thus memzones would call malloc internally for memory allocation while
maintaining its ABI.

During initialization malloc sets all available memory as part of the heaps.
CONFIG_RTE_MALLOC_MEMZONE_SIZE was used to specify the default memory
block size to expand the heap. The option is not used/relevant anymore,
so we remove it.

Remove free_memseg field from internal mem config structure as it is
not used anymore.
Also remove code in ivshmem that was setting up free_memseg on init.

It would be possible to free memzones and therefore any other structure
based on memzones, ie. mempools

Signed-off-by: Sergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com>
8 years agomem: move librte_malloc to eal/common
Sergio Gonzalez Monroy [Wed, 15 Jul 2015 16:32:20 +0000 (17:32 +0100)]
mem: move librte_malloc to eal/common

Move malloc inside eal and create a new section in MAINTAINERS file for
Memory Allocation in EAL.

Create a dummy malloc library to avoid breaking applications that have
librte_malloc in their DT_NEEDED entries.

This is the first step towards using malloc to allocate memory directly
from memsegs. Thus, memzones would allocate memory through malloc,
allowing to free memzones.

Signed-off-by: Sergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com>
8 years agodoc: announce ABI changes for unified packet type
Helin Zhang [Tue, 7 Jul 2015 17:45:20 +0000 (01:45 +0800)]
doc: announce ABI changes for unified packet type

Signed-off-by: Helin Zhang <helin.zhang@intel.com>
Acked-by: Jingjing Wu <jingjing.wu@intel.com>
[Thomas: reword with NEXT_ABI option]
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
8 years agombuf: remove old packet type bit masks
Helin Zhang [Thu, 9 Jul 2015 16:31:41 +0000 (00:31 +0800)]
mbuf: remove old packet type bit masks

As unified packet types are used instead, those old bit masks and
the relevant macros for packet type indication need to be removed.
To avoid breaking ABI compatibility, all the changes would be
enabled by RTE_NEXT_ABI, which is disabled by default.

Signed-off-by: Helin Zhang <helin.zhang@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
8 years agoexamples: replace some offload flags with packet type
Helin Zhang [Thu, 9 Jul 2015 16:31:35 +0000 (00:31 +0800)]
examples: replace some offload flags with packet type

To unify packet types among all PMDs, bit masks of packet type for
'ol_flags' are replaced by unified packet type.
To avoid breaking ABI compatibility, all the changes would be
enabled by RTE_NEXT_ABI.

Signed-off-by: Helin Zhang <helin.zhang@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
8 years agoapp: replace some offload flags with packet type
Helin Zhang [Thu, 9 Jul 2015 16:31:32 +0000 (00:31 +0800)]
app: replace some offload flags with packet type

To unify packet types among all PMDs, bit masks of packet type for
'ol_flags' are replaced by unified packet type.
To avoid breaking ABI compatibility, all the changes would be
enabled by RTE_NEXT_ABI.

Signed-off-by: Helin Zhang <helin.zhang@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
8 years agomlx4: replace some offload flags with packet type
Thomas Monjalon [Wed, 15 Jul 2015 16:05:18 +0000 (18:05 +0200)]
mlx4: replace some offload flags with packet type

The workaround for Tx tunnel offloading can now be replaced with packet
type flag checking.
The ol_flags for IPv4/IPv6 and tunnel Rx offloading are replaced with
packet type flags.

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
8 years agocxgbe: replace some offload flags with packet type
Helin Zhang [Thu, 9 Jul 2015 16:31:31 +0000 (00:31 +0800)]
cxgbe: replace some offload flags with packet type

To unify packet types among all PMDs, bit masks of packet type for
'ol_flags' are replaced by unified packet type.

To avoid breaking ABI compatibility, all the changes would be enabled
by RTE_NEXT_ABI.

Signed-off-by: Helin Zhang <helin.zhang@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
8 years agoenic: replace some offload flags with packet type
Helin Zhang [Thu, 9 Jul 2015 16:31:28 +0000 (00:31 +0800)]
enic: replace some offload flags with packet type

To unify packet types among all PMDs, bit masks of packet type for
'ol_flags' are replaced by unified packet type.

To avoid breaking ABI compatibility, all the changes would be
enabled by RTE_NEXT_ABI.

Signed-off-by: Helin Zhang <helin.zhang@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
8 years agovmxnet3: replace some offload flags with packet type
Helin Zhang [Thu, 9 Jul 2015 16:31:29 +0000 (00:31 +0800)]
vmxnet3: replace some offload flags with packet type

To unify packet types among all PMDs, bit masks of packet type for
'ol_flags' are replaced by unified packet type.

To avoid breaking ABI compatibility, all the changes would be
enabled by RTE_NEXT_ABI.

Signed-off-by: Helin Zhang <helin.zhang@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
8 years agofm10k: replace some offload flags with packet type
Helin Zhang [Thu, 9 Jul 2015 16:31:30 +0000 (00:31 +0800)]
fm10k: replace some offload flags with packet type

To unify packet types among all PMDs, bit masks of packet type for
'ol_flags' are replaced by unified packet type.

To avoid breaking ABI compatibility, all the changes would be
enabled by RTE_NEXT_ABI.

Signed-off-by: Helin Zhang <helin.zhang@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
8 years agoi40e: replace some offload flags with unified packet type
Helin Zhang [Thu, 9 Jul 2015 16:31:27 +0000 (00:31 +0800)]
i40e: replace some offload flags with unified packet type

To unify packet types among all PMDs, bit masks of packet type for
'ol_flags' are replaced by unified packet type.

To avoid breaking ABI compatibility, all the changes would be
enabled by RTE_NEXT_ABI.

Signed-off-by: Helin Zhang <helin.zhang@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
8 years agoixgbe: replace some offload flags with packet type
Helin Zhang [Thu, 9 Jul 2015 16:31:26 +0000 (00:31 +0800)]
ixgbe: replace some offload flags with packet type

To unify packet type among all PMDs, bit masks of packet type for
'ol_flags' are replaced by unified packet type.

To avoid breaking ABI compatibility, all the changes would be
enabled by RTE_NEXT_ABI.

Note that around 2.5% performance drop (64B) was observed of doing
4 ports (1 port per 82599 card) IO forwarding on the same SNB core.

Signed-off-by: Helin Zhang <helin.zhang@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
8 years agoigb: replace some offload flags with packet type
Helin Zhang [Thu, 9 Jul 2015 16:31:25 +0000 (00:31 +0800)]
igb: replace some offload flags with packet type

To unify packet types among all PMDs, bit masks of packet type for
'ol_flags' are replaced by unified packet type.

To avoid breaking ABI compatibility, all the changes would be
enabled by RTE_NEXT_ABI.

Signed-off-by: Helin Zhang <helin.zhang@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
8 years agombuf: add definitions of unified packet types
Helin Zhang [Thu, 9 Jul 2015 16:31:24 +0000 (00:31 +0800)]
mbuf: add definitions of unified packet types

As there are only 6 bit flags in ol_flags for indicating packet
types, which is not enough to describe all the possible packet
types hardware can recognize. For example, i40e hardware can
recognize more than 150 packet types. Unified packet type is
composed of L2 type, L3 type, L4 type, tunnel type, inner L2 type,
inner L3 type and inner L4 type fields, and can be stored in
'struct rte_mbuf' of 32 bits field 'packet_type'.

To avoid breaking ABI compatibility, all the changes would be
enabled by RTE_NEXT_ABI.

Signed-off-by: Helin Zhang <helin.zhang@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
8 years agombuf: redefine packet type
Helin Zhang [Thu, 9 Jul 2015 16:31:23 +0000 (00:31 +0800)]
mbuf: redefine packet type

In order to unify the packet type, the field of 'packet_type' in
'struct rte_mbuf' needs to be extended from 16 to 32 bits.

Accordingly, some fields in 'struct rte_mbuf' are re-organized to support
this change for Vector PMD.
As 'struct rte_kni_mbuf' for KNI should be right mapped to
'struct rte_mbuf', it should be modified accordingly.
In ixgbe PMD driver, corresponding changes are added for the mbuf changes,
especially the bit masks of packet type for 'ol_flags' are replaced by
unified packet type. In addition, more packet types (UDP, TCP and SCTP)
are supported in vectorized ixgbe PMD.

To avoid breaking ABI compatibility, all the changes would be enabled by
RTE_NEXT_ABI.

Note that around 2% performance drop (64B) was observed of doing 4 ports
(1 port per 82599 card) IO forwarding on the same SNB core.

Signed-off-by: Helin Zhang <helin.zhang@intel.com>
Signed-off-by: Cunming Liang <cunming.liang@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
8 years agomem: fix initialization with --no-huge option
Sergio Gonzalez Monroy [Wed, 15 Jul 2015 10:12:00 +0000 (11:12 +0100)]
mem: fix initialization with --no-huge option

After code rework from bellow commit, logic expects hugepage_sz field to
always be set (ie. not zero value).
When using --no-huge, this field was left unset defaulting to zero.

Set hugepage_sz to RTE_PGSIZE_4K when using --no-huge.

Fixes: b3dfffd962ecd ("mem: allow multiple page sizes to be requested")

Signed-off-by: Sergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com>
8 years agoeal/tile: add const in prefetch functions
Zhigang Lu [Wed, 15 Jul 2015 07:26:47 +0000 (15:26 +0800)]
eal/tile: add const in prefetch functions

Commit 7c5d0cc91579 added const in prefetch functions for
X86 and PPC.  This patch does the same for Tile arch.

Signed-off-by: Zhigang Lu <zlu@ezchip.com>
8 years agocxgbe: fix and update doc
Rahul Lakkireddy [Wed, 15 Jul 2015 17:30:05 +0000 (23:00 +0530)]
cxgbe: fix and update doc

Fix spelling and grammar errors.  Re-organize sections for better explanation
in the documentation.  Add a section describing compilation of CXGBE with DPDK.
Add a note describing that CXGBE currently only supports binding to PF4.

Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
Signed-off-by: Kumar Sanghvi <kumaras@chelsio.com>
8 years agovfio: fix overflow of BAR region offset and size
Rahul Lakkireddy [Mon, 13 Jul 2015 08:51:45 +0000 (14:21 +0530)]
vfio: fix overflow of BAR region offset and size

When using vfio, the probe fails for BAR > 0 after the
commit-id 90a1633b2 (eal/linux: allow to map BARs with MSI-X tables).

While debugging further, found that the BAR region offset and size read from
vfio are u64, but are assigned to uint32_t variables.  This results in the u64
value getting truncated to 0 and passing wrong offset and size to mmap for
subsequent BAR regions.

The fix is to use unsigned long for the offset and size.

This is based on patch by Alejandro Lucero <alejandro.lucero@netronome.com>
posted at below:
http://dpdk.org/ml/archives/dev/2015-June/020201.html
and updated with diff from below to fix 32-bit compilation:
http://dpdk.org/ml/archives/dev/2015-July/020963.html

Fixes: 90a1633b2347 ("eal/linux: allow to map BARs with MSI-X tables")

Signed-off-by: Alejandro Lucero <alejandro.lucero@netronome.com>
Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
Signed-off-by: Kumar Sanghvi <kumaras@chelsio.com>