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

Function null_bbdev_create

dpdk/drivers/baseband/null/bbdev_null.c:261–294  ·  view source on GitHub ↗

Create device */

Source from the content-addressed store, hash-verified

259
260/* Create device */
261static int
262null_bbdev_create(struct rte_vdev_device *vdev,
263 struct bbdev_null_params *init_params)
264{
265 struct rte_bbdev *bbdev;
266 const char *name = rte_vdev_device_name(vdev);
267
268 bbdev = rte_bbdev_allocate(name);
269 if (bbdev == NULL)
270 return -ENODEV;
271
272 bbdev->data->dev_private = rte_zmalloc_socket(name,
273 sizeof(struct bbdev_private), RTE_CACHE_LINE_SIZE,
274 init_params->socket_id);
275 if (bbdev->data->dev_private == NULL) {
276 rte_bbdev_release(bbdev);
277 return -ENOMEM;
278 }
279
280 bbdev->dev_ops = &pmd_ops;
281 bbdev->device = &vdev->device;
282 bbdev->data->socket_id = init_params->socket_id;
283 bbdev->intr_handle = NULL;
284
285 /* register rx/tx burst functions for data path */
286 bbdev->dequeue_enc_ops = dequeue_enc_ops;
287 bbdev->dequeue_dec_ops = dequeue_dec_ops;
288 bbdev->enqueue_enc_ops = enqueue_enc_ops;
289 bbdev->enqueue_dec_ops = enqueue_dec_ops;
290 ((struct bbdev_private *) bbdev->data->dev_private)->max_nb_queues =
291 init_params->queues_num;
292
293 return 0;
294}
295
296/* Initialise device */
297static int

Callers 1

null_bbdev_probeFunction · 0.85

Calls 4

rte_vdev_device_nameFunction · 0.85
rte_bbdev_allocateFunction · 0.85
rte_zmalloc_socketFunction · 0.85
rte_bbdev_releaseFunction · 0.85

Tested by

no test coverage detected