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]
Date:	Thu, 13 Mar 2014 05:53:09 -0700
From:	Joe Perches <joe@...ches.com>
To:	Byungho An <bh74.an@...sung.com>
Cc:	netdev@...r.kernel.org, linux-samsung-soc@...r.kernel.org,
	davem@...emloft.net, ilho215.lee@...sung.com,
	siva.kallam@...sung.com, vipul.pandya@...sung.com,
	ks.giri@...sung.com
Subject: Re: [PATCH V2 RE-SEND 1/7] net: sxgbe: add basic framework for
 Samsung 10Gb ethernet driver

On Thu, 2014-03-13 at 15:55 +0900, Byungho An wrote:
> This patch adds support for Samsung 10Gb ethernet driver(sxgbe).
> - sxgbe core initialization
> - Tx and Rx support
> - MDIO support
> - ISRs for Tx and Rx
> - ifconfig support to driver
[]
> diff --git a/drivers/net/ethernet/samsung/sxgbe_desc.c b/drivers/net/ethernet/samsung/sxgbe_desc.c
[]
> +/* Set Time stamp */
> +static void sxgbe_tx_ctxt_desc_set_tstamp(struct sxgbe_tx_ctxt_desc *p,
> +					  u8 ostc_enable, u64 tstamp)
> +{
> +	if (ostc_enable) {
> +		p->ostc = ostc_enable;
> +		p->tstamp_lo = (u32) tstamp;
> +		p->tstamp_hi = (u32) (tstamp>>32);
> +	}
> +}

[]

> +static u64 sxgbe_get_rx_timestamp(struct sxgbe_rx_ctxt_desc *p)
> +{
> +	u64 ns;
> +	ns = p->tstamp_lo;
> +	ns += p->tstamp_hi * 1000000000ULL;
> +
> +	return ns;
> +}

This looks odd.

rx and tx timestamps are different clocks?

rx tstamp_lo resets every second but tx_stamp
is free-running?

Maybe this was supposed to be something like

	ns = p->tstamp_lo
	ns |= ((u64)tstamp_hi) << 32;

If not, maybe it warrants a comment around
here or on the descriptor definition

> diff --git a/drivers/net/ethernet/samsung/sxgbe_desc.h b/drivers/net/ethernet/samsung/sxgbe_desc.h
[]
> +/* Context descriptor structure */
> +struct sxgbe_tx_ctxt_desc {
> +	u32 tstamp_lo:32;
> +	u32 tstamp_hi:32;

[]

> +struct sxgbe_rx_ctxt_desc {
> +	u32 tstamp_lo:32;
> +	u32 tstamp_hi:32;
 


--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