it exists default namedpace config, and you still create net namespace by 
yourself.vpp cli reference docs introduces config field.

----------
alexan

--------------原始邮件--------------
发件人:"Moritz Beck via lists.fd.io 
"<[email protected]&gt;;
发送时间:2026年1月29日(星期四) 上午8:46
收件人:"[email protected]" <[email protected]&gt;;
主题:[vpp-dev] linux-cp does not work in different namespaces
-----------------------------------

   /* Font Definitions */ @font-face    {font-family:"Cambria Math";    
panose-1:2 4 5 3 5 4 6 3 2 4;} @font-face       {font-family:Aptos;} /* Style 
Definitions */ .qmbox p.MsoNormal, .qmbox li.MsoNormal, .qmbox div.MsoNormal    
  {margin:0cm;    font-size:12.0pt;       font-family:"Aptos",sans-serif;} 
.qmbox span.E-MailFormatvorlage17      {mso-style-type:personal-compose;       
font-family:"Aptos",sans-serif;         color:windowtext;} .qmbox 
.MsoChpDefault        {mso-style-type:export-only;    
mso-fareast-language:EN-US;} @page WordSection1         {size:612.0pt 792.0pt;  
margin:70.85pt 70.85pt 2.0cm 70.85pt;} .qmbox div.WordSection1  
{page:WordSection1;} 
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 {
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; dev 0000:3b:10.1
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; dev 0000:3b:10.3
}

plugins {
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; plugin default { disable }
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; plugin dpdk_plugin.so { enable }
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; plugin linux_cp_plugin.so { enable }
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; plugin linux_nl_plugin.so { enable }
}

linux-cp {
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; lcp-auto-subint
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; 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
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; 
Name&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
&nbsp; Idx&nbsp; &nbsp; State&nbsp; MTU (L3/IP4/IP6/MPLS)&nbsp;&nbsp; &nbsp; 
Counter&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; Count
VirtualFunctionEthernet3b/10/1&nbsp; &nbsp; 1&nbsp;&nbsp; &nbsp; 
down&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; 9000/0/0/0
VirtualFunctionEthernet3b/10/3&nbsp; &nbsp; 2&nbsp;&nbsp; &nbsp; 
down&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; 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&gt; mtu 9000 qdisc mq state DOWN mode DEFAULT 
group default qlen 1000
&nbsp; &nbsp; link/ether 02:09:c0:4b:41:34 brd ff:ff:ff:ff:ff:ff
152: if-ns2: <BROADCAST,MULTICAST&gt; mtu 9000 qdisc mq state DOWN mode DEFAULT 
group default qlen 1000
&nbsp; &nbsp; 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&gt; mtu 9000 qdisc mq state 
UNKNOWN mode DEFAULT group default qlen 1000
&nbsp; &nbsp; link/ether 02:09:c0:4b:41:34 brd ff:ff:ff:ff:ff:ff
152: if-ns2: <BROADCAST,MULTICAST,UP,LOWER_UP&gt; mtu 9000 qdisc mq state 
UNKNOWN mode DEFAULT group default qlen 1000
&nbsp; &nbsp; link/ether 02:09:c0:00:3d:84 brd ff:ff:ff:ff:ff:ff

vpp# show interface
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; 
Name&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
&nbsp; Idx&nbsp; &nbsp; State&nbsp; MTU (L3/IP4/IP6/MPLS)&nbsp;&nbsp; &nbsp; 
Counter&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; Count
VirtualFunctionEthernet3b/10/1&nbsp; &nbsp; 1&nbsp;&nbsp;&nbsp; &nbsp; 
up&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; 9000/0/0/0
VirtualFunctionEthernet3b/10/3&nbsp; &nbsp; 2&nbsp;&nbsp;&nbsp; &nbsp; 
up&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; 9000/0/0/0



# Not working:
vpp# show interface
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; 
Name&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
&nbsp; Idx&nbsp; &nbsp; State&nbsp; MTU (L3/IP4/IP6/MPLS)&nbsp;&nbsp; &nbsp; 
Counter&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; Count
VirtualFunctionEthernet3b/10/1&nbsp; &nbsp; 1&nbsp;&nbsp; &nbsp; 
down&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; 9000/0/0/0
VirtualFunctionEthernet3b/10/3&nbsp; &nbsp; 2&nbsp;&nbsp; &nbsp; 
down&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; 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&gt; mtu 65536 qdisc noop state DOWN mode DEFAULT group default 
qlen 1000
&nbsp; &nbsp; link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
3: if-ns2: <BROADCAST,MULTICAST&gt; mtu 9000 qdisc mq state DOWN mode DEFAULT 
group default qlen 1000
&nbsp; &nbsp; link/ether 02:09:c0:45:49:2d brd ff:ff:ff:ff:ff:ff

netns: ns1
1: lo: <LOOPBACK&gt; mtu 65536 qdisc noop state DOWN mode DEFAULT group default 
qlen 1000
&nbsp; &nbsp; link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
3: if-ns1: <BROADCAST,MULTICAST&gt; mtu 9000 qdisc mq state DOWN mode DEFAULT 
group default qlen 1000
&nbsp; &nbsp; 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&gt; mtu 65536 qdisc noop state DOWN mode DEFAULT group default 
qlen 1000
&nbsp; &nbsp; link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
3: if-ns2: <BROADCAST,MULTICAST,UP,LOWER_UP&gt; mtu 9000 qdisc mq state UNKNOWN 
mode DEFAULT group default qlen 1000
&nbsp; &nbsp; link/ether 02:09:c0:45:49:2d brd ff:ff:ff:ff:ff:ff

netns: ns1
1: lo: <LOOPBACK&gt; mtu 65536 qdisc noop state DOWN mode DEFAULT group default 
qlen 1000
&nbsp; &nbsp; link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
3: if-ns1: <BROADCAST,MULTICAST,UP,LOWER_UP&gt; mtu 9000 qdisc mq state UNKNOWN 
mode DEFAULT group default qlen 1000
&nbsp; &nbsp; link/ether 02:09:c0:8d:d4:08 brd ff:ff:ff:ff:ff:ff

vpp# show interface
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; 
Name&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
&nbsp; Idx&nbsp; &nbsp; State&nbsp; MTU (L3/IP4/IP6/MPLS)&nbsp;&nbsp; &nbsp; 
Counter&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; Count
VirtualFunctionEthernet3b/10/1&nbsp; &nbsp; 1&nbsp;&nbsp; &nbsp; 
down&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; 9000/0/0/0
VirtualFunctionEthernet3b/10/3&nbsp; &nbsp; 2&nbsp;&nbsp; &nbsp; 
down&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; 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.
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#26744): https://lists.fd.io/g/vpp-dev/message/26744
Mute This Topic: https://lists.fd.io/mt/117519257/21656
Group Owner: [email protected]
Unsubscribe: https://lists.fd.io/g/vpp-dev/leave/14379924/21656/631435203/xyzzy 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to