Hi Padraig,

From: vpp-dev@lists.fd.io <vpp-dev@lists.fd.io> on behalf of Pádraig Connolly 
via lists.fd.io <pcpadraigconnolly96=gmail....@lists.fd.io>
Date: Saturday, 1 October 2022 at 09:52
To: vpp-dev@lists.fd.io <vpp-dev@lists.fd.io>
Subject: [vpp-dev] Insert Custom Node Into ip4-unicast Feature Arc
Hi,

For purely my own learning, I am trying to insert my custom node into the 
ip4-unicast feature arc. Based on what I know so far, I would expect the 
following FEATURE_INIT struct to achieve what I want :
VNET_FEATURE_INIT (padraig, static) =
{
  .arc_name = "ip4-unicast",
  .node_name = "padraig",
  .runs_before = VNET_FEATURES ("ip4-lookup"),
};

This and a call to vnet_feature_enable_disable(“ip4-unicast”, “Padraig”, 
sw_if_index_foo, 1, NULL, 0) shoud be all you need.

But sadly no vectors reach my custom node "padraig" when I send a IPv4 ping 
through (A trace shows no interaction with the vector).
The next thing I tried was:
VNET_FEATURE_INIT (padraig, static) =
{
  .arc_name = "ip4-unicast",
  .node_name = "padraig",
  .runs_after = VNET_FEATURES ("ip4-input"),
  .runs_before = VNET_FEATURES ("ip4-lookup"),
};

But with this I get the following runtime error:
vpp[39613]: vnet_feature_arc_init:272: feature node 'ip4-input' not found 
(before 'padraig', arc 'ip4-unicast')

ip4-input is the node at which the ip4 input feature arcs start, so it is not a 
feature on the arc, therefore other nodes cannot run before it.

I have inserted the node in the device-input feature arc before ethernet-input 
as per the wiki doc and it works perfectly but should I assume ip4-unicast 
feature arc is not really meant to have any custom nodes added to it? Or is 
this just a bad configuration on my side?

Ip4-unicast can have custom features added, see e.g. IP reassembly; 
ip4_full_reass_enable_disable()

For vectors to reach my node, does a vnet node have to have my custom node set 
as a "next_node"?

No. next nodes automatically added when the feature is enabled for the first 
time.

/neale

Thanks in advance,
Padraig

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#21951): https://lists.fd.io/g/vpp-dev/message/21951
Mute This Topic: https://lists.fd.io/mt/94037156/21656
Group Owner: vpp-dev+ow...@lists.fd.io
Unsubscribe: https://lists.fd.io/g/vpp-dev/leave/1480452/21656/631435203/xyzzy 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to