Extending socket timestamping API for NTP

2017-02-07 Thread Miroslav Lichvar
if the PHC index was provided with each HW timestamp. I'm not sure what would be the best place to put it. I guess the second timespec in scm_timestamping could be reused for this, but that sounds like a gross hack. Do we need to define a new struct? Thoughts? -- Miroslav Lichvar

Re: Extending socket timestamping API for NTP

2017-02-08 Thread Miroslav Lichvar
On Tue, Feb 07, 2017 at 10:54:22AM -0800, Soheil Hassas Yeganeh wrote: > On Tue, Feb 7, 2017 at 6:01 AM, Miroslav Lichvar <mlich...@redhat.com> wrote: > > 2) new SO_TIMESTAMPING option to receive from the error queue only > >user data as was passed to sendmsg() inste

Re: Extending socket timestamping API for NTP

2017-02-08 Thread Miroslav Lichvar
On Tue, Feb 07, 2017 at 12:37:15PM -0800, sdncurious wrote: > On Tue, Feb 7, 2017 at 6:01 AM, Miroslav Lichvar <mlich...@redhat.com> wrote: > > 6) new SO_TIMESTAMPING option to get PHC index with HW timestamps > > > >With bridges, bonding and other things

Re: Extending socket timestamping API for NTP

2017-02-09 Thread Miroslav Lichvar
On Thu, Feb 09, 2017 at 09:02:42AM +0100, Richard Cochran wrote: > On Tue, Feb 07, 2017 at 03:01:44PM +0100, Miroslav Lichvar wrote: > > 2) new SO_TIMESTAMPING option to receive from the error queue only > >user data as was passed to sendmsg() instead of Ethernet frames >

Re: Extending socket timestamping API for NTP

2017-02-09 Thread Miroslav Lichvar
On Wed, Feb 08, 2017 at 04:45:05PM -0800, Denny Page wrote: > > On Feb 07, 2017, at 06:01, Miroslav Lichvar <mlich...@redhat.com> wrote: > > > > 5) new SO_TIMESTAMPING options to get transposed RX timestamps > > 6) new SO_TIMESTAMPING option to ge

Re: Extending socket timestamping API for NTP

2017-02-28 Thread Miroslav Lichvar
On Mon, Feb 27, 2017 at 07:01:54PM -0500, Willem de Bruijn wrote: > On Mon, Feb 27, 2017 at 10:23 AM, Miroslav Lichvar <mlich...@redhat.com> > wrote: > > On Tue, Feb 07, 2017 at 02:32:04PM -0800, Willem de Bruijn wrote: > >> >> 4) allow sockets to use both SW a

Re: Extending socket timestamping API for NTP

2017-02-27 Thread Miroslav Lichvar
ore sense to not add any SCM_TIMESTAMP (and SW timestamp in SCM_TIMESTAMPING) when the the timestamp is missing. If that's not always acceptable, maybe it could be restricted to sockets that have HW timestamping enabled? Some drivers don't call skb_tx_timestamp() when HW timestamp was requested. From a cursory look it is e1000e, xgbe, sxgbe, and stmmac. This should hopefully be an easy fix. Thoughts? -- Miroslav Lichvar

[PATCH] net: ethtool: don't require CAP_NET_ADMIN for ETHTOOL_GLINKSETTINGS

2016-11-24 Thread Miroslav Lichvar
The ETHTOOL_GLINKSETTINGS command is deprecating the ETHTOOL_GSET command and likewise it shouldn't require the CAP_NET_ADMIN capability. Signed-off-by: Miroslav Lichvar <mlich...@redhat.com> --- net/core/ethtool.c | 1 + 1 file changed, 1 insertion(+) diff --git a/net/core/ethtool.c b/ne

Re: Extending socket timestamping API for NTP

2017-03-24 Thread Miroslav Lichvar
On Thu, Mar 23, 2017 at 08:07:33PM +0100, Richard Cochran wrote: > On Thu, Mar 23, 2017 at 05:21:45PM +0100, Miroslav Lichvar wrote: > > A better approach might be a control message that would provide the > > original interface index together with the length of the packet, so >

