Re: [PATCH] igb: add a method to get the nic hw time stampingpolicy

From: Dong Zhu
Date: Mon May 13 2013 - 06:09:57 EST


> You could use the flags field, as it has no definition yet.
>
> But you still need to explain why this new functionality is needed in
> the first place:
>
> - You can query an interface's time stamping capabilities with the
> GET_TS_INFO ethtool command.
>

Hi,

I modified this patch and added the method to igb_get_ts_info function.
For 82576 nic, through this method we can easily check which type of packets
are time stamped now, such as (HWTSTAMP_FILTER_PTP_V1_L4_SYNC and
HWTSTAMP_FILTER_PTP_V1_L4_DELAY_REQ), then change or disable it up to your requests.
I think it is convenient.The origial GET_TS_INFO method can only show the deviceâs
time stamping capabilities which nics supported.

I use the tx_reserved[0] and rx_reserved[0] to restore the hwtstamp_tx_types and
hwtstamp_rx_filters enumeration values.

Due to the limitation of 80 characters one line, I have to move the
switch out of else judegment.

I test it on I350 and 82576NS nics and it works as expect.

Could help reviewing it again ? Any comments would be appreciated.