Subject: Re: [PATCH v2 net-next 09/12] net: aquantia: implement get_ts_info ethtool

From: Richard Cochran <[email-masked]>
Date: Sat, 12 Oct 2019 12:07:17 -0700

On Tue, Oct 08, 2019 at 10:56:54AM +0000, Igor Russkikh wrote:
> +static int aq_ethtool_get_ts_info(struct net_device *ndev,
> +				  struct ethtool_ts_info *info)
> +{
> +	struct aq_nic_s *aq_nic = netdev_priv(ndev);
> +
> +	ethtool_op_get_ts_info(ndev, info);
> +
> +	info->so_timestamping |=
> +		SOF_TIMESTAMPING_TX_HARDWARE |
> +		SOF_TIMESTAMPING_RX_HARDWARE |
> +		SOF_TIMESTAMPING_RAW_HARDWARE;
> +
> +	info->tx_types =
> +		BIT(HWTSTAMP_TX_OFF) |
> +		BIT(HWTSTAMP_TX_ON);
> +
> +	info->rx_filters = BIT(HWTSTAMP_FILTER_NONE);
> +
> +	if (aq_nic->aq_ptp)

Shouldn't the test for (aq_nic->aq_ptp) also effect
info->so_timestamping and info->tx_types ?

> +		info->rx_filters |= BIT(HWTSTAMP_FILTER_PTP_V2_L4_EVENT) |
> +				    BIT(HWTSTAMP_FILTER_PTP_V2_L2_EVENT) |
> +				    BIT(HWTSTAMP_FILTER_PTP_V2_EVENT);
> +
> +	info->phc_index = (aq_nic->aq_ptp) ?
> +		ptp_clock_index(aq_ptp_get_ptp_clock(aq_nic->aq_ptp)) : -1;
> +
> +	return 0;
> +}

Thanks,
Richard