Re: Extending socket timestamping API for NTP

2017-03-24 Thread Miroslav Lichvar
On Thu, Mar 23, 2017 at 10:08:00AM -0700, Denny Page wrote: > > On Mar 23, 2017, at 09:21, Miroslav Lichvar <mlich...@redhat.com> wrote: > > > > After becoming a bit more familiar with the code I don't think this is > > a good idea anymore :). I suspect there would b

Re: Extending socket timestamping API for NTP

2017-03-27 Thread Miroslav Lichvar
On Fri, Mar 24, 2017 at 10:17:51AM -0700, Denny Page wrote: > > On Mar 24, 2017, at 02:45, Miroslav Lichvar <mlich...@redhat.com> wrote: > > How common is to have link speed changing in normal operation on LAN? > > In my case, it’s currently every few minutes becaus

Re: Extending socket timestamping API for NTP

2017-03-23 Thread Miroslav Lichvar
On Thu, Feb 09, 2017 at 12:09:41PM +0100, Miroslav Lichvar wrote: > On Thu, Feb 09, 2017 at 09:02:42AM +0100, Richard Cochran wrote: > > On Tue, Feb 07, 2017 at 03:01:44PM +0100, Miroslav Lichvar wrote: > > > 5) new SO_TIMESTAMPING options to get transposed RX timestamps > &

[RFC PATCH 2/7] net: ethernet: update drivers to handle HWTSTAMP_FILTER_NTP_ALL

2017-04-12 Thread Miroslav Lichvar
Update drivers which can timestamp all packets to handle also HWTSTAMP_FILTER_NTP_ALL. CC: Richard Cochran <richardcoch...@gmail.com> CC: Willem de Bruijn <will...@google.com> Signed-off-by: Miroslav Lichvar <mlich...@redhat.com> --- drivers/net/ethernet/amd/xgbe/xgbe-d

[RFC PATCH 1/7] net: define receive timestamp filter for NTP

2017-04-12 Thread Miroslav Lichvar
; Signed-off-by: Miroslav Lichvar <mlich...@redhat.com> --- include/uapi/linux/net_tstamp.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/uapi/linux/net_tstamp.h b/include/uapi/linux/net_tstamp.h index 464dcca..0749fb1 100644 --- a/include/uapi/linux/net_tstamp.h +++ b/

[RFC PATCH 3/7] net: add option to get information about timestamped packets

2017-04-12 Thread Miroslav Lichvar
timestamp using the skb_hw_timestamp() function. CC: Richard Cochran <richardcoch...@gmail.com> CC: Willem de Bruijn <will...@google.com> Signed-off-by: Miroslav Lichvar <mlich...@redhat.com> --- Documentation/networking/timestamping.txt | 8 include/linux/skbuff.h

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

2017-04-12 Thread Miroslav Lichvar
timestamp only if it's for a received packet (i.e. it's not in the error queue). CC: Richard Cochran <richardcoch...@gmail.com> CC: Willem de Bruijn <will...@google.com> Signed-off-by: Miroslav Lichvar <mlich...@redhat.com> --- net/socket.c | 3 ++- 1 file changed, 2 insertions(+), 1

[RFC PATCH 4/7] net: ethernet: update drivers to provide timestamping packet info

2017-04-12 Thread Miroslav Lichvar
t; CC: Jacob Keller <jacob.e.kel...@intel.com> Signed-off-by: Miroslav Lichvar <mlich...@redhat.com> --- drivers/net/ethernet/intel/e1000e/netdev.c | 14 +- drivers/net/ethernet/intel/igb/igb.h | 7 ++--- drivers/net/ethernet/intel/igb/igb_main.c | 21 --- dr

[RFC PATCH 0/7] Extend socket timestamping API

