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

Function cryptodev_ccp_probe

dpdk/drivers/crypto/ccp/rte_ccp_pmd.c:265–305  ·  view source on GitHub ↗

Probe ccp pmd */

Source from the content-addressed store, hash-verified

263
264/** Probe ccp pmd */
265static int
266cryptodev_ccp_probe(struct rte_pci_driver *pci_drv __rte_unused,
267 struct rte_pci_device *pci_dev)
268{
269 int rc = 0;
270 char name[RTE_CRYPTODEV_NAME_MAX_LEN];
271 struct ccp_pmd_init_params init_params = {
272 .def_p = {
273 "",
274 sizeof(struct ccp_private),
275 rte_socket_id(),
276 CCP_PMD_MAX_QUEUE_PAIRS
277 },
278 .auth_opt = CCP_PMD_AUTH_OPT_CCP,
279 };
280
281 if (ccp_pmd_init_done) {
282 RTE_LOG(INFO, PMD, "CCP PMD already initialized\n");
283 return -EFAULT;
284 }
285 rte_pci_device_name(&pci_dev->addr, name, sizeof(name));
286 if (name[0] == '\0')
287 return -EINVAL;
288
289 init_params.def_p.max_nb_queue_pairs = CCP_PMD_MAX_QUEUE_PAIRS;
290
291 RTE_LOG(INFO, PMD, "Initialising %s on NUMA node %d\n", name,
292 init_params.def_p.socket_id);
293 RTE_LOG(INFO, PMD, "Max number of queue pairs = %d\n",
294 init_params.def_p.max_nb_queue_pairs);
295 RTE_LOG(INFO, PMD, "Authentication offload to %s\n",
296 ((init_params.auth_opt == 0) ? "CCP" : "CPU"));
297
298 rte_pci_device_name(&pci_dev->addr, name, sizeof(name));
299
300 rc = cryptodev_ccp_create(name, pci_dev, &init_params, pci_drv);
301 if (rc)
302 return rc;
303 ccp_pmd_init_done = 1;
304 return 0;
305}
306
307static struct rte_pci_driver cryptodev_ccp_pmd_drv = {
308 .id_table = ccp_pci_id,

Callers

nothing calls this directly

Calls 3

rte_socket_idFunction · 0.85
rte_pci_device_nameFunction · 0.85
cryptodev_ccp_createFunction · 0.85

Tested by

no test coverage detected