On Tue, 12 May 2020 at 02:15, Florian Fainelli <f.faine...@gmail.com> wrote: > > > > On 5/11/2020 1:20 PM, Vladimir Oltean wrote: > > From: Vladimir Oltean <vladimir.olt...@nxp.com> > > > > For all DSA formats that don't use tail tags, it looks like behind the > > obscure number crunching they're all doing the same thing: locating the > > real EtherType behind the DSA tag. Nonetheless, this is not immediately > > obvious, so create a generic helper for those DSA taggers that put the > > header before the EtherType. > > > > Another assumption for the generic function is that the DSA tags are of > > equal length on RX and on TX. Prior to the previous patch, this was not > > true for ocelot and for gswip. The problem was resolved for ocelot, but > > for gswip it still remains, so that hasn't been converted. > > > > Signed-off-by: Vladimir Oltean <vladimir.olt...@nxp.com> > > Given that __skb_flow_dissect() already de-references dsa_device_ops > from skb->dev->dsa_ptr, maybe we can go one step further and just have > dsa_tag_generic_flow_dissect obtain the overhead from the SKB directly > since this will already have touched the cache lines involved. This then > makes it unnecessary for the various taggers to specify a custom > function and instead, dsa_tag_generic_flow_dissect() can be assigned > where the dsa_device_ops are declared for the various tags. Did I miss > something? > > It also looks like tag_ocelot.c and tag_sja1105.c should have their > dsa_device_ops structures const, as a separate patch certainly. > -- > Florian
Actually I wrote this patch in such a way that the assembly code generated would remain the same, since dsa_tag_generic_flow_dissect is inline, the arithmetic would be done at compile time, which it wouldn't be if this function were to look at the tagger .overhead. I don't know, I can do either way.