Commit Graph

2395 Commits

Author SHA1 Message Date
Yuanhan Liu
1d41d77cf8 vhost: optimize dequeue for small packets
A virtio driver normally uses at least 2 desc buffers for Tx: the
first for storing the header, and the others for storing the data.

Therefore, we could fetch the first data desc buf before the main
loop, and do the copy first before the check of "are we done yet?".
This could save one check for small packets that just have one data
desc buffer and need one mbuf to store it.

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Acked-by: Huawei Xie <huawei.xie@intel.com>
Tested-by: Rich Lane <rich.lane@bigswitch.com>
2016-06-22 09:47:12 +02:00
Yuanhan Liu
7f74b95c44 vhost: pre update used ring for Tx and Rx
Pre update and update used ring in batch for Tx and Rx at the stage
while fetching all avail desc idx. This would reduce some cache misses
and hence, increase the performance a bit.

Pre update would be feasible as guest driver will not start processing
those entries as far as we don't update "used->idx". (I'm not 100%
certain I don't miss anything, though).

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Tested-by: Rich Lane <rich.lane@bigswitch.com>
2016-06-22 09:47:12 +02:00
Yuanhan Liu
0823c1cb0a vhost: workaround stale vring base
When DPDK app crashes (or quits, or gets killed), a restart of DPDK
app would get stale vring base from QEMU. That would break the kernel
virtio net completely, making it non-work any more, unless a driver
reset is done.

So, instead of getting the stale vring base from QEMU, Huawei suggested
we could get a much saner (and may not the most accurate) vring base
from used->idx. That would work because:

- there is a memory barrier between updating used ring entries and
  used->idx. So, even though we crashed at updating the used ring
  entries, it will not cause any issue, as the guest driver will not
  process those stale used entries, for used-idx is not updated yet.

- DPDK process vring in order, that means a crash may just lead some
  packet retransmission for Tx and drop for Rx.

Suggested-by: Huawei Xie <huawei.xie@intel.com>
Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Acked-by: Huawei Xie <huawei.xie@intel.com>
2016-06-22 09:47:12 +02:00
Yuanhan Liu
e623e0c6d8 vhost: add reconnect ability
Allow reconnecting on failure by default when:

- DPDK app starts first and QEMU (as the server) is not started yet.
  Without reconnecting, DPDK app would simply fail on vhost-user
  registration.

- QEMU restarts, say due to OS reboot.
  Without reconnecting, you can't re-establish the connection without
  restarting DPDK app.

This patch make it work well for both above cases. It simply creates
a new thread, and keep trying calling "connect()", until it succeeds.

The reconnect could be disabled when RTE_VHOST_USER_NO_RECONNECT flag
is set.

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
2016-06-22 09:47:12 +02:00
Yuanhan Liu
64ab701c3d vhost: add vhost-user client mode
Add a new paramter (flags) to rte_vhost_driver_register(). DPDK
vhost-user acts as client mode when RTE_VHOST_USER_CLIENT flag
is set.  The flags would also allow future extensions without
breaking the API (again).

The rest is straingfoward then: allocate a unix socket, and
bind/listen for server, connect for client.

This extension is for vhost-user only, therefore we simply quit
and report error when any flags are given for vhost-cuse.

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
2016-06-22 09:47:07 +02:00
Yuanhan Liu
9ebcd4f9c7 vhost: rename structs for enabling client mode
DPDK vhost-user just acts as server so far, so, using a struct named
as "vhost_server" is okay. However, if we add client mode, it doesn't
make sense any more. Here renames it to "vhost_user_socket".

There was no obvious wrong about "connfd_ctx", but I think it's obviously
better to rename it to "vhost_user_connection", as it does represent
a connection, a connection between the backend (DPDK) and the frontend
(QEMU).

Similarly, few more renames are taken, such as "vserver_new_vq_conn"
to "vhost_user_new_connection".

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
2016-06-22 09:44:21 +02:00
Ilya Maximets
7fd5dde987 vhost: make buffer vector for scatter Rx local
Array of buf_vector's is just an array for temporary storing information
about available descriptors. It used only locally in virtio_dev_merge_rx()
and there is no reason for that array to be shared.

