From: <Arun.Ramadoss@microchip.com>
To: <olteanv@gmail.com>
Cc: <andrew@lunn.ch>, <linux-kernel@vger.kernel.org>,
<UNGLinuxDriver@microchip.com>, <vivien.didelot@gmail.com>,
<f.fainelli@gmail.com>, <kuba@kernel.org>, <pabeni@redhat.com>,
<netdev@vger.kernel.org>, <Woojung.Huh@microchip.com>,
<davem@davemloft.net>
Subject: Re: [RFC patch net-next 3/3] net: dsa: ksz: moved ksz9477 port mirror to ksz_common.c
Date: Thu, 28 Apr 2022 16:05:15 +0000 [thread overview]
Message-ID: <7092c728df06e762aa659119c057b4ee308967d4.camel@microchip.com> (raw)
In-Reply-To: <20220428152233.tqzbdrqqgydilncw@skbuf>
On Thu, 2022-04-28 at 18:22 +0300, Vladimir Oltean wrote:
> EXTERNAL EMAIL: Do not click links or open attachments unless you
> know the content is safe
>
> On Thu, Apr 28, 2022 at 03:09:50PM +0000, Arun.Ramadoss@microchip.com
> wrote:
> > > > +#define
> > > > P_MIRROR_CTRL REG_PORT_MRI_MIRROR_CTRL
> > > > +
> > > > +#define S_MIRROR_CTRL REG_SW_MRI_CTRL_0
> > >
> > > Small comment: if P_MIRROR_CTRL and S_MIRROR_CTRL are expected to
> > > be
> > > at
> > > the same register offset for all switch families, why is there a
> > > macro
> > > behind a macro for their addresses?
> >
> > ksz8795 and ksz9477 have different address/register for the
> > Mirror_ctrl. To make it common for the both, P_MIRROR_CTRL is
> > defined
> > in ksz8795_reg.h and ksz9477_reg.h file.
> > I just carried forward to ksz_reg.h.
>
> So if P_MIRROR_CTRL has different values for ksz9477 and ksz8795, how
> exactly do you plan to mask that difference away through the C
> preprocessor
> at the level of ksz_reg.h included by ksz_common.c, depending on
> which
> switch driver calls ksz_port_mirror_add()?
>
> This can't work, you need to provide the offset of P_MIRROR_CTRL as
> argument to the common function. What am I missing?
I compared the ksz8795 and ksz9447 mirror_add/del implementation, they
are different. Ksz9477 writes S_MIRROR_CTRL in addition to
P_MIRROL_CTRL. KSZ9477 and LAN937x have similar register set but
KSZ8795 has only limited registers/functionality.
Similar to port_mirror, few other functionality like mib counter, vlan
registers are same for both KSZ9477 & LAN937x.But ksz8795 has different
set of register implementation for that.
So I thought of not to disturb the existing ksz8795 implementation
except for any conflicts, just move the ksz9477 to ksz_common, and call
this for KSZ9477 and LAN937x dsa hooks.
prev parent reply other threads:[~2022-04-28 16:06 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-27 16:23 [RFC patch net-next 0/3] net: dsa: ksz: generic port mirror function for ksz9477 based switch Arun Ramadoss
2022-04-27 16:23 ` [RFC patch net-next 1/3] net: dsa: ksz9477: port mirror sniffing limited to one port Arun Ramadoss
2022-04-27 16:40 ` Vladimir Oltean
2022-04-27 16:23 ` [RFC patch net-next 2/3] net: dsa: ksz: remove duplicate ksz_cfg and ksz_port_cfg Arun Ramadoss
2022-04-27 16:49 ` Vladimir Oltean
2022-04-27 16:23 ` [RFC patch net-next 3/3] net: dsa: ksz: moved ksz9477 port mirror to ksz_common.c Arun Ramadoss
2022-04-27 16:57 ` Vladimir Oltean
2022-04-28 15:09 ` Arun.Ramadoss
2022-04-28 15:22 ` Vladimir Oltean
2022-04-28 16:05 ` Arun.Ramadoss [this message]
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=7092c728df06e762aa659119c057b4ee308967d4.camel@microchip.com \
--to=arun.ramadoss@microchip.com \
--cc=UNGLinuxDriver@microchip.com \
--cc=Woojung.Huh@microchip.com \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=f.fainelli@gmail.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=olteanv@gmail.com \
--cc=pabeni@redhat.com \
--cc=vivien.didelot@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).