netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Richard Cochran <richardcochran@gmail.com>
To: Sudarsana Kalluru <Sudarsana.Kalluru@cavium.com>
Cc: davem@davemloft.net, netdev@vger.kernel.org, Yuval.Mintz@cavium.com
Subject: Re: [PATCH net-next v2 1/2] qed: Add infrastructure for PTP support.
Date: Sun, 29 Jan 2017 16:31:34 +0100	[thread overview]
Message-ID: <20170129153134.GC2223@localhost.localdomain> (raw)
In-Reply-To: <1485674903-27689-2-git-send-email-Sudarsana.Kalluru@cavium.com>

On Sat, Jan 28, 2017 at 11:28:22PM -0800, Sudarsana Kalluru wrote:
> +/* Read Rx timestamp */
> +static int qed_ptp_hw_read_rx_ts(struct qed_dev *cdev, u64 *timestamp)
> +{
> +	struct qed_hwfn *p_hwfn = QED_LEADING_HWFN(cdev);
> +	struct qed_ptt *p_ptt = p_hwfn->p_ptp_ptt;
> +	u32 val;
> +
> +	*timestamp = 0;
> +	val = qed_rd(p_hwfn, p_ptt, NIG_REG_LLH_PTP_HOST_BUF_SEQID);
> +	if (!(val & QED_TIMESTAMP_MASK)) {
> +		DP_INFO(p_hwfn, "Invalid Rx timestamp, buf_seqid = %d\n", val);
> +		return -EINVAL;
> +	}
> +
> +	val = qed_rd(p_hwfn, p_ptt, NIG_REG_LLH_PTP_HOST_BUF_TS_LSB);
> +	*timestamp = qed_rd(p_hwfn, p_ptt, NIG_REG_LLH_PTP_HOST_BUF_TS_MSB);

You can already "Reset timestamp register to allow new timestamp" at
this point, before combining the MSB and LSB.

> +	*timestamp <<= 32;
> +	*timestamp |= val;
> +
> +	/* Reset timestamp register to allow new timestamp */
> +	qed_wr(p_hwfn, p_ptt, NIG_REG_LLH_PTP_HOST_BUF_SEQID,
> +	       QED_TIMESTAMP_MASK);
> +
> +	return 0;
> +}

Thanks,
Richard

  parent reply	other threads:[~2017-01-29 15:31 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-29  7:28 [PATCH net-next v2 0/2] qed*: Add support for PTP Sudarsana Kalluru
2017-01-29  7:28 ` [PATCH net-next v2 1/2] qed: Add infrastructure for PTP support Sudarsana Kalluru
2017-01-29  8:32   ` kbuild test robot
2017-01-29 15:28   ` Richard Cochran
2017-01-29 15:31   ` Richard Cochran [this message]
2017-01-29 17:26     ` Mintz, Yuval
2017-01-29 20:51       ` Richard Cochran
2017-01-29 21:36         ` Mintz, Yuval
2017-01-30 13:26           ` Richard Cochran
2017-01-30 18:00             ` Mintz, Yuval
2017-01-29  7:28 ` [PATCH net-next v2 2/2] qede: Add driver support for PTP Sudarsana Kalluru
2017-01-29 15:35   ` Richard Cochran
2017-01-29 17:30     ` Mintz, Yuval
2017-01-29 21:02       ` Richard Cochran
2017-01-29 21:40         ` Mintz, Yuval
2017-01-30 14:34     ` David Laight
2017-01-30 17:55       ` Mintz, Yuval
2017-01-31 10:03         ` David Laight
2017-01-31 14:31           ` Mintz, Yuval
2017-01-31 14:53             ` Richard Cochran
2017-01-31 15:08               ` Mintz, Yuval
2017-01-31 17:43                 ` Richard Cochran
2017-01-29 15:09 ` [PATCH net-next v2 0/2] qed*: Add " Richard Cochran
2017-01-29 17:23   ` Mintz, Yuval

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170129153134.GC2223@localhost.localdomain \
    --to=richardcochran@gmail.com \
    --cc=Sudarsana.Kalluru@cavium.com \
    --cc=Yuval.Mintz@cavium.com \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).