Re: [RFC PATCH v7 12/16] net: dsa: qca8k: add support for phy read/write with mgmt Ethernet

Vladimir Oltean
2022-01-26T22:05:11Z

On Wed, Jan 26, 2022 at 02:57:03AM +0100, Ansuel Smith wrote:
> > > > Shouldn't qca8k_master_change() also take phy_hdr_data->mutex?
> > > >
> > >
> > > Is actually the normal mgmg_hdr_data.
> > >
> > > phy_hdr_data = &priv->mgmt_hdr_data;
> > >
> > > Should I remove this and use mgmt_hdr_data directly to remove any
> > > confusion?
> >
> > I am not thrilled by the naming of this data structure anyway
> > (why "hdr"?), but yes, I also got tricked by inconsistent naming.
> > Please choose a consistent name and stick with it.
>
> Hdr as header stuff since all this stuff is put in the hdr. Should I
> just drop hdr and use mgmt_data directly? Or mgmt_eth?

I don't have a strong preference because I can't find a good name.
Consistency in naming this feature is the most important part.
Maybe it is just me who is reading it this way, but I associate a
structure whose name contains "hdr" with something that pertains to data
from an skb (such as "mgmt_ethhdr" which is exactly that), hence the
earlier comment. I opened the manual and the phrasing that the vendor
uses is that "[ the switch ] supports the read/write register (sic)
through the Atheros header". So it makes more sense now and it's in line
with that, at least to some degree. I understand if you prefer not to
change it, but "mgmt_data" sounds less confusing to me.