summaryrefslogtreecommitdiffstats
path: root/src/vnet/devices/virtio/vhost_user.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/virtio/vhost_user.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/virtio/vhost_user.c')
-rw-r--r--src/vnet/devices/virtio/vhost_user.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/vnet/devices/virtio/vhost_user.c b/src/vnet/devices/virtio/vhost_user.c
index 426f03c6ab1..5f04db09395 100644
--- a/src/vnet/devices/virtio/vhost_user.c
+++ b/src/vnet/devices/virtio/vhost_user.c
@@ -515,12 +515,16 @@ vhost_user_socket_read (clib_file_t * uf)
if (vui->enable_gso &&
((vui->features & FEATURE_VIRTIO_NET_F_HOST_GUEST_TSO_FEATURE_BITS)
== FEATURE_VIRTIO_NET_F_HOST_GUEST_TSO_FEATURE_BITS))
- hw->flags |=
- (VNET_HW_INTERFACE_FLAG_SUPPORTS_GSO |
- VNET_HW_INTERFACE_FLAG_SUPPORTS_TX_L4_CKSUM_OFFLOAD);
+ {
+ hw->caps |= (VNET_HW_INTERFACE_CAP_SUPPORTS_TCP_GSO |
+ VNET_HW_INTERFACE_CAP_SUPPORTS_TX_TCP_CKSUM |
+ VNET_HW_INTERFACE_CAP_SUPPORTS_TX_UDP_CKSUM);
+ }
else
- hw->flags &= ~(VNET_HW_INTERFACE_FLAG_SUPPORTS_GSO |
- VNET_HW_INTERFACE_FLAG_SUPPORTS_TX_L4_CKSUM_OFFLOAD);
+ {
+ hw->caps &= ~(VNET_HW_INTERFACE_CAP_SUPPORTS_TCP_GSO |
+ VNET_HW_INTERFACE_CAP_SUPPORTS_L4_TX_CKSUM);
+ }
vnet_hw_interface_set_flags (vnm, vui->hw_if_index, 0);
vui->is_ready = 0;
vhost_user_update_iface_state (vui);
@@ -1619,7 +1623,7 @@ vhost_user_vui_init (vnet_main_t * vnm, vhost_user_intf_t * vui,
for (q = 0; q < vec_len (vui->vrings); q++)
vhost_user_vring_init (vui, q);
- hw->flags |= VNET_HW_INTERFACE_FLAG_SUPPORTS_INT_MODE;
+ hw->caps |= VNET_HW_INTERFACE_CAP_SUPPORTS_INT_MODE;
vnet_hw_interface_set_flags (vnm, vui->hw_if_index, 0);
if (sw_if_index)