summaryrefslogtreecommitdiffstats
path: root/src/vnet/devices/af_packet/af_packet.c
diff options
context:
space:
mode:
authorMohsin Kazmi <sykazmi@cisco.com>2021-02-10 12:03:53 +0100
committerDamjan Marion <dmarion@me.com>2021-03-19 14:30:50 +0000
commit5b3f523918932793254b6313f78659fe0ed6320e (patch)
tree26241978a6669b4a466e09d598cc0e83cb00825c /src/vnet/devices/af_packet/af_packet.c
parent34c54dff5c66f9a4aef77daf08219301e15cc1fa (diff)
interface: add capabilities flags
Type: improvement This patch adds flags to represent the modern NICs capabilities. Change-Id: I96d38d9ab7eac55974d72795cd100d8337168e1e Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
Diffstat (limited to 'src/vnet/devices/af_packet/af_packet.c')
-rw-r--r--src/vnet/devices/af_packet/af_packet.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/vnet/devices/af_packet/af_packet.c b/src/vnet/devices/af_packet/af_packet.c
index 2cc0cc70bca..60a3ccc081f 100644
--- a/src/vnet/devices/af_packet/af_packet.c
+++ b/src/vnet/devices/af_packet/af_packet.c
@@ -404,7 +404,7 @@ af_packet_create_if (vlib_main_t * vm, u8 * host_if_name, u8 * hw_addr_set,
apif->queue_index = vnet_hw_if_register_rx_queue (vnm, apif->hw_if_index, 0,
VNET_HW_IF_RXQ_THREAD_ANY);
- hw->flags |= VNET_HW_INTERFACE_FLAG_SUPPORTS_INT_MODE;
+ hw->caps |= VNET_HW_INTERFACE_CAP_SUPPORTS_INT_MODE;
vnet_hw_interface_set_flags (vnm, apif->hw_if_index,
VNET_HW_INTERFACE_FLAG_LINK_UP);
@@ -515,10 +515,15 @@ af_packet_set_l4_cksum_offload (vlib_main_t * vm, u32 sw_if_index, u8 set)
return VNET_API_ERROR_INVALID_INTERFACE;
if (set)
- hw->flags &= ~VNET_HW_INTERFACE_FLAG_SUPPORTS_TX_L4_CKSUM_OFFLOAD;
+ {
+ hw->caps &= ~(VNET_HW_INTERFACE_CAP_SUPPORTS_TX_TCP_CKSUM |
+ VNET_HW_INTERFACE_CAP_SUPPORTS_TX_UDP_CKSUM);
+ }
else
- hw->flags |= VNET_HW_INTERFACE_FLAG_SUPPORTS_TX_L4_CKSUM_OFFLOAD;
-
+ {
+ hw->caps |= (VNET_HW_INTERFACE_CAP_SUPPORTS_TX_TCP_CKSUM |
+ VNET_HW_INTERFACE_CAP_SUPPORTS_TX_UDP_CKSUM);
+ }
return 0;
}