History log of /vpp/src/vnet/devices/tap/
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
4834a66b 06-Jul-2020 Mohsin Kazmi <sykazmi@cisco.com>

tap: fix the tun sndbuf value for kernel 4.20 and later

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

86f281a8 30-Jun-2020 Mohsin Kazmi <sykazmi@cisco.com>

tap: fix dump for TUN interfaces

Type: fix

Change-Id: I3bcc8ff1cf0a828ce3ba112694d38e3287d38d8d
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>

add4a412 26-Jun-2020 Mohsin Kazmi <sykazmi@cisco.com>

tap: remove the bridge configurations for TUN interface

Type: fix

Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
Change-Id: Ifeae641ec0aa7de74e33e582234505bf6e28ca87

b660a0e5 05-Jun-2020 Mohsin Kazmi <sykazmi@cisco.com>

tap: enable gso/csum offload for tun

Type: improvement

Change-Id: I5b9d5ea192776f14a45bf909acc4bef7793521e8
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>

5bb3e81e 21-May-2020 John DeNisco <jdenisco@cisco.com>

docs: Minor updates to feature.yaml files

Type: docs

Signed-off-by: John DeNisco <jdenisco@cisco.com>
Change-Id: Iba106d33d34766b91e46980e7237fbdfc3710b8b

7784140f 29-Apr-2020 Dave Barach <dave@barachs.net>

misc: binary api fuzz test fixes

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

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

d88fc0fc 30-Apr-2020 Mohsin Kazmi <sykazmi@cisco.com>

tap: refactor existing flags

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>

073d74d0 27-Apr-2020 Paul Vinciguerra <pvinci@vinciconsulting.com>

tap: implement sw_interface_tap_v2_dump filtering by sw_if_index

Type: feature

Change-Id: I6f607f383dc77a71e8712124f7613b38b4ac065a
Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>

3d18fbf8 29-Apr-2020 Matthew Smith <mgsmith@netgate.com>

tap: allow deletion of tun interface

Type: improvement

tap_delete_if() returns early if the interface type is not
appropriate action for those interfaces.

Change-Id: I196b6d6f3f5e1543a14d6be76fd879d44c9794fd
Signed-off-by: Matthew Smith <mgsmith@netgate.com>

28adbb3a 29-Apr-2020 Mohsin Kazmi <sykazmi@cisco.com>

tap: fix missing "num-rx-queues" from cli help

Type: fix

Change-Id: Ib09c7cebb6978b3adc09ac36cb32f7947b143e51
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>

2857e785 16-Mar-2020 Aloys Augustin <aloaugus@cisco.com>

tap: use one tap fd per rx queue

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>

206acf84 06-Apr-2020 Mohsin Kazmi <sykazmi@cisco.com>

tap: add initial support for tun

Type: feature

Change-Id: I699a01ac925fe5c475a36032edb7018618bb4dd4
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>

547a6165 18-Mar-2020 Mohsin Kazmi <sykazmi@cisco.com>

tap: fix the numa/queue for buffers

Type: fix

Change-Id: Ib320171708bebde6d1dae0b2c665f9bcfc9102db
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>

b49bc1ae 14-Feb-2020 Mohsin Kazmi <sykazmi@cisco.com>

tap: add support for persistance

Type: feature

Change-Id: I775f53531972447ebae0d69b9e2dfeee84d115e5
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>

2dbee936 07-Feb-2020 Jakub Grajciar <jgrajcia@cisco.com>

api: improve api string safety

- Remove vl_api_from_api_string
to prevent use of not nul-terminated strings.
- Rename vl_api_from_api_to_vec -> vl_api_from_api_to_new_vec
to imply a new vector is created. NOT nul terminated.
- Add vl_api_from_api_to_new_c_string. Returns
nul terminated string in a new vector.
- Add vl_api_c_string_to_api_string. Convert nul terminated
string to vl_api_string_t
- Add vl_api_vec_to_api_string. Convert NON nul terminated
vector to vl_api_string_t

Type: fix

Signed-off-by: Jakub Grajciar <jgrajcia@cisco.com>
Change-Id: Iadd59b612c0d960a34ad0dd07a9d17f56435c6ea
Signed-off-by: Jakub Grajciar <jgrajcia@cisco.com>

9f32b6ac 14-Feb-2020 Mohsin Kazmi <sykazmi@cisco.com>

tap: fix the default parameter for num_rx_queues

Type: fix

Change-Id: I1a20fea56f1ba1fada7c7ce96ea333bf097b1273
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>

91592c0c 30-Jan-2020 Mohsin Kazmi <sykazmi@cisco.com>

tap: fix host mtu configuration setting

host mtu can't be set if tap interface is in namespace.
This patch fixes this issue.

Type: fix

Change-Id: I63811c4b56c708fe708061a8afbaec41994f08ca
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>

3039753e 30-Jan-2020 Mohsin Kazmi <sykazmi@cisco.com>

tap: fix the host mac address

Tap configuration code sets the host mac address
two time. This patch fixes it.

Type: fix

Change-Id: I7bebb9b7f25352a8a9a98bae6a0636757c0cea9c
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>

ba0061fe 18-Dec-2019 Mohsin Kazmi <sykazmi@cisco.com>

tap: split gso and checksum offload functionality

Type: refactor

Change-Id: I0d4b79ef384c11c841576d264bfd8ccb21783e10
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>

5de4fb70 03-Sep-2019 Jakub Grajciar <jgrajcia@cisco.com>

devices: tap API cleanup

Use consistent API types.

Type: fix

Change-Id: I11cc7f6347b7a60e5fd41e54f0c7994e2d81199f
Signed-off-by: Jakub Grajciar <jgrajcia@cisco.com>

39d69112 27-Nov-2019 Dave Barach <dave@barachs.net>

api: multiple connections per process

Type: feature

Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: I2272521d6e69edcd385ef684af6dd4eea5eaa953

3f5594d8 03-Dec-2019 Mohsin Kazmi <sykazmi@cisco.com>

gso: remove the interface count

Type: refactor

Change-Id: I51405b9d09fb6fb03d08569369fdd4e11c647908
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>

0d3d4824 25-Nov-2019 Andrew Yourtchenko <ayourtch@gmail.com>

tap: fix coverity warning 205875

check the return result from fcntl, and if error, behave
the same way the expansion of _IOCTL macro does.

Type: fix
Change-Id: I6d537d1bdedae64470612aef64b46e07387fe84b
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>

7c6102b1 08-Nov-2019 Damjan Marion <damarion@cisco.com>

tap: multiqueue support

Type: feature

Change-Id: I7dcc8c6911d02729b3bda1b3a21a211c82c3b949
Signed-off-by: Damjan Marion <damarion@cisco.com>

44d06916 30-Oct-2019 Paul Vinciguerra <pvinci@vinciconsulting.com>

tap: Move client registration check to top

Type: fix

Change-Id: I33dc4cf7b6c69f74c7bf4971ce59442678b878ef
Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>

39807d02 08-Nov-2019 Damjan Marion <damarion@cisco.com>

tap: add check for vhost-net backend

Type: feature

Change-Id: I402f4c88dee70fbb0b3b61dc4e0a4034d24d8b56
Signed-off-by: Damjan Marion <damarion@cisco.com>

0ba86cb1 08-Nov-2019 Damjan Marion <damarion@cisco.com>

tap: fix cli parser

Type: fix

Change-Id: I38ee9efd23774cce7790565825527cca9ba6f200
Signed-off-by: Damjan Marion <damarion@cisco.com>

6b0dd550 03-Nov-2019 Paul Vinciguerra <pvinci@vinciconsulting.com>

build: add yaml file linting to make checkstyle

Type: feature

fts and trex rely on yaml config files. Verify
that they are valid, so comitters can catch
errors early.

Change-Id: Ide0bb276659119c59bdbbc8b8155e37562a648b8
Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>

97c998c2 29-Oct-2019 Paul Vinciguerra <pvinci@vinciconsulting.com>

docs: devices-- add FEATURES.yaml

Type: docs

Change-Id: I039ba9ad5385452b202366fba0b367506a21ea4f
Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>

a069762e 05-Sep-2019 Mohsin Kazmi <sykazmi@cisco.com>

tap: revert clean-up when linux will delete the tap interface

Type: fix
Ticket: VPP-1766

revert e4ac48e792f4eebfce296cfde844ee73b1abd62f

Change-Id: I03feea4008a47859d570ad8d1d08ff3f30d139ef
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
(cherry picked from commit 623a1b7053424b539a51faf866ab839d3da3f45b)

ba0da570 21-Aug-2019 Lijian.Zhang <Lijian.Zhang@arm.com>

tap: fix tap interface not working on Arm issue

The VPP code tries to set all userspace memory in the table via IOCTL
to VHOST_SET_MEM_TABLE. But on aarch64, the userspace address range is
larger (48 bits) than that on x86 (47 bits). Below is an segment from

fffb41200000-fffb43a00000 rw-s 00000000 00:0e 532232
/anon_hugepage (deleted)

Instead of setting all userspace memory space to vhost-net, will only set
the address space reserved by pmalloc module during initialization.

Type: fix

Change-Id: I91cb35e990869b42094cf2cd0512593733d33677
Signed-off-by: Lijian Zhang <Lijian.Zhang@arm.com>
Reviewed-by: Steve Capper <Steve.Capper@arm.com>

19b697f3 29-Jul-2019 Mohsin Kazmi <sykazmi@cisco.com>

tap: fix segv when host-if-name is not given

Type: fix
Fixes: c30d87e6139c64eceade54972715b402c625763d

Change-Id: I86b606b18ff6a30709b7aff089fd5dd00103bd7f
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>

c5d5327a 01-Jul-2019 Mohsin Kazmi <sykazmi@cisco.com>

tap: print the interface name on cli when created

Type: feature

Change-Id: If11f00574322c35c1780c31d5f7b47d30e083e35
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>

3940de36 23-Jul-2019 Dave Barach <dave@barachs.net>

api: binary api cleanup

Multiple API message handlers call vnet_get_sup_hw_interface(...)
without checking the inbound sw_if_index. This can cause a
pool_elt_at_index ASSERT in a debug image, and major disorder in a
production image.

Given that a number of places are coded as follows, add an
"api_visible_or_null" variant of vnet_get_sup_hw_interface, which
returns NULL given an invalid sw_if_index, or a hidden sw interface:

- hw = vnet_get_sup_hw_interface (vnm, sw_if_index);
+ hw = vnet_get_sup_hw_interface_api_visible_or_null (vnm, sw_if_index);
if (hw == NULL || memif_device_class.index != hw->dev_class_index)
return clib_error_return (0, "not a memif interface");

Rename two existing xxx_safe functions -> xxx_or_null to make it
obvious what they return.

Type: fix

Change-Id: I29996e8d0768fd9e0c5495bd91ff8bedcf2c5697
Signed-off-by: Dave Barach <dave@barachs.net>

c30d87e6 15-Jul-2019 Benoît Ganne <bganne@cisco.com>

tap: fix memory errors with create/delete API

CLI allocates vectors consumed by tap_create_if(), whereas API pass
null-terminated C-strings allocated on API segment.
Do not try to be too clever here, and just allocate our own private

Type: fix
Fixes: 8d879e1a6bac47240a232893e914815f781fd4bf
Ticket: VPP-1724

Change-Id: I3ccdb8e0fcd4cb9be414af9f38cf6c33931a1db7
Signed-off-by: Benoît Ganne <bganne@cisco.com>

8d879e1a 27-Jun-2019 Benoît Ganne <bganne@cisco.com>

tap: fix memory errors in create/delete

If the host interface name is not specified at creation, host_if_name
was wrongly set to a stack-allocated variable. Make sure it always
points to a heap allocated vector.
At deletion time, we must free all allocated vectors.


Change-Id: I17751f38e95097998d51225fdccbf3ce3c365593
Signed-off-by: Benoît Ganne <bganne@cisco.com>

97d54ed4 10-Jun-2019 Mohsin Kazmi <sykazmi@cisco.com>

tap: add support to configure tap interface host MTU size

This patch adds support to configure host mtu size using
api, cli or startup.conf.

Type: feature

Change-Id: I8ab087d82dbe7dedc498825c1a3ea3fcb2cce030
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>

3f340175 27-May-2019 Mohsin Kazmi <sykazmi@cisco.com>

tap: crash in multi-thread environment

In tap tx routine, virtio_interface_tx_inline, there used to be an
interface spinlock to ensure packets are processed in an orderly fashion
clib_spinlock_lock_if_init (&vif->lockp);

When virtio code was introduced in 19.04, that line is changed to
clib_spinlock_lock_if_init (&vring->lockp);
to accommodate multi-queues.

Unfortunately, althrough the spinlock exists in the vring, it was never
initialized for tap, only for virtio. As a result, many nasty things can
happen when running tap interface in multi-thread environment. Crash is

The fix is to initialize vring->lockp for tap and remove vif->lockp as it
is not used anymore.

Change-Id: I82b15d3e9b0fb6add9b9ac49bf602a538946634a
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
(cherry picked from commit c2c89782d34df0dc7197b18b042b4c2464a101ef)

e4ac48e7 16-Apr-2019 Mohsin Kazmi <sykazmi@cisco.com>

tap: clean-up when linux will delete the tap interface

When container is deleted which has tap interface attached,
Linux also delete the tap interface leaving the VPP side of
tap. This patch does a clean up job to remove that VPP side
of tap interface.

To produce the behavior:
create tap
On linux:
sudo ip netns add ns1
sudo ip link set dev tap0 netns ns1
sudo ip netns del ns1

Change-Id: Iaed1700073a9dc64e626c1d0c449f466c143f3ae
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>

2a6861ff 15-Apr-2019 Mohsin Kazmi <sykazmi@cisco.com>

tap: fix the crash

Crash will happen when someone will try to setup a tap interface
in host namespace without providing the host side of tap interface
custom name. This patch fixes the problem by using the default name
in this case.

Change-Id: Ic1eaea5abd01bc6c766d0e0fcacae29ab7a7ec45
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>

2e1c8967 10-Apr-2019 Ole Troan <ot@cisco.com>

API: Fix shared memory only action handlers.

Some API action handlers called vl_msg_ai_send_shmem()
directly. That breaks Unix domain socket API transport.

A couple (bond / vhost) also tried to send a sw_interface_event
directly, but did not send the message to all that had
registred interest. That scheme never worked correctly.
Refactored and improved the interface event code.

Change-Id: Idb90edfd8703c6ae593b36b4eeb4d3ed7da5c808
Signed-off-by: Ole Troan <ot@cisco.com>

09a3bc50 02-Apr-2019 Mohsin Kazmi <sykazmi@cisco.com>

virtio: Add support for multiqueue

Change-Id: Id71ffa77e977651f219ac09d1feef334851209e1
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>

fe750c24 25-Mar-2019 Benoît Ganne <bganne@cisco.com>

Add RDMA ibverb driver plugin

RDMA ibverb is a userspace API to efficiently rx/tx packets. This is an
initial, unoptimized driver targeting Mellanox cards.
Next steps should include batching, multiqueue and additional cards.

Change-Id: I0309c7a543f75f2f9317eaf63ca502ac7a093ef9
Signed-off-by: Benoît Ganne <bganne@cisco.com>

3b0d7e42 15-Mar-2019 Ole Trøan <otroan@employees.org>

Revert "API: Cleanup APIs interface.api"

This reverts commit e63325e3ca03c847963863446345e6c80a2c0cfd.

Allow time for CSIT to accommodate.

Change-Id: I59435e4ab5e05e36a2796c3bf44889b5d4823cc2
Signed-off-by: ot@cisco.com

