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

Function eca_adapter_ctrl

dpdk/lib/eventdev/rte_event_crypto_adapter.c:1281–1321  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1279}
1280
1281static int
1282eca_adapter_ctrl(uint8_t id, int start)
1283{
1284 struct event_crypto_adapter *adapter;
1285 struct crypto_device_info *dev_info;
1286 struct rte_eventdev *dev;
1287 uint32_t i;
1288 int use_service;
1289 int stop = !start;
1290
1291 use_service = 0;
1292 EVENT_CRYPTO_ADAPTER_ID_VALID_OR_ERR_RET(id, -EINVAL);
1293 adapter = eca_id_to_adapter(id);
1294 if (adapter == NULL)
1295 return -EINVAL;
1296
1297 dev = &rte_eventdevs[adapter->eventdev_id];
1298
1299 for (i = 0; i < rte_cryptodev_count(); i++) {
1300 dev_info = &adapter->cdevs[i];
1301 /* if start check for num queue pairs */
1302 if (start && !dev_info->num_qpairs)
1303 continue;
1304 /* if stop check if dev has been started */
1305 if (stop && !dev_info->dev_started)
1306 continue;
1307 use_service |= !dev_info->internal_event_port;
1308 dev_info->dev_started = start;
1309 if (dev_info->internal_event_port == 0)
1310 continue;
1311 start ? (*dev->dev_ops->crypto_adapter_start)(dev,
1312 &dev_info->dev[i]) :
1313 (*dev->dev_ops->crypto_adapter_stop)(dev,
1314 &dev_info->dev[i]);
1315 }
1316
1317 if (use_service)
1318 rte_service_runstate_set(adapter->service_id, start);
1319
1320 return 0;
1321}
1322
1323int
1324rte_event_crypto_adapter_start(uint8_t id)

Callers 2

Calls 3

eca_id_to_adapterFunction · 0.85
rte_cryptodev_countFunction · 0.85
rte_service_runstate_setFunction · 0.85

Tested by

no test coverage detected