From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755508AbcIFHnY (ORCPT ); Tue, 6 Sep 2016 03:43:24 -0400 Received: from mail-lf0-f67.google.com ([209.85.215.67]:34065 "EHLO mail-lf0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754294AbcIFHnV (ORCPT ); Tue, 6 Sep 2016 03:43:21 -0400 MIME-Version: 1.0 In-Reply-To: <1472820817-21874-2-git-send-email-andrei.pistirica@microchip.com> References: <1472820817-21874-1-git-send-email-andrei.pistirica@microchip.com> <1472820817-21874-2-git-send-email-andrei.pistirica@microchip.com> From: Harini Katakam Date: Tue, 6 Sep 2016 13:13:19 +0530 Message-ID: Subject: Re: [RFC PATCH 2/2] macb: Enable 1588 support in SAMA5D2 platform. To: Andrei Pistirica Cc: netdev@vger.kernel.org, "linux-kernel@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , davem@davemloft.net, Nicolas Ferre , Harini Katakam , Punnaiah Choudary Kalluri , "michals@xilinx.com" , Anirudha Sarangi , Boris Brezillon , alexandre.belloni@free-electrons.com, tbultel@pixelsurmer.com, Richard Cochran Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Andrei, +Richard Cochran On Fri, Sep 2, 2016 at 6:23 PM, Andrei Pistirica wrote: > Hardware time stamp on the PTP Ethernet packets are received using the > SO_TIMESTAMPING API. Timers are obtained from the PTP event/peer > gem registers. > > Signed-off-by: Andrei Pistirica > --- > Integration with SAMA5D2 only. This feature wasn't tested on any > other platform that might use cadence/gem. > > Patch is not completely ported to the very latest version of net-next, > and it will be after review. > > @@ -853,6 +858,11 @@ static int gem_rx(struct macb *bp, int budget) > GEM_BFEXT(RX_CSUM, ctrl) & GEM_RX_CSUM_CHECKED_MASK) > skb->ip_summed = CHECKSUM_UNNECESSARY; > > +/* guard the hot-path */ > +#ifdef CONFIG_MACB_USE_HWSTAMP > + if (bp->hwts_rx_en) > + macb_ptp_do_rxstamp(bp, skb); > +#endif I'm just wondering if the same #ifdef can be used for timestamping in all versions of this IP. As you know, ZynqMP uses the timestamp from BD and older versions of do not have an indication or extended BD support. So, it might useful to add a dependency/check on the product family, through config structure. That way, both version can use their respective RX timestamp methods based on the compatible string. Please let me know if you have any other ideas. Regards, Harini