[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <ZFIKLRqFaJSHEIwp@corigine.com>
Date: Wed, 3 May 2023 09:15:57 +0200
From: Simon Horman <simon.horman@...igine.com>
To: Justin Chen <justinpopo6@...il.com>
Cc: netdev@...r.kernel.org, devicetree@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-media@...r.kernel.org,
dri-devel@...ts.freedesktop.org,
bcm-kernel-feedback-list@...adcom.com, justin.chen@...adcom.com,
f.fainelli@...il.com, davem@...emloft.net, edumazet@...gle.com,
kuba@...nel.org, pabeni@...hat.com, robh+dt@...nel.org,
krzysztof.kozlowski+dt@...aro.org, opendmb@...il.com,
andrew@...n.ch, hkallweit1@...il.com, linux@...linux.org.uk,
richardcochran@...il.com, sumit.semwal@...aro.org,
christian.koenig@....com
Subject: Re: [PATCH v2 net-next 3/6] net: bcmasp: Add support for ASP2.0
Ethernet controller
On Tue, May 02, 2023 at 02:26:53PM -0700, Justin Chen wrote:
> On Tue, May 2, 2023 at 12:44 PM Simon Horman <simon.horman@...igine.com> wrote:
> >
> > On Wed, Apr 26, 2023 at 11:54:29AM -0700, Justin Chen wrote:
...
> > > +static void bcmasp_update_mib_counters(struct bcmasp_intf *priv)
> > > +{
> > > + int i, j = 0;
> > > +
> > > + for (i = 0; i < BCMASP_STATS_LEN; i++) {
> > > + const struct bcmasp_stats *s;
> > > + u16 offset = 0;
> > > + u32 val = 0;
> > > + char *p;
> > > +
> > > + s = &bcmasp_gstrings_stats[i];
> > > + switch (s->type) {
> > > + case BCMASP_STAT_NETDEV:
> > > + case BCMASP_STAT_SOFT:
> > > + continue;
> > > + case BCMASP_STAT_RUNT:
> > > + offset += BCMASP_STAT_OFFSET;
> > > + fallthrough;
> > > + case BCMASP_STAT_MIB_TX:
> > > + offset += BCMASP_STAT_OFFSET;
> > > + fallthrough;
> > > + case BCMASP_STAT_MIB_RX:
> > > + val = umac_rl(priv, UMC_MIB_START + j + offset);
> > > + offset = 0; /* Reset Offset */
> > > + break;
> > > + case BCMASP_STAT_RX_EDPKT:
> > > + val = rx_edpkt_core_rl(priv->parent, s->reg_offset);
> > > + break;
> > > + case BCMASP_STAT_RX_CTRL:
> > > + offset = bcmasp_stat_fixup_offset(priv, s);
> > > + if (offset != ASP_RX_CTRL_FB_FILT_OUT_FRAME_COUNT)
> > > + offset += sizeof(u32) * priv->port;
> > > + val = rx_ctrl_core_rl(priv->parent, offset);
> > > + break;
> > > + }
> > > +
> > > + j += s->stat_sizeof;
> > > + p = (char *)priv + s->stat_offset;
> > > + *(u32 *)p = val;
> >
> > Is p always 32bit aligned?
> >
>
> Nope. I can make sure it is 32 bit aligned.
I'm not sure if it helps, but you could also consider put_unaligned().
> Acked, the other comments. Will submit v3 when net-next window is
> open. Thank you for the review.
Likewise, thanks.
Powered by blists - more mailing lists