Re: [Intel-wired-lan] [PATCH next-queue v2 3/3] igc: Add support for PTP getcrosststamp()

2020-11-12 Thread Miroslav Lichvar
On Wed, Nov 11, 2020 at 02:23:28PM -0800, Vinicius Costa Gomes wrote: > Miroslav Lichvar writes: > > On Tue, Nov 10, 2020 at 11:06:07AM -0800, Vinicius Costa Gomes wrote: > >> The NIC I have supports PTM cycles from every ~1ms to ~512ms, and from > >> my tests it w

Re: [Intel-wired-lan] [PATCH next-queue v2 3/3] igc: Add support for PTP getcrosststamp()

2020-11-11 Thread Miroslav Lichvar
On Tue, Nov 10, 2020 at 11:06:07AM -0800, Vinicius Costa Gomes wrote: > Miroslav Lichvar writes: > > I suspect the estimate would be valid only when the NIC is connected > > directly to the PTM root (PCI root complex). Is it possible to get the > > timestamps or delay from PT

Re: [Intel-wired-lan] [PATCH next-queue v2 3/3] igc: Add support for PTP getcrosststamp()

2020-11-10 Thread Miroslav Lichvar
frequent can be the PTM dialogs? Could they be performed synchronously in the ioctl? -- Miroslav Lichvar

Re: [PATCH net-next] macvlan: pass get_ts_info and SIOC[SG]HWTSTAMP ioctl to real device

2019-05-07 Thread Miroslav Lichvar
Makes sense to me. Some applications that support HW timestamping cannot do that currently (they call SIOCSHWTSTAMP even if nothing is changing), but it shouldn't be difficult to add support for this case. Thanks, -- Miroslav Lichvar

Re: [PATCH net-next] macvlan: pass get_ts_info and SIOC[SG]HWTSTAMP ioctl to real device

2019-04-23 Thread Miroslav Lichvar
On Tue, Apr 23, 2019 at 05:15:43PM +0800, Hangbin Liu wrote: > On Tue, Apr 23, 2019 at 10:31:41AM +0200, Miroslav Lichvar wrote: > > V2_L4_SYNC is already selected, only the following filters could be > > selected on the macvlan interface: > > > > HWT

Re: [PATCH net-next] macvlan: pass get_ts_info and SIOC[SG]HWTSTAMP ioctl to real device

2019-04-23 Thread Miroslav Lichvar
On Tue, Apr 23, 2019 at 12:18:17PM +0800, Hangbin Liu wrote: > On Thu, Apr 18, 2019 at 10:05:09AM +0200, Miroslav Lichvar wrote: > > select a more general filter. A container could run a PTP clock if it > > Do you have an idea about how to select a general filter? If

Re: [PATCH net-next] macvlan: pass get_ts_info and SIOC[SG]HWTSTAMP ioctl to real device

2019-04-18 Thread Miroslav Lichvar
stamps at a high rate. I suspect the timestamping would need to be restricted to the real interface to fully protect it from applications having access to the virtual interfaces. -- Miroslav Lichvar

Re: [PATCH net 1/2] ptp: check that rsv field is zero in struct ptp_sys_offset_extended

2019-01-07 Thread Miroslav Lichvar
by doing this. FWIW, this ioctl wasn't present in a stable Linux release yet and the two applications that I know that support it both zero the rsv field, so I think at least this patch is very unlikely to break anything. Anyway, thanks to Eugene for catching the issues. -- Miroslav Lichvar

[PATCH mlx5-next 1/2] mlx5: update timecounter at least twice per counter overflow

2018-12-03 Thread Miroslav Lichvar
Cc: Ariel Levkovich Cc: Saeed Mahameed Signed-off-by: Miroslav Lichvar --- drivers/net/ethernet/mellanox/mlx5/core/lib/clock.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/lib/clock.c b/drivers/net/ethernet/mellanox/mlx5/core

[PATCH mlx5-next 0/2] Improvements for PTP clock in mlx5 driver

2018-12-03 Thread Miroslav Lichvar
This is a pair of patches for the mlx5 driver related to the PTP clock. The first patch fixes a potential issue causing backward jumps due to a late update of the PHC timecounter. The second patch adds support for the PTP_SYS_OFFSET_EXTENDED ioctl. Miroslav Lichvar (2): mlx5: update

[PATCH mlx5-next 2/2] mlx5: extend PTP gettime function to read system clock

2018-12-03 Thread Miroslav Lichvar
Read the system time right before and immediately after reading the low register of the internal timer. This adds support for the PTP_SYS_OFFSET_EXTENDED ioctl. Cc: Richard Cochran Cc: Saeed Mahameed Signed-off-by: Miroslav Lichvar --- .../ethernet/mellanox/mlx5/core/lib/clock.c | 20

[PATCH net-next 8/8] tg3: extend PTP gettime function to read system clock

2018-11-09 Thread Miroslav Lichvar
This adds support for the PTP_SYS_OFFSET_EXTENDED ioctl. Cc: Richard Cochran Cc: Michael Chan Signed-off-by: Miroslav Lichvar --- drivers/net/ethernet/broadcom/tg3.c | 19 +-- 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/drivers/net/ethernet/broadcom/tg3.c b

[PATCH net-next 7/8] ixgbe: extend PTP gettime function to read system clock

2018-11-09 Thread Miroslav Lichvar
This adds support for the PTP_SYS_OFFSET_EXTENDED ioctl. Cc: Richard Cochran Cc: Jacob Keller Cc: Jeff Kirsher Signed-off-by: Miroslav Lichvar --- drivers/net/ethernet/intel/ixgbe/ixgbe_ptp.c | 54 1 file changed, 44 insertions(+), 10 deletions(-) diff --git a/drivers