2017-04-12 Thread Miroslav Lichvar
together with HW timestamping. Miroslav Lichvar (7): net: define receive timestamp filter for NTP net: ethernet: update drivers to handle HWTSTAMP_FILTER_NTP_ALL net: add option to get information about timestamped packets net: ethernet: update drivers to provide timestamping packet info

[RFC PATCH 6/7] net: allow simultaneous SW and HW transmit timestamping

2017-04-12 Thread Miroslav Lichvar
message only when the skb has no software timestamp. CC: Richard Cochran <richardcoch...@gmail.com> CC: Willem de Bruijn <will...@google.com> Signed-off-by: Miroslav Lichvar <mlich...@redhat.com> --- Documentation/networking/timestamping.txt | 12 ++-- incl

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

2017-04-12 Thread Miroslav Lichvar
och...@gmail.com> CC: Willem de Bruijn <will...@google.com> Signed-off-by: Miroslav Lichvar <mlich...@redhat.com> --- 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 |

Re: [RFC PATCH 0/7] Extend socket timestamping API

2017-04-13 Thread Miroslav Lichvar
was that ethtool should list only filters that are actually supported by the HW and are not handled just by switching to a more general filter. I think that's what drivers I've looked were doing. The phyter driver would be the only one that could list the filter as supported. Is that correct? -- Miroslav Lichvar

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

2017-04-13 Thread Miroslav Lichvar
On Thu, Apr 13, 2017 at 10:30:32AM -0400, Willem de Bruijn wrote: > On Wed, Apr 12, 2017 at 10:17 AM, Miroslav Lichvar <mlich...@redhat.com> > wrote: > > +SOF_TIMESTAMPING_OPT_MULTIMSG: > > + > > + Allow outgoing packets to be looped multiple times to the socket

Re: [RFC PATCH 3/7] net: add option to get information about timestamped packets

2017-04-13 Thread Miroslav Lichvar
On Thu, Apr 13, 2017 at 10:37:07AM -0400, Willem de Bruijn wrote: > On Wed, Apr 12, 2017 at 10:17 AM, Miroslav Lichvar <mlich...@redhat.com> > wrote: > > Extend the skb_shared_hwtstamps structure with the index of the > > real interface which received or transmitted t

[PATCH v1 net-next 0/6] Extend socket timestamping API

2017-04-26 Thread Miroslav Lichvar
dds a new option to request both software and hardware timestamps for outgoing packets. The sixth 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

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

2017-04-26 Thread Miroslav Lichvar
message only when the skb has no software timestamp or it is an incoming packet. CC: Richard Cochran <richardcoch...@gmail.com> CC: Willem de Bruijn <will...@google.com> Signed-off-by: Miroslav Lichvar <mlich...@redhat.com> --- Documentation/networking/tim

[PATCH v1 net-next 4/6] net: don't make false software transmit timestamps

2017-04-26 Thread Miroslav Lichvar
timestamp only if it's for a received packet (i.e. it's not in the error queue). CC: Richard Cochran <richardcoch...@gmail.com> CC: Willem de Bruijn <will...@google.com> Signed-off-by: Miroslav Lichvar <mlich...@redhat.com> --- net/socket.c | 3 ++- 1 file changed, 2 insertions(+), 1

[PATCH v1 net-next 2/6] net: ethernet: update drivers to handle HWTSTAMP_FILTER_NTP_ALL

2017-04-26 Thread Miroslav Lichvar
Bruijn <will...@google.com> Signed-off-by: Miroslav Lichvar <mlich...@redhat.com> --- drivers/net/ethernet/amd/xgbe/xgbe-drv.c | 1 + drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c | 1 + drivers/net/ethernet/cavium/liquidio/lio_main.c| 1 + drivers/net/ethern

[PATCH v1 net-next 1/6] net: define receive timestamp filter for NTP

2017-04-26 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 <richardcoch...@gmail.com> CC: Willem de Bruijn <will...@google.com> Signed-off-by: Miroslav Li

[PATCH v1 net-next 3/6] net: add new control message for incoming HW-timestamped packets