Fix that by allocating local buf_vec inside virtio_dev_merge_rx().

Signed-off-by: Ilya Maximets <i.maximets@samsung.com>
Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Tested-by: Rich Lane <rich.lane@bigswitch.com>
Acked-by: Rich Lane <rich.lane@bigswitch.com>
2016-06-22 09:44:21 +02:00
Yuanhan Liu
e197bd630a vhost: make virtio header length per device
Virtio net header length is set per device, but not per queue. So, there
is no reason to store it in vhost_virtqueue struct, instead, we should
store it in virtio_net struct, to make one copy only.

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Tested-by: Rich Lane <rich.lane@bigswitch.com>
Acked-by: Rich Lane <rich.lane@bigswitch.com>
2016-06-22 09:44:20 +02:00
Yuanhan Liu
004b8ca8b5 vhost: reserve few more space for future extension
"virtio_net_device_ops" is the only left open struct that an application
can access, therefore, it's the only place that might introduce potential
ABI break in future for extension.

So, do some reservation for it. 5 should be pretty enough, considering
that we have barely touched it for a long while. Another reason to
choose 5 is for cache alignment: 5 makes the struct 64 bytes for 64 bit
machine.

With this, it's confidence to say that we might be able to be free from
the ABI violation forever.

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Tested-by: Rich Lane <rich.lane@bigswitch.com>
Acked-by: Rich Lane <rich.lane@bigswitch.com>
2016-06-22 09:43:01 +02:00
Yuanhan Liu
f0fa04e35e vhost: remove virtio-net.h
It barely has anything useful there, just 2 functions prototype. Here
move them to vhost-net.h, and delete it.

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Tested-by: Rich Lane <rich.lane@bigswitch.com>
Acked-by: Rich Lane <rich.lane@bigswitch.com>
2016-06-22 09:43:01 +02:00
Yuanhan Liu
758e3471b4 vhost: remove unnecessary fields
The "reserved" field in virtio_net and vhost_virtqueue struct is not
necessary any more. We now expose virtio_net device with a number "vid".

This patch also removes the "priv" field: all fields are priviate now:
application can't access it now. The only way that we could still access
it is to expose it by a function, but I doubt that's needed or worthwhile.

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Tested-by: Rich Lane <rich.lane@bigswitch.com>
Acked-by: Rich Lane <rich.lane@bigswitch.com>
2016-06-22 09:43:01 +02:00
Yuanhan Liu
db69be54b6 vhost: hide internal code
We are now safe to move all those internal structs/macros/functions to
vhost-net.h, to hide them from external access.

This patch also breaks long lines and removes some redundant comments.

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Tested-by: Rich Lane <rich.lane@bigswitch.com>
Acked-by: Rich Lane <rich.lane@bigswitch.com>
2016-06-22 09:43:01 +02:00
Yuanhan Liu
4ecf22e356 vhost: export device id as the interface to applications
With all the previous prepare works, we are just one step away from
the final ABI refactoring. That is, to change current API to let them
stick to vid instead of the old virtio_net dev.

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Tested-by: Rich Lane <rich.lane@bigswitch.com>
Acked-by: Rich Lane <rich.lane@bigswitch.com>
2016-06-22 09:42:57 +02:00
Yuanhan Liu
a67f286a65 vhost: export queue free entries
The new API rte_vhost_avail_entries() is actually a rename of
rte_vring_available_entries(), with the "vring" to "vhost" name
change to keep the consistency of other vhost exported APIs.

