Re: [PATCH v3 6/9] ethernet: ti: cpts: Use generic helper function
From: Grygorii Strashko <grygorii.strashko@ti.com>
Date: 2020-08-05 19:11:51
On 02/08/2020 23:22, Florian Fainelli wrote:
On 7/30/2020 1:00 AM, Kurt Kanzenbach wrote:quoted
In order to reduce code duplication between ptp drivers, generic helper functions were introduced. Use them. Signed-off-by: Kurt Kanzenbach <kurt@linutronix.de> ---[snip]quoted
- if (unlikely(ptp_class & PTP_CLASS_V1)) - msgtype = data + offset + OFF_PTP_CONTROL; - else - msgtype = data + offset; + msgtype = ptp_get_msgtype(hdr, ptp_class); + seqid = be16_to_cpu(hdr->sequence_id);Same comment as patch 5 would probably apply here as well, with using ntohs(): Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
As reported in [1] this patch as is broke cpts and below diff on top restore it [1] https://lore.kernel.org/netdev/20200805152503.GB9122@hoboy/T/#mcf2bd0322805e6706ee9fe4f10805e657fd0103e (local) -- Best regards, grygorii ---------------
--- a/drivers/net/ethernet/ti/cpts.c
+++ b/drivers/net/ethernet/ti/cpts.c@@ -509,6 +509,11 @@ void cpts_rx_timestamp(struct cpts *cpts, struct sk_buff *skb) int ret; u64 ns; + /* cpts_rx_timestamp() is called before eth_type_trans(), so + * skb MAC Hdr properties are not configured yet. Hence need to + * rest skb MAC header here + */ + skb_reset_mac_header(skb); ret = cpts_skb_get_mtype_seqid(skb, &skb_cb->skb_mtype_seqid); if (!ret) return;