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/avf/device.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'src/plugins/avf') diff --git a/src/plugins/avf/device.c b/src/plugins/avf/device.c index cc2415a9293..627ead6f4e5 100644 --- a/src/plugins/avf/device.c +++ b/src/plugins/avf/device.c @@ -1729,22 +1729,19 @@ avf_create_if (vlib_main_t * vm, avf_create_if_args_t * args) if (error) goto error; - /* Indicate ability to support L3 DMAC filtering and - * initialize interface to L3 non-promisc mode */ - vnet_hw_interface_t *hi = vnet_get_hw_interface (vnm, ad->hw_if_index); - hi->caps |= VNET_HW_INTERFACE_CAP_SUPPORTS_MAC_FILTER | - VNET_HW_INTERFACE_CAP_SUPPORTS_L4_TX_CKSUM | - VNET_HW_INTERFACE_CAP_SUPPORTS_TCP_GSO; ethernet_set_flags (vnm, ad->hw_if_index, ETHERNET_INTERFACE_FLAG_DEFAULT_L3); vnet_sw_interface_t *sw = vnet_get_hw_sw_interface (vnm, ad->hw_if_index); args->sw_if_index = ad->sw_if_index = sw->sw_if_index; - vnet_hw_interface_t *hw = vnet_get_hw_interface (vnm, ad->hw_if_index); - hw->caps |= VNET_HW_INTERFACE_CAP_SUPPORTS_INT_MODE; vnet_hw_if_set_input_node (vnm, ad->hw_if_index, avf_input_node.index); + /* set hw interface caps */ + vnet_hw_if_set_caps (vnm, ad->hw_if_index, + VNET_HW_IF_CAP_INT_MODE | VNET_HW_IF_CAP_MAC_FILTER | + VNET_HW_IF_CAP_L4_TX_CKSUM | VNET_HW_IF_CAP_TCP_GSO); + for (i = 0; i < ad->n_rx_queues; i++) { u32 qi, fi; -- cgit 1.2.3-korg