aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/bonding/cli.c
diff options
context:
space:
mode:
authorSteven Luong <sluong@cisco.com>2021-12-03 12:05:45 -0800
committerDamjan Marion <dmarion@me.com>2022-01-25 09:49:54 +0000
commit05a68d6ece72affa0a4683f51e94aa8aa0533db3 (patch)
tree8d3a455dcb5338196a2f357de48f60215f4dbf5f /src/vnet/bonding/cli.c
parent340bd8f1efdaaf40d87553a46314c51aba074eb3 (diff)
bonding: refactor bonding hash functions to vnet/hash
- move bonding hash functions to vnet/hash - register the corresponding hash function when the bond interface is created - remove floating point vec256 usage - split bond_tx_inline into bond_tx_hash and bond_tx_no_hash Type: refactor Signed-off-by: Steven Luong <sluong@cisco.com> Change-Id: I1698023c48470290d11c9b2bd00996eee9aa079d
Diffstat (limited to 'src/vnet/bonding/cli.c')
-rw-r--r--src/vnet/bonding/cli.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/vnet/bonding/cli.c b/src/vnet/bonding/cli.c
index d20c68606d8..c3593ab663e 100644
--- a/src/vnet/bonding/cli.c
+++ b/src/vnet/bonding/cli.c
@@ -408,6 +408,16 @@ bond_create_if (vlib_main_t * vm, bond_create_if_args_t * args)
bif->mode = args->mode;
bif->gso = args->gso;
+ if (bif->lb == BOND_LB_L2)
+ bif->hash_func =
+ vnet_hash_function_from_name ("hash-eth-l2", VNET_HASH_FN_TYPE_ETHERNET);
+ else if (bif->lb == BOND_LB_L34)
+ bif->hash_func = vnet_hash_function_from_name ("hash-eth-l34",
+ VNET_HASH_FN_TYPE_ETHERNET);
+ else if (bif->lb == BOND_LB_L23)
+ bif->hash_func = vnet_hash_function_from_name ("hash-eth-l23",
+ VNET_HASH_FN_TYPE_ETHERNET);
+
// Adjust requested interface id
if (bif->id == ~0)
bif->id = bif->dev_instance;