Thanks for the guidance Neale, this definitely helps.
I think approach #2 suits my purpose. Looking at the example you linked
it looks like I'll use a combination of mpls_label_dpo_create() and
fib_table_entry_special_dpo_add(). I'm not clear on all the parameters
yet, but will look at it more and try some things. I'll circle back if I
can't figure it out.
Thanks again,
Jeff
On 1/6/26 17:51, Neale Ranns via lists.fd.io wrote:
Hi Jeff,
There isn’t a way to achieve that using the current CLI.
I would suggest you add a new CLI/API for your feature (e.g. jeff-feat
label 100 … ) and then if:
1. You want your feature to process then packet and then pass it on to
the normal FIB processing, you would ‘interpose’ your feature’s DPO in
the existing FIB chain (i.e. your CLI would be in addition to the usual
‘mpls local-label 100 …. via X’). see example: https://github.com/FDio/
vpp/blob/master/src/plugins/unittest/fib_test.c#L9824 <https://
github.com/FDio/vpp/blob/master/src/plugins/unittest/fib_test.c#L9824>
and your DPO will need to implement the interpose functionality:
https://github.com/FDio/vpp/blob/master/src/vnet/dpo/
mpls_label_dpo.c#L1239 <https://github.com/FDio/vpp/blob/master/src/
vnet/dpo/mpls_label_dpo.c#L1239>
2. you only want your node to handle the MPLS packets, in which case
your feature can directly create the MPLS table entry and provide the
DPO to use, e.g.: https://github.com/FDio/vpp/blob/master/src/plugins/
unittest/fib_test.c#L9824 <https://github.com/FDio/vpp/blob/master/src/
plugins/unittest/fib_test.c#L9824>
/neale
*From: *[email protected] <[email protected]> on behalf of Jeff via
lists.fd.io <[email protected]>
*Date: *Wednesday, 7 January 2026 at 7:40 am
*To: *[email protected] <[email protected]>
*Subject: *[vpp-dev] MPLS to node
Hello,
Is it possible to send incoming MPLS traffic to my_node after a label
pop/swap? For example, if VPP receives an MPLS frame with label 12345:
1) pop label 12345
2) add labels 100 101 102
3) enqueue to my_node
Maybe something like the following, but I don't know if "mpls
local-label" supports sending to a custom node. I looked at the "via"
options in unformat_fib_route_path(), but nothing jumped out.
mpls table add 0
mpls local-label add 100 eos via <my_node> out-labels 100
mpls local-label add 100 non-eos via <my_node> out-labels 100
sr mpls policy add bsid 12345 next 100 next 101 next 102
or
mpls table add 0
mpls local-label add 12345 eos via <my_node> out-labels 100 101 102
mpls local-label add 12345 non-eos via <my_node> out-labels 100 101 102
Thanks,
Jeff
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#26706): https://lists.fd.io/g/vpp-dev/message/26706
Mute This Topic: https://lists.fd.io/mt/117112683/21656
Group Owner: [email protected]
Unsubscribe: https://lists.fd.io/g/vpp-dev/leave/14379924/21656/631435203/xyzzy
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-