summaryrefslogtreecommitdiffstats
path: root/src/vnet/devices/virtio
AgeCommit message (Collapse)AuthorFilesLines
2020-11-23virtio: fix overflow in case of buffering + dropBenoît Ganne1-1/+0
Type: fix Fixes: 2e6f624f1f82ae0351dd05ad5d930d6876105519 Change-Id: Ib41c82ea1e8430afc920250fb0d054a2fb2d08c9 Signed-off-by: Benoît Ganne <bganne@cisco.com>
2020-11-17virtio: virtio: implement packed queues from virtio 1.1Mohsin Kazmi8-135/+1037
Type: feature Change-Id: I12703371541298efa029903d6762b1cd1f7322ca Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
2020-11-12virtio: fix the index issueMohsin Kazmi1-7/+15
Type: fix Fixes: 587f9130424fd451e4ba823240d02f655fb197d1 Change-Id: I230993a54c84e22e324de2a8defeda83c517d733 Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
2020-11-09vlib: fix trace number accountingBenoît Ganne2-16/+17
When using classifier to filter traces, not all packets will be traced. In that case, we should only count traced packets. Type: fix Change-Id: I87d1e217b580ebff8c6ade7860eb43950420ae78 Signed-off-by: Benoît Ganne <bganne@cisco.com>
2020-11-05tap: allow change of carrier state on hostMatthew Smith2-0/+2
Type: feature Add a function to adjust the link state of the host side of a tap interface. If an application (e.g. route protocol daemons) running on the host uses netlink to monitor interface state, a plugin could use this function to communicate a loss of connectivity to the application by making the interface appear to go down. Requires a somewhat recent kernel. E.g. it does not have any effect on CentOS 7 but it works on CentOS 8. Change-Id: I677ee7889d2eb142e2395bea98f0b4d7e7e7f810 Signed-off-by: Matthew Smith <mgsmith@netgate.com>
2020-11-05virtio: misc optimizationsDamjan Marion1-35/+41
Type: improvement Change-Id: Iaf98a60e37dd28828feca365b8fdc5d2f7ae6935 Signed-off-by: Damjan Marion <damarion@cisco.com>
2020-11-05virtio: move retry logic to outer functionDamjan Marion1-8/+9
Improves compile time.... Type: improvement Change-Id: I310a2e55e5e488a953d65fd065f7795a43d2e9a7 Signed-off-by: Damjan Marion <damarion@cisco.com>
2020-10-28misc: Break the big IP header files to improve compile timeNeale Ranns4-7/+1
Type: refactor Signed-off-by: Neale Ranns <neale.ranns@cisco.com> Change-Id: Id1801519638a9b97175847d7ed58824fb83433d6
2020-10-28virtio: fix the buffer array indexMohsin Kazmi1-1/+1
Type: fix Fixes: 2e6f624f1f82ae0351dd05ad5d930d6876105519 Change-Id: I24a9822d1968a134c7e41221f48296cc8a67dd91 Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
2020-10-26virtio: improve the compile timeMohsin Kazmi1-36/+32
Type: improvement packet buffering is common code to tun/tap/virtio. Change-Id: I59a339f268a28a0c32756e52d10d1ed6b207db42 Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
2020-10-26virtio: reduce the compile time for device.cMohsin Kazmi1-15/+19
Type: improvement GRO is common to tap/tun/virtio devices. Hence move to common place. Change-Id: Ibb099f3a80f493ddb934df6bb7640f7c9c370fd5 Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
2020-10-22virtio: checksum error reported for ip6 traffic with GSO enableSteven Luong2-11/+1
When GSO is enabled, vhost clears the checksum field prior to transmitting the packet. Some newer kernel version does not like that and complains about checksum error. This was seen with ip6 traffic. Type: fix Signed-off-by: Steven Luong <sluong@cisco.com> Change-Id: I7c6f2a6148f4a30107bfa8b078f5990e64300cf1
2020-10-21virtio: run process to send interrupts to input nodesMohsin Kazmi3-17/+111
Type: improvement virtio interfaces support packet coalescing and buffering which depends on timer expiry to flush the stored packets periodically. virtio input node checks timer expiry and schedules tx queue accordingly. In poll mode, timer expiry is handled naturally, as input node runs periodically. In interrupt mode, virtio input node depends on the interrupts send from backend. Stored packets could starve, if there would not be interrupts to input node. This patch implements a process node which periodically sends interrupt to virtio input node given coalescing or buffering feature is enabled on an interface. Change-Id: Ic38f749f74b001073d4d0579dca149d0a4cea039 Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
2020-10-21virtio: improve input node performanceDamjan Marion1-13/+26
- Avoid feature arc lookup per packet, as all packets belong to the same interface - don't validate enqueue for l2 packets, as they all have same destionation Type: improvement Change-Id: I32ddd801f219eab9281736abafdc91a4ff9e0989 Signed-off-by: Damjan Marion <damarion@cisco.com>
2020-10-21virtio: move lock and kick to outer functionDamjan Marion1-31/+28
Type: improvement Change-Id: I4fdcb40142e8cc9f5f1d0035116659543d5d92fe Signed-off-by: Damjan Marion <damarion@cisco.com>
2020-10-19virtio: fix compilation timeDamjan Marion1-30/+31
There is no need to inline 3 times virtio_refill_vring()... Type: fix Change-Id: Ic26e24fd7911af743fedd0e2282784b715e86c3c Signed-off-by: Damjan Marion <damarion@cisco.com>
2020-10-12misc: clang-11 and gcc-10 supportDamjan Marion1-1/+1
clang-11 complains: error: field 'buffer_template' with variable sized type 'vlib_buffer_t' not at the end of a struct or class is a GNU extension [-Werror,-Wgnu-variable-sized-type-not-at-end] Type: improvement Change-Id: I2cb6b4fde723a05b42cf33dd8130df074f0362ab Signed-off-by: Damjan Marion <damarion@cisco.com>
2020-10-08interface: shorten vnet_hw_if_rx_modeDamjan Marion5-24/+23
This is part of bigger refactor. Type: refactor Change-Id: I6fc2c0a1e2d217a70952901bcf775b8485bd3c20 Signed-off-by: Damjan Marion <damarion@cisco.com>
2020-10-08virtio: fix the traceMohsin Kazmi1-23/+19
Type: fix This patch fixes the commit e347acbc31111504c015531e8ad764a86d489309 Change-Id: Icee7a6e250c94ae93e606d7869acc55c7a5806b1 Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
2020-09-29virtio: fix modern device queue notifyMohsin Kazmi5-22/+53
QUEUE_SELECT and QUEUE_NOTIFY_OFF registers are shared between all workers operating on the same device and operations are not atomic Type: fix Change-Id: Ie017b1bfc7e3b6b4e59029f45db78eeffd9f3aeb Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
2020-09-28virtio: add packet buffering on txMohsin Kazmi10-15/+386
Type: feature This patch adds packet buffering on tx for slow backend which have some jitter/delays in freeing the vrings. There are some limitations to the current design: 1) It only works in poll mode. 2) Atleast 1 rx queue of an interface (with buffering enabled) should be placed on each worker and main thread. Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com> Change-Id: Ib93c350298b228e80426e58ac77f3bbc93b8be27
2020-09-28virtio: fix the gro enable/disable on tx-vringsMohsin Kazmi2-7/+22
Type: fix Change-Id: I96c30baaf34fe7b0cd899966a507501e58cde934 Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
2020-09-24virtio: refactor tx traceMohsin Kazmi1-33/+37
Type: refactor Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com> Change-Id: I37fef2c32d0561b944b201a1012b87c7ac315e73
2020-09-18virtio: fix txq lockingBenoît Ganne2-2/+6
Initialize txq lock only if some txq are shared and check if another worker is already operating on the txq before processing gro timeouts in input node. Type: fix Change-Id: I89dab6c0e6eb6a7aa621fa1548b0a2c76e6c7581 Signed-off-by: Benoît Ganne <bganne@cisco.com>
2020-09-16misc: fix the formatting styleMohsin Kazmi1-6/+8
Type: style Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com> Change-Id: Id86e16677564669b0295bbb9fc1303fe39a21b6f
2020-09-16api: clean up use of deprecated flagOle Troan1-2/+2
The syntax of the deprecated flag has evolved. Clean up usage to be "option deprecated;". Type: fix Signed-off-by: Ole Troan <ot@cisco.com> Change-Id: If2b639f275eb8db58b36c457f9245fe35a4d8cb1
2020-09-11build: fix build for Debian 9 and Debian 10Benoît Ganne2-7/+13
Type: fix Change-Id: Ic07d0ae313b32e420ba93693cb75960a86f752a9 Signed-off-by: Benoît Ganne <bganne@cisco.com>
2020-09-04virtio: remove kernel virtio header dependenciesMohsin Kazmi15-383/+472
Type: refactor tap, virtio and vhost use virtio/vhost header files from linux kernel. Different features are supported on different kernel versions, making it difficult to use those in VPP. This patch removes virtio/vhost based header dependencies to local header files. Change-Id: I064a8adb5cd9753c986b6f224bb075200b3856af Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
2020-09-02virtio: add virtio 1.1 api flagsMohsin Kazmi3-1/+119
Type: feature Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com> Change-Id: I95d7fc1cc8db5199570c66535f45e867a7cae676
2020-09-01virtio: fix the bar starting indexMohsin Kazmi1-1/+1
Type: fix Change-Id: Ia28161b583ea26ab820a494332a79b64add7004d Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
2020-09-01virtio: fix the NULL deferenceMohsin Kazmi1-1/+2
Type: fix Change-Id: I8d55c2bfdd3c4607044370ebabf40cbac78b4996 Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
2020-09-01virtio: fix the error returnMohsin Kazmi1-9/+12
Type: fix Change-Id: I12b08333f3f69aaa882e8801f4f69bca2d7bd558 Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
2020-08-31virtio: fix the coverity warningMohsin Kazmi2-7/+13
Type: fix Change-Id: I6c6d66ad8aa158be8d2b9d111de7d46473b9dc02 Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
2020-08-20virtio: add modern device supportMohsin Kazmi6-47/+676
Type: feature Change-Id: I205f7c146a213d603d9d1e46fcf5195a876608dc Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
2020-08-20virtio: refactor pci device codeMohsin Kazmi6-350/+531
Type: refactor Change-Id: I7342178f9ab9adb99b91a4f984bc22bef2ce8021 Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
2020-08-17tap: add gro supportMohsin Kazmi5-7/+61
Type: feature Change-Id: I5868dd267aa26aa97aec5fd70e70c5956ac52277 Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
2020-07-22virtio: add the buffer allocation errorMohsin Kazmi1-7/+13
Type: improvement Change-Id: I991e32d531719693c387db4ef93d04d4b562789d Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
2020-07-15virtio: fix the msix for multiqueueMohsin Kazmi2-15/+60
Type: fix Change-Id: Ie0cff37b474f8d85a3ae376e0f547a347fb1ad8a Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
2020-07-02tap: fix dump for TUN interfacesMohsin Kazmi1-0/+1
Type: fix Change-Id: I3bcc8ff1cf0a828ce3ba112694d38e3287d38d8d Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
2020-06-27virtio: add tx traceMohsin Kazmi1-2/+60
Type: improvement Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com> Change-Id: I0b1a1ce085ceb75fe139092e40878566682a7986
2020-06-24virtio: fix the vlib buffer flagsMohsin Kazmi1-2/+1
Type: fix Change-Id: I92e8e30e4175229e24dd92471016e9095b5cc83e Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
2020-06-16virtio: add vhost sw_if_index filter for sw_interface_vhost_user_dumpSteven Luong2-3/+6
The filter sw_if_index was in the API sw_interface_vhost_user_dump. But it was never implemented in the backend. This patch is to add the backend, vat, and custom dump support for the filter. Type: feature Signed-off-by: Steven Luong <sluong@cisco.com> Change-Id: Iaa41a7e11bfbcbb4c60092375e4b0dcf0950077b
2020-06-12virtio: interface type based improvementsMohsin Kazmi3-75/+142
Type: improvement Change-Id: I220ea6ab609e3c1628f5210be441d0d5e825a32c Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
2020-05-29docs: Minor updates to feature.yaml filesJohn DeNisco1-4/+5
Type: docs Signed-off-by: John DeNisco <jdenisco@cisco.com> Change-Id: Iba106d33d34766b91e46980e7237fbdfc3710b8b
2020-05-28tap: fix rx queue indexMohsin Kazmi1-1/+2
Type: fix Change-Id: I5601bdeb47d08118476ff7bd29435d2c1dba34b9 Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
2020-05-05gso: add support for IP-IPMohsin Kazmi2-11/+21
Type: feature Change-Id: I37752af8496e0042a1da91124f3d94216b39ff11 Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
2020-05-04tap: refactor existing flagsMohsin Kazmi1-5/+4
Type: refactor This patch refactor the existing flags and also add a new flag for packet coalescing. Change-Id: Ic826e4c81313f26d87c475cdf666b06cbed60a3a Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
2020-04-29devices: vhost: simplify string copies for GCC-10Benoît Ganne1-10/+5
GCC-10 increases string truncations warnings. Refactor string copies confusing it. Type: refactor Change-Id: I9720a0539059de00ab212ff2fc73055f04f5af1d Signed-off-by: Benoît Ganne <bganne@cisco.com>
2020-04-28tap: use one tap fd per rx queueAloys Augustin2-2/+5
This matches vhost queues to linux netdev queues and avoids random packet shuffling across vhost queues on rx. Change-Id: I9901689d361e440fb0b91c9fbaf8124ce525b316 Type: fix Signed-off-by: Aloys Augustin <aloaugus@cisco.com>
2020-04-27virtio: support virtio 1.1 packed ring in vhostSteven Luong8-156/+1604
virtio 1.1 defines a number of new features. Packed ring is among the most notable and important one. It combines used, available, and descripptor rings into one. This patch provides experimental support for packed ring. To avoid regression, when packed ring is configured for the interface, it is branched to a separate RX and TX driver. Non packed ring should continue to perform as it was before. Packed ring is tested using qemu4.2 and ubuntu focal fossa (kernel 5.4.0-12) on the guess VM which supports packed ring. To configure VPP with packed ring, just add the optional keyword "packed" when creating the vhost interface. To bring up the guest VM with packed ring, add "packed=on" in the qemu launch command. To facilitate troubleshooting, also added "verbose" option in show vhost desc CLI to include displaying the indirect descriptors. Known qemu reconnect issue - If VPP is restarted, guest VMs also need to be restarted. The problem is kernel virtio-net-pci keeps track of the previous available and used indices. For virtio 1.0, these indices are in shared memory and qemu can easily copy them to pass to the backend for reconnect. For virio 1.1, these indices are no longer in shared memory. Qemu needs a new mechanism to retrieve them and it is not currently implemented. So when the protocol reconnects, qemu does not have the correct available and used indices to pass to the backend. As a result, after the reconnect, virtio-net-pci is reading the TX ring from the wrong position in the ring, not the same position which the backend is writing. Similar problem exists also in the RX. Type: feature Signed-off-by: Steven Luong <sluong@cisco.com> Change-Id: I5afc50b0bafab5a1de7a6dd10f399db3fafd144c