Subject: Re: [PATCH RFC 5/6] net: dsa: microchip: Update tag_ksz.c to access switch driver

From: Andrew Lunn <[email-masked]>
Date: Wed, 5 Dec 2018 19:18:08 +0100

On Wed, Dec 05, 2018 at 07:00:38PM +0100, Andrew Lunn wrote:
> On Mon, Dec 03, 2018 at 03:34:56PM -0800, [email-masked] wrote:
> > From: Tristram Ha <[email-masked]>
> > 
> > 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