From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jiri Benc Subject: Re: [PATCH net-next] macvlan: Pass SIOC[SG]HWTSTAMP ioctls and get_ts_info to lower device Date: Thu, 18 Jan 2018 11:57:19 +0100 Message-ID: <20180118115719.3c5efc67@redhat.com> References: <20180118011233.GA14152@HTGD74-02.ds.mot.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: netdev@vger.kernel.org, davem@davemloft.net To: grzegorz.halat@gmail.com Return-path: Received: from mx1.redhat.com ([209.132.183.28]:38470 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754788AbeARK5W (ORCPT ); Thu, 18 Jan 2018 05:57:22 -0500 In-Reply-To: <20180118011233.GA14152@HTGD74-02.ds.mot.com> Sender: netdev-owner@vger.kernel.org List-ID: On Thu, 18 Jan 2018 02:12:34 +0100, grzegorz.halat@gmail.com wrote: > This patch allows to enable hardware timestamping on macvlan intefaces and find out capabilities of the lower device. > > Signed-off-by: Grzegorz Halat NACK. This does not work. For start, how do you deal with fwd_priv? When a packet is sent to other software ports, it wouldn't be time stamped. And I expect more cases like this to be there in macvlan, I only spent 10 seconds checking it. Please study how time stamping in the kernel works. A good start is Documentation/networking/timestamping.txt. Then examine all possible packet paths with macvlan, both egress and ingress. > +static int macvlan_ethtool_get_ts_info(struct net_device *dev, > + struct ethtool_ts_info *ts_info) > +{ > + const struct macvlan_dev *vlan = netdev_priv(dev); > + const struct ethtool_ops *eth_ops = vlan->lowerdev->ethtool_ops; > + > + if (eth_ops->get_ts_info) > + return eth_ops->get_ts_info(vlan->lowerdev, ts_info); > + > + ts_info->so_timestamping = SOF_TIMESTAMPING_RX_SOFTWARE | > + SOF_TIMESTAMPING_SOFTWARE; > + ts_info->phc_index = -1; What calls skb_tx_timestamp if the driver does not support it? Jiri