1. environment
 Bridge br-int
        fail_mode: secure
        Port br-int
            Interface br-int
                type: internal
       Port "vf-10.180.0.95"
            Interface "vf-10.180.0.95"
                type: vxlan
                options: {csum="true", df_default="false", in_key=flow, 
local_ip="10.180.0.95", out_key=flow, remote_ip=flow}
        Port tap111
            Interface tap111
                type: internal
   Bridge br-phy
        fail_mode: secure
        Port "dpdk_phy1"
            Interface "dpdk_phy1"
                type: dpdk
                options: {dpdk-devargs="0000:01:10.0", n_rxq="2"}
        Port br-phy
            Interface br-phy
                type: internal
        Port "dpdk_phy0"
            Interface "dpdk_phy0"
                type: dpdk
                options: {dpdk-devargs="0000:01:10.1", n_rxq="2"}


01:10.0 Ethernet controller: Intel Corporation 82599 Ethernet Controller 
Virtual Function (rev 01)
01:10.2 Ethernet controller: Intel Corporation 82599 Ethernet Controller 
Virtual Function (rev 01)


175: br-phy: <BROADCAST,PROMISC,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state 
UNKNOWN group default qlen 1000
    link/ether fa:86:77:0b:1a:31 brd ff:ff:ff:ff:ff:ff
    inet 10.180.0.95/24 scope global br-phy
       valid_lft forever preferred_lft forever
    inet6 fe80::f886:77ff:fe0b:1a31/64 scope link
       valid_lft forever preferred_lft forever


bridge br-phy flows:
table=0,priority=150,in_port=LOCAL actions=group:1
table=0,priority=150,in_port="dpdk_phy0" actions=LOCAL
table=0,priority=150,in_port="dpdk_phy1" actions=LOCAL
group_id=1,type=select,bucket=watch_port:"dpdk_phy0",actions=output:"dpdk_phy0",bucket=watch_port:"dpdk_phy1",actions=output:"dpdk_phy1"


bridge br-int flows:
table=0, priority=100,in_port="tap111", 
actions=set_field:10.180.0.81->tun_dst,set_field:0x1435->tun_id,output:"vf-10.180.0.95"


tap111 configurations:
ip netns ns111
ip link set dev tap111 netns ns111
ip netns exec ns111 ip link set dev tap111 up
ip netns exec ns111 ip addr add 192.168.10.5/24 dev tap111
ip netns exec ns111 ip neigh add 192.168.10.6 lladdr 00:00:00:00:11:66 dev 
tap111


send packet from tap111 with ip_dst=192.168.10.6, ip_src=192.168.10.5, udp dst 
port=5000, udp src port= range from 40000~65534


2. phenomenon
   we can only watch packet from dpdk_phy0, but not sometimes dpdk_phy0, and 
sometimes dpdk_phy1


3. code trace in ovs
    a. we can watch the packet send from dpdk_phy0 with outer 
header(dst=10.180.0.81, src=10.180.0.95, udp src port=range in 32768 to 65535, 
dst=4789), and with inner header(dst=192.168.10.6, src=192.168.10.5,udp dst 
port=5000, udp src port=range from 40000~65534)
   b. as we can see, we will use default group select method
     FIRST QUESTION: why we not use udp port for hash calculate? in function 
flow_hash_symmetric_l4(), we can see the following code:
      if (fields.eth_type == htons(ETH_TYPE_IP)) {
        fields.ipv4_addr = flow->nw_src ^ flow->nw_dst;
        fields.ip_proto = flow->nw_proto;
        if (fields.ip_proto == IPPROTO_TCP || fields.ip_proto == IPPROTO_SCTP) {
            fields.tp_port = flow->tp_src ^ flow->tp_dst;
        }
      }
  c. when send packet out from userspace vxlan port, it will first do group 
select, then build the total tunnel packet and send out
      SECOND QUESTION: how can we use the tunnel src port to do group hash? 
when packet do xlate in function xlate_select_group(), flow->tp_src is always 0
      Thread 1 "ovs-vswitchd" hit Breakpoint 2, xlate_default_select_group 
(ctx=0x7ffc80f91e10, group=0x55f7e8024950)
    at ofproto/ofproto-dpif-xlate.c:4135
4135        struct flow_wildcards *wc = ctx->wc;
(gdb)  p/x ctx->xin->flow->tp_dst
$6 = 0xb512
(gdb)  p/x ctx->xin->flow->tp_src
$8 = 0x0
(gdb) bt
#0  xlate_default_select_group (ctx=0x7ffc80f91e10, group=0x55f7e8024950) at 
ofproto/ofproto-dpif-xlate.c:4135
#1  0x000055f7e7440f6d in xlate_select_group (ctx=0x7ffc80f91e10, 
group=0x55f7e8024950) at ofproto/ofproto-dpif-xlate.c:4260
#2  0x000055f7e744100f in xlate_group_action__ (ctx=0x7ffc80f91e10, 
group=0x55f7e8024950) at ofproto/ofproto-dpif-xlate.c:4287
#3  0x000055f7e74410df in xlate_group_action (ctx=0x7ffc80f91e10, group_id=1) 
at ofproto/ofproto-dpif-xlate.c:4314
#4  0x000055f7e7445405 in do_xlate_actions (ofpacts=0x55f7e7ff3758, 
ofpacts_len=8, ctx=0x7ffc80f91e10) at ofproto/ofproto-dpif-xlate.c:6215
#5  0x000055f7e7440117 in xlate_recursively (ctx=0x7ffc80f91e10, 
rule=0x55f7e7ffb1f0, deepens=true) at ofproto/ofproto-dpif-xlate.c:3907
#6  0x000055f7e744069d in xlate_table_action (ctx=0x7ffc80f91e10, 
in_port=65534, table_id=0 '\000', may_packet_in=true,
    honor_table_miss=true, with_ct_orig=false) at 