e63325e3 01-Mar-2019 Jakub Grajciar <jgrajcia@cisco.com>

API: Cleanup APIs interface.api

Use of consistent API types for interface.api

Change-Id: Ieb54cebb4ac96b432a3f0b41596718aa2f34885b
Signed-off-by: Jakub Grajciar <jgrajcia@cisco.com>

4a310d2b 21-Feb-2019 Steven Luong <sluong@cisco.com>

tapv2: coverity strikes back

while https://gerrit.fd.io/r/#/c/16590/ fixed the leaked fd which coverity
reported at that time, new coverity run reports simailar leaked fd in a
different goto punt path. It would be nice if coverity reported both of them
at the same time. Or perhaps it did and I just missed it. Anyway, the new fix
is to put the close (fd) statement prior to the return of tap_create_if routine
which should catch all goto's.

Change-Id: I0a51ed3710e32d5d74c9cd9b5066a667153e2f9d
Signed-off-by: Steven Luong <sluong@cisco.com>

6a7cff7e 12-Oct-2018 Andrew Yourtchenko <ayourtch@gmail.com>

tap gso: experimental support

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>

80659b46 31-Jan-2019 Mohsin Kazmi <sykazmi@cisco.com>

virtio: Use new buffer optimization

Change-Id: Ifc98373371b967c49a75989eac415ddda1dcf15f
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>

d6c15af3 23-Oct-2018 Mohsin Kazmi <sykazmi@cisco.com>

virtio: Native virtio driver

Change-Id: Id7fccf2f805e578fb05032aeb2b649a74c3c0e56
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>

754f24b3 07-Jan-2019 Andrew Yourtchenko <ayourtch@gmail.com>

tapv2: add "tap_flags" field to the TAPv2 interface API

Change-Id: I26f99d95f52c9fe107d17dcbbf5c6185523beade
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>

27ca2982 21-Dec-2018 Steven <sluong@cisco.com>

tapv2: coverity woe

coverity complains about fd leaking inside the if statement because there is
a goto which bypasses the statement close (fd).

The fix is to close (fd) immediately after it is no longer used.

Change-Id: Ic5035b07ec1f179ff3db77744843e47aa8067a3c
Signed-off-by: Steven <sluong@cisco.com>

b7b92993 17-Oct-2018 Dave Barach <dave@barachs.net>

c11 safe string handling support

Change-Id: Ied34720ca5a6e6e717eea4e86003e854031b6eab
Signed-off-by: Dave Barach <dave@barachs.net>

d600ffe1 18-Jun-2018 Ian Wells <iawells@cisco.com>

Update tapv2 documentation

The documentation in the API file says that 0xffff == 'no interface
ID specified' but the code tests against ~(u32)0.

Change-Id: I5cd83d876c3ad4f53a5b01463299d4fcb806ea98
Signed-off-by: Ian Wells <iawells@cisco.com>

0b061112 04-Jun-2018 Jerome Tollet <jtollet@cisco.com>

VPP-1305: Add support for tags

Change-Id: I9e759037295fe675abe426e565a562b1ec1e7d33
Signed-off-by: Jerome Tollet <jtollet@cisco.com>

a23b615a 17-May-2018 Mohsin Kazmi <sykazmi@cisco.com>

tap: remove the local vlib_log_info definition

Change-Id: Idff55a19d27fed0d57e222f38d2e16c5367911cb
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>

cbe8d650 27-Apr-2018 Neale Ranns <nranns@cisco.com>

TAP memory leaks:

1 - use bit-map to re-use ID values and thus VLIB nodes
2 - free vrings
3 - free hw_address on HW interface delete (a HW * struct is memset on pool_get)
4 - free temporary node names during TX node setup

Change-Id: Id114c8bb9c844fd4ceb02fbbeb4b511ecfeb61ce
Signed-off-by: Neale Ranns <nranns@cisco.com>

07a38572 21-Jan-2018 Damjan Marion <damarion@cisco.com>

