All of lore.kernel.org
 help / color / mirror / Atom feed
From: Richard Cochran <richardcochran@gmail.com>
To: "Vick, Matthew" <matthew.vick@intel.com>
Cc: "Kirsher, Jeffrey T" <jeffrey.t.kirsher@intel.com>,
	"davem@davemloft.net" <davem@davemloft.net>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"gospo@redhat.com" <gospo@redhat.com>,
	"sassmann@redhat.com" <sassmann@redhat.com>
Subject: Re: [net-next 11/13] igb: Update PTP function names/variables and locations.
Date: Thu, 23 Aug 2012 19:53:36 +0200	[thread overview]
Message-ID: <20120823175335.GB2192@netboy.at.omicron.at> (raw)
In-Reply-To: <06DFBC1E25D8024DB214DC7F41A3CD34488DD079@ORSMSX101.amr.corp.intel.com>

On Thu, Aug 23, 2012 at 04:22:02PM +0000, Vick, Matthew wrote:

> > >  #ifdef CONFIG_IGB_PTP
> > > -static int igb_ethtool_get_ts_info(struct net_device *dev,
> > > +static int igb_get_ts_info(struct net_device *dev,
> > 
> > I like the old name better.
> 
> The old name is out of the coding style of igb. Every other function is igb_get_* or igb_set_*, with the exception of igb_ethtool_begin and igb_ethtool_complete. Are you suggesting we add _ethtool to every ethtool function in igb? 

No, just leave the names alone, and keep the functions where they
are. It is just churn.

One of the most useful ways to understand code (at least for me) is to
use git blame. It tells you when code was added, what the reason was,
and how the change looks in context. By moving and renaming willy
nilly, you are obscuring this valuable information.

> > > -#ifdef CONFIG_IGB_PTP
> > > -/**
> > > - * igb_tx_hwtstamp - utility function which checks for TX time stamp
> > > - * @q_vector: pointer to q_vector containing needed info
> > > - * @buffer: pointer to igb_tx_buffer structure
> > > - *
> > > - * If we were asked to do hardware stamping and such a time stamp is
> > > - * available, then it must have been for this skb here because we
> > > only
> > > - * allow only one such packet into the queue.
> > > - */
> > > -static void igb_tx_hwtstamp(struct igb_q_vector *q_vector,
> > > -			    struct igb_tx_buffer *buffer_info)
> > > -{
> > > -	struct igb_adapter *adapter = q_vector->adapter;
> > > -	struct e1000_hw *hw = &adapter->hw;
> > > -	struct skb_shared_hwtstamps shhwtstamps;
> > > -	u64 regval;
> > > -
> > > -	/* if skb does not support hw timestamp or TX stamp not valid
> > exit */
> > > -	if (likely(!(buffer_info->tx_flags & IGB_TX_FLAGS_TSTAMP)) ||
> > > -	    !(rd32(E1000_TSYNCTXCTL) & E1000_TSYNCTXCTL_VALID))
> > > -		return;
> > > -
> > > -	regval = rd32(E1000_TXSTMPL);
> > > -	regval |= (u64)rd32(E1000_TXSTMPH) << 32;
> > > -
> > > -	igb_systim_to_hwtstamp(adapter, &shhwtstamps, regval);
> > > -	skb_tstamp_tx(buffer_info->skb, &shhwtstamps);
> > > -}
> > > -#endif /* CONFIG_IGB_PTP */
> > > -
> > 
> > Here you have taken a static local function and made it into a global
> > function. This can have performance impacts.
> 
> Which, this function calls igb_systim_to_hwtstamp anyway, which is
> global.

So how does calling two global functions in series improve performance?

> Also, in a follow-on patch I have coming, igb_ptp_tx_hwtstamp won't
> even be called in clean_tx_irq, FWIW.

If this is part of some larger plan, then it would help to see that
plan.

> > >  /**
> > >   * igb_clean_tx_irq - Reclaim resources after transmit completes
> > >   * @q_vector: pointer to q_vector containing needed info @@ -5827,7
> > > +5796,7 @@ static bool igb_clean_tx_irq(struct igb_q_vector
> > *q_vector)
> > >
> > >  #ifdef CONFIG_IGB_PTP
> > >  		/* retrieve hardware timestamp */
> > > -		igb_tx_hwtstamp(q_vector, tx_buffer);
> > > +		igb_ptp_tx_hwtstamp(q_vector, tx_buffer);
> > 
> > This name stinks, too. You know that you can have time stamping all by
> > itself, right? It is logically separate from the ptp clock stuff.
> > 
> > This patch doesn't really improve the driver at all, IMHO.
> > 
> > Thanks,
> > Richard
> 
> Yes, I'm aware. But, as it stands today, we don't use it for anything else. If the function is feature specific, then we should be calling it out as such.

Right now the time stamping is being equated with the clock functions,
but it really should be decoupled. The 82580 can time stamp every
received packet, which can be interesting for performance monitoring,
even without PTP (and adding *that* would be a useful change).

> I'm sorry you feel like this patch doesn't improve the driver. The goal is code cleanup and consistency, both of which I consider to be driver improvements and is why I made the patches. 

But the code wasn't dirty in the first place. It doesn't need this
"cleaning." This series undoes the inline-able functions for no good
reason. As far as ixgbe goes, this driver came first, so you might as
well be making *that* driver consistent with this one.

Thanks,
Richard
 

  reply	other threads:[~2012-08-23 17:53 UTC|newest]

Thread overview: 61+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-23  9:56 [net-next 00/13][pull request] Intel Wired LAN Driver Updates Jeff Kirsher
2012-08-23  9:56 ` [net-next 01/13] e1000e: use correct type for read of 32-bit register Jeff Kirsher
2012-08-23  9:56 ` [net-next 02/13] e1000e: cleanup strict checkpatch check Jeff Kirsher
2012-08-23  9:56 ` [net-next 03/13] e1000e: cleanup - remove inapplicable comment Jeff Kirsher
2012-08-23  9:56 ` [net-next 04/13] e1000e: cleanup checkpatch PREFER_PR_LEVEL warning Jeff Kirsher
2012-08-23 14:01   ` Joe Perches
2012-08-24 18:02     ` Joe Perches
2012-08-24 21:19       ` Jeff Kirsher
2012-08-24 22:43         ` Joe Perches
2012-08-23  9:56 ` [net-next 05/13] e1000e: cleanup - remove unnecessary variable Jeff Kirsher
2012-08-23  9:56 ` [net-next 06/13] e1000e: update driver version number Jeff Kirsher
2012-08-23  9:56 ` [net-next 07/13] e1000e: cleanup strict checkpatch MEMORY_BARRIER checks Jeff Kirsher
2012-08-23  9:56 ` [net-next 08/13] igb: Add loopback test support for i210 Jeff Kirsher
2012-08-23  9:56 ` [net-next 09/13] igb: reduce Rx header size Jeff Kirsher
2012-08-23  9:56 ` [net-next 10/13] igb: Tidy up wrapping for CONFIG_IGB_PTP Jeff Kirsher
2012-08-23 11:03   ` Richard Cochran
2012-08-23 16:09     ` Vick, Matthew
2012-08-23 17:29       ` Richard Cochran
2012-08-23 17:40         ` Vick, Matthew
2012-08-23 18:03           ` Richard Cochran
2012-08-23 18:03         ` Keller, Jacob E
2012-08-23 18:40           ` Vick, Matthew
2012-08-24  7:04             ` Richard Cochran
2012-08-24 10:10             ` Richard Cochran
2012-08-24 16:51               ` Ben Hutchings
2012-08-24 19:38                 ` Keller, Jacob E
2012-08-25  6:20                   ` Richard Cochran
2012-08-26  1:33                     ` Keller, Jacob E
2012-08-26 13:01                       ` Richard Cochran
2012-08-23 11:28   ` Richard Cochran
2012-08-23 16:27     ` Vick, Matthew
2012-08-23  9:56 ` [net-next 11/13] igb: Update PTP function names/variables and locations Jeff Kirsher
2012-08-23 11:16   ` Richard Cochran
2012-08-23 16:22     ` Vick, Matthew
2012-08-23 17:53       ` Richard Cochran [this message]
2012-08-23 18:00         ` Keller, Jacob E
2012-08-23 18:11           ` Richard Cochran
2012-08-23 18:44             ` Vick, Matthew
2012-08-24  6:55               ` Richard Cochran
2012-08-24 15:52                 ` Vick, Matthew
2012-08-25  5:48                   ` Richard Cochran
2012-08-27 15:23                     ` Vick, Matthew
2012-08-27 16:44                       ` Richard Cochran
2012-08-27 17:39                         ` Vick, Matthew
2012-08-23 18:35         ` Vick, Matthew
2012-08-23 18:48           ` Keller, Jacob E
2012-08-23 18:58             ` Vick, Matthew
2012-08-24  3:02         ` Joe Perches
2012-08-24  6:32           ` Richard Cochran
2012-08-24  9:22             ` Joe Perches
2012-08-24 15:12               ` David Miller
2012-08-24 17:56                 ` Joe Perches
2012-08-23  9:56 ` [net-next 12/13] igb: Correct PTP support query from ethtool Jeff Kirsher
2012-08-23 11:24   ` Richard Cochran
2012-08-23 16:38     ` Vick, Matthew
2012-08-23  9:56 ` [net-next 13/13] igb: Store the MAC address in the name in the PTP struct Jeff Kirsher
2012-08-23 10:45   ` Richard Cochran
2012-08-23 16:05     ` Vick, Matthew
2012-08-23 21:35     ` Ben Hutchings
2012-08-24  6:19       ` Richard Cochran
2012-09-06 23:04         ` Keller, Jacob E

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120823175335.GB2192@netboy.at.omicron.at \
    --to=richardcochran@gmail.com \
    --cc=davem@davemloft.net \
    --cc=gospo@redhat.com \
    --cc=jeffrey.t.kirsher@intel.com \
    --cc=matthew.vick@intel.com \
    --cc=netdev@vger.kernel.org \
    --cc=sassmann@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.