summaryrefslogtreecommitdiffstats
path: root/src/vnet/devices/virtio/device.c
AgeCommit message (Collapse)AuthorFilesLines
2020-05-05gso: add support for IP-IPMohsin Kazmi1-8/+14
Type: feature Change-Id: I37752af8496e0042a1da91124f3d94216b39ff11 Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
2020-04-22gso: add vxlan tunnel supportMohsin Kazmi1-7/+11
Type: feature Change-Id: I85f6ec77187a4983c66c5e22fd39fbb2cef82902 Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
2020-04-17virtio: fix to use chained descriptors when missing indirect descriptorMohsin Kazmi1-7/+68
Some vhost-backed missing the VIRTIO_RING_F_INDIRECT_DESC feature. Previously, vpp doesn't support jumbo frames using chained descriptors. This patch fixes this issue. Type: fix Change-Id: I20487e201e88ea136b556ac84dde058019ab3e78 Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
2020-04-17tap: add initial support for tunMohsin Kazmi1-1/+3
Type: feature Change-Id: I699a01ac925fe5c475a36032edb7018618bb4dd4 Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
2020-04-10virtio: fix gso and csum offload errors handlingMohsin Kazmi1-45/+82
GSO and CSUM offloaded packets are transmitted even itf doesn't support GSO/CSUM. This patch fixes it by logging the respective errors and dropping the packets. Type: fix Change-Id: I5ab19d15ce6aa9fda515313c313a5a56c0b96837 Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
2020-04-08virtio: fix the tcp/udp checksum offloadsMohsin Kazmi1-26/+0
Some vhost-backend calculates the wrong checksum in case of tcp/udp offload when driver resets tcp/udp checksum field to '0'. Type: fix Change-Id: I1d2a9b95b3d5cc1decac38027104a04df2af4680 Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
2020-03-30gso: fix the header parser to read onlyMohsin Kazmi1-4/+38
Previously, header parser sets the tcp/udp checksum to 0. It should be read only function for vlib_buffer_t. Type: fix Change-Id: I9c3398372f22998da3df188f0b7db13748303068 Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
2020-03-21virtio: fix link up/down flagMohsin Kazmi1-3/+9
Type: fix "set int state <interface> down" puts the virtio device link down. It will not put the link in "UP" state, when "set int state <interface up>" will be used again to change the interface admin up. This patch fixes it. To test: create tap set int state tap0 up set int state tap0 down sh hardware sh int set int state tap0 up sh int sh hardware Change-Id: I3c0e31539f8a2a1e40220e7fb57eedecf408f067 Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
2020-03-21virtio: fix the out of order descriptors in txMohsin Kazmi1-8/+95
Type: fix Some vhost-backends give used descriptors back in out-of-order. This patch fixes the native virtio to handle out-of-order descriptors. Change-Id: I57323303349f6a385e412ee22772ab979ae8edbf Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
2020-01-08virtio: split gso and checksum offload functionalityMohsin Kazmi1-11/+77
Type: refactor Change-Id: I897e36bd5db593b417c2bac9f739bc51cf45bc08 Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
2019-12-04gso: remove the interface countMohsin Kazmi1-2/+1
Type: refactor Change-Id: I51405b9d09fb6fb03d08569369fdd4e11c647908 Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
2019-11-14virtio: refactor virtio-pci loggingDamjan Marion1-21/+0
Type: refactor Change-Id: I34306c1206b2bf5f521be6c6b78074ccf9259a08 Signed-off-by: Damjan Marion <damarion@cisco.com>
2019-05-24Tap: Fix the indirect buffers allocation VPP-1660Mohsin Kazmi1-12/+35
Indirect buffers are used to store indirect descriptors to xmit big packets. This patch moves the indirect buffer allocation from interface creation to device node. Now it allocates or deallocates buffers during tx for chained buffers. Change-Id: I55cec208a2a7432e12fe9254a7f8ef84a9302bd5 Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com> (cherry picked from commit 55203e745f5e3f1f6c4dbe99d6eab8dee4d13ea6)
2019-04-03virtio: Add support for multiqueueMohsin Kazmi1-6/+7
Change-Id: Id71ffa77e977651f219ac09d1feef334851209e1 Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
2019-03-13deprecate VLIB_DEVICE_TX_FUNCTION_MULTIARCHFilip Tehlar1-7/+7
Change-Id: I8819bcb9e228e7a432f4a7b67b6107f984927cd4 Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
2019-02-19tap gso: experimental supportAndrew Yourtchenko1-4/+30
This commit adds a "gso" parameter to existing "create tap..." CLI, and a "no-gso" parameter for the compatibility with the future, when/if defaults change. It makes use of the lowest bit of the "tap_flags" field in the API call in order to allow creation of GSO interfaces via API as well. It does the necessary syscalls to enable the GSO and checksum offload support on the kernel side and sets two flags on the interface: virtio-specific virtio_if_t.gso_enabled, and vnet_hw_interface_t.flags & VNET_HW_INTERFACE_FLAG_SUPPORTS_GSO. The first one, if enabled, triggers the marking of the GSO-encapsulated packets on ingress with VNET_BUFFER_F_GSO flag, and setting vnet_buffer2(b)->gso_size to the desired L4 payload size. VNET_HW_INTERFACE_FLAG_SUPPORTS_GSO determines the egress packet processing in interface-output for such packets: When the flag is set, they are sent out almost as usual (just taking care to set the vnet header for virtio). When the flag is not enabled (the case for most interfaces), the egress path performs the re-segmentation such that the L4 payload of the transmitted packets equals gso_size. The operations in the datapath are enabled only when there is at least one GSO-compatible interface in the system - this is done by tracking the count in interface_main.gso_interface_count. This way the impact of conditional checks for the setups that do not use GSO is minimized. "show tap" CLI shows the state of the GSO flag on the interface, and the total count of GSO-enabled interfaces (which is used to enable the GSO-related processing in the packet path). This commit lacks IPv6 extension header traversal support of any kind - the L4 payload is assumed to follow the IPv6 header. Also it performs the offloads only for TCP (TSO - TCP segmentation offload). The UDP fragmentation offload (UFO) is not part of it. For debug purposes it also adds the debug CLI: "set tap gso {<interface> | sw_if_index <sw_idx>} <enable|disable>" Change-Id: Ifd562db89adcc2208094b3d1032cee8c307aaef9 Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
2019-02-06virtio: enable msix interrupt modeMohsin Kazmi1-0/+6
Change-Id: Idd560f3afde1dd03bc3d6fbb2070096146865f50 Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
2019-01-24virtio: Minor fixes and header cleanupMohsin Kazmi1-2/+0
Change-Id: I2e5fd45abcd07e9eda6184587889bdcd9613a159 Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
2019-01-21virtio: Native virtio driverMohsin Kazmi1-42/+94
Change-Id: Id7fccf2f805e578fb05032aeb2b649a74c3c0e56 Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
2019-01-08virtio: fix kick race issueDamjan Marion1-5/+5
Change-Id: I25b2a28513821bc5eab9ac6890a3964d412b0399 Signed-off-by: Damjan Marion <damarion@cisco.com>
2018-11-13vlib rename vlib_frame_args(...) to vlib_frame_scalar_args(..)Damjan Marion1-1/+1
Typically we have scalar_size == 0, so it doesn't matter but vlib_frame_args was providing pointer to scalar frame data, not vector data. To avoid future confusion function is renamed to vlib_frame_scalar_args(...) Change-Id: I48b75523b46d487feea24f3f3cb10c528dde516f Signed-off-by: Damjan Marion <damarion@cisco.com>
2018-10-27virtio: remove the extra return callMohsin Kazmi1-2/+0
Change-Id: I6e43953a6ad1bd672e69d8377d18bd9614b469d8 Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
2018-10-23c11 safe string handling supportDave Barach1-1/+1
Change-Id: Ied34720ca5a6e6e717eea4e86003e854031b6eab Signed-off-by: Dave Barach <dave@barachs.net>
2018-02-19virtio: add missing tx lock when running multithreadedDamjan Marion1-0/+4
Change-Id: I373f429c53c6f66ad38322addcfaccddb7761392 Signed-off-by: Damjan Marion <damarion@cisco.com>
2018-02-08virtio: reset vnet header on txDamjan Marion1-0/+3
Change-Id: Ib04a8787038fb536470a04d99fdc165102edfb5a Signed-off-by: Damjan Marion <damarion@cisco.com>
2018-01-16tapv2: deleting tap interface may leak buffers (VPP-1124)Steven1-1/+1
Buffers may be allocated for indirect descriptors by tx thread and they are freed when tx thread is invoked in the next invocation. This is to allow the recipient (kernel) to have a chance to process them. But if the tap interface is deleted, the tx thread may not yet be called to clean up the indirect descriptors' buffers. In that case, we need to remove them without waiting for the tx thread to be called. Failure to do so may cause buffers leak when the tap interface is deleted. For the RX ring, leakage also exists for vring->buffers when the interface is removed. Change-Id: I3df313a0e60334776b19daf51a9f5bf20dfdc489 Signed-off-by: Steven <sluong@cisco.com> (cherry picked from commit d8a998e74b815dd3725dfcd80080e4e540940236)
2017-12-14tap_v2: include host-side parameters in the dump binary APIMilan Lenco1-0/+2
Change-Id: I097a738b96a304621520f1842dcac7dbf61a8e3f Signed-off-by: Milan Lenco <milan.lenco@pantheon.tech>
2017-12-08tapv2: multiple improvementsDamjan Marion1-1/+1
- change interface naming scheme - rework netlink code - add option to set link address, namespace Change-Id: Icf667babb3077a07617b0b87c45c957e345cb4d1 Signed-off-by: Damjan Marion <damarion@cisco.com>
2017-11-30virtio: fast TAP interfaces with vhost-net backendDamjan Marion1-0/+328
Change-Id: Ided667356d5c6fb9648eb34685aabd6b16a598b7 Signed-off-by: Damjan Marion <damarion@cisco.com> Signed-off-by: Steven Luong <sluong@cisco.com>