ofproto/ofproto-dpif-xlate.c:4033
#7  0x000055f7e743f07d in apply_nested_clone_actions (ctx=0x7ffc80f91e10, 
in_dev=0x55f7e8033b60, out_dev=0x55f7e7fff320)
    at ofproto/ofproto-dpif-xlate.c:3559
#8  0x000055f7e743e266 in validate_and_combine_post_tnl_actions 
(ctx=0x7ffc80f91e10, xport=0x55f7e8033b60, out_dev=0x55f7e7fff320,
    tnl_push_data=...) at ofproto/ofproto-dpif-xlate.c:3311
#9  0x000055f7e743e9d8 in build_tunnel_send (ctx=0x7ffc80f91e10, 
xport=0x55f7e8033b60, flow=0x7ffc80f935d0, tunnel_odp_port=1)
    at ofproto/ofproto-dpif-xlate.c:3450
#10 0x000055f7e743fd9c in compose_output_action__ (ctx=0x7ffc80f91e10, 
ofp_port=1, xr=0x0, check_stp=true)
    at ofproto/ofproto-dpif-xlate.c:3829
#11 0x000055f7e744002e in compose_output_action (ctx=0x7ffc80f91e10, 
ofp_port=1, xr=0x0) at ofproto/ofproto-dpif-xlate.c:3887
#12 0x000055f7e7442672 in xlate_output_action (ctx=0x7ffc80f91e10, port=1, 
max_len=0, may_packet_in=true)
    at ofproto/ofproto-dpif-xlate.c:4896
#13 0x000055f7e74453e0 in do_xlate_actions (ofpacts=0x55f7e7ff6210, 
ofpacts_len=72, ctx=0x7ffc80f91e10) at ofproto/ofproto-dpif-xlate.c:6210
#14 0x000055f7e7447b5c in xlate_actions (xin=0x7ffc80f935c0, 
xout=0x7ffc80f938f0) at ofproto/ofproto-dpif-xlate.c:7116


Thread 1 "ovs-vswitchd" hit Breakpoint 1, netdev_tnl_get_src_port 
(packet=0x55f7e803c320) at lib/netdev-native-tnl.h:94
94          hash = dp_packet_get_rss_hash(packet);
(gdb) bt
#0  netdev_tnl_get_src_port (packet=0x55f7e803c320) at 
lib/netdev-native-tnl.h:94
#1  0x000055f7e75600d8 in netdev_tnl_push_udp_header (packet=0x55f7e803c320, 
data=0x55f7e7ff4160) at lib/netdev-native-tnl.c:226
#2  0x000055f7e74adda9 in netdev_push_header (netdev=0x55f7e7fea610, 
batch=0x7ffc80f93120, data=0x55f7e7ff4160) at lib/netdev.c:865
#3  0x000055f7e7478d4f in push_tnl_action (pmd=0x7f30502d5010, 
attr=0x55f7e7ff415c, batch=0x7ffc80f93120) at lib/dpif-netdev.c:5089
#4  0x000055f7e7479058 in dp_execute_cb (aux_=0x7ffc80f93620, 
packets_=0x7ffc80f93120, a=0x55f7e7ff415c, may_steal=false)
    at lib/dpif-netdev.c:5158
#5  0x000055f7e74bad76 in odp_execute_actions (dp=0x7ffc80f93620, 
batch=0x7ffc80f93120, steal=true, actions=0x55f7e7ff415c, actions_len=80,
    dp_execute_action=0x55f7e7478e91 <dp_execute_cb>) at lib/odp-execute.c:686
#6  0x000055f7e74babde in odp_execute_clone (dp=0x7ffc80f93620, 
batch=0x7ffc80f93670, steal=false, actions=0x55f7e7ff4158,
    dp_execute_action=0x55f7e7478e91 <dp_execute_cb>) at lib/odp-execute.c:618
#7  0x000055f7e74bb282 in odp_execute_actions (dp=0x7ffc80f93620, 
batch=0x7ffc80f93670, steal=false, actions=0x55f7e7ff4158,
    actions_len=84, dp_execute_action=0x55f7e7478e91 <dp_execute_cb>) at 
lib/odp-execute.c:795
#8  0x000055f7e7479a13 in dp_netdev_execute_actions (pmd=0x7f30502d5010, 
packets=0x7ffc80f93670, may_steal=false, flow=0x55f7e803eb90,
    actions=0x55f7e7ff4158, actions_len=84, now=21251493341) at 
lib/dpif-netdev.c:5428
#9  0x000055f7e74732e4 in dpif_netdev_execute (dpif=0x55f7e7f68390, 
execute=0x7ffc80f93878) at lib/dpif-netdev.c:2853
#10 0x000055f7e74733db in dpif_netdev_operate (dpif=0x55f7e7f68390, 
ops=0x7ffc80f938c8, n_ops=1) at lib/dpif-netdev.c:2883
#11 0x000055f7e747d6ca in dpif_operate (dpif=0x55f7e7f68390, 
ops=0x7ffc80f938c8, n_ops=1) at lib/dpif.c:1339
#12 0x000055f7e747d626 in dpif_execute (dpif=0x55f7e7f68390, 
execute=0x7ffc80f938f0) at lib/dpif.c:1304
_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to