summaryrefslogtreecommitdiffstats
path: root/src/vnet/devices/virtio/virtio_api.c
diff options
context:
space:
mode:
authorJakub Grajciar <jgrajcia@cisco.com>2019-09-26 10:34:41 +0200
committerJakub Grajciar <jgrajcia@cisco.com>2020-01-03 11:44:17 +0100
commit2c504f89c662629be5548d26d65e09e35726927e (patch)
tree715a9601340bd237006b86dfed73e3c45c5bb34b /src/vnet/devices/virtio/virtio_api.c
parent4b76c58be0eca6b2b5b97e4fdad9768fad071ff1 (diff)
devices: virtio API cleanup
Use consistent API types. Type: fix Signed-off-by: Jakub Grajciar <jgrajcia@cisco.com> Change-Id: I38a409af770c88c1eb2c68b24abef2a5a91e1b9a
Diffstat (limited to 'src/vnet/devices/virtio/virtio_api.c')
-rw-r--r--src/vnet/devices/virtio/virtio_api.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/vnet/devices/virtio/virtio_api.c b/src/vnet/devices/virtio/virtio_api.c
index 9d009f37a38..ac167e827c6 100644
--- a/src/vnet/devices/virtio/virtio_api.c
+++ b/src/vnet/devices/virtio/virtio_api.c
@@ -25,6 +25,7 @@
#include <vnet/ip/ip.h>
#include <vnet/devices/virtio/virtio.h>
#include <vnet/devices/virtio/pci.h>
+#include <vnet/pci/pci_types_api.h>
#include <vnet/vnet_msg_enum.h>
@@ -59,7 +60,7 @@ vl_api_virtio_pci_create_t_handler (vl_api_virtio_pci_create_t * mp)
clib_memset (ap, 0, sizeof (*ap));
- ap->addr = ntohl (mp->pci_addr);
+ pci_address_decode (&mp->pci_addr, (vlib_pci_addr_t *) & ap->addr);
if (!mp->use_random_mac)
{
clib_memcpy (ap->mac_addr, mp->mac_address, 6);
@@ -136,7 +137,8 @@ virtio_pci_send_sw_interface_details (vpe_api_main_t * am,
clib_memset (mp, 0, sizeof (*mp));
mp->_vl_msg_id = htons (VL_API_SW_INTERFACE_VIRTIO_PCI_DETAILS);
- mp->pci_addr = htonl (vif->pci_addr.as_u32);
+ pci_address_encode ((vlib_pci_addr_t *) & vif->pci_addr.as_u32,
+ &mp->pci_addr);
mp->sw_if_index = htonl (vif->sw_if_index);
virtio_vring_t *vring = vec_elt_at_index (vif->rxq_vrings, 0);
mp->rx_ring_sz = htons (vring->size);