From: Florian Fainelli <f.fainelli@gmail.com>
To: Andrew Lunn <andrew@lunn.ch>, Tristram.Ha@microchip.com
Cc: Pavel Machek <pavel@ucw.cz>,
UNGLinuxDriver@microchip.com, netdev@vger.kernel.org
Subject: Re: [PATCH RFC 5/6] net: dsa: microchip: Update tag_ksz.c to access switch driver
Date: Wed, 5 Dec 2018 10:52:13 -0800 [thread overview]
Message-ID: <899f4595-eaa1-269d-ca31-36bdf8b64923@gmail.com> (raw)
In-Reply-To: <20181205181808.GH12484@lunn.ch>
On 12/5/18 10:18 AM, Andrew Lunn wrote:
> On Wed, Dec 05, 2018 at 07:00:38PM +0100, Andrew Lunn wrote:
>> On Mon, Dec 03, 2018 at 03:34:56PM -0800, Tristram.Ha@microchip.com wrote:
>>> From: Tristram Ha <Tristram.Ha@microchip.com>
>>>
>>> Update tag_ksz.c to access switch driver's tail tagging operations.
>>
>> Hi Tristram
>>
>> Humm, i'm not sure we want this, the tagging spit into two places. I
>> need to take a closer look at the previous patch, to see why it cannot
>> be done here.
>
> O.K, i think i get what is going on.
>
> I would however implement it differently.
>
> One net/dsa/tag_X.c file can export two dsa_device_ops structures,
> allowing you to share common code for the two taggers. You could call
> these DSA_TAG_PROTO_KSZ_1_BYTE, and DSA_TAG_PROTO_KSZ_2_BYTE, and the
> .get_tag_protocol call would then return the correct one for the
> switch.
Agreed, that is what is done by net/dsa/tag_brcm.c because there are two
formats for the Broadcom tag:
- TAG_BRCM: the 4-bytes Broadcom tag is between MAC SA and Ethertype
- TAG_BRCM_PREPEND: the 4-bytes Broadcom tag is before the MAC DA
And the code to process them is basically using relative offsets from
the start of the frame to access correct data.
This is done largely for performance reasons because we have 1/2
Gigabit/secs capable CPU ports and so we want to avoid as little cache
trashing as possible and immediately get the right rcv() function to
process the packets.
>
> It might also be possible to merge in tag_trailer, or at least share
> some code.
>
> What i don't yet understand is how you are passing PTP information
> around. The commit messages need to explain that, since it is not
> obvious, and it is the first time we have needed PTP info in a tag
> driver.
>
> Andrew
>
--
Florian
next prev parent reply other threads:[~2018-12-05 18:52 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-12-03 23:34 [PATCH RFC 0/6] net: dsa: microchip: Modify KSZ9477 DSA driver to support different tail tag formats Tristram.Ha
2018-12-03 23:34 ` [PATCH RFC 1/6] net: dsa: microchip: Prepare PHY for proper advertisement Tristram.Ha
2018-12-05 17:40 ` Andrew Lunn
2018-12-06 20:31 ` Tristram.Ha
2018-12-03 23:34 ` [PATCH RFC 2/6] net: dsa: microchip: Add MIB counter reading support Tristram.Ha
2018-12-05 17:53 ` Andrew Lunn
2018-12-06 20:16 ` Tristram.Ha
2018-12-06 20:42 ` Andrew Lunn
2018-12-03 23:34 ` [PATCH RFC 3/6] net: dsa: microchip: Break ksz_priv.h into two files Tristram.Ha
2018-12-03 23:34 ` [PATCH RFC 4/6] net: dsa: microchip: Each switch driver has its own tail tagging operations Tristram.Ha
2018-12-03 23:34 ` [PATCH RFC 5/6] net: dsa: microchip: Update tag_ksz.c to access switch driver Tristram.Ha
2018-12-05 18:00 ` Andrew Lunn
2018-12-05 18:18 ` Andrew Lunn
2018-12-05 18:52 ` Florian Fainelli [this message]
2018-12-06 20:00 ` Tristram.Ha
2018-12-06 20:41 ` Andrew Lunn
2018-12-07 3:16 ` Richard Cochran
2018-12-09 9:17 ` Pavel Machek
2018-12-11 23:59 ` Tristram.Ha
2018-12-12 8:18 ` Andrew Lunn
2018-12-03 23:34 ` [PATCH RFC 6/6] net: dsa: microchip: Add switch offload forwarding support Tristram.Ha
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=899f4595-eaa1-269d-ca31-36bdf8b64923@gmail.com \
--to=f.fainelli@gmail.com \
--cc=Tristram.Ha@microchip.com \
--cc=UNGLinuxDriver@microchip.com \
--cc=andrew@lunn.ch \
--cc=netdev@vger.kernel.org \
--cc=pavel@ucw.cz \
/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.