Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1538411

Re: [RFC PATCH net-next v3 1/2] macb: Add 1588 support in Cadence GEM.

From Nicolas Ferre <nicolas.ferre@atmel.com>
Newsgroups linux.kernel
Subject Re: [RFC PATCH net-next v3 1/2] macb: Add 1588 support in Cadence GEM.
Date 2016-12-08 11:10 +0100
Message-ID <sM3Oh-4RM-13@gated-at.bofh.it> (permalink)
References <sLMkq-1Oz-25@gated-at.bofh.it> <sLQem-4fD-11@gated-at.bofh.it>
Organization atmel

Show all headers | View raw


Le 07/12/2016 à 20:39, Richard Cochran a écrit :
> On Wed, Dec 07, 2016 at 08:21:51PM +0200, Andrei Pistirica wrote:
>> +#ifdef CONFIG_MACB_USE_HWSTAMP
>> +void gem_ptp_init(struct net_device *ndev);
>> +void gem_ptp_remove(struct net_device *ndev);
>> +
>> +void gem_ptp_do_txstamp(struct macb *bp, struct sk_buff *skb);
>> +void gem_ptp_do_rxstamp(struct macb *bp, struct sk_buff *skb);
> 
> These are in the hot path, and so you should do the test before
> calling the global function, something like this:
> 
> void gem_ptp_txstamp(struct macb *bp, struct sk_buff *skb);
> 
> static void gem_ptp_do_txstamp(struct macb *bp, struct sk_buff *skb)
> {
> 	if (!bp->hwts_tx_en)
> 		return;
> 	gem_ptp_txstamp(bp, skb);
> }
> 
> Ditto for Rx.

Hi Richard,

So you mean that as the "global" function won't be "inlined" by the
compiler as the function is not "static" neither in the same file and
that the jump will be implemented anyway. And this even if the function
is only called at a single location...

This way, if we add a kind or accessors function like the one that you
propose, with the test in it, the branch prediction can play his role
without breaking the processor pipeline as the accessors function will
be inlined by the compiler: Am I right?

So, yes, makes sense. Thanks for the hint.

Regards,
-- 
Nicolas Ferre

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[RFC PATCH net-next v3 1/2] macb: Add 1588 support in Cadence GEM. Andrei Pistirica <andrei.pistirica@microchip.com> - 2016-12-07 16:30 +0100
  [RFC PATCH net-next v3 2/2] macb: Enable 1588 support in SAMA5Dx platforms. Andrei Pistirica <andrei.pistirica@microchip.com> - 2016-12-07 16:30 +0100
    Re: [RFC PATCH net-next v3 2/2] macb: Enable 1588 support in SAMA5Dx  platforms. Richard Cochran <richardcochran@gmail.com> - 2016-12-07 20:50 +0100
  Re: [RFC PATCH net-next v3 1/2] macb: Add 1588 support in Cadence  GEM. Richard Cochran <richardcochran@gmail.com> - 2016-12-07 20:40 +0100
    Re: [RFC PATCH net-next v3 1/2] macb: Add 1588 support in Cadence  GEM. Richard Cochran <richardcochran@gmail.com> - 2016-12-07 22:20 +0100
      RE: [RFC PATCH net-next v3 1/2] macb: Add 1588 support in Cadence  GEM. <Andrei.Pistirica@microchip.com> - 2016-12-08 15:50 +0100
        Re: [RFC PATCH net-next v3 1/2] macb: Add 1588 support in Cadence GEM. Harini Katakam <harinikatakamlinux@gmail.com> - 2016-12-09 06:40 +0100
          Re: [RFC PATCH net-next v3 1/2] macb: Add 1588 support in Cadence  GEM. Richard Cochran <richardcochran@gmail.com> - 2016-12-09 10:00 +0100
        RE: [RFC PATCH net-next v3 1/2] macb: Add 1588 support in Cadence  GEM. Rafal Ozieblo <rafalo@cadence.com> - 2016-12-09 10:30 +0100
    Re: [RFC PATCH net-next v3 1/2] macb: Add 1588 support in Cadence  GEM. Nicolas Ferre <nicolas.ferre@atmel.com> - 2016-12-08 11:10 +0100

csiph-web