[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20181205181808.GH12484@lunn.ch>
Date: Wed, 5 Dec 2018 19:18:08 +0100
From: Andrew Lunn <andrew@...n.ch>
To: Tristram.Ha@...rochip.com
Cc: Florian Fainelli <f.fainelli@...il.com>,
Pavel Machek <pavel@....cz>, UNGLinuxDriver@...rochip.com,
netdev@...r.kernel.org
Subject: Re: [PATCH RFC 5/6] net: dsa: microchip: Update tag_ksz.c to access
switch driver
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@...rochip.com wrote:
> > From: Tristram Ha <Tristram.Ha@...rochip.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.
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
Powered by blists - more mailing lists