lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87eeg5k0un.fsf@vcostago-mobl2.amr.corp.intel.com>
Date:   Tue, 23 Mar 2021 14:37:52 -0700
From:   Vinicius Costa Gomes <vinicius.gomes@...el.com>
To:     Bjorn Helgaas <helgaas@...nel.org>
Cc:     intel-wired-lan@...ts.osuosl.org, sasha.neftin@...el.com,
        anthony.l.nguyen@...el.com, linux-pci@...r.kernel.org,
        bhelgaas@...gle.com, netdev@...r.kernel.org, mlichvar@...hat.com,
        richardcochran@...il.com
Subject: Re: [PATCH next-queue v3 3/3] igc: Add support for PTP
 getcrosststamp()

Bjorn Helgaas <helgaas@...nel.org> writes:

> On Mon, Mar 22, 2021 at 09:18:22AM -0700, Vinicius Costa Gomes wrote:
>> i225 has support for PCIe PTM, which allows us to implement support
>> for the PTP_SYS_OFFSET_PRECISE ioctl(), implemented in the driver via
>> the getcrosststamp() function.
>
>> +static bool igc_is_ptm_supported(struct igc_adapter *adapter)
>> +{
>> +#if IS_ENABLED(CONFIG_X86_TSC) && IS_ENABLED(CONFIG_PCIE_PTM)
>> +	return adapter->pdev->ptm_enabled;
>> +#endif
>
> It's not obvious why you make this x86-specific.  Maybe a comment?

Sure. Will add a comment.

>
> You shouldn't have to test for CONFIG_PCIE_PTM, either.  We probably
> should have a pdev->ptm_enabled() predicate with a stub that returns
> false when CONFIG_PCIE_PTM is not set.

Makes sense. Will add that predicate for next version.

>
>> +	return false;
>> +}
>
>> +/* PCIe Registers */
>> +#define IGC_PTM_CTRL		0x12540  /* PTM Control */
>> +#define IGC_PTM_STAT		0x12544  /* PTM Status */
>> +#define IGC_PTM_CYCLE_CTRL	0x1254C  /* PTM Cycle Control */
>> +
>> +/* PTM Time registers */
>> +#define IGC_PTM_T1_TIM0_L	0x12558  /* T1 on Timer 0 Low */
>> +#define IGC_PTM_T1_TIM0_H	0x1255C  /* T1 on Timer 0 High */
>> +
>> +#define IGC_PTM_CURR_T2_L	0x1258C  /* Current T2 Low */
>> +#define IGC_PTM_CURR_T2_H	0x12590  /* Current T2 High */
>> +#define IGC_PTM_PREV_T2_L	0x12584  /* Previous T2 Low */
>> +#define IGC_PTM_PREV_T2_H	0x12588  /* Previous T2 High */
>> +#define IGC_PTM_PREV_T4M1	0x12578  /* T4 Minus T1 on previous PTM Cycle */
>> +#define IGC_PTM_CURR_T4M1	0x1257C  /* T4 Minus T1 on this PTM Cycle */
>> +#define IGC_PTM_PREV_T3M2	0x12580  /* T3 Minus T2 on previous PTM Cycle */
>> +#define IGC_PTM_TDELAY		0x12594  /* PTM PCIe Link Delay */
>> +
>> +#define IGC_PCIE_DIG_DELAY	0x12550  /* PCIe Digital Delay */
>> +#define IGC_PCIE_PHY_DELAY	0x12554  /* PCIe PHY Delay */
>
> I assume the above are device-specific registers, right?  Nothing that
> would be found in the PCIe base spec?

Yeah, these registers control the corrections the NIC hardware make to
the timestamps based on the PCIe link delays from the NIC to its
upstream PCIe port.

I don't remember seeing anything like that on the PCIe base spec. Will
take another look to make sure.


Cheers,
-- 
Vinicius

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