Commit Graph

30 Commits

Author SHA1 Message Date
Stephen Hemminger
ce65e697c6 virtio: simplify the hardware structure
The host_features are never used after negotiation.
The PCI information is unused (and available in rte_pci if needed).

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Alan Carew <alan.carew@intel.com>
2014-07-22 15:00:01 +02:00
Stephen Hemminger
9d168c68df virtio: remove unused adapter_stopped field
This flag was set to zero (but was already zero)
and never used.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Alan Carew <alan.carew@intel.com>
2014-07-22 15:00:01 +02:00
Stephen Hemminger
f37cdfde46 virtio: remove unused virtqueue name
vq_name is only used when setting up queue, and does not need
to be saved.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Alan Carew <alan.carew@intel.com>
2014-07-22 15:00:01 +02:00
Stephen Hemminger
11efa9f07c virtio: check for ip checksum offload
This driver does not support receive IP checksum offload,
therefore must check and return error if configured incorrectly.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Alan Carew <alan.carew@intel.com>
2014-07-22 15:00:01 +02:00
Stephen Hemminger
61b16f0f16 virtio: check for transmit checksum config error
This driver does not support transmit checksum or vlan offload
therefore check for this when device is configured.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Alan Carew <alan.carew@intel.com>
2014-07-22 15:00:01 +02:00
Stephen Hemminger
403ac76b37 virtio: deinline some code
This driver has lots of functions marked always inline which is actually
counterproductive with modern compilers. Better to move the functions to
the one file they are used (proper scope) and let compiler decide.

For trivial functions leave them as static inline.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Alan Carew <alan.carew@intel.com>
2014-07-22 15:00:01 +02:00
Stephen Hemminger
51c005546a virtio: dont double space log messages
PMD_INIT_LOG macro already adds a newline, no need to double space.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Alan Carew <alan.carew@intel.com>
2014-07-22 15:00:00 +02:00
Stephen Hemminger
9658d17da2 virtio: maintain stats per queue
Avoid cache collision and thrashing of the software statistics
by keeping them per-queue in the driver.

Signed-off-by: Stephen Hemminger <shemming@brocade.com>
Acked-by: Alan Carew <alan.carew@intel.com>
2014-07-22 15:00:00 +02:00
Vijayakumar Muthuvel Manickam
3ed4e9735a virtio: fix 32-bit build for 64-bit kernel
virtio_net_hdr_mem member within virtqueue structure stores a
physical address and is defined as void ptr. When 32bit pmd is used
with 64bit kernel this leads to truncation of 64bit physical address
and pkt i/o does not work.
Changed virtio_net_hdr_mem to phys_addr_t type and
removed the typecasts

Signed-off-by: Vijayakumar Muthuvel Manickam <mmvijay@gmail.com>
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
2014-07-22 15:00:00 +02:00
Alan Carew
4d6d8babac virtio: fix device specific header offset when MSI-X is disabled
Suggested-by: Neil Horman <nhorman@tuxdriver.com>
Suggested-by: Stephen Hemminger <stephen@networkplumber.org>
Signed-off-by: Alan Carew <alan.carew@intel.com>
2014-07-22 15:00:00 +02:00
Thomas Monjalon
8c4e33562d virtio: fix build of debug dump
The commit 591a9d7985 (add FILE argument to debug functions) didn't
compile if CONFIG_RTE_LIBRTE_VIRTIO_DEBUG_DUMP is enabled.

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
2014-07-02 22:32:43 +02:00
Stephen Hemminger
6f41fe75e2 eal: deprecate rte_snprintf
The function rte_snprintf serves no useful purpose. It is the
same as snprintf() for all valid inputs. Deprecate it and
replace all uses in current code.

Leave the tests for the deprecated function in place.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
2014-06-27 02:31:24 +02:00
Anatoly Burakov
71d74422e2 pci: rename RTE_PCI_DRV_NEED_IGB_UIO to RTE_PCI_DRV_NEED_MAPPING
Rename the RTE_PCI_DRV_NEED_IGB_UIO to be more generic.

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
2014-06-16 15:02:10 +02:00
Stephen Hemminger
36c248ebc6 virtio: fix build with debug enabled
Remove useless message that breaks if VIRTIO_DEBUG_DRIVER is defined.
virtio_ethdev.c:224:2: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing]

Signed-off-by: Stephen Hemminger <shemming@brocade.com>
Acked-by: Changchun Ouyang <changchun.ouyang@intel.com>
2014-06-13 11:18:56 +02:00
Stephen Hemminger
14337d0b7a virtio: checkpatch cleanups
This fixes style problems reported by checkpatch including:
  * extra whitespace
  * spaces before tabs
  * strings broken across lines
  * excessively long lines
  * missing spaces after keywords
  * unnecessary paren's in return statements

Signed-off-by: Stephen Hemminger <shemming@brocade.com>
Acked-by: Changchun Ouyang <changchun.ouyang@intel.com>
2014-06-13 11:18:56 +02:00
Bruce Richardson
3031749c2d remove trailing whitespaces
This commit removes trailing whitespace from lines in files. Almost all
files are affected, as the BSD license copyright header had trailing
whitespace on 4 lines in it [hence the number of files reporting 8 lines
changed in the diffstat].

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
[Thomas: remove spaces before tabs in libs]
[Thomas: remove more trailing spaces in non-C files]
Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
2014-06-11 00:29:34 +02:00
Ouyang Changchun
823ad64795 virtio: support multiple queues
This patch supports multiple queues feature in DPDK based virtio-net frontend.
It firstly gets max queue number of virtio-net from virtio PCI configuration and
then send command to negotiate the queue number with backend; When receiving and
transmitting packets, it negotiates multiple virtio-net queues which serve RX/TX;
To utilize this feature, the backend also need support multiple queues feature
and enable it.

Signed-off-by: Ouyang Changchun <changchun.ouyang@intel.com>
Tested-by: Waterman Cao <waterman.cao@intel.com>
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
2014-05-29 11:11:24 +02:00
Ouyang Changchun
5591a4a913 virtio: code-style cleanup
This patch cleanups some coding style issue, and fixes some errors and warnings
reported by checkpatch.pl.

Signed-off-by: Ouyang Changchun <changchun.ouyang@intel.com>
Tested-by: Waterman Cao <waterman.cao@intel.com>
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
2014-05-29 11:11:24 +02:00
Neil Horman
42a6654c10 virtio: convert to use of PMD_REGISTER_DRIVER and fix linking
Convert the virtio pmd driver to use the PMD_REGISTER_DRIVER macro.
This means that the test applications now have no reference to the virtio library
when building DSO's and must specify its use on the command line with the -d
option.  Static linking will still initalize the driver automatically.

Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
2014-05-20 14:28:17 +02:00
Stephen Hemminger
c738c6a644 spelling fixes
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
2014-05-16 16:02:55 +02:00
David Marchand
99d44c7e26 pci: remove virtio-uio workaround
virtio-uio does not need eal to map bars from uio device, so remove flag
RTE_PCI_DRV_NEED_IGB_UIO.
Then, move virtio-uio workaround out of generic eal_pci.c for linux
implementation.

Signed-off-by: David Marchand <david.marchand@6wind.com>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
2014-05-13 13:20:35 +02:00
Daniel Kan
18f02ff759 pci: fix igb_uio mapping for virtio_uio and vmxnet3_uio
Since commit 10ed994 (pci: use igb_uio mapping only when needed),
the flag RTE_PCI_DRV_NEED_IGB_UIO must be set even if RTE_EAL_UNBIND_PORTS
is disabled.
It was not the case for virtio_uio and vmxnet3_uio so the uio resources were
not mapped when RTE_EAL_UNBIND_PORTS was not defined.
Specifically, pci_uio_map_resource() was not called so
pci_dev->mem_resource was not mapped.

Signed-off-by: Daniel Kan <dan@nyansa.com>
Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
2014-03-21 15:40:30 +01:00
Thomas Monjalon
5dbb84c0a8 virtio: rename library
In order to distinguish clearly this implementation from the extension
virtio-net-pmd, it is renamed to reflect its usage of uio framework.

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Acked-by: Chris Wright <chrisw@redhat.com>
2014-03-20 17:50:51 +01:00
Bruce Richardson
b9a4361fc5 virtio: mark functions as always inline
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
2014-02-26 10:22:32 +01:00
Bruce Richardson
2cf3151ee4 virtio: various improvements
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
2014-02-26 10:22:32 +01:00
Bruce Richardson
0978aa72cd virtio: add close function
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
2014-02-26 10:22:32 +01:00
Bruce Richardson
764bf26873 add FreeBSD support
Changes to allow compilation and use on FreeBSD. Includes:
* contigmem and nic_uio driver for FreeBSD
* new EAL instance
* new "bsdapp" compilation target
* various compilation fixes due to differences between linux and freebsd

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
2014-02-25 21:29:18 +01:00
Bruce Richardson
e9d48c0072 update Intel copyright years to 2014
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
2014-02-25 21:29:14 +01:00
Intel
f72751f2c7 virtio: minor changes
Signed-off-by: Intel
2013-11-24 01:31:33 +01:00
Intel
c1f86306a0 virtio: add new driver
This PMD can be used in a VM having virtio-net NIC.

Note: it is a different implementation than virtio-usermap extension.

Signed-off-by: Intel
2013-10-09 16:16:14 +02:00