[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <BL2PR07MB23065AC5421859AAC6D334348D480@BL2PR07MB2306.namprd07.prod.outlook.com>
Date: Sun, 29 Jan 2017 17:26:13 +0000
From: "Mintz, Yuval" <Yuval.Mintz@...ium.com>
To: Richard Cochran <richardcochran@...il.com>
CC: "davem@...emloft.net" <davem@...emloft.net>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
"Kalluru, Sudarsana" <Sudarsana.Kalluru@...ium.com>
Subject: RE: [PATCH net-next v2 1/2] qed: Add infrastructure for PTP support.
> > +/* 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.
We could - but what difference would it make?
> > + *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;
> > +}
Powered by blists - more mailing lists