diff options
author | Mohsin Kazmi <sykazmi@cisco.com> | 2020-05-12 14:23:28 +0200 |
---|---|---|
committer | Andrew Yourtchenko <ayourtch@gmail.com> | 2020-05-29 19:13:34 +0000 |
commit | 220e40541e3b1ad9bf0a5a4d6543e3e49cb2276d (patch) | |
tree | 7f12e669758d4c193efbe87c2f228e9ef0fd75d9 /src/vnet | |
parent | 99fa5f7229dafa98f5c4ff39776dc5db16f1abe7 (diff) |
bonding: fix the gso flags
Type: fix
Only add GSO and Checksum offload flags when gso is
enabled.
Change-Id: I58945a4ffbb9a0e6a8640fc01424c63feef16306
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
(cherry picked from commit e4f0020e8d16bad614f50e16b8471480bc16a74b)
Diffstat (limited to 'src/vnet')
-rw-r--r-- | src/vnet/bonding/cli.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/vnet/bonding/cli.c b/src/vnet/bonding/cli.c index b65fe80be1f..631a97b3a82 100644 --- a/src/vnet/bonding/cli.c +++ b/src/vnet/bonding/cli.c @@ -342,7 +342,6 @@ bond_create_if (vlib_main_t * vm, bond_create_if_args_t * args) vnet_main_t *vnm = vnet_get_main (); vnet_sw_interface_t *sw; bond_if_t *bif; - vnet_hw_interface_t *hw; if ((args->mode == BOND_MODE_LACP) && bm->lacp_plugin_loaded == 0) { @@ -420,9 +419,16 @@ bond_create_if (vlib_main_t * vm, bond_create_if_args_t * args) bif->group = bif->sw_if_index; bif->numa_only = args->numa_only; - hw = vnet_get_hw_interface (vnm, bif->hw_if_index); - hw->flags |= (VNET_HW_INTERFACE_FLAG_SUPPORTS_GSO | - VNET_HW_INTERFACE_FLAG_SUPPORTS_TX_L4_CKSUM_OFFLOAD); + /* + * Add GSO and Checksum offload flags if GSO is enabled on Bond + */ + if (args->gso) + { + vnet_hw_interface_t *hw = vnet_get_hw_interface (vnm, bif->hw_if_index); + + hw->flags |= (VNET_HW_INTERFACE_FLAG_SUPPORTS_GSO | + VNET_HW_INTERFACE_FLAG_SUPPORTS_TX_L4_CKSUM_OFFLOAD); + } if (vlib_get_thread_main ()->n_vlib_mains > 1) clib_spinlock_init (&bif->lockp); |