From a1a2246eab0269f3ee330d3866fba44e29a31639 Mon Sep 17 00:00:00 2001 From: Mohsin Kazmi Date: Wed, 2 Sep 2020 11:59:37 +0000 Subject: tap: add the static assert for api flags Type: improvement Signed-off-by: Mohsin Kazmi Change-Id: Ia1276d00dded36ee28b4b2e93b4cc7c1df6b1eef --- src/vnet/devices/tap/tapv2_api.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'src/vnet') diff --git a/src/vnet/devices/tap/tapv2_api.c b/src/vnet/devices/tap/tapv2_api.c index 5aca93ec310..ea618521aa4 100644 --- a/src/vnet/devices/tap/tapv2_api.c +++ b/src/vnet/devices/tap/tapv2_api.c @@ -126,6 +126,25 @@ vl_api_tap_create_v2_t_handler (vl_api_tap_create_v2_t * mp) ap->host_mtu_set = 1; } + STATIC_ASSERT (((int) TAP_API_FLAG_GSO == (int) TAP_FLAG_GSO), + "tap gso api flag mismatch"); + STATIC_ASSERT (((int) TAP_API_FLAG_CSUM_OFFLOAD == + (int) TAP_FLAG_CSUM_OFFLOAD), + "tap checksum offload api flag mismatch"); + STATIC_ASSERT (((int) TAP_API_FLAG_PERSIST == (int) TAP_FLAG_PERSIST), + "tap persist api flag mismatch"); + STATIC_ASSERT (((int) TAP_API_FLAG_ATTACH == (int) TAP_FLAG_ATTACH), + "tap attach api flag mismatch"); + STATIC_ASSERT (((int) TAP_API_FLAG_TUN == (int) TAP_FLAG_TUN), + "tap tun api flag mismatch"); + STATIC_ASSERT (((int) TAP_API_FLAG_GRO_COALESCE == + (int) TAP_FLAG_GRO_COALESCE), + "tap gro coalesce api flag mismatch"); + STATIC_ASSERT (((int) TAP_API_FLAG_PACKED == (int) TAP_FLAG_PACKED), + "tap packed api flag mismatch"); + STATIC_ASSERT (((int) TAP_API_FLAG_IN_ORDER == + (int) TAP_FLAG_IN_ORDER), "tap in-order api flag mismatch"); + ap->tap_flags = ntohl (mp->tap_flags); tap_create_if (vm, ap); -- cgit 1.2.3-korg