Thread (6 messages) flat view 6 messages, 2 authors, 2020-07-09

Re: [PATCH v2 net-next 3/3] octeontx2-pf: Add support for PTP clock

From: sundeep subbaraya <hidden>
Date: 2020-07-09 12:54:57

Hi Jakub,

On Wed, Jul 8, 2020 at 11:10 PM Jakub Kicinski [off-list ref] wrote:
On Wed,  8 Jul 2020 22:20:18 +0530 sundeep.lkml@gmail.com wrote:
quoted
From: Aleksey Makarov <redacted>

This patch adds PTP clock and uses it in Octeontx2
network device. PTP clock uses mailbox calls to
access the hardware counter on the RVU side.

Co-developed-by: Subbaraya Sundeep <sbhatta@marvell.com>
Signed-off-by: Subbaraya Sundeep <sbhatta@marvell.com>
Signed-off-by: Aleksey Makarov <redacted>
Signed-off-by: Sunil Goutham <sgoutham@marvell.com>
Please address the new sparse warnings as well:

drivers/net/ethernet/marvell/octeontx2/nic/otx2_txrx.c:130:42: warning: cast to restricted __be64
Sure. There are some already existing in octeontx2/ for those I will
fix and submit after this patch set.
quoted
+static inline void otx2_set_rxtstamp(struct otx2_nic *pfvf,
+                                  struct sk_buff *skb, void *data)
+{
Please don't use static inline in C files, compiler will know which
static functions to inline, and static inline covers up unused code.
Sure.

Thanks,
Sundeep
quoted
+     u64 tsns;
+     int err;
+
+     if (!(pfvf->flags & OTX2_FLAG_RX_TSTAMP_ENABLED))
+             return;
+
+     /* The first 8 bytes is the timestamp */
+     err = otx2_ptp_tstamp2time(pfvf, be64_to_cpu(*(u64 *)data), &tsns);
+     if (err)
+             return;
+
+     skb_hwtstamps(skb)->hwtstamp = ns_to_ktime(tsns);
+}
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help