[PATCH net-next 5/8] e1000e: extend PTP gettime function to read system clock

2018-11-09 Thread Miroslav Lichvar
This adds support for the PTP_SYS_OFFSET_EXTENDED ioctl. Cc: Richard Cochran Cc: Jacob Keller Cc: Jeff Kirsher Signed-off-by: Miroslav Lichvar --- drivers/net/ethernet/intel/e1000e/e1000.h | 3 ++ drivers/net/ethernet/intel/e1000e/netdev.c | 42 -- drivers/net/ethernet

[PATCH net-next 6/8] igb: extend PTP gettime function to read system clock

2018-11-09 Thread Miroslav Lichvar
This adds support for the PTP_SYS_OFFSET_EXTENDED ioctl. Cc: Richard Cochran Cc: Jacob Keller Cc: Jeff Kirsher Signed-off-by: Miroslav Lichvar --- drivers/net/ethernet/intel/igb/igb_ptp.c | 65 1 file changed, 55 insertions(+), 10 deletions(-) diff --git a/drivers

[PATCH net-next 4/8] ptp: deprecate gettime64() in favor of gettimex64()

2018-11-09 Thread Miroslav Lichvar
When a driver provides gettimex64(), use it in the PTP_SYS_OFFSET ioctl and POSIX clock's gettime() instead of gettime64(). Drivers should provide only one of the functions. Cc: Richard Cochran Cc: Jacob Keller Signed-off-by: Miroslav Lichvar --- drivers/ptp/ptp_chardev.c

[PATCH net-next 2/8] ptp: check gettime64 return code in PTP_SYS_OFFSET ioctl

2018-11-09 Thread Miroslav Lichvar
If a gettime64 call fails, return the error and avoid copying data back to user. Cc: Richard Cochran Cc: Jacob Keller Signed-off-by: Miroslav Lichvar --- drivers/ptp/ptp_chardev.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/ptp/ptp_chardev.c b/drivers/ptp

[PATCH net-next 1/8] ptp: reorder declarations in ptp_ioctl()

2018-11-09 Thread Miroslav Lichvar
Reorder declarations of variables as reversed Christmas tree. Cc: Richard Cochran Suggested-by: Richard Cochran Signed-off-by: Miroslav Lichvar --- drivers/ptp/ptp_chardev.c | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/ptp/ptp_chardev.c b/drivers

[PATCH net-next 3/8] ptp: add PTP_SYS_OFFSET_EXTENDED ioctl

2018-11-09 Thread Miroslav Lichvar
Cc: Jacob Keller Cc: Marcelo Tosatti Signed-off-by: Miroslav Lichvar --- drivers/ptp/ptp_chardev.c| 33 include/linux/ptp_clock_kernel.h | 31 ++ include/uapi/linux/ptp_clock.h | 12 3 files changed, 76

[PATCH net-next 0/8] More accurate PHC<->system clock synchronization

2018-11-09 Thread Miroslav Lichvar
750 ns - with an X550 (ixgbe) the delay was reduced from 1950 to 650 ns - with a BCM5720 (tg3) the delay was reduced from 2400 to 1200 ns Miroslav Lichvar (8): ptp: reorder declarations in ptp_ioctl() ptp: check gettime64 return code in PTP_SYS_OFFSET ioctl ptp: add PTP_SYS_OFFSET_EXTEN

Re: [net 1/8] igb: shorten maximum PHC timecounter update interval

2018-11-01 Thread Miroslav Lichvar
On Wed, Oct 31, 2018 at 12:42:47PM -0700, Jeff Kirsher wrote: > From: Miroslav Lichvar > > The timecounter needs to be updated at least once per ~550 seconds in > order to avoid a 40-bit SYSTIM timestamp to be misinterpreted as an old > timestamp. > > Since commit 500462a9

Re: [RFC PATCH 4/4] ixgbe: add support for extended PHC gettime

2018-10-31 Thread Miroslav Lichvar
On Wed, Oct 31, 2018 at 07:40:03AM -0700, Richard Cochran wrote: > On Mon, Oct 29, 2018 at 02:31:09PM +0100, Miroslav Lichvar wrote: > > I think there could be a flag in ptp_system_timestamp, or a parameter > > of gettimex64(), which would enable/disable reading of the system >

Re: [RFC PATCH 3/4] igb: add support for extended PHC gettime

