diff options
Diffstat (limited to 'src/vnet/devices/tap')
-rw-r--r-- | src/vnet/devices/tap/tap.c | 38 |
1 files changed, 16 insertions, 22 deletions
diff --git a/src/vnet/devices/tap/tap.c b/src/vnet/devices/tap/tap.c index 7e7d3d5e8c0..5b15f92051d 100644 --- a/src/vnet/devices/tap/tap.c +++ b/src/vnet/devices/tap/tap.c @@ -724,15 +724,17 @@ tap_create_if (vlib_main_t * vm, tap_create_if_args_t * args) args->sw_if_index = vif->sw_if_index; args->rv = 0; hw = vnet_get_hw_interface (vnm, vif->hw_if_index); - hw->flags |= VNET_HW_INTERFACE_FLAG_SUPPORTS_INT_MODE; + hw->caps |= VNET_HW_INTERFACE_CAP_SUPPORTS_INT_MODE; if (args->tap_flags & TAP_FLAG_GSO) { - hw->flags |= VNET_HW_INTERFACE_FLAG_SUPPORTS_GSO | - VNET_HW_INTERFACE_FLAG_SUPPORTS_TX_L4_CKSUM_OFFLOAD; + hw->caps |= VNET_HW_INTERFACE_CAP_SUPPORTS_TCP_GSO | + VNET_HW_INTERFACE_CAP_SUPPORTS_TX_TCP_CKSUM | + VNET_HW_INTERFACE_CAP_SUPPORTS_TX_UDP_CKSUM; } else if (args->tap_flags & TAP_FLAG_CSUM_OFFLOAD) { - hw->flags |= VNET_HW_INTERFACE_FLAG_SUPPORTS_TX_L4_CKSUM_OFFLOAD; + hw->caps |= VNET_HW_INTERFACE_CAP_SUPPORTS_TX_TCP_CKSUM | + VNET_HW_INTERFACE_CAP_SUPPORTS_TX_UDP_CKSUM; } if ((args->tap_flags & TAP_FLAG_GSO) && (args->tap_flags & TAP_FLAG_GRO_COALESCE)) @@ -834,26 +836,18 @@ tap_csum_offload_enable_disable (vlib_main_t * vm, u32 sw_if_index, vif->packet_coalesce = 0; vif->csum_offload_enabled = enable_disable ? 1 : 0; - if ((hw->flags & VNET_HW_INTERFACE_FLAG_SUPPORTS_GSO) != 0) + if ((hw->caps & VNET_HW_INTERFACE_CAP_SUPPORTS_TCP_GSO) != 0) { - hw->flags &= ~VNET_HW_INTERFACE_FLAG_SUPPORTS_GSO; + hw->caps &= ~VNET_HW_INTERFACE_CAP_SUPPORTS_TCP_GSO; } if (enable_disable) { - if ((hw->flags & VNET_HW_INTERFACE_FLAG_SUPPORTS_TX_L4_CKSUM_OFFLOAD) == - 0) - { - hw->flags |= VNET_HW_INTERFACE_FLAG_SUPPORTS_TX_L4_CKSUM_OFFLOAD; - } + hw->caps |= VNET_HW_INTERFACE_CAP_SUPPORTS_L4_TX_CKSUM; } else { - if ((hw->flags & VNET_HW_INTERFACE_FLAG_SUPPORTS_TX_L4_CKSUM_OFFLOAD) != - 0) - { - hw->flags &= ~VNET_HW_INTERFACE_FLAG_SUPPORTS_TX_L4_CKSUM_OFFLOAD; - } + hw->caps &= ~VNET_HW_INTERFACE_CAP_SUPPORTS_L4_TX_CKSUM; } error: @@ -893,10 +887,10 @@ tap_gso_enable_disable (vlib_main_t * vm, u32 sw_if_index, int enable_disable, vif->csum_offload_enabled = 0; if (enable_disable) { - if ((hw->flags & VNET_HW_INTERFACE_FLAG_SUPPORTS_GSO) == 0) + if ((hw->caps & VNET_HW_INTERFACE_CAP_SUPPORTS_TCP_GSO) == 0) { - hw->flags |= VNET_HW_INTERFACE_FLAG_SUPPORTS_GSO | - VNET_HW_INTERFACE_FLAG_SUPPORTS_TX_L4_CKSUM_OFFLOAD; + hw->caps |= VNET_HW_INTERFACE_CAP_SUPPORTS_TCP_GSO | + VNET_HW_INTERFACE_CAP_SUPPORTS_L4_TX_CKSUM; } if (is_packet_coalesce) { @@ -905,10 +899,10 @@ tap_gso_enable_disable (vlib_main_t * vm, u32 sw_if_index, int enable_disable, } else { - if ((hw->flags & VNET_HW_INTERFACE_FLAG_SUPPORTS_GSO) != 0) + if ((hw->caps & VNET_HW_INTERFACE_CAP_SUPPORTS_TCP_GSO) != 0) { - hw->flags &= ~(VNET_HW_INTERFACE_FLAG_SUPPORTS_GSO | - VNET_HW_INTERFACE_FLAG_SUPPORTS_TX_L4_CKSUM_OFFLOAD); + hw->caps &= ~(VNET_HW_INTERFACE_CAP_SUPPORTS_TCP_GSO | + VNET_HW_INTERFACE_CAP_SUPPORTS_L4_TX_CKSUM); } vif->packet_coalesce = 0; } |