summaryrefslogtreecommitdiffstats
path: root/src/vnet/interface_funcs.h
diff options
context:
space:
mode:
authorDamjan Marion <damarion@cisco.com>2018-11-08 15:30:16 +0100
committerFlorin Coras <florin.coras@gmail.com>2018-11-08 17:08:11 +0000
commit5100aa9cb9e7acff35fa3bfde8aa95b5ace60344 (patch)
treea42bb046ea2933042b2722e7b4fe229e3070cac5 /src/vnet/interface_funcs.h
parenta71844f27a0be91fcda25b19604d16122ccc3e73 (diff)
vnet: store hw interface speed in kbps instead of using flags
Change-Id: Idd4471a3adf7023e48e85717f00c786b1dde0cca Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'src/vnet/interface_funcs.h')
-rw-r--r--src/vnet/interface_funcs.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/vnet/interface_funcs.h b/src/vnet/interface_funcs.h
index b7d900740d5..c4c66179bb5 100644
--- a/src/vnet/interface_funcs.h
+++ b/src/vnet/interface_funcs.h
@@ -325,6 +325,14 @@ vnet_put_frame_to_sw_interface (vnet_main_t * vnm, u32 sw_if_index,
return vlib_put_frame_to_node (vlib_get_main (), hw->output_node_index, f);
}
+always_inline void
+vnet_hw_interface_set_link_speed (vnet_main_t * vnm, u32 hw_if_index,
+ u32 link_speed)
+{
+ vnet_hw_interface_t *hw = vnet_get_hw_interface (vnm, hw_if_index);
+ hw->link_speed = link_speed;
+}
+
/* Change interface flags (e.g. up, down, enable, disable). */
clib_error_t *vnet_hw_interface_set_flags (vnet_main_t * vnm, u32 hw_if_index,
vnet_hw_interface_flags_t flags);