I have two interfaces that are bound to two different tables in VPP. I want to create two kernel interfaces that run in different namespaces and relay the netlink messages from there accordingly. VPP itself is running in the default namespace. linux-cp does not have a default namespace set.
# Relevant startup.conf:
dpdk {
dev 0000:3b:10.1
dev 0000:3b:10.3
}
plugins {
plugin default { disable }
plugin dpdk_plugin.so { enable }
plugin linux_cp_plugin.so { enable }
plugin linux_nl_plugin.so { enable }
}
linux-cp {
lcp-auto-subint
lcp-sync
}
# Linux config:
ip netns add ns1
ip netns add ns2
# VPP config:
ip table add 1
ip table add 2
ip6 table add 1
ip6 table add 2
set interface ip table VirtualFunctionEthernet3b/10/1 1
set interface ip table VirtualFunctionEthernet3b/10/3 2
set interface ip6 table VirtualFunctionEthernet3b/10/1 1
set interface ip6 table VirtualFunctionEthernet3b/10/3 2
# working:
vpp# show interface
Name Idx State MTU (L3/IP4/IP6/MPLS)
Counter Count
VirtualFunctionEthernet3b/10/1 1 down 9000/0/0/0
VirtualFunctionEthernet3b/10/3 2 down 9000/0/0/0
vpp# lcp create VirtualFunctionEthernet3b/10/1 host-if if-ns1
vpp# lcp create VirtualFunctionEthernet3b/10/3 host-if if-ns2
$ ip link
151: if-ns1: <BROADCAST,MULTICAST> mtu 9000 qdisc mq state DOWN mode DEFAULT
group default qlen 1000
link/ether 02:09:c0:4b:41:34 brd ff:ff:ff:ff:ff:ff
152: if-ns2: <BROADCAST,MULTICAST> mtu 9000 qdisc mq state DOWN mode DEFAULT
group default qlen 1000
link/ether 02:09:c0:00:3d:84 brd ff:ff:ff:ff:ff:ff
$ ip link set dev if-ns1 up
$ ip link set dev if-ns2 up
$ ip link
151: if-ns1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 9000 qdisc mq state
UNKNOWN mode DEFAULT group default qlen 1000
link/ether 02:09:c0:4b:41:34 brd ff:ff:ff:ff:ff:ff
152: if-ns2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 9000 qdisc mq state
UNKNOWN mode DEFAULT group default qlen 1000
link/ether 02:09:c0:00:3d:84 brd ff:ff:ff:ff:ff:ff
vpp# show interface
Name Idx State MTU (L3/IP4/IP6/MPLS)
Counter Count
VirtualFunctionEthernet3b/10/1 1 up 9000/0/0/0
VirtualFunctionEthernet3b/10/3 2 up 9000/0/0/0
# Not working:
vpp# show interface
Name Idx State MTU (L3/IP4/IP6/MPLS)
Counter Count
VirtualFunctionEthernet3b/10/1 1 down 9000/0/0/0
VirtualFunctionEthernet3b/10/3 2 down 9000/0/0/0
vpp# lcp create VirtualFunctionEthernet3b/10/1 host-if if-ns1 netns ns1
vpp# lcp create VirtualFunctionEthernet3b/10/3 host-if if-ns2 netns ns2
$ ip -all netns exec ip link
netns: ns2
1: lo: <LOOPBACK> mtu 65536 qdisc noop state DOWN mode DEFAULT group default
qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
3: if-ns2: <BROADCAST,MULTICAST> mtu 9000 qdisc mq state DOWN mode DEFAULT
group default qlen 1000
link/ether 02:09:c0:45:49:2d brd ff:ff:ff:ff:ff:ff
netns: ns1
1: lo: <LOOPBACK> mtu 65536 qdisc noop state DOWN mode DEFAULT group default
qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
3: if-ns1: <BROADCAST,MULTICAST> mtu 9000 qdisc mq state DOWN mode DEFAULT
group default qlen 1000
link/ether 02:09:c0:8d:d4:08 brd ff:ff:ff:ff:ff:ff
$ ip netns exec ns1 ip link set dev if-ns1 up
$ ip netns exec ns2 ip link set dev if-ns2 up
$ ip -all netns exec ip link
netns: ns2
1: lo: <LOOPBACK> mtu 65536 qdisc noop state DOWN mode DEFAULT group default
qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
3: if-ns2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 9000 qdisc mq state UNKNOWN
mode DEFAULT group default qlen 1000
link/ether 02:09:c0:45:49:2d brd ff:ff:ff:ff:ff:ff
netns: ns1
1: lo: <LOOPBACK> mtu 65536 qdisc noop state DOWN mode DEFAULT group default
qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
3: if-ns1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 9000 qdisc mq state UNKNOWN
mode DEFAULT group default qlen 1000
link/ether 02:09:c0:8d:d4:08 brd ff:ff:ff:ff:ff:ff
vpp# show interface
Name Idx State MTU (L3/IP4/IP6/MPLS)
Counter Count
VirtualFunctionEthernet3b/10/1 1 down 9000/0/0/0
VirtualFunctionEthernet3b/10/3 2 down 9000/0/0/0
# Corresponding log entries:
vpp[4403]: vpp[4403]: clib_c11_violation: s2 NULL
vpp[4403]: clib_c11_violation: s2 NULL
vpp[4403]: vpp[4403]: clib_c11_violation: s2 NULL
vpp[4403]: clib_c11_violation: s2 NULL
As you can see, the netlink messages only get relayed from the default
namespace and not the other ones. Creating the interfaces in the default
namespace and then moving them to the other ones also does not work. It
results in the interfaces disappearing from the kernel and VPP altogether.
smime.p7s
Description: S/MIME cryptographic signature
-=-=-=-=-=-=-=-=-=-=-=- Links: You receive all messages sent to this group. View/Reply Online (#26743): https://lists.fd.io/g/vpp-dev/message/26743 Mute This Topic: https://lists.fd.io/mt/117519114/21656 Group Owner: [email protected] Unsubscribe: https://lists.fd.io/g/vpp-dev/leave/14379924/21656/631435203/xyzzy [[email protected]] -=-=-=-=-=-=-=-=-=-=-=-