Add logging support

Change-Id: Ieac9cf50156dbbb4962411e900d59256441915ef
Signed-off-by: Damjan Marion <damarion@cisco.com>
Signed-off-by: Klement Sekera <ksekera@cisco.com>

074f698b 31-Mar-2018 Steven <sluong@cisco.com>

tapv2: Sporadic SIGABRT in ethernet_input [VPP-1183]

virtio_free_rx_buffers uses the wrong slot in the vring to get
the buffer index. It uses desc_next. It should be last_used_idx
which is the slot number for the first valid descriptor.

Change-Id: I6b62b794f06869fbffffce45430b8b2e37b1266c
Signed-off-by: Steven <sluong@cisco.com>

9e635696 01-Mar-2018 Steven <sluong@cisco.com>

tapv2: CLI and binary API fixes

1. When interface create encouners an error (see test below),
the same id cannot be used again.
This is due to hash_set is called too early in the function. After the
hash entry is set, there are different errors may cause the interface
create to be aborted. But we didn't remove the hash entry when error is
encountered. The fix is to move the hash_set call near the end which has
no more "goto error"

DBGvpp# create tap id 1 rx-ring-size 1021 tx-ring-size 1021
create tap id 1 rx-ring-size 1021 tx-ring-size 1021
create tap: ring size must be power of 2
DBGvpp# create tap id 1 rx-ring-size 1024 tx-ring-size 1024
create tap id 1 rx-ring-size 1024 tx-ring-size 1024
create tap: interface already exists

2. multiple issues exist with api_format.c with the below command

binary-api tap_create_v2 id 4 hw-addr 90:e2:ba:76:cf:2f rx-ring-size 1024 tx-ring-size 1024

- hw_addr is not taken due to the test for random mac is inverted
- id is an integer, not a string
- integer values were not converted to network format

Change-Id: I5a669d702a80ad158517df46f0ab089e4d0d692e
Signed-off-by: Steven <sluong@cisco.com>

0b856733 28-Feb-2018 Steven <sluong@cisco.com>

tapv2: abort in tap_create_if (VPP-1179)

The following command sequences cause the crash:

create tap id 0 rx-ring-size 1024 tx-ring-size 1024
create tap id 1 rx-ring-size 1024 tx-ring-size 1024
set interface state tap0 up
set interface state tap1 up
delete tap tap0
delete tap tap1
create tap id 0 rx-ring-size 1024 tx-ring-size 1024