2017-04-26 Thread Miroslav Lichvar
with enabled CONFIG_NET_RX_BUSY_POLL and drivers using napi, which should cover all current MAC drivers that support hardware timestamping. CC: Richard Cochran <richardcoch...@gmail.com> CC: Willem de Bruijn <will...@google.com> Signed-off-by: Miroslav Lichvar <mlic

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

2017-04-26 Thread Miroslav Lichvar
skb_tx_timestamp(). CC: Richard Cochran <richardcoch...@gmail.com> CC: Willem de Bruijn <will...@google.com> Signed-off-by: Miroslav Lichvar <mlich...@redhat.com> --- drivers/net/ethernet/amd/xgbe/xgbe-drv.c | 3 +-- drivers/net/ethernet/intel/e1000e/netdev.c| 4 ++-- dr

Re: [PATCH v1 net-next 3/6] net: add new control message for incoming HW-timestamped packets

2017-04-27 Thread Miroslav Lichvar
v2 > that extends in_pktinfo. Just a thought. The struct would contain both the original and last interface index, and the length as well? And similarly with in6_pktinfo? If there is an agreement that the information would useful also for other things than timestamping, I can try that. If not, I think it would be better to keep it tied to HW timestamping. -- Miroslav Lichvar

Re: [PATCH v1 net-next 0/6] Extend socket timestamping API

2017-04-27 Thread Miroslav Lichvar
On Wed, Apr 26, 2017 at 06:54:35PM +0200, Richard Cochran wrote: > On Wed, Apr 26, 2017 at 04:50:29PM +0200, Miroslav Lichvar wrote: > > This patchset adds new options to the timestamping API that will be > > useful for NTP implementations and possibly other applications. >

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
uld 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

Re: [RFC PATCH 3/7] net: add option to get information about timestamped packets

