summaryrefslogtreecommitdiffstats
path: root/src/vnet/devices
AgeCommit message (Collapse)AuthorFilesLines
2021-01-27vhost: vhost interface hardware address not setSteven Luong3-6/+9
The check args->hwaddr is always true and it always copies the mac address from args->hwaddr even though none was set. Check args->use_custom_mac instead. Type: fix Fixes: gerrit 29970 Signed-off-by: Steven Luong <sluong@cisco.com> Change-Id: I0c51bf1ea79b02c4fbdc3c52e694f186bdd96600
2021-01-26interface: remove vnet_device_input_runtime_tMohammed Hawari2-314/+1
Change-Id: I85a463b4ca15baf11e3eb70189f5190ba2585170 Type: refactor Signed-off-by: Mohammed Hawari <mohammed@hawari.fr>
2021-01-22devices: adapt af_packet to new rxq frameworkMohammed Hawari3-32/+32
Change-Id: If8077280cef501599f810ad9255efa2a5a451ced Signed-off-by: Mohammed Hawari <mohammed@hawari.fr> Type: improvement
2021-01-21interface: rx queue infra rework, part oneDamjan Marion10-175/+130
Type: improvement Change-Id: I4008cadfd5141f921afbdc09a3ebcd1dcf88eb29 Signed-off-by: Damjan Marion <damarion@cisco.com>
2021-01-08vhost: Add event index for interrupt notification to driverSteven Luong8-192/+506
VPP only supports a poor man's approach for interrupt notification to the driver. It uses a simple binary flag for "interrupt needed" or "interrupt not needed". Most drivers support more sophisticated event index already. This feature is to add the long due missing feature and make it configurable, off by default. Type: feature Signed-off-by: Steven Luong <sluong@cisco.com> Change-Id: I68dab7dd07045cafb49af97b7f70db9b8131ae03
2021-01-05tap: fix the buffering index for groMohsin Kazmi1-6/+8
Type: fix Fixes: 587f9130424fd451e4ba823240d02f655fb197d1 Change-Id: Ia1739fad6a36fa658aece157d7adea8bbaa751d2 Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
2020-12-28vlib: add missing file template descriptionsPaul Vinciguerra1-0/+4
Add descriptions to clib_file_t template structures so that sockets can be identified via the 'show unix file' cli command. Type: fix Change-Id: Ibf82d55aa6c7b1126bd252b76d0dc8b7076f5046 Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
2020-12-25virtio: Extend vhost multi-queues support beyond 8 queue pairsSteven Luong3-60/+122
Current vhost multi-queues support has a hard limit of 8 queue pairs due to static vring array. This limit was raised in qemu. VPP should support more than 8 queue pairs also. Change static vring allocation to dynamic. When the interface is created, we allocate 8 queue pairs to begin with. We also keep track of how many queue pairs that the interface actually uses. We reply VHOST_USER_GET_QUEUE_NUM with 128 as our maximum number of support queue pair. When qemu starts initializing queue pair greater than 8, we expand the vrings as needed on demand. Type: improvement Signed-off-by: Steven Luong <sluong@cisco.com> Change-Id: I4a02d987d52d1bbe601b00e71f650fe6ebfcc0d7
2020-12-14misc: move to new pool_foreach macrosDamjan Marion8-39/+32
Type: refactor Change-Id: Ie67dc579e88132ddb1ee4a34cb69f96920101772 Signed-off-by: Damjan Marion <damarion@cisco.com>
2020-12-14vppinfra: simpler and faster pool_foreachDamjan Marion1-0/+1
- reduces number of instructions generated 4 times compared to old code - adds pool_foreach2 which is more friendly to clang-format Type: improvement Change-Id: I51e9c7fb09655c60d883987dadf5b2666c12b3f7 Signed-off-by: Damjan Marion <damarion@cisco.com>
2020-12-11virtio: fix vrings overflow in vhost_userBenoît Ganne1-1/+10
Type: fix Change-Id: I7ca955882c0e263a9ace4b14021e51488564e411 Signed-off-by: Benoît Ganne <bganne@cisco.com>
2020-12-04virtio: fix the interrupt handling for packed queuesMohsin Kazmi1-5/+25
Type: fix Change-Id: I2cc1cfd519e5b3502c59cf72e95e454f9122b8e5 Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
2020-12-04virtio: fix the len offsetMohsin Kazmi1-2/+2
Type: fix Change-Id: I8ce1df5c97941fb645b33476db9cfc74f1395b15 Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
2020-12-03virtio: fix the offloads in tx pathMohsin Kazmi1-4/+2
Type: fix Change-Id: I1f1f0b6e8c5ef8bc9f2aca4bdc78e89fa951b841 Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
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-12devices: remove unused codeDamjan Marion1-7/+0
Type: refactor Change-Id: I3f561818bc7c221f676477a52c7c7781624c185a Signed-off-by: Damjan Marion <damarion@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 Ganne3-19/+20
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-09tap: add function to set speedAlexander Chernavin2-1/+83
A plugin can set the speed on a host interface making it possible for host applications to be aware of the actual interface speed, not the one that the driver reports by default. With this change, add a function to set speed on a host interface. Type: feature Signed-off-by: Alexander Chernavin <achernavin@netgate.com> Change-Id: I259a52b736022bdd805e8d92dcd1bfd5c58f6f96
2020-11-05tap: allow change of carrier state on hostMatthew Smith4-0/+45
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-29tap: fix the segvMohsin Kazmi1-2/+5
Type: fix Change-Id: I53cb96950f8658d7159fb0bd8ecfa50b6977e5af Signed-off-by: Mohsin Kazmi <sykazmi@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-22tap: fix the api for use of vec_lenMohsin Kazmi1-3/+8
Type: fix Fixes: 03b76a20c569b8275beb8783691300a7d66b54a4 Change-Id: Ife788974cb7b2c35f40a017dd195dc2f7ee797b4 Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
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-17tap: replaces strlen to vec_lenMohsin Kazmi1-4/+4
Type: fix Change-Id: I478b6fc54c47f0e77a1470ed29fdd56774671441 Signed-off-by: Mohsin Kazmi <sykazmi@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 Marion9-44/+41
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 Kazmi4-10/+23
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-18tap: do not use strlen on vectorVladimir Isaev1-2/+1
sanitizer complains about strlen on hi->name in tap_dump_ifs. hi->name is a vector which is not null-terminated, so use vec_len. Type: fix Signed-off-by: Vladimir Isaev <visaev@netgate.com> Change-Id: Icdd5f65369bb51b0c4a9cd86c24899e6febd837c
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-09interface: support configuring RSS steering queuesChenmin Sun1-2/+0
This patch adds the RSS steering queues set interface, and it's implementation in DPDK device: /* Interface to set rss queues of the interface */ typedef clib_error_t *(vnet_interface_rss_queues_set_t) (struct vnet_main_t * vnm, struct vnet_hw_interface_t * hi, clib_bitmap_t *bitmap); This patch also introduces a command line to set the RSS queues: set interface rss queues <interface> <list <queue-list>> To display the rss queues, use "show hardware-interfaces" Below is the example to configure rss queues for interface Gig0: vpp# set interface rss queues Gig0 list 0,2,4-7 vpp# show hardware-interfaces brief Name Idx Link Hardware VirtualFunctionEthernet18/1/0 1 down VirtualFunctionEthernet18/1/0 Link speed: unknown RSS queues: 0 2 4 5 6 7 local0 0 down local0 Link speed: unknown vpp# Users can also configure the rss queues on a dpdk interface in startup.conf: dpdk { dev 0000:18:01.0 { rss-queues 0,2,5-7 } } Type: feature Signed-off-by: Chenmin Sun <chenmin.sun@intel.com> Change-Id: I1835595a1c54016a84eabee9fd62ce137935385d
2020-09-04virtio: remove kernel virtio header dependenciesMohsin Kazmi17-393/+478
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-02tap: add the static assert for api flagsMohsin Kazmi1-0/+19
Type: improvement Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com> Change-Id: Ia1276d00dded36ee28b4b2e93b4cc7c1df6b1eef