lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Z4KdxQMBXmkF37KI@hoboy.vegasvil.org>
Date: Sat, 11 Jan 2025 08:35:17 -0800
From: Richard Cochran <richardcochran@...il.com>
To: Basharath Hussain Khaja <basharath@...thit.com>
Cc: danishanwar@...com, rogerq@...nel.org, andrew+netdev@...n.ch,
	davem@...emloft.net, edumazet@...gle.com, kuba@...nel.org,
	pabeni@...hat.com, robh@...nel.org, krzk+dt@...nel.org,
	conor+dt@...nel.org, nm@...com, ssantosh@...nel.org,
	tony@...mide.com, parvathi@...thit.com, schnelle@...ux.ibm.com,
	rdunlap@...radead.org, diogo.ivo@...mens.com, m-karicheri2@...com,
	horms@...nel.org, jacob.e.keller@...el.com, m-malladi@...com,
	javier.carrasco.cruz@...il.com, afd@...com, s-anna@...com,
	linux-arm-kernel@...ts.infradead.org, netdev@...r.kernel.org,
	devicetree@...r.kernel.org, linux-kernel@...r.kernel.org,
	linux-omap@...r.kernel.org, pratheesh@...com, prajith@...com,
	vigneshr@...com, praneeth@...com, srk@...com, rogerq@...com,
	krishna@...thit.com, pmohan@...thit.com, mohan@...thit.com
Subject: Re: [RFC PATCH 06/10] net: ti: prueth: Adds HW timestamping support
 for PTP using PRU-ICSS IEP module

On Fri, Jan 10, 2025 at 11:29:02AM +0530, Basharath Hussain Khaja wrote:

> @@ -189,12 +190,37 @@ static void icssm_emac_get_regs(struct net_device *ndev,
>  	regs->version = PRUETH_REG_DUMP_GET_VER(prueth);
>  }
>  
> +static int icssm_emac_get_ts_info(struct net_device *ndev,
> +				  struct kernel_ethtool_ts_info *info)
> +{
> +	struct prueth_emac *emac = netdev_priv(ndev);
> +
> +	if ((PRUETH_IS_EMAC(emac->prueth) && !emac->emac_ptp_tx_irq))
> +		return ethtool_op_get_ts_info(ndev, info);
> +
> +	info->so_timestamping =
> +		SOF_TIMESTAMPING_TX_HARDWARE |
> +		SOF_TIMESTAMPING_TX_SOFTWARE |

The driver advertises software Transmit time stamping, but where is
the call to skb_tx_timestamp() ?

I didn't see it in Patch #4.

> +		SOF_TIMESTAMPING_RX_HARDWARE |
> +		SOF_TIMESTAMPING_RX_SOFTWARE |
> +		SOF_TIMESTAMPING_SOFTWARE |
> +		SOF_TIMESTAMPING_RAW_HARDWARE;
> +
> +	info->phc_index = icss_iep_get_ptp_clock_idx(emac->prueth->iep);
> +	info->tx_types = BIT(HWTSTAMP_TX_OFF) | BIT(HWTSTAMP_TX_ON);
> +	info->rx_filters = BIT(HWTSTAMP_FILTER_NONE) |
> +				BIT(HWTSTAMP_FILTER_PTP_V2_EVENT);
> +
> +	return 0;
> +}

> @@ -442,6 +482,173 @@ static void icssm_emac_adjust_link(struct net_device *ndev)
>  	spin_unlock_irqrestore(&emac->lock, flags);
>  }
>  
> +static u8 icssm_prueth_ptp_ts_event_type(struct sk_buff *skb, u8 *ptp_msgtype)
> +{
> +	unsigned int ptp_class = ptp_classify_raw(skb);
> +	struct ptp_header *hdr;
> +	u8 msgtype, event_type;
> +
> +	if (ptp_class == PTP_CLASS_NONE)
> +		return PRUETH_PTP_TS_EVENTS;
> +
> +	hdr = ptp_parse_header(skb, ptp_class);
> +	if (!hdr)
> +		return PRUETH_PTP_TS_EVENTS;
> +
> +	msgtype = ptp_get_msgtype(hdr, ptp_class);
> +	/* Treat E2E Delay Req/Resp messages sane as P2P peer delay req/resp

s/sane/in the same way/

> +	 * in driver here since firmware stores timestamps in the same memory
> +	 * location for either (since they cannot operate simultaneously
> +	 * anyway)
> +	 */
> +	switch (msgtype) {
> +	case PTP_MSGTYPE_SYNC:
> +		event_type = PRUETH_PTP_SYNC;
> +		break;
> +	case PTP_MSGTYPE_DELAY_REQ:
> +	case PTP_MSGTYPE_PDELAY_REQ:
> +		event_type = PRUETH_PTP_DLY_REQ;
> +		break;
> +	/* TODO: Check why PTP_MSGTYPE_DELAY_RESP needs timestamp
> +	 * and need for it.
> +	 */
> +	case 0x9:

Delay response messages are PTP "general" messages and not event
messages, and as such they do not require time stamps.

> +	case PTP_MSGTYPE_PDELAY_RESP:
> +		event_type = PRUETH_PTP_DLY_RESP;
> +		break;
> +	default:
> +		event_type = PRUETH_PTP_TS_EVENTS;
> +	}
> +
> +	if (ptp_msgtype)
> +		*ptp_msgtype = msgtype;
> +
> +	return event_type;
> +}

Thanks,
Richard

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