[ovs-discuss] Why OVS behaves difference between ovs-vswitchd and ovs-vswitchd-dpdk?

Harry Lee chn.lee.yumi at gmail.com
Mon Jun 7 10:47:16 UTC 2021



> 2021年6月4日 下午11:21,Ben Pfaff <blp at ovn.org> 写道:
> 
> On Fri, Jun 04, 2021 at 02:11:23PM +0800, Harry Lee wrote:
>> Hello,
>> 
>> My server is running debian testing. I install two ovs version through apt:
>> 
>> ```
>> openvswitch-switch/testing,unstable,now 2.15.0+ds1-2 amd64 [installed]
>>  Open vSwitch switch implementations
>> 
>> openvswitch-switch-dpdk/testing,unstable,now 2.15.0+ds1-2 amd64 [installed]
>>  DPDK enabled Open vSwitch switch implementation
>> ```
>> 
>> Then I found something  difference between them.
>> 
>> Here's my experience:
>> 
>> ```
>> # switch ovs version to ovs-vswitchd
>> update-alternatives --set ovs-vswitchd /usr/lib/openvswitch-common/ovs-vswitchd
>> /etc/init.d/openvswitch-switch restart
>> ip addr add 10.90.67.148/25 dev br0
>> ping 10.90.67.129  # network is ok
>> 
>> # switch ovs version to ovs-vswitchd-dpdk
>> update-alternatives --set ovs-vswitchd /usr/lib/openvswitch-switch-dpdk/ovs-vswitchd-dpdk
>> /etc/init.d/openvswitch-switch restart
>> ip addr add 10.90.67.148/25 dev br0
>> ping 10.90.67.129  # unreachable
>> ```
>> 
>> The same configuration, using ovs-vswitchd was reachable while using ovs-vswitchd-dpdk was unreachable.
>> 
>> Then I used `tcpdump br0` to checkout if there are packets from br0, and I found some ARP packets:
>> 
>> ```
>> root at debian:~# tcpdump -i br0 -nnn
>> tcpdump: verbose output suppressed, use -v[v]... for full protocol decode
>> listening on br0, link-type EN10MB (Ethernet), snapshot length 262144 bytes
>> 02:14:27.010265 ARP, Request who-has 10.90.67.129 tell 10.90.67.148, length 28
>> 02:14:28.034127 ARP, Request who-has 10.90.67.129 tell 10.90.67.148, length 28
>> 02:14:29.058128 ARP, Request who-has 10.90.67.129 tell 10.90.67.148, length 28
>> ```
>> 
>> But when I ran `ovs-ofctl dump-flows br0`, I saw n_packets is 0:
>> 
>> ```
>> root at debian:~# ovs-ofctl dump-flows br0
>> cookie=0x0, duration=1016.243s, table=0, n_packets=0, n_bytes=0, priority=0 actions=NORMAL
>> ```
>> 
>> Why does ovs-vswitchd-dpdk ignore the packet from br0? Does it need additional configuration?
> 
> Did you configure the dpdk version to use DPDK devices and the userspace
> datapath?  If you didn't, then these two versions of OVS were using the
> same code in the same way, so it's puzzling why there would have been
> any difference.

Did you mean `ovs-vsctl --no-wait set Open_vSwitch . other_config:dpdk-init=false` ?

I had set it to false and restart, but no matter I set it true or set it false, the results were the same.

By the way, I found some warning in log:

```
2021-06-07T10:36:26.790Z|00001|vlog|INFO|opened log file /var/log/openvswitch/ovs-vswitchd.log
2021-06-07T10:36:26.794Z|00002|ovs_numa|INFO|Discovered 20 CPU cores on NUMA node 0
2021-06-07T10:36:26.795Z|00003|ovs_numa|INFO|Discovered 20 CPU cores on NUMA node 1
2021-06-07T10:36:26.795Z|00004|ovs_numa|INFO|Discovered 2 NUMA nodes and 40 CPU cores
2021-06-07T10:36:26.795Z|00005|reconnect|INFO|unix:/var/run/openvswitch/db.sock: connecting...
2021-06-07T10:36:26.795Z|00006|reconnect|INFO|unix:/var/run/openvswitch/db.sock: connected
2021-06-07T10:36:26.799Z|00007|bridge|INFO|ovs-vswitchd (Open vSwitch) 2.15.0
2021-06-07T10:36:26.801Z|00008|dpdk|INFO|DPDK Disabled - Use other_config:dpdk-init to enable
2021-06-07T10:36:26.830Z|00009|ofproto_dpif|INFO|system at ovs-system: Datapath supports recirculation
2021-06-07T10:36:26.830Z|00010|ofproto_dpif|INFO|system at ovs-system: VLAN header stack length probed as 2
2021-06-07T10:36:26.830Z|00011|ofproto_dpif|INFO|system at ovs-system: MPLS label stack length probed as 3
2021-06-07T10:36:26.830Z|00012|ofproto_dpif|INFO|system at ovs-system: Datapath supports truncate action
2021-06-07T10:36:26.830Z|00013|ofproto_dpif|INFO|system at ovs-system: Datapath supports unique flow ids
2021-06-07T10:36:26.830Z|00014|ofproto_dpif|INFO|system at ovs-system: Datapath supports clone action
2021-06-07T10:36:26.831Z|00015|ofproto_dpif|INFO|system at ovs-system: Max sample nesting level probed as 10
2021-06-07T10:36:26.831Z|00016|ofproto_dpif|INFO|system at ovs-system: Datapath supports eventmask in conntrack action
2021-06-07T10:36:26.831Z|00017|ofproto_dpif|INFO|system at ovs-system: Datapath supports ct_clear action
2021-06-07T10:36:26.831Z|00018|ofproto_dpif|INFO|system at ovs-system: Max dp_hash algorithm probed to be 0
2021-06-07T10:36:26.831Z|00019|ofproto_dpif|INFO|system at ovs-system: Datapath supports check_pkt_len action
2021-06-07T10:36:26.831Z|00020|ofproto_dpif|INFO|system at ovs-system: Datapath supports timeout policy in conntrack action
2021-06-07T10:36:26.831Z|00021|ofproto_dpif|INFO|system at ovs-system: Datapath supports ct_state
2021-06-07T10:36:26.831Z|00022|ofproto_dpif|INFO|system at ovs-system: Datapath supports ct_zone
2021-06-07T10:36:26.831Z|00023|ofproto_dpif|INFO|system at ovs-system: Datapath supports ct_mark
2021-06-07T10:36:26.831Z|00024|ofproto_dpif|INFO|system at ovs-system: Datapath supports ct_label
2021-06-07T10:36:26.831Z|00025|ofproto_dpif|INFO|system at ovs-system: Datapath supports ct_state_nat
2021-06-07T10:36:26.831Z|00026|ofproto_dpif|INFO|system at ovs-system: Datapath supports ct_orig_tuple
2021-06-07T10:36:26.831Z|00027|ofproto_dpif|INFO|system at ovs-system: Datapath supports ct_orig_tuple6
2021-06-07T10:36:26.831Z|00028|ofproto_dpif|INFO|system at ovs-system: Datapath does not support IPv6 ND Extensions
2021-06-07T10:36:27.004Z|00029|bridge|INFO|bridge br0: added interface br0 on port 65534
2021-06-07T10:36:27.004Z|00030|bridge|INFO|bridge br0: added interface eth1 on port 1
2021-06-07T10:36:27.004Z|00031|bridge|INFO|bridge br0: using datapath ID 00001402ec974171
2021-06-07T10:36:27.005Z|00032|connmgr|INFO|br0: added service controller "punix:/var/run/openvswitch/br0.mgmt"
2021-06-07T10:36:37.007Z|00033|memory|INFO|353268 kB peak resident set size after 10.2 seconds
2021-06-07T10:36:37.007Z|00034|memory|INFO|handlers:29 ports:2 revalidators:11 rules:5
2021-06-07T10:36:40.160Z|00001|dpif(handler1)|WARN|system at ovs-system: failed to put[create] (Invalid argument) ufid:00000000-0000-0000-0000-000000000000 <empty>
2021-06-07T10:36:40.160Z|00002|ofproto_dpif_upcall(handler1)|INFO|received packet on unassociated datapath port 4294967295
2021-06-07T10:36:40.160Z|00003|dpif(handler1)|WARN|system at ovs-system: failed to put[create] (Invalid argument) ufid:00000000-0000-0000-0000-000000000000 <empty>
2021-06-07T10:36:40.160Z|00004|ofproto_dpif_upcall(handler1)|INFO|received packet on unassociated datapath port 4294967295
2021-06-07T10:36:40.160Z|00005|dpif(handler1)|WARN|system at ovs-system: failed to put[create] (Invalid argument) ufid:00000000-0000-0000-0000-000000000000 <empty>
2021-06-07T10:36:40.160Z|00006|ofproto_dpif_upcall(handler1)|INFO|received packet on unassociated datapath port 4294967295
2021-06-07T10:36:40.944Z|00007|dpif(handler1)|WARN|system at ovs-system: failed to put[create] (Invalid argument) ufid:00000000-0000-0000-0000-000000000000 <empty>
2021-06-07T10:36:40.944Z|00008|ofproto_dpif_upcall(handler1)|INFO|received packet on unassociated datapath port 4294967295
2021-06-07T10:36:47.703Z|00001|dpif(handler7)|WARN|system at ovs-system: failed to put[create] (Invalid argument) ufid:00000000-0000-0000-0000-000000000000 <empty>
2021-06-07T10:36:47.703Z|00002|ofproto_dpif_upcall(handler7)|INFO|received packet on unassociated datapath port 4294967295
2021-06-07T10:36:53.160Z|00003|dpif(handler7)|WARN|system at ovs-system: failed to put[create] (Invalid argument) ufid:00000000-0000-0000-0000-000000000000 <empty>
```

Also some logs in dmesg:

```
[321931.322617] openvswitch: netlink: Flow key attr not present in new flow.
[321931.322691] openvswitch: netlink: Flow key attr not present in new flow.
[321931.323034] openvswitch: netlink: Flow key attr not present in new flow.
[321931.323118] openvswitch: netlink: Flow key attr not present in new flow.
```



More information about the discuss mailing list