> On 24 Jan 2019, at 11:16, Damjan Marion via Lists.Fd.Io 
> <dmarion=me....@lists.fd.io> wrote:
> 
> 
> 
>> On 24 Jan 2019, at 10:39, Benoit Ganne (bganne) via Lists.Fd.Io 
>> <bganne=cisco....@lists.fd.io> wrote:
>> 
>> Hi all,
>> 
>> While refactoring the GBP plugin to use feature arcs instead of hardcoded L2 
>> feature bits, I had to basically duplicate my feature arc nodes 3x (and 
>> disable/enable them 3x etc.) because the L2 feature arcs are divided in 3 
>> flavors: nonip (no IP ethertype), ip4 (IPv4 ethertype) and ip6 (IPv6 
>> ethertype). It works but I'd prefer to hide this complexity from the plugins.
>> I can see several possibilities:
>> 1) add a new feature arc flavor 'all' alongside nonip, ip4 and ip6. Nodes on 
>> this arc will gets all packets regardless of the headers. It keeps backward 
>> compat but should add a small performance hit when L2 feature arcs are 
>> enabled (we have to visit 4 feature arcs instead of 3). This is my favorite.
> 
> How this works if you have features enabled on both all and ip4 for example?
> 
>> 2) remove feature arcs flavors and just pass all packets to feature nodes. 
>> It is the responsibility of the nodes to check the packet type. It 
>> simplifies the L2 feature arc code but breaks backward compat. It could also 
>> be slightly less efficient as the ethertype test will happen later and must 
>> be duplicating in all feature nodes.

Exactly the reason why I did it this way and why I would not go that route.

>> 3) add a new feature arc using a new feature bit. It does not modify the 
>> current path at all, so perf & compat is unchanged but adds some complexity 
>> in the L2 path.
>> 4) keeps the 3 flavors as they are but add helper to register nodes to the 3 
>> arcs - basically move helpers from GBP plugin to vnet/l2. Basically same 
>> up/downside as (3)

This would be my favourite approach. The benefit of having per-arc nodes is 
that we can get compiler optimizations by using constant propagation of 
“is_ip6” parameter to a common inline node function... overhead in total is 
about 20 LOC per node, and is a one-time thing.

—a


>> 5) keep it as is (boilerplate in GBP)
>> 
>> My favorite would be (1) but I'd like to hear from more experience VPP dev.
> 
> 
> I would say 2, but that's just my 2 cents...
> 
> -- 
> Damjan
> 
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> 
> View/Reply Online (#11987): https://lists.fd.io/g/vpp-dev/message/11987
> Mute This Topic: https://lists.fd.io/mt/29523811/675608
> Group Owner: vpp-dev+ow...@lists.fd.io
> Unsubscribe: https://lists.fd.io/g/vpp-dev/unsub  [ayour...@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#11992): https://lists.fd.io/g/vpp-dev/message/11992
Mute This Topic: https://lists.fd.io/mt/29523811/21656
Group Owner: vpp-dev+ow...@lists.fd.io
Unsubscribe: https://lists.fd.io/g/vpp-dev/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to