36 #define CACHE_LINE_SIZE 64
43 DOCA_LOG_ERR(
"Failed to allocate eth_core_resources: invalid parameters");
54 DOCA_LOG_ERR(
"Failed to allocate eth_core_resources: failed to open a device, err: %s",
61 DOCA_LOG_ERR(
"Failed to allocate eth_core_resources: failed to create core objects, err: %s",
69 DOCA_LOG_ERR(
"Failed to allocate eth_core_resources: failed to allocate mmap memory");
81 DOCA_LOG_ERR(
"Failed to allocate eth_core_resources: failed to set mmap range, err: %s",
89 DOCA_LOG_ERR(
"Failed to allocate eth_core_resources: failed to start mmap, err: %s",
132 if (ibdev_name ==
NULL || ibdev_name_out ==
NULL)
141 strncpy(ibdev_name_out, ibdev_name,
len + 1);
150 if (mac_addr ==
NULL || mac_addr_out ==
NULL)
153 valid_size = strlen(
"FF:FF:FF:FF:FF:FF");
154 len = strnlen(mac_addr, valid_size + 1);
155 if (
len != valid_size) {
156 DOCA_LOG_ERR(
"Invalid MAC address, it should be in the following format FF:FF:FF:FF:FF:FF");
161 "%hhx:%hhx:%hhx:%hhx:%hhx:%hhx",
168 DOCA_LOG_ERR(
"Invalid MAC address, it should be in the following format FF:FF:FF:FF:FF:FF");
uint64_t align_up_uint64(uint64_t value, uint64_t alignment)
doca_error_t destroy_core_objects(struct program_core_objects *state)
doca_error_t create_core_objects(struct program_core_objects *state, uint32_t max_bufs)
doca_error_t open_doca_device_with_ibdev_name(const uint8_t *value, size_t val_size, tasks_check func, struct doca_dev **retval)
doca_error_t destroy_eth_core_resources(struct eth_core_resources *resources)
doca_error_t extract_ibdev_name(char *ibdev_name, char *ibdev_name_out)
doca_error_t allocate_eth_core_resources(struct eth_core_config *cfg, struct eth_core_resources *resources)
DOCA_LOG_REGISTER(ETH::COMMON)
doca_error_t extract_mac_addr(char *mac_addr, uint8_t *mac_addr_out)
struct rdma_resources resources
#define DOCA_DEVINFO_IBDEV_NAME_SIZE
Buffer size to hold Infiniband/RoCE device name. Including a null terminator.
#define DOCA_DEVINFO_MAC_ADDR_SIZE
Length of MAC address.
DOCA_STABLE doca_error_t doca_dev_close(struct doca_dev *dev)
Destroy allocated local device instance.
enum doca_error doca_error_t
DOCA API return codes.
DOCA_STABLE const char * doca_error_get_name(doca_error_t error)
Returns the string representation of an error code name.
@ DOCA_ERROR_INVALID_VALUE
#define DOCA_LOG_ERR(format,...)
Generates an ERROR application log message.
DOCA_STABLE doca_error_t doca_mmap_set_memrange(struct doca_mmap *mmap, void *addr, size_t len)
Set the memory range of DOCA memory map.
DOCA_STABLE doca_error_t doca_mmap_start(struct doca_mmap *mmap)
Start DOCA Memory Map.
const struct ip_frag_config * cfg