MCPcopy Create free account
hub / github.com/F-Stack/f-stack / ree_dev_register

Function ree_dev_register

dpdk/drivers/regex/cn9k/cn9k_regexdev.c:190–222  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

188}
189
190static struct rte_regexdev *
191ree_dev_register(const char *name)
192{
193 struct rte_regexdev *dev;
194
195 cn9k_ree_dbg("Creating regexdev %s", name);
196
197 /* allocate device structure */
198 dev = rte_regexdev_register(name);
199 if (dev == NULL) {
200 cn9k_err("Failed to allocate regex device for %s", name);
201 return NULL;
202 }
203
204 /* allocate private device structure */
205 if (rte_eal_process_type() == RTE_PROC_PRIMARY) {
206 dev->data->dev_private =
207 rte_zmalloc_socket("regexdev device private",
208 sizeof(struct cn9k_ree_data),
209 RTE_CACHE_LINE_SIZE,
210 rte_socket_id());
211
212 if (dev->data->dev_private == NULL) {
213 cn9k_err("Cannot allocate memory for dev %s private data",
214 name);
215
216 rte_regexdev_unregister(dev);
217 return NULL;
218 }
219 }
220
221 return dev;
222}
223
224static int
225ree_dev_unregister(struct rte_regexdev *dev)

Callers 1

cn9k_ree_pci_probeFunction · 0.85

Calls 5

rte_regexdev_registerFunction · 0.85
rte_eal_process_typeFunction · 0.85
rte_zmalloc_socketFunction · 0.85
rte_socket_idFunction · 0.85
rte_regexdev_unregisterFunction · 0.85

Tested by

no test coverage detected