diff options
author | Damjan Marion <damarion@cisco.com> | 2022-01-05 01:52:38 +0100 |
---|---|---|
committer | Damjan Marion <damarion@cisco.com> | 2022-01-05 19:04:07 +0100 |
commit | d4f88cc0967ea1de66396ac07b20cf6e33a3fa1a (patch) | |
tree | 1f316431b414ac3adf693eb876132dd675c73a2a /src/vnet/devices/virtio/vhost_user.c | |
parent | 7c11bd7a87b901106bb14d40572fddc703b74e5b (diff) |
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 <damarion@cisco.com>
Diffstat (limited to 'src/vnet/devices/virtio/vhost_user.c')
-rw-r--r-- | src/vnet/devices/virtio/vhost_user.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/vnet/devices/virtio/vhost_user.c b/src/vnet/devices/virtio/vhost_user.c index cd37d4c59f8..85c39b9de8b 100644 --- a/src/vnet/devices/virtio/vhost_user.c +++ b/src/vnet/devices/virtio/vhost_user.c @@ -558,14 +558,12 @@ vhost_user_socket_read (clib_file_t * uf) ((vui->features & FEATURE_VIRTIO_NET_F_HOST_GUEST_TSO_FEATURE_BITS) == FEATURE_VIRTIO_NET_F_HOST_GUEST_TSO_FEATURE_BITS)) { - 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); + hw->caps |= (VNET_HW_IF_CAP_TCP_GSO | VNET_HW_IF_CAP_TX_TCP_CKSUM | + VNET_HW_IF_CAP_TX_UDP_CKSUM); } else { - hw->caps &= ~(VNET_HW_INTERFACE_CAP_SUPPORTS_TCP_GSO | - VNET_HW_INTERFACE_CAP_SUPPORTS_L4_TX_CKSUM); + hw->caps &= ~(VNET_HW_IF_CAP_TCP_GSO | VNET_HW_IF_CAP_L4_TX_CKSUM); } vnet_hw_interface_set_flags (vnm, vui->hw_if_index, 0); vui->is_ready = 0; @@ -1658,7 +1656,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->caps |= VNET_HW_INTERFACE_CAP_SUPPORTS_INT_MODE; + hw->caps |= VNET_HW_IF_CAP_INT_MODE; vnet_hw_interface_set_flags (vnm, vui->hw_if_index, 0); if (sw_if_index) |