This change could let us avoid the dependency of "virtio_net"
struct, to prepare for the ABI refactoring.

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Tested-by: Rich Lane <rich.lane@bigswitch.com>
Acked-by: Rich Lane <rich.lane@bigswitch.com>
2016-06-22 09:02:58 +02:00
Yuanhan Liu
f6d1bd5365 vhost: export interface name
Introduce a new API rte_vhost_get_ifname() to export the ifname to
application.

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Tested-by: Rich Lane <rich.lane@bigswitch.com>
Acked-by: Rich Lane <rich.lane@bigswitch.com>
2016-06-22 09:01:30 +02:00
Yuanhan Liu
4b4af666b9 vhost: export number of queues
Introduce a new API rte_vhost_get_queue_num() to export the number of
queues.

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Tested-by: Rich Lane <rich.lane@bigswitch.com>
Acked-by: Rich Lane <rich.lane@bigswitch.com>
2016-06-22 09:01:30 +02:00
Yuanhan Liu
586e390013 vhost: export numa node
Introduce a new API rte_vhost_get_numa_node() to get the numa node
from which the virtio_net struct is allocated.

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Tested-by: Rich Lane <rich.lane@bigswitch.com>
Acked-by: Rich Lane <rich.lane@bigswitch.com>
2016-06-22 09:01:30 +02:00
Yuanhan Liu
adf97191b3 vhost: move cuse only struct to cuse
vhost cuse is now the last reference of the vhost_device_ctx struct;
move it there, and do a rename to "vhost_cuse_device_ctx", to make
it clear that it's "cuse only".

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Tested-by: Rich Lane <rich.lane@bigswitch.com>
Acked-by: Rich Lane <rich.lane@bigswitch.com>
2016-06-22 09:01:30 +02:00
Yuanhan Liu
319d362e3b vhost: get device by device id only
get_device() just needs vid, so pass vid as the parameter only.

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Tested-by: Rich Lane <rich.lane@bigswitch.com>
Acked-by: Rich Lane <rich.lane@bigswitch.com>
2016-06-22 09:01:30 +02:00
Yuanhan Liu
e2a1dd1275 vhost: rename device id variable
I failed to figure out what does "fh" mean here for a long while.
The only guess I could have had is "file handle". So, you get the
point that it's not well named.

I then figured it out that "fh" is derived from the fuse lib, and
my above guess is right. However, device_fh represents a virtio
net device ID. Therefore, here I rename it to vid (Virtio-net device
ID, or Vhost device ID; choose one you prefer) to make it easier for
understanding.

This name (vid) then will be considered to the only interface to
applications. That's another reason to do the rename: it's our
interface, make it more understandable.

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Tested-by: Rich Lane <rich.lane@bigswitch.com>
Acked-by: Rich Lane <rich.lane@bigswitch.com>
2016-06-22 09:01:25 +02:00
Yuanhan Liu
c08a349006 vhost: declare device id as int
device_fh repsents the device id for a specific virtio net device.
Firstly, "int" would be big enough: we don't need 64 bit. Secondly,
this could let us avoid the ugly "%" PRIu64 ".." stuff.

And since ctx.fh is derived from device_fh, declare it as int, too.

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Tested-by: Rich Lane <rich.lane@bigswitch.com>
Acked-by: Rich Lane <rich.lane@bigswitch.com>
2016-06-22 08:59:54 +02:00
Yuanhan Liu
550c9d27d1 vhost: set/reset device flags internally
It does not make sense to ask the application to set/unset the flag
VIRTIO_DEV_RUNNING (that used internal only) at new_device()/
destroy_device() callback.

Instead, it should be set after new_device() succeeds and reset before
destroy_device() is invoked inside vhost lib. This patch fixes it.

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Tested-by: Rich Lane <rich.lane@bigswitch.com>
Acked-by: Rich Lane <rich.lane@bigswitch.com>
2016-06-22 06:10:54 +02:00
Yuanhan Liu
092f1c2c77 vhost: declare backend with int type
It's an fd; so define it as "int", which could also save the unncessary
(int) case.

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Tested-by: Rich Lane <rich.lane@bigswitch.com>
Acked-by: Rich Lane <rich.lane@bigswitch.com>
2016-06-22 06:10:54 +02:00
Michal Kobylinski
34d279906d table: fix next hop table entry type
Change type of nht field from uint32_t to uint8_t and increase max of
next hops.

nht_entry and nht should be declared as uint8_t because
entry_size is in bytes and is given as a parameter to compute
the position in nht array.

Fixes: dc81ebbaca ("lpm: extend IPv4 next hop field")

