All of lore.kernel.org
 help / color / mirror / Atom feed
From: Giuseppe CAVALLARO <peppe.cavallaro@st.com>
To: David Miller <davem@davemloft.net>
Cc: netdev@vger.kernel.org, bh74.an@samsung.com, rayagond@vayavyalabs.com
Subject: Re: [net-next.git 0/9] stmmac: update to March_2013 (adding PTP & RGMII/SGMII)
Date: Mon, 11 Mar 2013 08:11:22 +0100	[thread overview]
Message-ID: <513D839A.8000009@st.com> (raw)
In-Reply-To: <20130308.112219.1999774630969953487.davem@davemloft.net>

On 3/8/2013 5:22 PM, David Miller wrote:
> From: Giuseppe CAVALLARO <peppe.cavallaro@st.com>
> Date: Fri, 08 Mar 2013 08:16:24 +0100
>
>> Hello David
>>
>> On 3/7/2013 9:34 PM, David Miller wrote:
>>> From: Giuseppe CAVALLARO <peppe.cavallaro@st.com>
>>> Date: Thu,  7 Mar 2013 11:50:10 +0100
>>>
>>>> The PTP support is quite intrusive because it needs to support the
>>>> extended
>>>> descriptors used for saving the HW timestamps.
>>>> These are available in new chip generations, only.
>>>> So we have actually found useful to use some Kconfig options to
>>>> surround PTP and extended descriptor support. This approach helped on
>>>> old platform (embeeded system) where PTP is not supported and where we
>>>> do not want to pay extra code and check in critical rx/tx paths.
>>>
>>> I would prefer run time handling of all of this.
>>>
>>> You do not need to put extra checks in the fast paths, instead you
>>> have different methods that get hooked up into the netdev_ops
>>> based upon chip capabilities/features/mode.
>   ...
>> Welcome advice.
>
> Exactly what I told you above.  You have two sets of routines,
> one that deal with the older descriptors and one set that deals
> with the new descriptors that can do PTP.
>
> And you hook up different interrupt handler, NAPI poll, and
> netdev_ops based upon the chip's capabilities.
>
> You need no runtime testing, only a test a probe time to setup
> things up properly.

> What is so hard about this to understand?

This is exactly what the driver does to manage different chip versions
w/o using any ifdef. So fortunately I had already understood this :-).

Unfortunately, just in this case, I've met some problems on
implementing the code because We have three cases:

  1- normal desc
  2- enhanced desc.
  3- enhanced desc + extended desc.
                     -------------
                          |_ Also used for PTPv2

To support extended desc (3) we have to modify the main descriptor
structure and it is not good for the case (2) where the DMA will expect
to use these descriptors:

-------------
|   des0    |    status / conf
-------------
|   des1    |    status / conf
-------------
|   des2    |    Buffer 1 Address [31:0]
-------------
|   des3    |    Buffer 2 Address [31:0] or Next Descriptor Addr
-------------

but we have added other 4 fields:
	struct des {
		unsigned int des0;
		unsigned int des1;
		unsigned int des2;
		unsigned int des3;
		unsigned int des4; |
		unsigned int des5; |_ extended
		unsigned int des6; |
		unsigned int des7; |
	}

and this structure cannot be used.
In fact, if the HW supports the  extended desc we have to program a
register to allow the DMA to walk through the new structure.

At any case, I'll arrange to change the code removing the Koption and
continuing (as done in the past) to setup at probe time the right
configuration. This will be in the next version of the patches.

Thx
Peppe

  reply	other threads:[~2013-03-11  7:23 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-07 10:50 [net-next.git 0/9] stmmac: update to March_2013 (adding PTP & RGMII/SGMII) Giuseppe CAVALLARO
2013-03-07 10:50 ` [net-next.git 1/9] stmmac: add tx_skbuff_dma to save descriptors used by PTP Giuseppe CAVALLARO
2013-03-07 10:50 ` [net-next.git 2/9] stmmac: add IEEE 1588-2002 PTP support Giuseppe CAVALLARO
2013-03-08  6:34   ` Richard Cochran
2013-03-08  7:02     ` Giuseppe CAVALLARO
2013-03-08  7:51       ` Rayagond K
2013-03-10 12:25       ` Richard Cochran
2013-03-10 12:40         ` Richard Cochran
2013-03-11  6:35         ` Giuseppe CAVALLARO
     [not found]       ` <CAJ3bTp6tQ4L0vya9-eO0E+19Wk74uNJonbA9hqc+fgN77dcjOQ@mail.gmail.com>
2013-03-10 12:31         ` Richard Cochran
2013-03-07 10:50 ` [net-next.git 3/9] stmmac: support extend descriptors Giuseppe CAVALLARO
2013-03-07 10:50 ` [net-next.git 4/9] stmmac: add the support for PTP hw clock driver Giuseppe CAVALLARO
2013-03-10 12:10   ` Richard Cochran
     [not found]     ` <CAJ3bTp7n-Y6TYrhDMe58fALtX5O34qifO9khWYXpo-OwnrRKiQ@mail.gmail.com>
2013-03-11 18:55       ` Richard Cochran
2013-03-12  4:43         ` Rayagond K
2013-03-07 10:50 ` [net-next.git 5/9] stmmac: add IEEE 1588-2008 PTP V2 support Giuseppe CAVALLARO
2013-03-07 10:50 ` [net-next.git 6/9] stmmac: add missing supported filters to get_ts_info Giuseppe CAVALLARO
2013-03-10 12:36   ` Richard Cochran
2013-03-11  6:39     ` Giuseppe CAVALLARO
2013-03-07 10:50 ` [net-next.git 7/9] stmmac: start adding pcs and rgmii core irq Giuseppe CAVALLARO
2013-03-07 10:50 ` [net-next.git 8/9] stmmac: initial support to manage pcs modes Giuseppe CAVALLARO
2013-03-07 10:50 ` [net-next.git 9/9] stmmac: update the Doc and Version (PTP+SGMII) Giuseppe CAVALLARO
2013-03-07 20:34 ` [net-next.git 0/9] stmmac: update to March_2013 (adding PTP & RGMII/SGMII) David Miller
2013-03-08  7:16   ` Giuseppe CAVALLARO
2013-03-08 16:22     ` David Miller
2013-03-11  7:11       ` Giuseppe CAVALLARO [this message]
2013-03-22 14:27         ` Giuseppe CAVALLARO
2013-03-08  6:04 ` Richard Cochran
2013-03-08  6:39   ` Giuseppe CAVALLARO

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=513D839A.8000009@st.com \
    --to=peppe.cavallaro@st.com \
    --cc=bh74.an@samsung.com \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    --cc=rayagond@vayavyalabs.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.