Commit Graph

8 Commits

Author SHA1 Message Date
Damjan Marion
9e71668b42 virtio: fix crash if CQ is not negotiated
Fix NULL dereference if virtio control queue is not negotiated.

Signed-off-by: Damjan Marion <damarion@cisco.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
2015-06-12 14:50:06 +02:00
Stephen Hemminger
d78deadae4 virtio: fix ring size negotiation
Negotiate the virtio ring size. The host may allow for very large
rings but application may only want a smaller ring.
Conversely, if the number of descriptors requested exceeds the virtio
host queue size, then just silently use the smaller host size.

This fixes issues with virtio in non-QEMU envirionments.
For example Google Compute Engine allows up to 16K elements
in ring.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Changchun Ouyang <changchun.ouyang@intel.com>
2015-06-12 14:44:59 +02:00
Stephen Hemminger
4a92b67151 virtio: clarify feature bit handling
Change the features from bit mask to bit number. This allows the
DPDK driver to use the definitions from Linux (yes the header
files already use a license compatiable with DPDK). This makes DPDK
driver handle future feature bit changes.

Get rid of double negative code in the feature bit intialization.
Instead just have a new define with the list of feature bits implemented.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Changchun Ouyang <changchun.ouyang@intel.com>
2015-06-12 14:43:40 +02:00
Stephen Hemminger
2704623620 virtio: do not set mac table unless negotiated
Don't attempt to set the MAC address table unless the host allows
it in feature negotiation. Also, don't return a value from mac_table_set
since all callers ignore the return value.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Changchun Ouyang <changchun.ouyang@intel.com>
2015-06-12 14:40:15 +02:00
Stephen Hemminger
e9e414a41a virtio: do not enable/disable Rx modes unless supported
If negotiation with host says that controlling Rx mode is
not supported, then don't try.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Changchun Ouyang <changchun.ouyang@intel.com>
2015-06-12 14:36:38 +02:00
Stephen Hemminger
4ecce8356e virtio: remove blank lines
Putting blank line between function and following conditional
just wastes screen space, and makes code less obvious.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Changchun Ouyang <changchun.ouyang@intel.com>
2015-06-12 14:35:10 +02:00
Stephen Hemminger
6c52c126f2 drivers: explicit initialization of pci drivers
Upcoming drivers will need to be able to support other bus types.
This is a transparent change to how struct eth_driver is initialized.
It has not function or ABI layout impact, but makes adding a later
bus type (Xen, Hyper-V, ...) much easier.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
2015-06-12 11:10:10 +02:00
Bruce Richardson
6c3169a3dc virtio: move to drivers/net/
Move virtio PMD to drivers/net directory

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
2015-05-22 16:06:23 +02:00