0: /home/sluong/vpp2/vpp/build-data/../src/vnet/interface_funcs.h:46
(vnet_get_hw_interface) assertion `! pool_is_free (vnm->interface_main.hw_interfaces, _e)' fails

The reason for the crash is because when the tap interface is deleted,
the code does not remove the entry from the device queue. But the interface
is deleted anyway from vnet_main.interface_main.hw_interfaces.
When an interface is created again, it may encounter
the deleted entry in the device queue and crash. Notice create and delete a
single entry does not cause a crash. Need to create and delete 2 interfaces
to create a "hole" in the device queue.

Change-Id: I42ce0b7943d73b3eab32a16751a0a3183de62d9f
Signed-off-by: Steven <sluong@cisco.com>

829ee539 16-Feb-2018 Damjan Marion <damarion@cisco.com>

virtio: add missing tx lock when running multithreaded

Change-Id: I373f429c53c6f66ad38322addcfaccddb7761392
Signed-off-by: Damjan Marion <damarion@cisco.com>

9d420871 12-Oct-2017 Ole Troan <ot@cisco.com>

VPPAPIGEN: vppapigen replacement in Python PLY.

This is a version of the VPP API generator in Python PLY. It supports
the existing language, and has a plugin architecture for generators.
Currently C and JSON are supported.

- vl_api_version to option version = "major.minor.patch"
- enum support
- Added error checking and reporting
- import support (removed the C pre-processor)
- services (tying request/reply together)

option version = "1.0.0";

enum colours {
BLUE = 50,
define foo {
vl_api_colours_t colours;

service {
rpc foo returns foo_reply;
rpc foo_dump returns stream foo_details;
rpc want_stats returns want_stats_reply
events ip4_counters, ip6_counters;

Future planned features:
- unions
- bool, text
- array support (including length)
- proto3 output plugin
- Refactor C/C++ generator as a plugin
- Refactor Java generator as a plugin

Change-Id: Ifa289966c790e1b1a8e2938a91e69331e3a58bdf
Signed-off-by: Ole Troan <ot@cisco.com>

7866c459 18-Jan-2018 Damjan Marion <damarion@cisco.com>

tapv2: add option to set host-side default gw

Change-Id: I76fd655ecd9445299b94b3b5af10e7b1588584e4
Signed-off-by: Damjan Marion <damarion@cisco.com>

a624dbe7 09-Jan-2018 Steven <sluong@cisco.com>

tapv2: deleting tap interface may leak buffers (VPP-1124)

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)

6c4dae27 09-Jan-2018 Florin Coras <fcoras@cisco.com>

api: remove transport specific code from handlers

This does not update api client code. In other words, if the client
assumes the transport is shmem based, this patch does not change that.
Furthermore, code that checks queue size, for tail dropping, is not

Done for the following apis:
- acl
- gtpu
- memif
- nat
- pppoe
- bfd
- bier
- tapv2
- vhost user
- dhcp
- flow
- geneve
- ip
- punt
- ipsec/ipsec-gre
- l2
- l2tp
- lisp-cp/one-cp
- lisp-gpe
- map
- mpls
- policer
- session
- span
- udp
- tap
- vxlan/vxlan-gpe
- interface
- api/api.c
- oam_api.c
- stats.c

Change-Id: I0e33ecefb2bdab0295698c0add948068a5a83345
Signed-off-by: Florin Coras <fcoras@cisco.com>

e86a8edd 05-Jan-2018 Florin Coras <fcoras@cisco.com>

api: refactor vlibmemory

- separate client/server code for both memory and socket apis
- separate memory api code from generic vlib api code
- move unix_shared_memory_fifo to svm and rename to svm_fifo_t
- overall declutter

Change-Id: I90cdd98ff74d0787d58825b914b0f1eafcfa4dc2
Signed-off-by: Florin Coras <fcoras@cisco.com>

73e7f427 14-Dec-2017 Milan Lenco <milan.lenco@pantheon.tech>

tap_v2: include host-side parameters in the dump binary API

Change-Id: I097a738b96a304621520f1842dcac7dbf61a8e3f
Signed-off-by: Milan Lenco <milan.lenco@pantheon.tech>

76dc22ce 05-Dec-2017 Swarup Nayak <swarupnpvt@gmail.com>

call unformat_free in some flow, remove unnecessary calls

Change-Id: I565277eafbce3d4f59a7f0d497fca1c4fed3cfc8
Signed-off-by: Swarup Nayak <swarupnpvt@gmail.com>

4e671d20 09-Dec-2017 Damjan Marion <damarion@cisco.com>

tap_v2: fix issues reported by coverity

Change-Id: I1bbd3f6ece255edfd4ebf268ac60f79dce1d10e7
Signed-off-by: Damjan Marion <damarion@cisco.com>

2df39094 04-Dec-2017 Damjan Marion <damarion@cisco.com>

tapv2: multiple improvements

- 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>

2aef64f0 04-Dec-2017 Milan Lenco <milan.lenco@pantheon.tech>

tap_v2: convert ring size from network to host order

Change-Id: Ica1be5c75c83ac64c7063bfeff1f4d00702a00e1
Signed-off-by: Milan Lenco <milan.lenco@pantheon.tech>

c99b4cd1 04-Dec-2017 Damjan Marion <damarion@cisco.com>

tap_v2: move code to vnet/devices/tap

virtio backend stays in vnet/devices/virtio

Change-Id: Idbf04f1c645a809ed408670ba330662859fe9309
Signed-off-by: Damjan Marion <damarion@cisco.com>