Skip to content

exanic ptp issue on heavily loaded system #117

Description

@AlexeySaff

I believe that on a heavily loaded system where housekeeping kernel can't respond in a time this function provide an error

`static enum hrtimer_restart exanic_ptp_soft_hrtimer_callback(
struct hrtimer *timer)
{
struct exanic *exanic =
container_of(timer, struct exanic, ptp_clock_hrtimer);
uint32_t hw_time =
readl(exanic->regs_virt + REG_EXANIC_OFFSET(REG_EXANIC_HW_TIME));
uint64_t time_ticks = exanic_ptp_soft_extend_hw_time(exanic, hw_time);
int32_t error;

if ((exanic->tick_rollover_counter & 1) == 0)
    /* Timer should have fired near halfway point */
    error = hw_time - 0x80000000;
else
    /* Timer should have fired around rollover time */
    error = hw_time;

if (error < -MAX_ERROR_TICKS || error > MAX_ERROR_TICKS)
    dev_err(exanic_dev(exanic),
        "Rollover timer fired at an unexpected time: "
        "counter 0x%llx hwtime 0x%08x\n", exanic->tick_rollover_counter,
        hw_time);

exanic->tick_rollover_counter++;
exanic_ptp_update_info_page(exanic);

hrtimer_forward_now(&exanic->ptp_clock_hrtimer,
        next_rollover_update_time(exanic, time_ticks));

return HRTIMER_RESTART;

}`

cause hrtimer callback is executed in softirq context. Would it be possible somehow to give more priority to that check, as it's negatively affecting the whole PTP process and measurements when an error happens?

[2208433.063915] exanic 0000:01:00.0: Rollover timer fired at an unexpected time: counter 0xc584802 hwtime 0xffffffff
[2208433.064020] exanic 0000:01:00.0: Rollover timer fired at an unexpected time: counter 0xc584803 hwtime 0x809d611a

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions