De : <vpp-dev@lists.fd.io> au nom de raju <rajugris...@gmail.com>
Date : vendredi 14 décembre 2018 à 14:58
À : vpp-dev <vpp-dev@lists.fd.io>
Objet : [vpp-dev] Feature arc and ordering graph nodes in an existing feature 
arc.

Hi
I am trying to add a feature (say 'my_node') to ip4_unicast arc.
Goal is just like ip4_gtpu_bypass to by pass the IP stack and process packets 
that are of my interest and if packets received are of not my interest give it 
back to the ip layer.
At the same time I am trying to use ip4 reassembly on the interface using CLI. 
(vppctl set interface reassembly GigabitEthernet13/0/0 on).

So expected graph

For packets of my interest :
dpdk-input --> ip4-input --> ip4-reassembly-feature --> my_node -->my_next_node 
 ....
Packets that are of not my interest :
dpdk-input --> ip4-input --> ip4-reassembly-feature --> my_node --> ip4_lookup 
--> ....

Q1. How are the feature nodes ordered in an arc ?
I tried to order these two feature my-node and  ip4-reassembly-feature using 
.runs_after like below and was able to get ip4-reassembly-feature before 
my-node. And with out using .runs_after, the order was other way. (my-node --> 
ip4-reassembly-feature).

VNET_FEATURE_INIT (my_node, static) = {
  .arc_name = "ip4-unicast",
  .node_name = "my_node",
[nr]
  .runs_before = VNET_FEATURES ("ip4-lookup"),    <<<<<< this you don’t need, 
since ip4-lookup is always last
  .runs_after = VNET_FEATURES ("ip4-reassembly-feature"),
};

Is this correct way of doing?

[nr] yes

Does the order of feature nodes in an arc depend on the order of enabling these 
using the function 'vnet_feature_enable_disable' ?

[nr] no. only runs_before and runs_after are used to determine ordering.

Q2.
With the above code, I could get my intent working with normal packets of my 
interest.
But for packets that are of not my interest I am not able to route them back to 
ip4-lookup, instead packets come to my-next-node that succeeds my-node.  I use 
the function 'vnet_feature_next' to get the next feature in the arc by default .
that meaning to say
For packets of my interest next = my_next_node
and for packets that are not of my interest next is taken from 
vnet_feature_next(vnet_buffer(b0)->sw_if_index[VLIB_RX], &next, b0);

have you defined my_next_node as an arc out of my_node, e.g.;

VLIB_REGISTER_NODE (my_node) = {
  .name = "my-node",
  .vector_size = sizeof (u32),

  .format_trace = format_ip4_rewrite_trace,

  .n_next_nodes = 1,
  .next_nodes = {
    [0] = "my-next-node",
  },
};


/Neale


Sorry for the long writings.
Please advice.

Thanks






-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#11607): https://lists.fd.io/g/vpp-dev/message/11607
Mute This Topic: https://lists.fd.io/mt/28752628/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