summaryrefslogtreecommitdiffstats
path: root/src/vnet/devices/tap
AgeCommit message (Collapse)AuthorFilesLines
2023-06-27api: tapv2 - Mark old message versions as deprecatedOndrej Fabry1-0/+4
List of changed messages: - tap_create_v2 - tap_create_v2_reply This change is part of VPP API cleanup initiative. Type: fix Signed-off-by: Ondrej Fabry <ofabry@cisco.com> Change-Id: I7b1b22cc4a0e31f5c19fe48e7a0f30631576f9df
2023-04-12misc: change of addressMohsin Kazmi1-1/+1
Type: style Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com> Change-Id: Ie02d068122ab8f2c6049754f28722d851ae9b3f1
2022-04-05tap: fix the coverity warningMohsin Kazmi1-1/+1
Type: fix Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com> Change-Id: I609fb28e58286ff490d12384b03dd713830379b3
2022-03-02tap: fix tun set mtuBenoît Ganne1-1/+1
Type: fix Fixes: 1cd0e5dd533f4209dde453eaa43215e52cd42985 Change-Id: I64318585fb3b12369b78735c681f3b747c67b53b Signed-off-by: Benoît Ganne <bganne@cisco.com>
2022-03-01virtio: refactor codeMohsin Kazmi1-6/+6
Type: refactor Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com> Change-Id: I3788cc857023fafcc8eb6d6ff4524425026a75d8
2022-02-18vnet: add set_max_frame_size callbacks for several interfacesArtem Glazychev1-0/+9
This is required after distinguishing between max_frame_size and MTU Type: fix Signed-off-by: Artem Glazychev <artem.glazychev@xored.com> Change-Id: Ie642bee4e30ca76903bb8be5eeb6914c2c09bf35
2022-01-18virtio: remove admin-up flag during interface creationMohsin Kazmi1-1/+0
Type: fix During the interface creation time, (by default) admin-up flag is locally set for tap and virtio interfaces. While, in VPP the state of these interfaces are still admin-down. User needs to explicitly call 'set interface state <interface-name> up' to admin-up the newly created tap or virtio interface(s) in VPP. So, this behavior is inconsistent. This patch fixes the issue to have consistent behavior for given interface between local and global administration state. Change-Id: Ifd8904a09fbdbe7b386874ac3231dc0527064518 Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
2022-01-18vnet: distinguish between max_frame_size and MTUDamjan Marion1-6/+4
Type: improvement Change-Id: I3659de6599f402c92e3855e3bf0e5e3388f2bea0 Signed-off-by: Damjan Marion <damarion@cisco.com>
2022-01-10interface: refactor interface capabilities code, part 2Damjan Marion1-29/+29
Type: improvement Signed-off-by: Damjan Marion <damarion@cisco.com> Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com> Change-Id: Ie595e69af8657b0ee18a84ac71c5d433108d9ef8
2022-01-07ethernet: new interface registration functionDamjan Marion1-10/+6
Prep for supporting multiple callbacks, optional args, etc. Type: improvement Change-Id: I96244c098712e8213374678623f12527b0e7f387 Signed-off-by: Damjan Marion <damarion@cisco.com>
2022-01-06tap: add num_tx_queues APINathan Skrzypczak5-5/+181
This adds a create_tap_v3 api that has a num_tx_queues parameter allowing to create more than num_workers queues, following on multi TX support Type: feature Change-Id: Idce433147e8dd165f842241d6c76e041e1b1c9b8 Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
2022-01-05interface: refactor interface capabilities codeDamjan Marion1-16/+12
Make it shorter to type, easier to debug, make adding callbacks in future simpler. Type: improvement Change-Id: I6cdd6375e36da23bd452a7c7273ff42789e94433 Signed-off-by: Damjan Marion <damarion@cisco.com>
2021-12-14virtio: integrate with new tx infraMohsin Kazmi1-0/+4
Type: improvement Change-Id: I337ec63d0868f665329d68eadf1744e080b73a0d Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
2021-12-03interface: add multi tx-queues support for new tx infraMohsin Kazmi1-4/+2
Type: feature Change-Id: I231f782b3c56dc2b10321e4569ac7acdad1c11da Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
2021-10-28tap: handle null namespace and bridge correctlyMatthew Smith1-2/+4
Type: fix In tap_create_if(), if args->host_namespace or args->host_bridge are null because no values were set for those, the virtio_if_t entry in virtio_main.interfaces ends up getting populated with values of "(nil)" in net_ns or host_bridge, respectively. Check whether args->host_namespace and args->host_bridge are null before trying to set the corresponding fields on virtio_if_t. Change-Id: I8e1e66a6d7b246e7c66fece406d116ffb1312c64 Signed-off-by: Matthew Smith <mgsmith@netgate.com>
2021-10-05tap: free the tap_fds vec on interface deletionMohsin Kazmi1-0/+1
Type: fix Tap fds are stored in vector array but deleting tap was not freeing this vector. This patch fixes it. Change-Id: I5228e3b9f432c69cf2656b2ee7402360d775964b Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
2021-09-29tap: Fix tap create with nsNathan Skrzypczak1-55/+24
This fixes the interface creation passing a netns. [0] made the renaming of the new tuntap interface before switching netns Thus, preventing creating an interface in another netns if one exists in VPP's netns with the same name. This also fixes restore netns on errors Type: fix [0] https://gerrit.fd.io/r/c/vpp/+/33696 Change-Id: I5c83bb37d664057bcf231cd0c636f0e51aa542ad Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
2021-09-27tap: move the api msg_id_base to tap_main_tMohsin Kazmi2-3/+3
Type: fix Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com> Change-Id: Ia4065550a7ad1109e3a2592ef2c21b5e23fa85b5
2021-09-22tap: remove cxq_vring from tap/tunMohsin Kazmi1-1/+0
Type: fix virtio_if_t is shared data struct between tap, tun and virtio pci. cxq_vring is virtio pci specific element. It shouldn't be set or accessed in tap driver. Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com> Change-Id: I8b34570f61b38d8b9d79d5b0669bda0f89ebc28c
2021-09-15tap: set device name on creation via TUNSETIFFDuncan Eastoe1-17/+8
Type: fix Currently when a new TAP/TUN device is created from tap_create_if() via the TUNSETIFF ioctl(), a name is allocated by the kernel (eg. tap0). If the caller supplied a name this is subsequently set via netlink, after the device has been created. Now we request the kernel to create the new device with the caller's requested name in the first instance, thus avoiding the need to rename the device, and therefore avoiding a window where the device exists with a different name. This can be beneficial, for example, when writing systemd-udevd link files [1]. Having the TAP/TUN devices created with the requested name ensures they can be correctly matched by the OriginalName option. Writing link files might be necessary, for example, to avoid VPP and systemd-udevd racing to set the MAC address on a newly created TAP interface. systemd-udevd can be configured to not manipulate the MAC addresses of matched interfaces. These changes also resolve an issue where the created device would not be renamed if the caller requested it be moved to a different network namespace, since vnet_netlink_set_link_name() was not called in that case. [1] https://www.freedesktop.org/software/systemd/man/systemd.link.html Signed-off-by: Duncan Eastoe <duncan@graphiant.com> Change-Id: I3d657632856d03979d6b914225c3c841c379e0a1
2021-07-22vppinfra: add abstract socket & netns fnsNathan Skrzypczak1-32/+14
* Add clib_socket_init support for abstract sockets if name starts with an '@' * Add clib_socket_init_netns to open socket in netns * Add clib_netns_open Type: feature Change-Id: I89637ad657c702ec38ddecb5c03a1673d0dfb104 Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
2021-07-08tap: Set the MTU on the TUN deivceNeale Ranns1-0/+13
Type: fix For a TAP device the MTU is set via the ethernet_register for TUN we need to do it explicitly (like we do for other tunnel types). Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com> Signed-off-by: Neale Ranns <neale@graphiant.com> Change-Id: Ie6a13c795acb35b53f8d99b05c70c3e73a7b428e
2021-06-22devices: tapv2 api cleanupFilip Tehlar1-49/+12
Use autogenerated code. Does not change API definitions. Type: improvement Signed-off-by: Filip Tehlar <ftehlar@cisco.com> Change-Id: I0a2c1cbbe798ddf9d08da78bf0b458a0f54fa13a
2021-03-19interface: add capabilities flagsMohsin Kazmi1-22/+16
Type: improvement This patch adds flags to represent the modern NICs capabilities. Change-Id: I96d38d9ab7eac55974d72795cd100d8337168e1e Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
2021-01-21interface: rx queue infra rework, part oneDamjan Marion1-12/+1
Type: improvement Change-Id: I4008cadfd5141f921afbdc09a3ebcd1dcf88eb29 Signed-off-by: Damjan Marion <damarion@cisco.com>
2020-12-14misc: move to new pool_foreach macrosDamjan Marion2-6/+4
Type: refactor Change-Id: Ie67dc579e88132ddb1ee4a34cb69f96920101772 Signed-off-by: Damjan Marion <damarion@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 Smith2-0/+43
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-10-29tap: fix the segvMohsin Kazmi1-2/+5
Type: fix Change-Id: I53cb96950f8658d7159fb0bd8ecfa50b6977e5af Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
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-17tap: replaces strlen to vec_lenMohsin Kazmi1-4/+4
Type: fix Change-Id: I478b6fc54c47f0e77a1470ed29fdd56774671441 Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
2020-10-08interface: shorten vnet_hw_if_rx_modeDamjan Marion1-1/+1
This is part of bigger refactor. Type: refactor Change-Id: I6fc2c0a1e2d217a70952901bcf775b8485bd3c20 Signed-off-by: Damjan Marion <damarion@cisco.com>
2020-09-28virtio: fix the gro enable/disable on tx-vringsMohsin Kazmi2-3/+1
Type: fix Change-Id: I96c30baaf34fe7b0cd899966a507501e58cde934 Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
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-04virtio: remove kernel virtio header dependenciesMohsin Kazmi2-10/+6
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
2020-09-02tap: add virtio 1.1 API flagMohsin Kazmi3-2/+10
Type: feature Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com> Change-Id: I3e00deb94943c545d1649865b2efdf7d51b90f4d
2020-08-17tap: add gro supportMohsin Kazmi3-7/+26
Type: feature Change-Id: I5868dd267aa26aa97aec5fd70e70c5956ac52277 Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
2020-07-07tap: fix the tun sndbuf value for kernel 4.20 and laterMohsin Kazmi1-4/+16
Type: fix From kernel 4.20, xdp support has been added in tun_sendmsg. If sndbuf == INT_MAX, kernel executes xdp data path for tun driver which assumes packets are ethernet frames. This patch is avoiding the xdp data path in kernel by setting the sendbuf value < INT_MAX. Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com> Change-Id: Ia4aa54b177b96d56a2d513d18d26ca01d5b88929
2020-07-02tap: fix dump for TUN interfacesMohsin Kazmi1-1/+4
Type: fix Change-Id: I3bcc8ff1cf0a828ce3ba112694d38e3287d38d8d Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
2020-06-27tap: remove the bridge configurations for TUN interfaceMohsin Kazmi1-9/+10
Type: fix Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com> Change-Id: Ifeae641ec0aa7de74e33e582234505bf6e28ca87
2020-06-09tap: enable gso/csum offload for tunMohsin Kazmi1-7/+0
Type: improvement Change-Id: I5b9d5ea192776f14a45bf909acc4bef7793521e8 Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
2020-05-29docs: Minor updates to feature.yaml filesJohn DeNisco1-2/+3
Type: docs Signed-off-by: John DeNisco <jdenisco@cisco.com> Change-Id: Iba106d33d34766b91e46980e7237fbdfc3710b8b
2020-05-04misc: binary api fuzz test fixesDave Barach1-1/+1
Add a hook to src/vlibapi/api_shared.c to fuzz (screw up) binary API messages, e.g. by xoring random data into them before processing. We specifically exempt client connection messages, and inband debug CLI messages. We step over msg_id, client index, client context, and sw_if_index. Otherwise, "make test" vectors fail too rapidly to learn anything. The goal is to reduce the number of crashes caused to zero. We're fairly close with this patch. Add vl_msg_api_max_length(void *mp), which returns the maximum plausible length for a binary API message. Use it to hardern vl_api_from_api_to_new_vec(...) which takes an additional argument - message pointer - so it can verify that astr->length is sane. If it's not sane, return a u8 *vector of the form "insane astr->length nnnn\0". Verify array lengths in vl_api_dhcp6_send_client_message_t_handler(...) and vl_api_dhcp6_pd_send_client_message_t_handler(...). Add a fairly effective binary API fuzz hook to the unittest plugin, and modify the "make test" framework.py to pass "api-fuzz { on|off }" to enable API fuzzing: "make API_FUZZ=on TEST=xxx test-debug" or similar Type: improvement Signed-off-by: Dave Barach <dave@barachs.net> Change-Id: I0157267652a163c01553d5267620f719cc6c3bde
2020-05-04tap: refactor existing flagsMohsin Kazmi3-12/+26
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-05-01tap: implement sw_interface_tap_v2_dump filtering by sw_if_indexPaul Vinciguerra3-13/+12
Type: feature Change-Id: I6f607f383dc77a71e8712124f7613b38b4ac065a Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
2020-04-30tap: allow deletion of tun interfaceMatthew Smith1-2/+5
Type: improvement tap_delete_if() returns early if the interface type is not VIRTIO_IF_TYPE_TAP. Allow VIRTIO_IF_TYPE_TUN also and take appropriate action for those interfaces. Change-Id: I196b6d6f3f5e1543a14d6be76fd879d44c9794fd Signed-off-by: Matthew Smith <mgsmith@netgate.com>
2020-04-29tap: fix missing "num-rx-queues" from cli helpMohsin Kazmi1-6/+6
Type: fix Change-Id: Ib09c7cebb6978b3adc09ac36cb32f7947b143e51 Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
2020-04-28tap: use one tap fd per rx queueAloys Augustin1-33/+59
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-17tap: add initial support for tunMohsin Kazmi4-22/+118
Type: feature Change-Id: I699a01ac925fe5c475a36032edb7018618bb4dd4 Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>