| 167 | } |
| 168 | |
| 169 | static int |
| 170 | eca_init(void) |
| 171 | { |
| 172 | const struct rte_memzone *mz; |
| 173 | unsigned int sz; |
| 174 | |
| 175 | sz = sizeof(*event_crypto_adapter) * |
| 176 | RTE_EVENT_CRYPTO_ADAPTER_MAX_INSTANCE; |
| 177 | sz = RTE_ALIGN(sz, RTE_CACHE_LINE_SIZE); |
| 178 | |
| 179 | mz = rte_memzone_lookup(ECA_ADAPTER_ARRAY); |
| 180 | if (mz == NULL) { |
| 181 | mz = rte_memzone_reserve_aligned(ECA_ADAPTER_ARRAY, sz, |
| 182 | rte_socket_id(), 0, |
| 183 | RTE_CACHE_LINE_SIZE); |
| 184 | if (mz == NULL) { |
| 185 | RTE_EDEV_LOG_ERR("failed to reserve memzone err = %" |
| 186 | PRId32, rte_errno); |
| 187 | return -rte_errno; |
| 188 | } |
| 189 | } |
| 190 | |
| 191 | event_crypto_adapter = mz->addr; |
| 192 | return 0; |
| 193 | } |
| 194 | |
| 195 | static int |
| 196 | eca_memzone_lookup(void) |
no test coverage detected