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

Function atl_dev_interrupt_action

dpdk/drivers/net/atlantic/atl_ethdev.c:1365–1417  ·  view source on GitHub ↗

* It executes link_update after knowing an interrupt occurred. * * @param dev * Pointer to struct rte_eth_dev. * * @return * - On success, zero. * - On failure, a negative value. */

Source from the content-addressed store, hash-verified

1363 * - On failure, a negative value.
1364 */
1365static int
1366atl_dev_interrupt_action(struct rte_eth_dev *dev,
1367 struct rte_intr_handle *intr_handle)
1368{
1369 struct atl_interrupt *intr =
1370 ATL_DEV_PRIVATE_TO_INTR(dev->data->dev_private);
1371 struct atl_adapter *adapter = dev->data->dev_private;
1372 struct aq_hw_s *hw = &adapter->hw;
1373
1374 if (!(intr->flags & ATL_FLAG_NEED_LINK_UPDATE))
1375 goto done;
1376
1377 intr->flags &= ~ATL_FLAG_NEED_LINK_UPDATE;
1378
1379 /* Notify userapp if link status changed */
1380 if (!atl_dev_link_update(dev, 0)) {
1381 atl_dev_link_status_print(dev);
1382 rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_INTR_LSC, NULL);
1383 } else {
1384 if (hw->aq_fw_ops->send_macsec_req == NULL)
1385 goto done;
1386
1387 /* Check macsec Keys expired */
1388 struct get_stats req = { 0 };
1389 struct macsec_msg_fw_request msg = { 0 };
1390 struct macsec_msg_fw_response resp = { 0 };
1391
1392 req.ingress_sa_index = 0x0;
1393 req.egress_sc_index = 0x0;
1394 req.egress_sa_index = 0x0;
1395 msg.msg_type = macsec_get_stats_msg;
1396 msg.stats = req;
1397
1398 int err = hw->aq_fw_ops->send_macsec_req(hw, &msg, &resp);
1399 if (err) {
1400 PMD_DRV_LOG(ERR, "send_macsec_req fail");
1401 goto done;
1402 }
1403 if (resp.stats.egress_threshold_expired ||
1404 resp.stats.ingress_threshold_expired ||
1405 resp.stats.egress_expired ||
1406 resp.stats.ingress_expired) {
1407 PMD_DRV_LOG(INFO, "RTE_ETH_EVENT_MACSEC");
1408 rte_eth_dev_callback_process(dev,
1409 RTE_ETH_EVENT_MACSEC, NULL);
1410 }
1411 }
1412done:
1413 atl_enable_intr(dev);
1414 rte_intr_ack(intr_handle);
1415
1416 return 0;
1417}
1418
1419/**
1420 * Interrupt handler triggered by NIC for handling

Callers 1

Calls 5

atl_dev_link_updateFunction · 0.85
atl_enable_intrFunction · 0.85
rte_intr_ackFunction · 0.50

Tested by

no test coverage detected