2017-04-24 Thread Miroslav Lichvar
On Thu, Apr 13, 2017 at 12:16:09PM -0400, Willem de Bruijn wrote: > On Thu, Apr 13, 2017 at 11:18 AM, Miroslav Lichvar <mlich...@redhat.com> > wrote: > > On Thu, Apr 13, 2017 at 10:37:07AM -0400, Willem de Bruijn wrote: > >> Why is this L2 length needed? > > >

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 <mlich...@redhat.com> wrote: > >> if (skb_shinfo(skb)->tx_flags & SKBTX_SW_TSTAMP && > >> -!(skb_shinfo(skb)->tx_flags &a

Re: [RFC PATCH 3/7] net: add option to get information about timestamped packets

2017-04-25 Thread Miroslav Lichvar
On Mon, Apr 24, 2017 at 11:18:13AM -0400, Willem de Bruijn wrote: > On Mon, Apr 24, 2017 at 5:00 AM, Miroslav Lichvar <mlich...@redhat.com> wrote: > > Would "skb->data - skb->head - > > skb->mac_header + skb->len" always work as the L2 length for rec

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 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 <mlich...@redhat.com> wrote: > > If software timestamping is enabled by the SO_TIMESTAMP(NS) option > > when a message without timestamp is already

[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 <w-kw...@ti.com> Cc: Richard Cochran <richardcoch...@gmail.com> Signed-off-by: Miroslav Lichvar <mlich...@redhat.com>

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 <mlich...@redhat.com> wrote: > > /** > > + * dev_get_by_napi_id - find a device by napi_id > > + * @napi_id: ID of the NAPI struct

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 <mlich...@redhat.com> wrote: > > +/* On transmit, software and hardware timestamps are returned > > independently. > > + * As the two skb clones s

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 <mlich...@redhat.com> > wrote: > > +Note that if the SO_TIMESTAMP or SO_TIMESTAMPNS option is enabled > > +together with SO_TIMESTAMPING using SOF_TIMEST

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 <mlich...@redhat.com> > wrote: > > +SOF_TIMESTAMPING_OPT_PKTINFO: > > + > > + Enable the SCM_TIMESTAMPING_PKTINFO control message for incomin

[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 <richardcoch...@gmail.com> CC: Willem de Bruijn <will...@google.com> Signed-off-by: Miroslav Lichvar <mlich...@redhat.com> --- drivers/net/ethernet/amd/xgbe/xgbe-drv.c | 3 +-- drivers/net/ethernet/intel/e1000e/netdev.c| 4 ++-- dr

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

2017-05-18 Thread Miroslav Lichvar
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 <richardcoch...@gmail.com> CC: Willem de Bruijn <will...@google.com> Signed-off-by: Miro

[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 <richardcoch...@gmail.com> CC: Willem de Bruijn <will...@google.com> Signed-off-by: Miroslav Li

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

2017-05-18 Thread Miroslav Lichvar
a SCM_TIMESTAMP(NS) message. CC: Richard Cochran <richardcoch...@gmail.com> CC: Willem de Bruijn <will...@google.com> Signed-off-by: Miroslav Lichvar <mlich...@redhat.com> --- Documentation/networking/timestamping.txt | 8 +++- 1 file changed, 7 insertions(+), 1 delet

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

2017-05-18 Thread Miroslav Lichvar
d-by: Willem de Bruijn <will...@google.com> Acked-by: Willem de Bruijn <will...@google.com> Signed-off-by: Miroslav Lichvar <mlich...@redhat.com> --- include/linux/netdevice.h | 1 + include/linux/skbuff.h| 9 + net/core/dev.c| 26 ++ 3 fil

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

2017-05-18 Thread Miroslav Lichvar
Bruijn <will...@google.com> Signed-off-by: Miroslav Lichvar <mlich...@redhat.com> --- drivers/net/ethernet/amd/xgbe/xgbe-drv.c | 1 + drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c | 1 + drivers/net/ethernet/cavium/liquidio/lio_main.c| 1 + drivers/net/ethern

[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 <richardcoch...@gmail.com> CC: Willem de Bruijn <will...@google.com> Signed-off-by: Miroslav Lichvar <mlich...@redhat.com> --- drivers/net/ethernet/amd/xgbe/xgbe-drv.c | 3 +-- drivers/net/ethernet/intel/e1000e/netdev.c| 4 ++-- dr

[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 <richardcoch...@gmail.com> CC: Willem de Bruijn <will...@google.com> Signed-off-by: Miroslav Li

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

2017-05-18 Thread Miroslav Lichvar
a SCM_TIMESTAMP(NS) message. CC: Richard Cochran <richardcoch...@gmail.com> CC: Willem de Bruijn <will...@google.com> Signed-off-by: Miroslav Lichvar <mlich...@redhat.com> --- Documentation/networking/timestamping.txt | 8 +++- 1 file changed, 7 insertions(+), 1 delet

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

2017-05-18 Thread Miroslav Lichvar
Bruijn <will...@google.com> Signed-off-by: Miroslav Lichvar <mlich...@redhat.com> --- drivers/net/ethernet/amd/xgbe/xgbe-drv.c | 1 + drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c | 1 + drivers/net/ethernet/cavium/liquidio/lio_main.c| 1 + drivers/net/ethern

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

2017-05-18 Thread Miroslav Lichvar
index will be returned in the control message. CC: Richard Cochran <richardcoch...@gmail.com> CC: Willem de Bruijn <will...@google.com> Signed-off-by: Miroslav Lichvar <mlich...@redhat.com> --- Documentation/networking/timestamping.txt | 9 + include/uapi/asm-generic/soc

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

2017-05-18 Thread Miroslav Lichvar
h 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. Mirosla

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 v5 net-next 0/7] Extend socket timestamping API

2017-05-18 Thread Miroslav Lichvar
he 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
d-by: Willem de Bruijn <will...@google.com> Acked-by: Willem de Bruijn <will...@google.com> Signed-off-by: Miroslav Lichvar <mlich...@redhat.com> --- include/linux/netdevice.h | 1 + include/linux/skbuff.h| 9 + net/core/dev.c| 26 ++ 3 fil

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

2017-05-18 Thread Miroslav Lichvar
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 <richardcoch...@gmail.com> CC: Willem de Bruijn <will...@google.com> Signed-off-by: Miro

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

2017-05-18 Thread Miroslav Lichvar
index will be returned in the control message. CC: Richard Cochran <richardcoch...@gmail.com> CC: Willem de Bruijn <will...@google.com> Signed-off-by: Miroslav Lichvar <mlich...@redhat.com> --- Documentation/networking/timestamping.txt | 9 + include/uapi/asm-generic/soc

[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 <richardcoch...@gmail.com> Signed-off-by: Miroslav Lichvar <mlich...@redhat.com> --- ethtool.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)

[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 <mlich...@redhat.com> 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 ou

[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 <richardcoch...@gmail.com> CC: Willem de Bruijn <will...@google.com> Signed-off-by: Miroslav Lichvar <mlich...@redhat.com> --- drivers/net/ethernet/amd/xgbe/xgbe-drv.c | 3 +-- drivers/net/ethernet/intel/e1000e/netdev.c| 4 ++-- dr

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

2017-05-19 Thread Miroslav Lichvar
a SCM_TIMESTAMP(NS) message. CC: Richard Cochran <richardcoch...@gmail.com> CC: Willem de Bruijn <will...@google.com> Signed-off-by: Miroslav Lichvar <mlich...@redhat.com> --- Documentation/networking/timestamping.txt | 8 +++- 1 file changed, 7 insertions(+), 1 delet

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

2017-05-19 Thread Miroslav Lichvar
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 <richardcoch...@gmail.com> CC: Willem de Bruijn <will...@google.com> Signed-off-by: Miro

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

2017-05-19 Thread Miroslav Lichvar
index will be returned in the control message. CC: Richard Cochran <richardcoch...@gmail.com> Acked-by: Willem de Bruijn <will...@google.com> Signed-off-by: Miroslav Lichvar <mlich...@redhat.com> --- Documentation/networking/timestamping.txt | 10 ++ include/uapi/as

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

2017-05-19 Thread Miroslav Lichvar
Bruijn <will...@google.com> Signed-off-by: Miroslav Lichvar <mlich...@redhat.com> --- drivers/net/ethernet/amd/xgbe/xgbe-drv.c | 1 + drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c | 1 + drivers/net/ethernet/cavium/liquidio/lio_main.c| 1 + drivers/net/ethern

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

2017-05-19 Thread Miroslav Lichvar
d-by: Willem de Bruijn <will...@google.com> Acked-by: Willem de Bruijn <will...@google.com> Signed-off-by: Miroslav Lichvar <mlich...@redhat.com> --- include/linux/netdevice.h | 1 + include/linux/skbuff.h| 9 + net/core/dev.c| 26 ++ 3 fil

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

2017-05-19 Thread Miroslav Lichvar
uest 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: define

[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 <richardcoch...@gmail.com> CC: Willem de Bruijn <will...@google.com> Signed-off-by: Miroslav Li

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

2017-05-16 Thread Miroslav Lichvar
en 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 for in

[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 <richardcoch...@gmail.com> CC: Willem de Bruijn <will...@google.com> Signed-off-by: Miroslav Li

[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 <richardcoch...@gmail.com> CC: Willem de Bruijn <will...@google.com> Signed-off-by: Miroslav Lichvar <mlich...@redhat.com> --- net/socket.c | 3 ++- 1 file changed, 2 insertions(+), 1

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

2017-05-16 Thread Miroslav Lichvar
Bruijn <will...@google.com> Signed-off-by: Miroslav Lichvar <mlich...@redhat.com> --- drivers/net/ethernet/amd/xgbe/xgbe-drv.c | 1 + drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c | 1 + drivers/net/ethernet/cavium/liquidio/lio_main.c| 1 + drivers/net/ethern

[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 <richardcoch...@gmail.com> CC: Willem de Bruijn <will...@google.com> Signed-off-by: Miroslav Lichvar <mlich...@redhat.com> --- drivers/net/ethernet/amd/xgbe/xgbe-drv.c | 3 +-- drivers/net/ethernet/intel/e1000e/netdev.c| 4 ++-- dr

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

2017-05-16 Thread Miroslav Lichvar
index will be returned in the control message. CC: Richard Cochran <richardcoch...@gmail.com> CC: Willem de Bruijn <will...@google.com> Signed-off-by: Miroslav Lichvar <mlich...@redhat.com> --- Documentation/networking/timestamping.txt | 9 + include/uapi/asm-generic/soc

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

2017-05-16 Thread Miroslav Lichvar
jn <will...@google.com> Suggested-by: Willem de Bruijn <will...@google.com> Signed-off-by: Miroslav Lichvar <mlich...@redhat.com> --- include/linux/netdevice.h | 1 + include/linux/skbuff.h| 9 + net/core/dev.c| 26 ++ 3 files changed

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

2017-05-16 Thread Miroslav Lichvar
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 <richardcoch...@gmail.com> CC: Willem de Bruijn <will...@google.com> Signed-off-by: Miro

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

2017-05-02 Thread Miroslav Lichvar
using napi, but it should cover all current MAC drivers that support hardware timestamping. CC: Richard Cochran <richardcoch...@gmail.com> CC: Willem de Bruijn <will...@google.com> Signed-off-by: Miroslav Lichvar <mlich...@redhat.com> --- Documentation/networking/tim

[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 <richardcoch...@gmail.com> CC: Willem de Bruijn <will...@google.com> Signed-off-by: Miroslav Lichvar <mlich...@redhat.com> --- drivers/net/ethernet/amd/xgbe/xgbe-drv.c | 3 +-- drivers/net/ethernet/intel/e1000e/netdev.c| 4 ++-- dr

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 <mlich...@redhat.com> > wrote: > > On Fri, Apr 28, 2017 at 11:50:28AM -0400, Willem de Bruijn wrote: > >> A more elegant solution would be t

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

2017-05-02 Thread Miroslav Lichvar
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-times

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

2017-05-02 Thread Miroslav Lichvar
Bruijn <will...@google.com> Signed-off-by: Miroslav Lichvar <mlich...@redhat.com> --- drivers/net/ethernet/amd/xgbe/xgbe-drv.c | 1 + drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c | 1 + drivers/net/ethernet/cavium/liquidio/lio_main.c| 1 + drivers/net/ethern

[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 <richardcoch...@gmail.com> CC: Willem de Bruijn <will...@google.com> Signed-off-by: Miroslav Li

[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 <richardcoch...@gmail.com> CC: Willem de Bruijn <will...@google.com> Signed-off-by: Miroslav Lichvar <mlich...@redhat.com> --- net/socket.c | 3 ++- 1 file changed, 2 insertions(+), 1

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

2017-05-02 Thread Miroslav Lichvar
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 <richardcoch...@gmail.com> CC: Willem de Bruijn <will...@google.com> Signed-off-by: Miro

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

2017-05-02 Thread Miroslav Lichvar
jn <will...@google.com> Suggested-by: Willem de Bruijn <will...@google.com> Signed-off-by: Miroslav Lichvar <mlich...@redhat.com> --- include/linux/netdevice.h | 1 + include/linux/skbuff.h| 9 + net/core/dev.c| 26 ++ 3 files changed

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 &

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

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
nd the system clock don'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: [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
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-02-01 Thread Miroslav Lichvar
ponses 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-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 serie

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

2018-03-08 Thread Miroslav Lichvar
t 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: [RFC v3 net-next 13/18] net/sched: Introduce the TBS Qdisc

2018-04-12 Thread Miroslav Lichvar
ere 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
is a no-op on AF_INET6 sockets. -- 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..29ced6b74

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 missin

  1   2   >