diff options
author | Mohsin Kazmi <sykazmi@cisco.com> | 2020-08-13 18:57:26 +0200 |
---|---|---|
committer | BenoƮt Ganne <bganne@cisco.com> | 2020-08-17 08:46:53 +0000 |
commit | 9e2a78564f0fc07f1ea3d15a31fa7ca3a0f6424d (patch) | |
tree | 03387739672584357b7038b67e998d8824de5d01 /src/vnet/devices/tap/tap.c | |
parent | 00dd39044e64b4a7a33d204ef7d19aac819d71f5 (diff) |
tap: add gro support
Type: feature
Change-Id: I5868dd267aa26aa97aec5fd70e70c5956ac52277
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
Diffstat (limited to 'src/vnet/devices/tap/tap.c')
-rw-r--r-- | src/vnet/devices/tap/tap.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/vnet/devices/tap/tap.c b/src/vnet/devices/tap/tap.c index fa5eef19c0d..a76b4e0c16a 100644 --- a/src/vnet/devices/tap/tap.c +++ b/src/vnet/devices/tap/tap.c @@ -730,6 +730,12 @@ tap_create_if (vlib_main_t * vm, tap_create_if_args_t * args) { hw->flags |= VNET_HW_INTERFACE_FLAG_SUPPORTS_TX_L4_CKSUM_OFFLOAD; } + if ((args->tap_flags & TAP_FLAG_GSO) + && (args->tap_flags & TAP_FLAG_GRO_COALESCE)) + { + vif->packet_coalesce = 1; + virtio_set_packet_coalesce (vif); + } vnet_hw_interface_set_input_node (vnm, vif->hw_if_index, virtio_input_node.index); @@ -827,6 +833,7 @@ tap_csum_offload_enable_disable (vlib_main_t * vm, u32 sw_if_index, vec_foreach_index (i, vif->tap_fds) _IOCTL (vif->tap_fds[i], TUNSETOFFLOAD, offload); vif->gso_enabled = 0; + vif->packet_coalesce = 0; vif->csum_offload_enabled = enable_disable ? 1 : 0; if ((hw->flags & VNET_HW_INTERFACE_FLAG_SUPPORTS_GSO) != 0) @@ -862,7 +869,8 @@ error: } int -tap_gso_enable_disable (vlib_main_t * vm, u32 sw_if_index, int enable_disable) +tap_gso_enable_disable (vlib_main_t * vm, u32 sw_if_index, int enable_disable, + int is_packet_coalesce) { vnet_main_t *vnm = vnet_get_main (); virtio_main_t *mm = &virtio_main; @@ -892,6 +900,11 @@ tap_gso_enable_disable (vlib_main_t * vm, u32 sw_if_index, int enable_disable) hw->flags |= VNET_HW_INTERFACE_FLAG_SUPPORTS_GSO | VNET_HW_INTERFACE_FLAG_SUPPORTS_TX_L4_CKSUM_OFFLOAD; } + if (is_packet_coalesce) + { + vif->packet_coalesce = 1; + virtio_set_packet_coalesce (vif); + } } else { @@ -900,6 +913,7 @@ tap_gso_enable_disable (vlib_main_t * vm, u32 sw_if_index, int enable_disable) hw->flags &= ~(VNET_HW_INTERFACE_FLAG_SUPPORTS_GSO | VNET_HW_INTERFACE_FLAG_SUPPORTS_TX_L4_CKSUM_OFFLOAD); } + vif->packet_coalesce = 0; } error: |