From d4f88cc0967ea1de66396ac07b20cf6e33a3fa1a Mon Sep 17 00:00:00 2001 From: Damjan Marion Date: Wed, 5 Jan 2022 01:52:38 +0100 Subject: interface: refactor interface capabilities code Make it shorter to type, easier to debug, make adding callbacks in future simpler. Type: improvement Change-Id: I6cdd6375e36da23bd452a7c7273ff42789e94433 Signed-off-by: Damjan Marion --- src/plugins/af_xdp/device.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/plugins/af_xdp/device.c') diff --git a/src/plugins/af_xdp/device.c b/src/plugins/af_xdp/device.c index d27901b70b3..c45e873f662 100644 --- a/src/plugins/af_xdp/device.c +++ b/src/plugins/af_xdp/device.c @@ -508,7 +508,6 @@ af_xdp_create_if (vlib_main_t * vm, af_xdp_create_if_args_t * args) af_xdp_main_t *am = &af_xdp_main; af_xdp_device_t *ad; vnet_sw_interface_t *sw; - vnet_hw_interface_t *hw; int rxq_num, txq_num, q_num; int ns_fds[2]; int i, ret; @@ -658,9 +657,9 @@ af_xdp_create_if (vlib_main_t * vm, af_xdp_create_if_args_t * args) } sw = vnet_get_hw_sw_interface (vnm, ad->hw_if_index); - hw = vnet_get_hw_interface (vnm, ad->hw_if_index); args->sw_if_index = ad->sw_if_index = sw->sw_if_index; - hw->caps |= VNET_HW_INTERFACE_CAP_SUPPORTS_INT_MODE; + + vnet_hw_if_set_caps (vnm, ad->hw_if_index, VNET_HW_IF_CAP_INT_MODE); vnet_hw_if_set_input_node (vnm, ad->hw_if_index, af_xdp_input_node.index); -- cgit 1.2.3-korg