aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSteven <sluong@cisco.com>2018-04-11 15:32:15 -0700
committersteven luong <sluong@cisco.com>2018-04-13 02:42:27 +0000
commit866c465697f14903af80214e07392a9ded7cd944 (patch)
tree1899e48bbaad1a2b9adffe6c9cceaae93bace549 /src
parent27669ac245f8951252980001534d9f5121988e79 (diff)
bond: 1 packet/frame == bad performance [VPP-1236]
While https://gerrit.fd.io/r/#/c/11316/ took care of 1 packet/frame for most of the bonding modes, it missed the broadcast mode. This patch is to fix the 1 packet/frame for the broadcast mode. Change-Id: Iac48a2977c7f702f341479cc712a6448090dbc60 Signed-off-by: Steven <sluong@cisco.com> (cherry picked from commit 22b5be06fae6f9a8b71c53fec548aabbdf69026b)
Diffstat (limited to 'src')
-rw-r--r--src/vnet/bonding/device.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/vnet/bonding/device.c b/src/vnet/bonding/device.c
index d4aa4a7fd31..e3c454bbc72 100644
--- a/src/vnet/bonding/device.c
+++ b/src/vnet/bonding/device.c
@@ -103,16 +103,19 @@ bond_load_balance_broadcast (vlib_main_t * vm, vlib_node_runtime_t * node,
{
vnet_main_t *vnm = vnet_get_main ();
vlib_buffer_t *c0;
- int i;
+ int port;
u32 *to_next = 0;
u32 sw_if_index;
vlib_frame_t *f;
+ u16 thread_index = vlib_get_thread_index ();
-
- for (i = 1; i < slave_count; i++)
+ for (port = 1; port < slave_count; port++)
{
- sw_if_index = *vec_elt_at_index (bif->active_slaves, i);
- f = vnet_get_frame_to_sw_interface (vnm, sw_if_index);
+ sw_if_index = *vec_elt_at_index (bif->active_slaves, port);
+ if (bif->per_thread_info[thread_index].frame[port] == 0)
+ bif->per_thread_info[thread_index].frame[port] =
+ vnet_get_frame_to_sw_interface (vnm, sw_if_index);
+ f = bif->per_thread_info[thread_index].frame[port];
to_next = vlib_frame_vector_args (f);
to_next += f->n_vectors;
c0 = vlib_buffer_copy (vm, b0);
@@ -121,7 +124,6 @@ bond_load_balance_broadcast (vlib_main_t * vm, vlib_node_runtime_t * node,
vnet_buffer (c0)->sw_if_index[VLIB_TX] = sw_if_index;
to_next[0] = vlib_get_buffer_index (vm, c0);
f->n_vectors++;
- vnet_put_frame_to_sw_interface (vnm, sw_if_index, f);
}
}