Subject: Re: [PATCH net-next] macvlan: Pass SIOC[SG]HWTSTAMP ioctls and get_ts_info to lower device

From: Jiri Benc <[email-masked]>
Date: Thu, 18 Jan 2018 11:57:19 +0100

On Thu, 18 Jan 2018 02:12:34 +0100, [email-masked] wrote:
> This patch allows to enable hardware timestamping on macvlan intefaces and find out capabilities of the lower device.
> 
> Signed-off-by: Grzegorz Halat <[email-masked]>

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