2 * RDMA device: Debug utilities
4 * Copyright (C) 2018 Oracle
5 * Copyright (C) 2018 Red Hat Inc
9 * Yuval Shaia <yuval.shaia@oracle.com>
10 * Marcel Apfelbaum <marcel@redhat.com>
12 * This work is licensed under the terms of the GNU GPL, version 2 or later.
13 * See the COPYING file in the top-level directory.
20 #include "qemu/error-report.h"
21 #include "sysemu/dma.h"
23 #define rdma_error_report(fmt, ...) \
24 error_report("%s: " fmt, "rdma", ## __VA_ARGS__)
25 #define rdma_warn_report(fmt, ...) \
26 warn_report("%s: " fmt, "rdma", ## __VA_ARGS__)
27 #define rdma_info_report(fmt, ...) \
28 info_report("%s: " fmt, "rdma", ## __VA_ARGS__)
30 typedef struct RdmaProtectedGQueue
{
33 } RdmaProtectedGQueue
;
35 typedef struct RdmaProtectedGSList
{
38 } RdmaProtectedGSList
;
40 void *rdma_pci_dma_map(PCIDevice
*dev
, dma_addr_t addr
, dma_addr_t len
);
41 void rdma_pci_dma_unmap(PCIDevice
*dev
, void *buffer
, dma_addr_t len
);
42 void rdma_protected_gqueue_init(RdmaProtectedGQueue
*list
);
43 void rdma_protected_gqueue_destroy(RdmaProtectedGQueue
*list
);
44 void rdma_protected_gqueue_append_int64(RdmaProtectedGQueue
*list
,
46 int64_t rdma_protected_gqueue_pop_int64(RdmaProtectedGQueue
*list
);
47 void rdma_protected_gslist_init(RdmaProtectedGSList
*list
);
48 void rdma_protected_gslist_destroy(RdmaProtectedGSList
*list
);
49 void rdma_protected_gslist_append_int32(RdmaProtectedGSList
*list
,
51 void rdma_protected_gslist_remove_int32(RdmaProtectedGSList
*list
,
54 static inline void addrconf_addr_eui48(uint8_t *eui
, const char *addr
)
59 memcpy(eui
+ 5, addr
+ 3, 3);