2018-10-31 Thread Miroslav Lichvar
On Tue, Oct 30, 2018 at 07:29:16PM -0700, Richard Cochran wrote: > On Fri, Oct 26, 2018 at 06:27:41PM +0200, Miroslav Lichvar wrote: > > +static int igb_ptp_gettimex(struct ptp_clock_info *ptp, > > + struct ptp_system_timestamp *sts) > > +{ > >

Re: [RFC PATCH 4/4] ixgbe: add support for extended PHC gettime

2018-10-29 Thread Miroslav Lichvar
On Fri, Oct 26, 2018 at 04:54:57PM +, Keller, Jacob E wrote: > > -Original Message- > > From: Miroslav Lichvar [mailto:mlich...@redhat.com] > > Sent: Friday, October 26, 2018 9:28 AM > > To: netdev@vger.kernel.org > > Cc: intel-wired-...@lis

Re: [Intel-wired-lan] [RFC PATCH 1/4] ptp: add PTP_SYS_OFFSET_EXTENDED ioctl

2018-10-29 Thread Miroslav Lichvar
sysoff_extended = memdup_user((void __user *)arg, > > + sizeof(*sysoff_extended)); > > Looks like you forgot to free 'sysoff_extended', no? Oh, I did. Thanks for catching that. I'll fix it in the next version. -- Miroslav Lichvar

[PATCH v2 net] igb: shorten maximum PHC timecounter update interval

2018-10-26 Thread Miroslav Lichvar
82580/I350/I354 being off by ~1100 seconds for few seconds every ~9 minutes. Cc: Jacob Keller Cc: Richard Cochran Cc: Thomas Gleixner Signed-off-by: Miroslav Lichvar --- drivers/net/ethernet/intel/igb/igb_ptp.c | 10 +- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/d

[RFC PATCH 4/4] ixgbe: add support for extended PHC gettime

2018-10-26 Thread Miroslav Lichvar
Cc: Richard Cochran Cc: Jacob Keller Signed-off-by: Miroslav Lichvar --- drivers/net/ethernet/intel/ixgbe/ixgbe_ptp.c | 57 1 file changed, 57 insertions(+) diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_ptp.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_ptp.c index

[RFC PATCH 2/4] e1000e: add support for extended PHC gettime

2018-10-26 Thread Miroslav Lichvar
Cc: Richard Cochran Cc: Jacob Keller Signed-off-by: Miroslav Lichvar --- drivers/net/ethernet/intel/e1000e/e1000.h | 3 ++ drivers/net/ethernet/intel/e1000e/netdev.c | 48 +- drivers/net/ethernet/intel/e1000e/ptp.c| 21 ++ 3 files changed, 62 insertions(+), 10

[RFC PATCH 1/4] ptp: add PTP_SYS_OFFSET_EXTENDED ioctl

2018-10-26 Thread Miroslav Lichvar
of the PHC timestamp Cc: Richard Cochran Cc: Jacob Keller Signed-off-by: Miroslav Lichvar --- drivers/ptp/ptp_chardev.c| 39 include/linux/ptp_clock_kernel.h | 26 + include/uapi/linux/ptp_clock.h | 12 ++ 3 files changed

[RFC PATCH 3/4] igb: add support for extended PHC gettime

2018-10-26 Thread Miroslav Lichvar
Cc: Richard Cochran Cc: Jacob Keller Signed-off-by: Miroslav Lichvar --- drivers/net/ethernet/intel/igb/igb_ptp.c | 43 1 file changed, 43 insertions(+) diff --git a/drivers/net/ethernet/intel/igb/igb_ptp.c b/drivers/net/ethernet/intel/igb/igb_ptp.c index

[RFC PATCH 0/4] More accurate PHC<->system clock synchronization

2018-10-26 Thread Miroslav Lichvar
iver. Also, mixing SYSTIM and "system time" in the code will probably be confusing. I wasn't able to find a better name for the ioctl, the structures, and the driver function. If anyone has suggestions, please let me know. Miroslav Lichvar (4): ptp: add PTP_SYS_OFFSET_EXTENDED io

Re: [PATCH] igb: shorten maximum PHC timecounter update interval

2018-10-26 Thread Miroslav Lichvar
On Fri, Oct 12, 2018 at 07:05:30AM -0700, Richard Cochran wrote: > On Fri, Oct 12, 2018 at 01:13:39PM +0200, Miroslav Lichvar wrote: > > Since commit 500462a9d ("timers: Switch to a non-cascading wheel"), > > scheduling of delayed work seems to be less accurate and a r

Re: Improving accuracy of PHC readings

2018-10-23 Thread Miroslav Lichvar
phc offset -14 s2 freq +89 delay 1301 phc offset -86 s2 freq +13 delay 1296 phc offset -21 s2 freq +52 delay 1298 -- Miroslav Lichvar

Re: Improving accuracy of PHC readings

2018-10-23 Thread Miroslav Lichvar
On Mon, Oct 22, 2018 at 03:48:02PM -0700, Richard Cochran wrote: > On Fri, Oct 19, 2018 at 11:51:37AM +0200, Miroslav Lichvar wrote: > > The extra timestamp doesn't fit the API of the PTP_SYS_OFFSET ioctl, > > so it would need to shift the timestamp it returns by the m

Improving accuracy of PHC readings

2018-10-19 Thread Miroslav Lichvar
as there are fewer register reads sensitive to the PCIe delay. What do you think? -- Miroslav Lichvar

[PATCH] igb: shorten maximum PHC timecounter update interval

2018-10-12 Thread Miroslav Lichvar
ochran Cc: Thomas Gleixner Signed-off-by: Miroslav Lichvar --- drivers/net/ethernet/intel/igb/igb_ptp.c | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/intel/igb/igb_ptp.c b/drivers/net/ethernet/intel/igb/igb_ptp.c index 9f4d700e09df..29ced6b74d36 10

Re: [RFC v3 net-next 13/18] net/sched: Introduce the TBS Qdisc

2018-04-12 Thread Miroslav Lichvar
possibility. There is also the possibility that the NIC clock is not synchronized to anything. For synchronization of the system clock it's easier to leave it free running and only track its phase/frequency offset to allow conversion between the PHC and system time. -- Miroslav Lichvar

Socket error queue with timestamping and SOF_TIMESTAMPING_OPT_CMSG

2018-04-03 Thread Miroslav Lichvar
_CMSG is a no-op on AF_INET6 sockets. -- Miroslav Lichvar

Re: [RFC v3 net-next 08/18] net: SO_TXTIME: Add clockid and drop_if_late params

2018-03-08 Thread Miroslav Lichvar
be a common use case, but a public NTP server could be sending millions of packets per second in traffic peaks (typically at *:00:00) over multiple interfaces. -- Miroslav Lichvar

Re: [Intel-wired-lan] [RFC v2 net-next 01/10] net: Add a new socket option for a future transmit time.

2018-02-13 Thread Miroslav Lichvar
On Mon, Feb 12, 2018 at 02:39:06PM -0800, Jesus Sanchez-Palencia wrote: > On 01/18/2018 12:42 AM, Miroslav Lichvar wrote: > > Please keep in mind that the PHCs and the system clock don't have to > > be synchronized to each other. If I understand the rest of the series > &

Re: [Intel-wired-lan] [RFC v2 net-next 01/10] net: Add a new socket option for a future transmit time.

2018-02-01 Thread Miroslav Lichvar
27;s no longer necessary to send the responses as soon as they are assembled. I think it would be nice the sendmmsg() calls didn't have to be split by clockid_t. -- Miroslav Lichvar

Re: [Intel-wired-lan] [RFC v2 net-next 01/10] net: Add a new socket option for a future transmit time.

2018-01-25 Thread Miroslav Lichvar
year 2262 yet, but wouldn't it be better to make it consistent with the timestamping API using timespec? Or is it just better to avoid the 64/32-bit mess of time_t? -- Miroslav Lichvar

Re: [Intel-wired-lan] [RFC v2 net-next 01/10] net: Add a new socket option for a future transmit time.

2018-01-18 Thread Miroslav Lichvar
;t have to be synchronized to each other. If I understand the rest of the series correctly, there is an assumption that the PHCs are keeping time in TAI and CLOCK_TAI can be used as a fallback. -- Miroslav Lichvar

Re: [PATCH RFC V1 net-next 0/6] Time based packet transmission

2017-09-19 Thread Miroslav Lichvar
| 240 | > > Using so_txtime, the peak to peak jitter is about 100 nanoseconds, Nice! -- Miroslav Lichvar

[PATCH ethtool 2/2] ethtool: add support for HWTSTAMP_FILTER_NTP_ALL

2017-05-23 Thread Miroslav Lichvar
Add HWTSTAMP_FILTER_NTP_ALL to the list of hardware receive filters which can be printed by ethtool -T. CC: Richard Cochran Signed-off-by: Miroslav Lichvar --- ethtool.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ethtool.c b/ethtool.c index ad18704..85b320c 100644

[PATCH ethtool 0/2] Add new receive timestamping filter

2017-05-23 Thread Miroslav Lichvar
These two patches update ethtool to be able to print the new NTP timestamping filter in the ethtool -T command. Miroslav Lichvar (2): net_tstamp.h: sync with net-next ethtool: add support for HWTSTAMP_FILTER_NTP_ALL ethtool.c | 3 ++- net_tstamp-copy.h | 52

[PATCH ethtool 1/2] net_tstamp.h: sync with net-next

2017-05-23 Thread Miroslav Lichvar
This covers kernel changes up to: commit b50a5c70ffa4fd6b6da324ab54c84adf48fb17d9 Author: Miroslav Lichvar Date: Fri May 19 17:52:40 2017 +0200 net: allow simultaneous SW and HW transmit timestamping Add SOF_TIMESTAMPING_OPT_TX_SWHW option to allow an outgoing packet to be looped

[PATCH v6 net-next 6/7] net: allow simultaneous SW and HW transmit timestamping

2017-05-19 Thread Miroslav Lichvar
ntrol message only when the skb has no software timestamp or it is an incoming packet. While changing sw_tx_timestamp(), inline it in skb_tx_timestamp() as there are no other users. CC: Richard Cochran CC: Willem de Bruijn Signed-off-by: Miroslav Lichvar --- Documentation/netwo

[PATCH v6 net-next 7/7] net: ethernet: update drivers to make both SW and HW TX timestamps

2017-05-19 Thread Miroslav Lichvar
skb_tx_timestamp(). CC: Richard Cochran CC: Willem de Bruijn Signed-off-by: Miroslav Lichvar --- drivers/net/ethernet/amd/xgbe/xgbe-drv.c | 3 +-- drivers/net/ethernet/intel/e1000e/netdev.c| 4 ++-- drivers/net/ethernet/samsung/sxgbe/sxgbe_main.c | 3 +-- drivers/net/ethernet/stmicro

[PATCH v6 net-next 5/7] net: fix documentation of struct scm_timestamping

2017-05-19 Thread Miroslav Lichvar
SCM_TIMESTAMP(NS) message. CC: Richard Cochran CC: Willem de Bruijn Signed-off-by: Miroslav Lichvar --- Documentation/networking/timestamping.txt | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Documentation/networking/timestamping.txt b/Documentation/networking

[PATCH v6 net-next 4/7] net: add new control message for incoming HW-timestamped packets

2017-05-19 Thread Miroslav Lichvar
PI, a zero index will be returned in the control message. CC: Richard Cochran Acked-by: Willem de Bruijn Signed-off-by: Miroslav Lichvar --- Documentation/networking/timestamping.txt | 10 ++ include/uapi/asm-generic/socket.h | 2 ++ include/uapi/linux/net_tstamp.h

[PATCH v6 net-next 2/7] net: ethernet: update drivers to handle HWTSTAMP_FILTER_NTP_ALL

2017-05-19 Thread Miroslav Lichvar
Include HWTSTAMP_FILTER_NTP_ALL in net_hwtstamp_validate() as a valid filter and update drivers which can timestamp all packets, or which explicitly list unsupported filters instead of using a default case, to handle the filter. CC: Richard Cochran CC: Willem de Bruijn Signed-off-by: Miroslav

[PATCH v6 net-next 3/7] net: add function to retrieve original skb device using NAPI ID

2017-05-19 Thread Miroslav Lichvar
Bruijn Signed-off-by: Miroslav Lichvar --- include/linux/netdevice.h | 1 + include/linux/skbuff.h| 9 + net/core/dev.c| 26 ++ 3 files changed, 36 insertions(+) diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 3f39d27.

[PATCH v6 net-next 0/7] Extend socket timestamping API

2017-05-19 Thread Miroslav Lichvar
o request both software and hardware timestamps for outgoing packets. The seventh patch updates drivers that assumed software timestamping cannot be used together with hardware timestamping. The patches have been tested on x86_64 machines with igb and e1000e drivers. Miroslav Lichvar (7): net: d

[PATCH v6 net-next 1/7] net: define receive timestamp filter for NTP

2017-05-19 Thread Miroslav Lichvar
Add HWTSTAMP_FILTER_NTP_ALL to the hwtstamp_rx_filters enum for timestamping of NTP packets. There is currently only one driver (phyter) that could support it directly. CC: Richard Cochran CC: Willem de Bruijn Signed-off-by: Miroslav Lichvar --- include/uapi/linux/net_tstamp.h | 3 +++ net

Re: [PATCH v5 net-next 5/7] net: fix documentation of struct scm_timestamping

2017-05-19 Thread Miroslav Lichvar
On Thu, May 18, 2017 at 03:38:30PM -0400, Willem de Bruijn wrote: > On Thu, May 18, 2017 at 10:07 AM, Miroslav Lichvar > wrote: > > +Note that if the SO_TIMESTAMP or SO_TIMESTAMPNS option is enabled > > +together with SO_TIMESTAMPING using SOF_TIMESTAMPING_SOFTWARE, a f

Re: [PATCH v5 net-next 4/7] net: add new control message for incoming HW-timestamped packets

2017-05-19 Thread Miroslav Lichvar
On Thu, May 18, 2017 at 04:20:53PM -0400, Willem de Bruijn wrote: > On Thu, May 18, 2017 at 10:07 AM, Miroslav Lichvar > wrote: > > +SOF_TIMESTAMPING_OPT_PKTINFO: > > + > > + Enable the SCM_TIMESTAMPING_PKTINFO control message for incoming > > + packets with ha

Re: [PATCH v4 net-next 6/7] net: allow simultaneous SW and HW transmit timestamping

2017-05-19 Thread Miroslav Lichvar
On Thu, May 18, 2017 at 04:16:26PM -0400, Willem de Bruijn wrote: > On Thu, May 18, 2017 at 9:06 AM, Miroslav Lichvar wrote: > > +/* On transmit, software and hardware timestamps are returned > > independently. > > + * As the two skb clones share the hardware timestamp,

[PATCH v5 net-next 6/7] net: allow simultaneous SW and HW transmit timestamping

2017-05-18 Thread Miroslav Lichvar
ntrol message only when the skb has no software timestamp or it is an incoming packet. While changing sw_tx_timestamp(), inline it in skb_tx_timestamp() as there are no other users. CC: Richard Cochran CC: Willem de Bruijn Signed-off-by: Miroslav Lichvar --- Documentation/netwo

[PATCH v5 net-next 0/7] Extend socket timestamping API

2017-05-18 Thread Miroslav Lichvar
g. The patches have been tested on x86_64 machines with igb and e1000e drivers. Miroslav Lichvar (7): net: define receive timestamp filter for NTP net: ethernet: update drivers to handle HWTSTAMP_FILTER_NTP_ALL net: add function to retrieve original skb device using NAPI ID net: add new

[PATCH v5 net-next 3/7] net: add function to retrieve original skb device using NAPI ID

2017-05-18 Thread Miroslav Lichvar
Bruijn Signed-off-by: Miroslav Lichvar --- include/linux/netdevice.h | 1 + include/linux/skbuff.h| 9 + net/core/dev.c| 26 ++ 3 files changed, 36 insertions(+) diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 3f39d27.

[PATCH v5 net-next 4/7] net: add new control message for incoming HW-timestamped packets

2017-05-18 Thread Miroslav Lichvar
PI, a zero index will be returned in the control message. CC: Richard Cochran CC: Willem de Bruijn Signed-off-by: Miroslav Lichvar --- Documentation/networking/timestamping.txt | 9 + include/uapi/asm-generic/socket.h | 2 ++ include/uapi/linux/net_tstamp.h | 11 ++

[PATCH v5 net-next 5/7] net: fix documentation of struct scm_timestamping

2017-05-18 Thread Miroslav Lichvar
SCM_TIMESTAMP(NS) message. CC: Richard Cochran CC: Willem de Bruijn Signed-off-by: Miroslav Lichvar --- Documentation/networking/timestamping.txt | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Documentation/networking/timestamping.txt b/Documentation/networking

[PATCH v5 net-next 2/7] net: ethernet: update drivers to handle HWTSTAMP_FILTER_NTP_ALL

2017-05-18 Thread Miroslav Lichvar
Include HWTSTAMP_FILTER_NTP_ALL in net_hwtstamp_validate() as a valid filter and update drivers which can timestamp all packets, or which explicitly list unsupported filters instead of using a default case, to handle the filter. CC: Richard Cochran CC: Willem de Bruijn Signed-off-by: Miroslav

[PATCH v5 net-next 7/7] net: ethernet: update drivers to make both SW and HW TX timestamps

2017-05-18 Thread Miroslav Lichvar
skb_tx_timestamp(). CC: Richard Cochran CC: Willem de Bruijn Signed-off-by: Miroslav Lichvar --- drivers/net/ethernet/amd/xgbe/xgbe-drv.c | 3 +-- drivers/net/ethernet/intel/e1000e/netdev.c| 4 ++-- drivers/net/ethernet/samsung/sxgbe/sxgbe_main.c | 3 +-- drivers/net/ethernet/stmicro

[PATCH v5 net-next 1/7] net: define receive timestamp filter for NTP

2017-05-18 Thread Miroslav Lichvar
Add HWTSTAMP_FILTER_NTP_ALL to the hwtstamp_rx_filters enum for timestamping of NTP packets. There is currently only one driver (phyter) that could support it directly. CC: Richard Cochran CC: Willem de Bruijn Signed-off-by: Miroslav Lichvar --- include/uapi/linux/net_tstamp.h | 3 +++ net

Re: [PATCH v4 net-next 0/7] Extend socket timestamping API

2017-05-18 Thread Miroslav Lichvar
On Thu, May 18, 2017 at 02:58:23PM +0200, Miroslav Lichvar wrote: > Changes v3->v4: > - added reserved fields to struct scm_ts_pktinfo Of course, I forgot to initialize the new reserved fields. I'll send a new series. -- Miroslav Lichvar

[PATCH v4 net-next 4/7] net: add new control message for incoming HW-timestamped packets

2017-05-18 Thread Miroslav Lichvar
PI, a zero index will be returned in the control message. CC: Richard Cochran CC: Willem de Bruijn Signed-off-by: Miroslav Lichvar --- Documentation/networking/timestamping.txt | 9 + include/uapi/asm-generic/socket.h | 2 ++ include/uapi/linux/net_tstamp.h | 11 ++

[PATCH v4 net-next 0/7] Extend socket timestamping API

2017-05-18 Thread Miroslav Lichvar
patch adds a new option to request both software and hardware timestamps for outgoing packets. The seventh patch updates drivers that assumed software timestamping cannot be used together with hardware timestamping. The patches have been tested on x86_64 machines with igb and e1000e drivers. Mi

[PATCH v4 net-next 6/7] net: allow simultaneous SW and HW transmit timestamping

2017-05-18 Thread Miroslav Lichvar
ntrol message only when the skb has no software timestamp or it is an incoming packet. While changing sw_tx_timestamp(), inline it in skb_tx_timestamp() as there are no other users. CC: Richard Cochran CC: Willem de Bruijn Signed-off-by: Miroslav Lichvar --- Documentation/netwo

[PATCH v4 net-next 1/7] net: define receive timestamp filter for NTP

2017-05-18 Thread Miroslav Lichvar
Add HWTSTAMP_FILTER_NTP_ALL to the hwtstamp_rx_filters enum for timestamping of NTP packets. There is currently only one driver (phyter) that could support it directly. CC: Richard Cochran CC: Willem de Bruijn Signed-off-by: Miroslav Lichvar --- include/uapi/linux/net_tstamp.h | 3 +++ net

[PATCH v4 net-next 2/7] net: ethernet: update drivers to handle HWTSTAMP_FILTER_NTP_ALL

2017-05-18 Thread Miroslav Lichvar
Include HWTSTAMP_FILTER_NTP_ALL in net_hwtstamp_validate() as a valid filter and update drivers which can timestamp all packets, or which explicitly list unsupported filters instead of using a default case, to handle the filter. CC: Richard Cochran CC: Willem de Bruijn Signed-off-by: Miroslav

[PATCH v4 net-next 5/7] net: fix documentation of struct scm_timestamping

2017-05-18 Thread Miroslav Lichvar
SCM_TIMESTAMP(NS) message. CC: Richard Cochran CC: Willem de Bruijn Signed-off-by: Miroslav Lichvar --- Documentation/networking/timestamping.txt | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Documentation/networking/timestamping.txt b/Documentation/networking

[PATCH v4 net-next 7/7] net: ethernet: update drivers to make both SW and HW TX timestamps

2017-05-18 Thread Miroslav Lichvar
skb_tx_timestamp(). CC: Richard Cochran CC: Willem de Bruijn Signed-off-by: Miroslav Lichvar --- drivers/net/ethernet/amd/xgbe/xgbe-drv.c | 3 +-- drivers/net/ethernet/intel/e1000e/netdev.c| 4 ++-- drivers/net/ethernet/samsung/sxgbe/sxgbe_main.c | 3 +-- drivers/net/ethernet/stmicro

[PATCH v4 net-next 3/7] net: add function to retrieve original skb device using NAPI ID

2017-05-18 Thread Miroslav Lichvar
Bruijn Signed-off-by: Miroslav Lichvar --- include/linux/netdevice.h | 1 + include/linux/skbuff.h| 9 + net/core/dev.c| 26 ++ 3 files changed, 36 insertions(+) diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 3f39d27.

Re: [PATCH v3 net-next 5/7] net: don't make false software transmit timestamps

2017-05-17 Thread Miroslav Lichvar
On Tue, May 16, 2017 at 06:34:38PM -0400, Willem de Bruijn wrote: > On Tue, May 16, 2017 at 8:44 AM, Miroslav Lichvar wrote: > > If software timestamping is enabled by the SO_TIMESTAMP(NS) option > > when a message without timestamp is already waiting in the queue, the > >

[PATCH v3 net-next 4/7] net: add new control message for incoming HW-timestamped packets

2017-05-16 Thread Miroslav Lichvar
PI, a zero index will be returned in the control message. CC: Richard Cochran CC: Willem de Bruijn Signed-off-by: Miroslav Lichvar --- Documentation/networking/timestamping.txt | 9 + include/uapi/asm-generic/socket.h | 2 ++ include/uapi/linux/net_tstamp.h | 10 +

[PATCH v3 net-next 3/7] net: add function to retrieve original skb device using NAPI ID

2017-05-16 Thread Miroslav Lichvar
Bruijn Signed-off-by: Miroslav Lichvar --- include/linux/netdevice.h | 1 + include/linux/skbuff.h| 9 + net/core/dev.c| 26 ++ 3 files changed, 36 insertions(+) diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 3f39d27..b6c36d5

[PATCH v3 net-next 6/7] net: allow simultaneous SW and HW transmit timestamping

2017-05-16 Thread Miroslav Lichvar
ntrol message only when the skb has no software timestamp or it is an incoming packet. While changing sw_tx_timestamp(), inline it in skb_tx_timestamp() as there are no other users. CC: Richard Cochran CC: Willem de Bruijn Signed-off-by: Miroslav Lichvar --- Documentation/netwo

[PATCH v3 net-next 7/7] net: ethernet: update drivers to make both SW and HW TX timestamps

2017-05-16 Thread Miroslav Lichvar
skb_tx_timestamp(). CC: Richard Cochran CC: Willem de Bruijn Signed-off-by: Miroslav Lichvar --- drivers/net/ethernet/amd/xgbe/xgbe-drv.c | 3 +-- drivers/net/ethernet/intel/e1000e/netdev.c| 4 ++-- drivers/net/ethernet/samsung/sxgbe/sxgbe_main.c | 3 +-- drivers/net/ethernet/stmicro

[PATCH v3 net-next 5/7] net: don't make false software transmit timestamps

2017-05-16 Thread Miroslav Lichvar
timestamp only if it's for a received packet (i.e. it's not in the error queue). CC: Richard Cochran CC: Willem de Bruijn Signed-off-by: Miroslav Lichvar --- net/socket.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/net/socket.c b/net/socket.c index ee1f4ec..879d

[PATCH v3 net-next 2/7] net: ethernet: update drivers to handle HWTSTAMP_FILTER_NTP_ALL

2017-05-16 Thread Miroslav Lichvar
Include HWTSTAMP_FILTER_NTP_ALL in net_hwtstamp_validate() as a valid filter and update drivers which can timestamp all packets, or which explicitly list unsupported filters instead of using a default case, to handle the filter. CC: Richard Cochran CC: Willem de Bruijn Signed-off-by: Miroslav

[PATCH v3 net-next 1/7] net: define receive timestamp filter for NTP

2017-05-16 Thread Miroslav Lichvar
Add HWTSTAMP_FILTER_NTP_ALL to the hwtstamp_rx_filters enum for timestamping of NTP packets. There is currently only one driver (phyter) that could support it directly. CC: Richard Cochran CC: Willem de Bruijn Signed-off-by: Miroslav Lichvar --- include/uapi/linux/net_tstamp.h | 3 +++ net

[PATCH v3 net-next 0/7] Extend socket timestamping API

2017-05-16 Thread Miroslav Lichvar
ve been tested on x86_64 machines with igb and e1000e drivers. Miroslav Lichvar (7): net: define receive timestamp filter for NTP net: ethernet: update drivers to handle HWTSTAMP_FILTER_NTP_ALL net: add function to retrieve original skb device using NAPI ID net: add new control message f

Re: [PATCH v2 net-next 3/7] net: add function to retrieve original skb device using NAPI ID

2017-05-16 Thread Miroslav Lichvar
On Tue, May 02, 2017 at 12:16:13PM -0400, Willem de Bruijn wrote: > On Tue, May 2, 2017 at 6:10 AM, Miroslav Lichvar wrote: > > /** > > + * dev_get_by_napi_id - find a device by napi_id > > + * @napi_id: ID of the NAPI struct > > + * > > + * S

[PATCH net] net: netcp: fix check of requested timestamping filter

2017-05-15 Thread Miroslav Lichvar
The driver doesn't support timestamping of all received packets and should return error when trying to enable the HWTSTAMP_FILTER_ALL filter. Cc: WingMan Kwok Cc: Richard Cochran Signed-off-by: Miroslav Lichvar --- drivers/net/ethernet/ti/netcp_ethss.c | 1 - 1 file changed, 1 del

Re: [PATCH v2 net-next 0/7] Extend socket timestamping API

2017-05-02 Thread Miroslav Lichvar
Hm, I see that net-next was closed. I missed the annoucement. Sorry for the spam. On Tue, May 02, 2017 at 02:46:02PM +0200, Miroslav Lichvar wrote: > Changes v1->v2: > - added separate patch for new NAPI functions > - split code from __sock_recv_timestamp() for better readability &

[PATCH v2 net-next 1/7] net: define receive timestamp filter for NTP

2017-05-02 Thread Miroslav Lichvar
Add HWTSTAMP_FILTER_NTP_ALL to the hwtstamp_rx_filters enum for timestamping of NTP packets. There is currently only one driver (phyter) that could support it directly. CC: Richard Cochran CC: Willem de Bruijn Signed-off-by: Miroslav Lichvar --- include/uapi/linux/net_tstamp.h | 3 +++ net

[PATCH v2 net-next 6/7] net: allow simultaneous SW and HW transmit timestamping

2017-05-02 Thread Miroslav Lichvar
ntrol message only when the skb has no software timestamp or it is an incoming packet. While changing sw_tx_timestamp(), inline it in skb_tx_timestamp() as there are no other users. CC: Richard Cochran CC: Willem de Bruijn Signed-off-by: Miroslav Lichvar --- Documentation/netwo

[PATCH v2 net-next 3/7] net: add function to retrieve original skb device using NAPI ID

2017-05-02 Thread Miroslav Lichvar
Bruijn Signed-off-by: Miroslav Lichvar --- include/linux/netdevice.h | 1 + include/linux/skbuff.h| 9 + net/core/dev.c| 26 ++ 3 files changed, 36 insertions(+) diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 9c23bd2..4ca2a16

[PATCH v2 net-next 2/7] net: ethernet: update drivers to handle HWTSTAMP_FILTER_NTP_ALL

2017-05-02 Thread Miroslav Lichvar
Include HWTSTAMP_FILTER_NTP_ALL in net_hwtstamp_validate() as a valid filter and update drivers which can timestamp all packets, or which explicitly list unsupported filters instead of using a default case, to handle the filter. CC: Richard Cochran CC: Willem de Bruijn Signed-off-by: Miroslav

[PATCH v2 net-next 5/7] net: don't make false software transmit timestamps

2017-05-02 Thread Miroslav Lichvar
timestamp only if it's for a received packet (i.e. it's not in the error queue). CC: Richard Cochran CC: Willem de Bruijn Signed-off-by: Miroslav Lichvar --- net/socket.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/net/socket.c b/net/socket.c index da4d4ab..fe7e

[PATCH v2 net-next 4/7] net: add new control message for incoming HW-timestamped packets

2017-05-02 Thread Miroslav Lichvar
nd drivers using napi, but it should cover all current MAC drivers that support hardware timestamping. CC: Richard Cochran CC: Willem de Bruijn Signed-off-by: Miroslav Lichvar --- Documentation/networking/timestamping.txt | 8 include/uapi/asm-generic/socket.h | 2 ++ include/

[PATCH v2 net-next 7/7] net: ethernet: update drivers to make both SW and HW TX timestamps

2017-05-02 Thread Miroslav Lichvar
skb_tx_timestamp(). CC: Richard Cochran CC: Willem de Bruijn Signed-off-by: Miroslav Lichvar --- drivers/net/ethernet/amd/xgbe/xgbe-drv.c | 3 +-- drivers/net/ethernet/intel/e1000e/netdev.c| 4 ++-- drivers/net/ethernet/samsung/sxgbe/sxgbe_main.c | 3 +-- drivers/net/ethernet/stmicro

[PATCH v2 net-next 0/7] Extend socket timestamping API

2017-05-02 Thread Miroslav Lichvar
d on x86_64 machines with igb and e1000e drivers. Miroslav Lichvar (7): net: define receive timestamp filter for NTP net: ethernet: update drivers to handle HWTSTAMP_FILTER_NTP_ALL net: add function to retrieve original skb device using NAPI ID net: add new control message for incoming HW-

Re: [PATCH v1 net-next 5/6] net: allow simultaneous SW and HW transmit timestamping

2017-05-02 Thread Miroslav Lichvar
On Fri, Apr 28, 2017 at 04:07:29PM -0400, Willem de Bruijn wrote: > On Fri, Apr 28, 2017 at 12:23 PM, Miroslav Lichvar > wrote: > > On Fri, Apr 28, 2017 at 11:50:28AM -0400, Willem de Bruijn wrote: > >> A more elegant solution would be to not set SKBTX_IN_PR

Re: [PATCH v1 net-next 5/6] net: allow simultaneous SW and HW transmit timestamping

2017-04-28 Thread Miroslav Lichvar
On Fri, Apr 28, 2017 at 11:50:28AM -0400, Willem de Bruijn wrote: > On Fri, Apr 28, 2017 at 4:54 AM, Miroslav Lichvar wrote: > >> if (skb_shinfo(skb)->tx_flags & SKBTX_SW_TSTAMP && > >> -!(skb_shinfo(skb)->tx_flags & SKBTX_IN_PROGRESS)) &g

Re: [PATCH v1 net-next 5/6] net: allow simultaneous SW and HW transmit timestamping

2017-04-28 Thread Miroslav Lichvar
gt;tx_flags & SKBTX_IN_PROGRESS)) || > + (skb->sk && skb->sk->sk_tsflags & SOF_TIMESTAMPING_OPT_TX_SWHW) I'm not sure if this can work. sk_buff.h would need to include sock.h in order to get the definition of struct sock. Any suggestions? -- Miroslav Lichvar

Re: [PATCH v1 net-next 5/6] net: allow simultaneous SW and HW transmit timestamping

2017-04-27 Thread Miroslav Lichvar
mp(skb) || !skb_is_err_queue(skb)) && ktime_to_timespec_cond(shhwtstamps->hwtstamp, tss.ts + 2)) { where skb_is_hwtx_tstamp() has return skb->tstamp == 0 && skb_is_err_queue(skb); I was just not sure about the unnecessary skb_is_err_queue() call. -- Miroslav Lichvar

Re: [PATCH v1 net-next 5/6] net: allow simultaneous SW and HW transmit timestamping

2017-04-27 Thread Miroslav Lichvar
suggest another helper function > skb_is_hwtx_tstamp with a concise comment about the race condition > between tx software and hardware timestamps (as in the last sentence of > the commit message). Should it include also the skb_is_err_queue() check? If it returned true for both TX and RX HW timestamps, maybe it could be called skb_has_hw_tstamp? -- Miroslav Lichvar

  1   2   >