Signed-off-by: Michal Kobylinski <michalx.kobylinski@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
2016-06-21 22:41:40 +02:00
WeiJie Zhuang
9fc37d1c07 port: support KNI
add KNI port type to the packet framework

Signed-off-by: WeiJie Zhuang <zhuangwj@gmail.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
2016-06-21 18:05:45 +02:00
Anupam Kapoor
cba50f6be0 kni: fix build with gcc 6
This commit fixes build errors triggered due misleading indentation.

Fixes: b9ee370557 ("kni: update kernel driver ethtool baseline")
Fixes: 3fc5ca2f63 ("kni: initial import")

Signed-off-by: Anupam Kapoor <anupam.kapoor@gmail.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
2016-06-21 17:50:22 +02:00
Ferruh Yigit
a7aeb6c658 igb_uio: fix build on CentOS 6.8
Following compile error observed with CentOS 6.8, which uses kernel
kernel-devel-2.6.32-642.el6.x86_64:

In function 'igbuio_msix_mask_irq':
	error: 'PCI_MSIX_ENTRY_CTRL_MASKBIT' undeclared

Reported-by: Thiago Martins <thiagocmartinsc@gmail.com>
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
2016-06-21 16:09:32 +02:00
Pablo de Lara
2773c86d06 crypto/kasumi: add driver for KASUMI library
Added new SW PMD which makes use of the libsso_kasumi SW library,
which provides wireless algorithms KASUMI F8 and F9
in software.

This PMD supports cipher-only, hash-only and chained operations
("cipher then hash" and "hash then cipher") of the following
algorithms:
- RTE_CRYPTO_SYM_CIPHER_KASUMI_F8
- RTE_CRYPTO_SYM_AUTH_KASUMI_F9

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Deepak Kumar Jain <deepak.k.jain@intel.com>
2016-06-20 22:25:32 +02:00
Remy Horton
5a592d35c0 keepalive: fix missing symbol export
The KeepAlive rte_keepalive_mark_sleep function was not being exported.

Fixes: 90c622f356 ("keepalive: add liveness callback")

Signed-off-by: Remy Horton <remy.horton@intel.com>
2016-06-20 12:22:49 +02:00
Marcin Kerlin
ea329d7f8e mem: fix leak after mapping failure
Patch fixes resource leak in rte_eal_hugepage_attach() where mapped files
were not freed back to the OS in case of failure. Patch uses the behavior
of Linux munmap: "It is not an error if the indicated range does not
contain any mapped pages".

Coverity issue: 13295, 13296, 13303

Fixes: af75078fec ("first public release")

Signed-off-by: Marcin Kerlin <marcinx.kerlin@intel.com>
Acked-by: Sergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com>
2016-06-20 11:26:41 +02:00
Marcin Kerlin
2489f1193c mem: fix error message with Xen
Minor typo fix to error message

Fixes: 148f963fb5 ("xen: core library changes")

Signed-off-by: Marcin Kerlin <marcinx.kerlin@intel.com>
2016-06-20 11:18:22 +02:00
Sergio Gonzalez Monroy
d4ee3c61c0 mem: fix possible integer overflow
It is possible to get an integer overflow if we try to reserve a memzone
with len = 0 (meaning the maximum contiguous space available) and the
maximum available elem size is less than (MALLOC_ELEM_OVERHEAD + align).

Coverity issue: 107111

Fixes: fafcc11985 ("mem: rework memzone to be allocated by malloc")

Signed-off-by: Sergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com>
2016-06-20 10:54:57 +02:00
Tetsuya Mukawa
3f0339efc1 pci: fix resource release when unmapping
This patch fixes wrong resource release of pci_uio_unmap().
The 'path' member of mapped_pci_resource structure is allocated by
primary process, but currently it will be freed by both primary
and secondary process.
The patch fixes to be freed by only primary process.

Signed-off-by: Tetsuya Mukawa <mukawa@igel.co.jp>
Acked-by: David Marchand <david.marchand@6wind.com>
2016-06-20 10:46:04 +02:00
Tetsuya Mukawa
0463fc37aa pci: fix resource leak when secondary process mapping fails
This patch fixes resource leak of pci_uio_map_secondary().
If pci_map_resource() succeeds but mapped address is different from an
address primary process mapped, this should be error.
Then the addresses secondary process mapped should be freed.

Signed-off-by: Tetsuya Mukawa <mukawa@igel.co.jp>
Acked-by: David Marchand <david.marchand@6wind.com>
2016-06-20 10:44:43 +02:00
Tetsuya Mukawa
3fe2e5fec8 eal: fix argument parsing check
This patch fixes wrong error checking of rte_eal_parse_devargs_str().
Currently, a return value of strdup() is wrongly checked.

Fixes: 0fe11ec592 ("eal: add vdev init and uninit")

Signed-off-by: Tetsuya Mukawa <mukawa@igel.co.jp>
Acked-by: David Marchand <david.marchand@6wind.com>
2016-06-20 10:44:43 +02:00
Thomas Monjalon
368e2624f2 eal/linux: fix build with glibc < 2.12
The function rte_thread_setname needs glibc 2.12,
otherwise it returns -1 without using any parameter.
The macro RTE_SET_USED avoids an "unused parameter" warning.

Fixes: 3901ed99c2 ("eal: fix thread naming on FreeBSD")

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
2016-06-20 10:14:21 +02:00
Thomas Monjalon
3901ed99c2 eal: fix thread naming on FreeBSD
rte_thread_setname was a macro defined only for Linux.
The function rte_thread_setname() can now be used on FreeBSD
as well on Linux.
It is required to build librte_pdump.

The macro was 0 for old glibc. The function is now returning -1.
The related logs are decreased from error to debug level because
it is not an important failure, just a debug inconvenience.

Fixes: 278f945402 ("pdump: add new library for packet capture")

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Acked-by: David Marchand <david.marchand@6wind.com>
2016-06-17 18:04:22 +02:00
Thomas Monjalon
92fed91965 keepalive: fix exported symbols
The function rte_keepalive_register_alive_callback do not exist.
The function rte_keepalive_register_relay_callback was missing for BSD.

Fixes: 90c622f356 ("keepalive: add liveness callback")

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
2016-06-17 17:04:12 +02:00
Reshma Pattan
278f945402 pdump: add new library for packet capture
The librte_pdump library provides a framework for
packet capturing in dpdk. The library provides set of
APIs to initialize the packet capture framework, to
enable or disable the packet capture, and to uninitialize
it.

The librte_pdump library works on a client/server model.
The server is responsible for enabling or disabling the
packet capture and the clients are responsible
for requesting the enabling or disabling of the packet
capture.

Enabling APIs are supported with port, queue, ring and
mempool parameters. Applications should pass on this information
to get the packets from the dpdk ports.

For enabling requests from applications, library creates the client
request containing the mempool, ring, port and queue information and
sends the request to the server. After receiving the request, server
registers the Rx and Tx callbacks for all the port and queues.
After the callbacks registration, registered callbacks will get the
Rx and Tx packets. Packets then will be copied to the new mbufs that
are allocated from the user passed mempool. These new mbufs then will
be enqueued to the application passed ring. Applications need to dequeue
the mbufs from the rings and direct them to the devices like
pcap vdev for viewing the packets outside of the dpdk
using the packet capture tools.

For disabling requests, library creates the client request containing
the port and queue information and sends the request to the server.
After receiving the request, server removes the Rx and Tx callback
for all the port and queues.

Signed-off-by: Reshma Pattan <reshma.pattan@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2016-06-16 23:39:56 +02:00
Reshma Pattan
bde516d5a8 ethdev: get port by name
Converted rte_eth_dev_get_port_by_name to a public API.
Converted rte_eth_dev_get_name_by_port to a public API.

The librte_pdump library provides the APIs to enable or disable the
packet capture either using the port id or pci address or device name.
So pdump library need to do a mapping from name to port and port to name
internally to validate the device name and register the Rx and Tx
callbacks for the mapped ports. So these APIs are made public for the
pdump library for doing the mentioned mappings.

Signed-off-by: Reshma Pattan <reshma.pattan@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2016-06-16 23:38:52 +02:00
Reshma Pattan
00851d47f7 ethdev: get queues numbers
The new fields nb_rx_queues and nb_tx_queues are added to the
rte_eth_dev_info structure.
Changes to API rte_eth_dev_info_get() are done to update these new fields
to the rte_eth_dev_info object.
Release notes is updated with the changes.

The librte_pdump library needs to register Rx and Tx callbacks for all
the nb_rx_queues and nb_tx_queues, when application wants to capture the
packets on all the software configured number of Rx and Tx queues of the
device. So far there is no support to get nb_rx_queues and nb_tx_queues
information from the ethdev library. Hence these changes are introduced.

Signed-off-by: Reshma Pattan <reshma.pattan@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2016-06-16 23:38:44 +02:00
Reshma Pattan
c8231c63dd ethdev: insert Rx callback as head of list
Added new public api rte_eth_add_first_rx_callback to add given
callback as head of the list.

The librte_pdump library should display Rx packets of the
NIC even before they are being processed by other callbacks
of the application (because other callbacks of the application
may change the packet data as part of the processing).
So packet capturing framework should register a callback at the
head of the Rx callback list so that callback always gets called
first before any other callbacks of the applications. Hence this API
is introduced.

Signed-off-by: Reshma Pattan <reshma.pattan@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2016-06-16 23:38:00 +02:00
Reshma Pattan
525335f4ce ethdev: protect Rx/Tx callback change with locks
Added spinlocks around add/remove logic of Rx and Tx callbacks
to avoid corruption of callback lists in multithreaded context.

Signed-off-by: Reshma Pattan <reshma.pattan@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2016-06-16 23:37:53 +02:00
Remy Horton
90c622f356 keepalive: add liveness callback
Adds and documents new callbacks that allow transitions to core
states other than dead to be reported to applications.

Signed-off-by: Remy Horton <remy.horton@intel.com>
2016-06-16 18:25:48 +02:00
Remy Horton
e70a61ad50 keepalive: export states
Changes the keepalive state from an anonymous enum to a declared one
which is externally visible, so that keepalive enum values can be
used by applications.

Signed-off-by: Remy Horton <remy.horton@intel.com>
2016-06-16 18:24:48 +02:00
Remy Horton
e2aae1c1ce ethdev: remove name from extended statistic fetch
The current extended ethernet statistics fetching involve doing several
string operations, which causes performance issues if there are lots of
statistics and/or network interfaces. This patch changes the test-pmd
and proc_info applications to use the new xstats API, and removes
deprecated code associated with the old API.

Signed-off-by: Remy Horton <remy.horton@intel.com>
2016-06-16 18:12:00 +02:00
Remy Horton
bd6aa172cf ethdev: fetch extended statistics with integer ids
The current extended ethernet statistics fetching involve doing several
string operations, which causes performance issues if there are lots of
statistics and/or network interfaces. This patch changes the xstats
functions to instead use a numeric identifier rather than a string, and
adds the ability to retrieve identifier-to-string mappings.

Signed-off-by: Remy Horton <remy.horton@intel.com>
2016-06-16 17:40:16 +02:00
Olivier Matz
24e718b4e1 pci: mmap ioports on non-x86 Linux
On PPC64, the ioports are mapped in memory. Implement the missing part
of ioport API for PPC64 when using uio. This may also work on other
architectures but it has not been tested.

Signed-off-by: David Marchand <david.marchand@6wind.com>
Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
2016-06-15 19:06:27 +02:00
Olivier Matz
781b587cc4 pci: split function parsing resources in sysfs
Split pci_parse_sysfs_resource() and introduce
pci_parse_one_sysfs_resource() that parses one line of sysfs resource
file.

This new function will be exported and used in next commits when
mapping the ioports resources.

No functional change.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
2016-06-15 19:06:27 +02:00
Olivier Matz
e314af1578 pci: remove invalid comment
In a previous commit, the file used to map the PCI resources changed
from "/dev/uio<x>" to "/sys/bus/pci/devices/<busaddr>/resource", making
the comment wrong. Remove it.

Fixes: 9e67561acd ("eal/linux: mmap uio resources using resourceX files")

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
2016-06-15 19:06:27 +02:00