diff options
author | Mohsin Kazmi <sykazmi@cisco.com> | 2020-04-30 19:05:56 +0200 |
---|---|---|
committer | Damjan Marion <dmarion@me.com> | 2020-05-04 13:56:29 +0000 |
commit | d88fc0fcedb402e3dc82cb44280d4567a6a13266 (patch) | |
tree | 24f5f0a9231067437045f1df458312682c5298b1 /src/vnet/devices/tap/tap.h | |
parent | 6bb080f1e54391b161cf211a9cfa3f488f2fd331 (diff) |
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>
Diffstat (limited to 'src/vnet/devices/tap/tap.h')
-rw-r--r-- | src/vnet/devices/tap/tap.h | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/src/vnet/devices/tap/tap.h b/src/vnet/devices/tap/tap.h index c1ac7a61229..a9cd4766c3c 100644 --- a/src/vnet/devices/tap/tap.h +++ b/src/vnet/devices/tap/tap.h @@ -22,6 +22,21 @@ #define MIN(x,y) (((x)<(y))?(x):(y)) #endif +#define foreach_tapv2_flags \ + _ (GSO, 0) \ + _ (CSUM_OFFLOAD, 1) \ + _ (PERSIST, 2) \ + _ (ATTACH, 3) \ + _ (TUN, 4) \ + _ (GRO_COALESCE, 5) + +typedef enum +{ +#define _(a, b) TAP_FLAG_##a = (1 << b), + foreach_tapv2_flags +#undef _ +} tap_flag_t; + typedef struct { u32 id; @@ -31,11 +46,6 @@ typedef struct u16 rx_ring_sz; u16 tx_ring_sz; u32 tap_flags; -#define TAP_FLAG_GSO (1 << 0) -#define TAP_FLAG_CSUM_OFFLOAD (1 << 1) -#define TAP_FLAG_PERSIST (1 << 2) -#define TAP_FLAG_ATTACH (1 << 3) -#define TAP_FLAG_TUN (1 << 4) u8 *host_namespace; u8 *host_if_name; mac_address_t host_mac_addr; |