[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <507580C8.2040808@mellanox.com>
Date: Wed, 10 Oct 2012 16:06:00 +0200
From: Or Gerlitz <ogerlitz@...lanox.com>
To: Richard Cochran <richardcochran@...il.com>
CC: <davem@...emloft.net>, <netdev@...r.kernel.org>,
Eugenia Emantayev <eugenia@...lanox.com>,
Tzahi Oved <tzahio@...lanox.com>
Subject: Re: [PATCH V1 3/3] net/mlx4_en: Add HW timestamping (TS) support
On 10/10/2012 05:37, Richard Cochran wrote:
> On Tue, Oct 09, 2012 at 05:20:13PM +0200, Or Gerlitz wrote:
>
>> @@ -1542,6 +1611,7 @@ static const struct net_device_ops mlx4_netdev_ops = {
>> .ndo_set_mac_address = mlx4_en_set_mac,
>> .ndo_validate_addr = eth_validate_addr,
>> .ndo_change_mtu = mlx4_en_change_mtu,
>> + .ndo_do_ioctl = mlx4_en_ioctl,
>> .ndo_tx_timeout = mlx4_en_tx_timeout,
>> .ndo_vlan_rx_add_vid = mlx4_en_vlan_rx_add_vid,
>> .ndo_vlan_rx_kill_vid = mlx4_en_vlan_rx_kill_vid,
> You should also provide a get_ts_info function to let the users know
> about the device's time stamping capabilities.
sure, will do.
>
>> diff --git a/drivers/net/ethernet/mellanox/mlx4/en_timestamp.c b/drivers/net/ethernet/mellanox
>> ...
>>
>> +void mlx4_en_init_timestamp(struct mlx4_en_dev *mdev)
>> +{
>> + struct mlx4_dev *dev = mdev->dev;
>> + u64 temp_mult;
>> +
>> + memset(&mdev->cycles, 0, sizeof(mdev->cycles));
>> + mdev->cycles.read = mlx4_en_read_clock;
>> + mdev->cycles.mask = CLOCKSOURCE_MASK(48);
>> +
>> + /* we have hca_core_clock in MHz, so to translate cycles to nsecs
>> + * we need to divide cycles by freq and multiply by 1000;
>> + * in order to get precise result we shift left the value,
>> + * since we don't have floating point there;
>> + * at the end shift result back
>> + */
>> + temp_mult = ((1ull * 1000) << 29) / dev->caps.hca_core_clock;
>> + mdev->cycles.mult = (u32)temp_mult;
>> + mdev->cycles.shift = 29;
>> +
>> + timecounter_init(&mdev->clock, &mdev->cycles,
>> + ktime_to_ns(ktime_get_real()));
> I didn't see any watchdog code to read this clock periodically, in order to catch overflows.
Thanks for pointing this out, will look on that and see what needs to be
fixed for V2
Or.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists