Dear all,

I have a use case that needs to connect dpdk datapath to kernel datapath. My 
setup is as below:

I created one DPDK datapath and one kernel datapath and connect them with patch 
port:
////////////////////////////////////////////////////////////////////////
ovs-vsctl --no-wait set Open_vSwitch . other_config:dpdk-init=true
ovs-ctl --no-ovsdb-server --db-sock="$DB_SOCK" start

ovs-vsctl get Open_vSwitch . dpdk_initialized //this returns true

ovs-vsctl add-br br0 -- set bridge br0 datapath_type=netdev
ovs-vsctl add-br br1

ovs-vsctl add-port br1 patch-br1 -- set interface patch-br1 type=patch 
options:peer=patch-br0
ovs-vsctl add-port br0 patch-br0 -- set interface patch-br0 type=patch 
options:peer=patch-br1
///////////////////////////////////////////////////////////////////////////

Then I created two veth pairs:
///////////////////////////////////////////////////
ip link add dev veth1 type veth peer name veth2
ip link set dev veth1 up
ip link set dev veth2 up
ip netns add ns1
ip link set veth1 netns ns1

ip link add dev veth3 type veth peer name veth4
ip link set dev veth3 up
ip link set dev veth4 up
ip netns add ns2
ip link set veth4 netns ns2
//////////////////////////////////////////////////

Then I add veth2 to br1 and veth3 to br0:
///////////////////////////////////////////////
ovs-vsctl add-port br1 veth2
ovs-vsctl --may-exist add-port br0 veth3 -- set Interface veth3 type=dpdk \
options:dpdk-devargs=eth_af_packet0,iface=veth3
////////////////////////////////////////////////////

Then I add ip address to veth1 and veth3:
//////////////////////////////////////////////////
ip netns exec ns1 ip addr add 1.1.1.1/24 dev veth1
ip netns exec ns2 ip addr add 1.1.1.2/24 dev veth4
///////////////////////////////////////////////////

Then I add some flows to br0 and br1:
/////////////////////////////////////////////////////////////
ovs-ofctl add-flow br1 \
    "table=0, priority=100, arp, nw_dst="1.1.1.1", actions=output:3"
ovs-ofctl add-flow br1 \
    "table=0, priority=100, arp, nw_dst="1.1.1.2", actions=output:2"

ovs-ofctl add-flow br1 \
    "table=0, priority=100, ip, nw_dst="1.1.1.1", actions=output:3"
ovs-ofctl add-flow br1 \
    "table=0, priority=100, ip, nw_dst="1.1.1.2", actions=output:2"

ovs-ofctl add-flow br0 \
    "table=0, priority=100, arp, nw_dst="1.1.1.1", actions=output:1"
ovs-ofctl add-flow br0 \
    "table=0, priority=100, ip, nw_dst="1.1.1.1", actions=output:1"
ovs-ofctl add-flow br0 \
    "table=0, priority=100, arp, nw_dst="1.1.1.2", actions=output:4"
ovs-ofctl add-flow br0 \
"table=0, priority=100, ip, nw_dst="1.1.1.2", actions=output:4"
/////////////////////////////////////////////////////////////////////

Then I try to ping 1.1.1.2 from 1.1.1.1:
   ///////////////////////////////
   ip netns  exec ns1 ping 1.1.1.2

I can see that the arp request has arrived at br1 with “ovs-ofctl dump-flows 
br1”:
////////////////////////////////////////////////////////////////////////////////
cookie=0x0, duration=1328.441s, table=0, n_packets=0, n_bytes=0, reset_counts 
priority=100,arp,arp_tpa=1.1.1.1 actions=output:veth2
cookie=0x0, duration=1328.281s, table=0, n_packets=786, n_bytes=33012, 
reset_counts priority=100,arp,arp_tpa=1.1.1.2 actions=output:"patch-br1"
cookie=0x0, duration=1328.235s, table=0, n_packets=0, n_bytes=0, reset_counts 
priority=100,ip,nw_dst=1.1.1.1 actions=output:veth2
cookie=0x0, duration=1327.359s, table=0, n_packets=0, n_bytes=0, reset_counts 
priority=100,ip,nw_dst=1.1.1.2 actions=output:"patch-br1"
//////////////////////////////////////////////////////////////////////////////////

But the packet has not arrived in br0,
////////////////////////////////
[root@openshift-demo ~]#  ovs-ofctl -O OpenFlow13 dump-flows br0
cookie=0x0, duration=1366.991s, table=0, n_packets=0, n_bytes=0, reset_counts 
priority=100,arp,arp_tpa=1.1.1.1 actions=output:"patch-br0"
cookie=0x0, duration=1366.969s, table=0, n_packets=0, n_bytes=0, reset_counts 
priority=100,ip,nw_dst=1.1.1.1 actions=output:"patch-br0"
cookie=0x0, duration=1366.932s, table=0, n_packets=0, n_bytes=0, reset_counts 
priority=100,arp,arp_tpa=1.1.1.2 actions=output:veth3
cookie=0x0, duration=1366.906s, table=0, n_packets=0, n_bytes=0, reset_counts 
priority=100,ip,nw_dst=1.1.1.2 actions=output:veth3
////////////////////////////////////

So is there an issue connecting a DPDK datapath with a kernel datapath with 
patch ports?

Br,

TEd


Sent from Mail<https://go.microsoft.com/fwlink/?LinkId=550986> for Windows 10

_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to