Re: [PATCH v2 net-next 06/16] net: dsa: add a generic procedure for the flow dissector

2020-09-26 Thread Andrew Lunn
On Sat, Sep 26, 2020 at 09:18:15PM +0300, Vladimir Oltean wrote: > On Sat, Sep 26, 2020 at 08:05:45PM +0200, Andrew Lunn wrote: > > Given spectra and meltdown etc, jumping through a pointer is expensive > > and we try to avoid it on the hot path. Given most of the taggers are > > going to use the g

Re: [PATCH v2 net-next 06/16] net: dsa: add a generic procedure for the flow dissector

2020-09-26 Thread Vladimir Oltean
On Sat, Sep 26, 2020 at 08:05:45PM +0200, Andrew Lunn wrote: > Given spectra and meltdown etc, jumping through a pointer is expensive > and we try to avoid it on the hot path. Given most of the taggers are > going to use the generic version, maybe add a test here, is > ops->flow_dissect the generic

Re: [PATCH v2 net-next 06/16] net: dsa: add a generic procedure for the flow dissector

2020-09-26 Thread Andrew Lunn
> +void dsa_tag_generic_flow_dissect(const struct sk_buff *skb, __be16 *proto, > + int *offset) > +{ > + const struct dsa_device_ops *ops = skb->dev->dsa_ptr->tag_ops; > + int tag_len = ops->overhead; > + > + *offset = tag_len; > + *proto = ((__be16 *)s

Re: [PATCH v2 net-next 06/16] net: dsa: add a generic procedure for the flow dissector

2020-09-26 Thread Andrew Lunn
On Sat, Sep 26, 2020 at 08:30:58PM +0300, Vladimir Oltean wrote: > 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

[PATCH v2 net-next 06/16] net: dsa: add a generic procedure for the flow dissector

2020-09-26 Thread Vladimir Oltean
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