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

Function bnxt_ptp_get_current_time

dpdk/drivers/net/bnxt/bnxt_ethdev.c:1431–1454  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1429}
1430
1431static void bnxt_ptp_get_current_time(void *arg)
1432{
1433 struct bnxt *bp = arg;
1434 struct bnxt_ptp_cfg *ptp = bp->ptp_cfg;
1435 int rc;
1436
1437 rc = is_bnxt_in_error(bp);
1438 if (rc)
1439 return;
1440
1441 if (!ptp)
1442 return;
1443
1444 rte_spinlock_lock(&ptp->ptp_lock);
1445 ptp->old_time = ptp->current_time;
1446 bnxt_hwrm_port_ts_query(bp, BNXT_PTP_FLAGS_CURRENT_TIME,
1447 &ptp->current_time);
1448 rte_spinlock_unlock(&ptp->ptp_lock);
1449 rc = rte_eal_alarm_set(US_PER_S, bnxt_ptp_get_current_time, (void *)bp);
1450 if (rc != 0) {
1451 PMD_DRV_LOG(ERR, "Failed to re-schedule PTP alarm\n");
1452 bp->flags2 &= ~BNXT_FLAGS2_PTP_ALARM_SCHEDULED;
1453 }
1454}
1455
1456static int bnxt_schedule_ptp_alarm(struct bnxt *bp)
1457{

Callers

nothing calls this directly

Calls 5

is_bnxt_in_errorFunction · 0.85
bnxt_hwrm_port_ts_queryFunction · 0.85
rte_spinlock_lockFunction · 0.50
rte_spinlock_unlockFunction · 0.50
rte_eal_alarm_setFunction · 0.50

Tested by

no test coverage detected