Skip to content

Instantly share code, notes, and snippets.

@krsna1729
Last active April 24, 2023 21:26
Show Gist options
  • Save krsna1729/17e987c96681dc460b4e00119d80d779 to your computer and use it in GitHub Desktop.
Save krsna1729/17e987c96681dc460b4e00119d80d779 to your computer and use it in GitHub Desktop.
tracing network stack for MACVLAN IPVLAN

This is only a trace on vxlan interface on the host. not from within container namespace

  ping-26819 [001]  3678.931358: fib_table_lookup:     table 254 oif 0 iif 1 proto 17 0.0.0.0/40784 -> 10.244.2.4/1025 tos 0 scope 0 flags 0 ==> dev flannel.1 gw 10.244.2.0 src 10.244.0.0 err 0
  ping-26819 [001]  3678.931387: fib_table_lookup:     table 254 oif 0 iif 1 proto 17 10.244.0.0/40784 -> 10.244.2.4/1025 tos 0 scope 0 flags 0 ==> dev flannel.1 gw 10.244.2.0 src 10.244.0.0 err 0
  ping-26819 [001]  3678.931468: fib_table_lookup:     table 254 oif 0 iif 1 proto 1 0.0.0.0/0 -> 10.244.2.4/0 tos 0 scope 0 flags 0 ==> dev flannel.1 gw 10.244.2.0 src 10.244.0.0 err 0
  ping-26819 [001]  3678.931485: fib_table_lookup:     table 255 oif 0 iif 0 proto 0 0.0.0.0/0 -> 10.244.2.4/0 tos 0 scope 0 flags 0 ==> dev flannel.1 gw 10.244.2.0 src 10.244.0.0 err 0
  ping-26819 [001]  3678.931499: net_dev_queue:        dev=flannel.1 skbaddr=0xffff919236689800 len=98
  ping-26819 [001]  3678.931500: net_dev_start_xmit:   dev=flannel.1 queue_mapping=0 skbaddr=0xffff919236689800 vlan_tagged=0 vlan_proto=0x0000 vlan_tci=0x0000 protocol=0x0800 ip_summed=0 len=98 data_len=0 network_offset=14 transport_offset_valid=1 transport_offset=34 tx_flags=0 gso_size=0 gso_segs=0 gso_type=0
  ping-26819 [001]  3678.931504: fib_table_lookup:     table 254 oif 0 iif 1 proto 17 192.168.121.2/51840 -> 192.168.121.110/8472 tos 0 scope 0 flags 0 ==> dev enp0s8 gw 0.0.0.0 src 192.168.121.2 err 0
  ping-26819 [001]  3678.931511: fib_table_lookup:     table 255 oif 0 iif 0 proto 0 0.0.0.0/0 -> 192.168.121.110/0 tos 0 scope 0 flags 0 ==> dev enp0s8 gw 0.0.0.0 src 192.168.121.2 err 0
  ping-26819 [001]  3678.931517: net_dev_queue:        dev=enp0s8 skbaddr=0xffff919236689800 len=148
  ping-26819 [001]  3678.931520: qdisc_dequeue:        dequeue ifindex=2 qdisc handle=0x0 parent=0xFFFFFFFF txq_state=0x0 packets=1 skbaddr=0xffff919236689800
  ping-26819 [001]  3678.931521: net_dev_start_xmit:   dev=enp0s8 queue_mapping=0 skbaddr=0xffff919236689800 vlan_tagged=0 vlan_proto=0x0000 vlan_tci=0x0000 protocol=0x0800 ip_summed=3 len=148 data_len=0 network_offset=14 transport_offset_valid=1 transport_offset=34 tx_flags=0 gso_size=0 gso_segs=0 gso_type=0
  ping-26819 [001]  3678.931523: consume_skb:          skbaddr=0xffff91921aa270e8
  ping-26819 [001]  3678.931540: net_dev_xmit:         dev=enp0s8 skbaddr=0xffff919236689800 len=148 rc=0
  ping-26819 [001]  3678.931540: qdisc_dequeue:        dequeue ifindex=2 qdisc handle=0x0 parent=0xFFFFFFFF txq_state=0x0 packets=0 skbaddr=(nil)
  ping-26819 [001]  3678.931541: net_dev_xmit:         dev=flannel.1 skbaddr=0xffff919236689800 len=98 rc=0
<idle>-0     [001]  3678.932214: napi_gro_receive_entry: dev=enp0s8 napi_id=0x141 queue_mapping=0 skbaddr=0xffff919236689100 vlan_tagged=0 vlan_proto=0x0000 vlan_tci=0x0000 protocol=0x0800 ip_summed=3 hash=0x00000000 l4_hash=0 len=134 data_len=20 truesize=2304 mac_header_valid=1 mac_header=-14 nr_frags=1 gso_size=0 gso_type=0
<idle>-0     [001]  3678.932218: netif_receive_skb:    dev=enp0s8 skbaddr=0xffff919236689100 len=134
<idle>-0     [001]  3678.932232: fib_table_lookup:     table 255 oif 0 iif 0 proto 0 0.0.0.0/0 -> 192.168.121.2/0 tos 0 scope 0 flags 0 ==> dev enp0s8 gw 0.0.0.0 src 192.168.121.2 err 0
<idle>-0     [001]  3678.932235: fib_table_lookup:     table 254 oif 0 iif 2 proto 0 192.168.121.110/0 -> 192.168.121.2/0 tos 0 scope 0 flags 0 ==> dev enp0s8 gw 0.0.0.0 src 192.168.121.2 err 0
<idle>-0     [001]  3678.932236: fib_table_lookup:     table 254 oif 0 iif 1 proto 0 192.168.121.2/0 -> 192.168.121.110/0 tos 0 scope 0 flags 0 ==> dev enp0s8 gw 0.0.0.0 src 192.168.121.2 err 0
<idle>-0     [001]  3678.932245: napi_poll:            napi poll on napi struct 0xffff919235dc2808 for device enp0s8 work 1 budget 64
<idle>-0     [001]  3678.932246: napi_gro_receive_entry: dev=flannel.1 napi_id=0 queue_mapping=0 skbaddr=0xffff919236689100 vlan_tagged=0 vlan_proto=0x0000 vlan_tci=0x0000 protocol=0x0800 ip_summed=0 hash=0x00000000 l4_hash=0 len=84 data_len=20 truesize=2304 mac_header_valid=1 mac_header=-14 nr_frags=1 gso_size=0 gso_type=0
<idle>-0     [001]  3678.932247: netif_receive_skb:    dev=flannel.1 skbaddr=0xffff919236689100 len=84
<idle>-0     [001]  3678.932252: fib_table_lookup:     table 254 oif 0 iif 6 proto 0 10.244.2.4/0 -> 10.244.0.0/0 tos 0 scope 0 flags 0 ==> dev flannel.1 gw 0.0.0.0 src 10.244.0.0 err 0
<idle>-0     [001]  3678.932252: fib_table_lookup:     table 254 oif 0 iif 1 proto 0 10.244.0.0/0 -> 10.244.2.4/0 tos 0 scope 0 flags 0 ==> dev flannel.1 gw 10.244.2.0 src 10.244.0.0 err 0
<idle>-0     [001]  3678.932263: kfree_skb:            skbaddr=0xffff919236689100 protocol=2048 location=0xffffffff9bc7650b
<idle>-0     [001]  3678.932265: napi_poll:            napi poll on napi struct 0xffffc5ad7fbef140 for device flannel.1 work 1 budget 64
  ping-26819 [001]  3678.932280: skb_copy_datagram_iovec: skbaddr=0xffff919236689500 len=84
  ping-26819 [001]  3678.932283: consume_skb:          skbaddr=0xffff919236689500

union

            ping-17960 [079] 3452769.758675: fib_table_lookup:     table 254 oif 0 iif 1 proto 17 0.0.0.0/45217 -> 10.54.81.172/1025 tos 0 scope 0 flags 0 ==> dev eth0 gw 172.17.0.1 src 172.17.0.4 err 0
            ping-17960 [079] 3452769.758681: fib_table_lookup:     table 254 oif 0 iif 1 proto 17 172.17.0.4/45217 -> 10.54.81.172/1025 tos 0 scope 0 flags 0 ==> dev eth0 gw 172.17.0.1 src 172.17.0.4 err 0
            ping-17960 [079] 3452769.758782: fib_table_lookup:     table 254 oif 0 iif 1 proto 1 0.0.0.0/0 -> 10.54.81.172/0 tos 0 scope 0 flags 0 ==> dev eth0 gw 172.17.0.1 src 172.17.0.4 err 0
            ping-17960 [079] 3452769.758795: net_dev_queue:        dev=eth0 skbaddr=0xffff94d070e15e00 len=98
            ping-17960 [079] 3452769.758798: net_dev_start_xmit:   dev=eth0 queue_mapping=0 skbaddr=0xffff94d070e15e00 vlan_tagged=0 vlan_proto=0x0000 vlan_tci=0x0000 protocol=0x0800 ip_summed=0 len=98 data_len=0 network_offset=14 transport_offset_valid=1 transport_offset=34 tx_flags=0 gso_size=0 gso_segs=0 gso_type=0
            ping-17960 [079] 3452769.758801: netif_rx_entry:       dev=vethee8c1bb napi_id=0x50 queue_mapping=0 skbaddr=0xffff94d070e15e00 vlan_tagged=0 vlan_proto=0x0000 vlan_tci=0x0000 protocol=0x0800 ip_summed=0 hash=0x00000000 l4_hash=0 len=84 data_len=0 truesize=768 mac_header_valid=1 mac_header=-14 nr_frags=0 gso_size=0 gso_type=0
            ping-17960 [079] 3452769.758802: netif_rx:             dev=vethee8c1bb skbaddr=0xffff94d070e15e00 len=84
            ping-17960 [079] 3452769.758803: netif_rx_exit:        ret=0
            ping-17960 [079] 3452769.758805: net_dev_xmit:         dev=eth0 skbaddr=0xffff94d070e15e00 len=98 rc=0
            ping-17960 [079] 3452769.758807: netif_receive_skb:    dev=vethee8c1bb skbaddr=0xffff94d070e15e00 len=84
            ping-17960 [079] 3452769.758826: fib_table_lookup:     table 255 oif 0 iif 0 proto 0 0.0.0.0/0 -> 10.54.81.172/0 tos 0 scope 0 flags 0 ==> dev eno1 gw 0.0.0.0 src 10.54.80.217 err 0
            ping-17960 [079] 3452769.758834: netif_receive_skb_entry: dev=docker0 napi_id=0x50 queue_mapping=0 skbaddr=0xffff94d070e15e00 vlan_tagged=0 vlan_proto=0x0000 vlan_tci=0x0000 protocol=0x0800 ip_summed=2 hash=0x00000000 l4_hash=0 len=84 data_len=0 truesize=768 mac_header_valid=1 mac_header=-14 nr_frags=0 gso_size=0 gso_type=0
            ping-17960 [079] 3452769.758835: netif_receive_skb:    dev=docker0 skbaddr=0xffff94d070e15e00 len=84
            ping-17960 [079] 3452769.758838: fib_table_lookup:     table 254 oif 0 iif 28 proto 0 172.17.0.4/0 -> 10.54.81.172/0 tos 0 scope 0 flags 0 ==> dev eno1 gw 0.0.0.0 src 10.54.80.217 err 0
            ping-17960 [079] 3452769.758843: fib_table_lookup:     table 254 oif 0 iif 7 proto 0 10.54.81.172/0 -> 172.17.0.4/0 tos 0 scope 0 flags 0 ==> dev docker0 gw 0.0.0.0 src 172.17.0.1 err 0
            ping-17960 [079] 3452769.758868: net_dev_queue:        dev=eno1 skbaddr=0xffff94d070e15e00 len=98
            ping-17960 [079] 3452769.758870: net_dev_start_xmit:   dev=eno1 queue_mapping=10 skbaddr=0xffff94d070e15e00 vlan_tagged=0 vlan_proto=0x0000 vlan_tci=0x0000 protocol=0x0800 ip_summed=0 len=98 data_len=0 network_offset=14 transport_offset_valid=1 transport_offset=34 tx_flags=0 gso_size=0 gso_segs=0 gso_type=0
            ping-17960 [079] 3452769.758876: net_dev_xmit:         dev=eno1 skbaddr=0xffff94d070e15e00 len=98 rc=0
            ping-17960 [079] 3452769.758878: qdisc_dequeue:        dequeue ifindex=7 qdisc handle=0x0 parent=0xB txq_state=0x0 packets=0 skbaddr=(nil)
            ping-17960 [079] 3452769.758880: netif_receive_skb_exit: ret=0
            ping-17960 [079] 3452769.758882: napi_poll:            napi poll on napi struct 0xffff94d81f8e3d50 for device (no_device) work 1 budget 64
          <idle>-0     [056] 3452769.758931: consume_skb:          skbaddr=0xffff94d070e15e00
          <idle>-0     [056] 3452769.758951: napi_poll:            napi poll on napi struct 0xffff94d0044dd050 for device eno1 work 0 budget 64
          <idle>-0     [020] 3452769.759035: napi_gro_receive_entry: dev=eno1 napi_id=0x20ba queue_mapping=10 skbaddr=0xffff94d0053ffb00 vlan_tagged=0 vlan_proto=0x0000 vlan_tci=0x0000 protocol=0x0800 ip_summed=0 hash=0x87675559 l4_hash=0 len=84 data_len=0 truesize=2304 mac_header_valid=1 mac_header=-14 nr_frags=0 gso_size=0 gso_type=0
          <idle>-0     [020] 3452769.759041: netif_receive_skb:    dev=eno1 skbaddr=0xffff94d0053ffb00 len=84
          <idle>-0     [020] 3452769.759059: fib_table_lookup:     table 254 oif 0 iif 7 proto 0 10.54.81.172/0 -> 172.17.0.4/0 tos 0 scope 0 flags 0 ==> dev docker0 gw 0.0.0.0 src 172.17.0.1 err 0
          <idle>-0     [020] 3452769.759062: fib_table_lookup:     table 254 oif 0 iif 28 proto 0 172.17.0.4/0 -> 10.54.81.172/0 tos 0 scope 0 flags 0 ==> dev eno1 gw 0.0.0.0 src 10.54.80.217 err 0
          <idle>-0     [020] 3452769.759075: net_dev_queue:        dev=docker0 skbaddr=0xffff94d0053ffb00 len=98
          <idle>-0     [020] 3452769.759077: net_dev_start_xmit:   dev=docker0 queue_mapping=0 skbaddr=0xffff94d0053ffb00 vlan_tagged=0 vlan_proto=0x0000 vlan_tci=0x0000 protocol=0x0800 ip_summed=0 len=98 data_len=0 network_offset=14 transport_offset_valid=1 transport_offset=34 tx_flags=0 gso_size=0 gso_segs=0 gso_type=0
          <idle>-0     [020] 3452769.759083: net_dev_queue:        dev=vethee8c1bb skbaddr=0xffff94d0053ffb00 len=98
          <idle>-0     [020] 3452769.759084: net_dev_start_xmit:   dev=vethee8c1bb queue_mapping=0 skbaddr=0xffff94d0053ffb00 vlan_tagged=0 vlan_proto=0x0000 vlan_tci=0x0000 protocol=0x0800 ip_summed=0 len=98 data_len=0 network_offset=14 transport_offset_valid=1 transport_offset=34 tx_flags=0 gso_size=0 gso_segs=0 gso_type=0
          <idle>-0     [020] 3452769.759088: netif_rx_entry:       dev=eth0 napi_id=0x15 queue_mapping=0 skbaddr=0xffff94d0053ffb00 vlan_tagged=0 vlan_proto=0x0000 vlan_tci=0x0000 protocol=0x0800 ip_summed=0 hash=0x87675559 l4_hash=0 len=84 data_len=0 truesize=2304 mac_header_valid=1 mac_header=-14 nr_frags=0 gso_size=0 gso_type=0
          <idle>-0     [020] 3452769.759091: netif_rx:             dev=eth0 skbaddr=0xffff94d0053ffb00 len=84
          <idle>-0     [020] 3452769.759094: netif_rx_exit:        ret=0
          <idle>-0     [020] 3452769.759095: net_dev_xmit:         dev=vethee8c1bb skbaddr=0xffff94d0053ffb00 len=98 rc=0
          <idle>-0     [020] 3452769.759096: net_dev_xmit:         dev=docker0 skbaddr=0xffff94d0053ffb00 len=98 rc=0
          <idle>-0     [020] 3452769.759098: napi_gro_receive_exit: ret=3
          <idle>-0     [020] 3452769.759099: napi_poll:            napi poll on napi struct 0xffff94d0044da050 for device eno1 work 1 budget 64
          <idle>-0     [020] 3452769.759101: netif_receive_skb:    dev=eth0 skbaddr=0xffff94d0053ffb00 len=84
          <idle>-0     [020] 3452769.759106: fib_table_lookup:     table 254 oif 0 iif 2558 proto 0 10.54.81.172/0 -> 172.17.0.4/0 tos 0 scope 0 flags 0 ==> dev eth0 gw 0.0.0.0 src 172.17.0.4 err 0
          <idle>-0     [020] 3452769.759108: fib_table_lookup:     table 254 oif 0 iif 1 proto 0 172.17.0.4/0 -> 10.54.81.172/0 tos 0 scope 0 flags 0 ==> dev eth0 gw 172.17.0.1 src 172.17.0.4 err 0
          <idle>-0     [020] 3452769.759123: kfree_skb:            skbaddr=0xffff94d0053ffb00 protocol=2048 location=0xffffffffa3351021
          <idle>-0     [020] 3452769.759125: napi_poll:            napi poll on napi struct 0xffff94d01f523d50 for device (no_device) work 1 budget 64
            ping-17960 [079] 3452769.759136: skb_copy_datagram_iovec: skbaddr=0xffff94d0053fe100 len=84
            ping-17960 [079] 3452769.759142: consume_skb:          skbaddr=0xffff94d0053fe100

no union

            ping-6644  [006]  9419.402638: fib_table_lookup:     table 254 oif 0 iif 1 proto 17 0.0.0.0/37894 -> 10.54.81.172/1025 tos 0 scope 0 flags 0 ==> dev eth0 gw 172.17.0.1/:: err 0
            ping-6644  [006]  9419.402643: fib_table_lookup:     table 254 oif 0 iif 1 proto 17 172.17.0.2/37894 -> 10.54.81.172/1025 tos 0 scope 0 flags 0 ==> dev eth0 gw 172.17.0.1/:: err 0
            ping-6644  [006]  9419.402740: fib_table_lookup:     table 254 oif 0 iif 1 proto 1 0.0.0.0/0 -> 10.54.81.172/0 tos 0 scope 0 flags 0 ==> dev eth0 gw 172.17.0.1/:: err 0
            ping-6644  [006]  9419.402750: net_dev_queue:        dev=eth0 skbaddr=0xffff92f45644f800 len=98
            ping-6644  [006]  9419.402752: net_dev_start_xmit:   dev=eth0 queue_mapping=0 skbaddr=0xffff92f45644f800 vlan_tagged=0 vlan_proto=0x0000 vlan_tci=0x0000 protocol=0x0800 ip_summed=0 len=98 data_len=0 network_offset=14 transport_offset_valid=1 transport_offset=34 tx_flags=0 gso_size=0 gso_segs=0 gso_type=0
            ping-6644  [006]  9419.402755: netif_rx_entry:       dev=veth32abe19 napi_id=0 queue_mapping=0 skbaddr=0xffff92f45644f800 vlan_tagged=0 vlan_proto=0x0000 vlan_tci=0x0000 protocol=0x0800 ip_summed=0 hash=0x00000000 l4_hash=0 len=84 data_len=0 truesize=768 mac_header_valid=1 mac_header=-14 nr_frags=0 gso_size=0 gso_type=0
            ping-6644  [006]  9419.402756: netif_rx:             dev=veth32abe19 skbaddr=0xffff92f45644f800 len=84
            ping-6644  [006]  9419.402757: netif_rx_exit:        ret=0
            ping-6644  [006]  9419.402758: net_dev_xmit:         dev=eth0 skbaddr=0xffff92f45644f800 len=98 rc=0
            ping-6644  [006]  9419.402760: netif_receive_skb:    dev=veth32abe19 skbaddr=0xffff92f45644f800 len=84
            ping-6644  [006]  9419.402780: fib_table_lookup:     table 255 oif 0 iif 0 proto 0 0.0.0.0/0 -> 10.54.81.172/0 tos 0 scope 0 flags 0 ==> dev eno1 gw 0.0.0.8/::5400:0 err 0
            ping-6644  [006]  9419.402786: netif_receive_skb_entry: dev=docker0 napi_id=0 queue_mapping=0 skbaddr=0xffff92f45644f800 vlan_tagged=0 vlan_proto=0x0000 vlan_tci=0x0000 protocol=0x0800 ip_summed=2 hash=0x00000000 l4_hash=0 len=84 data_len=0 truesize=768 mac_header_valid=1 mac_header=-14 nr_frags=0 gso_size=0 gso_type=0
            ping-6644  [006]  9419.402787: netif_receive_skb:    dev=docker0 skbaddr=0xffff92f45644f800 len=84
            ping-6644  [006]  9419.402789: fib_table_lookup:     table 254 oif 0 iif 30 proto 0 172.17.0.2/0 -> 10.54.81.172/0 tos 0 scope 0 flags 0 ==> dev eno1 gw 0.0.0.8/200::5400:0 err 0
            ping-6644  [006]  9419.402791: fib_table_lookup:     table 254 oif 0 iif 7 proto 0 10.54.81.172/0 -> 172.17.0.2/0 tos 0 scope 0 flags 0 ==> dev docker0 gw 0.0.0.8/200::5400:0 err 0
            ping-6644  [006]  9419.402807: net_dev_queue:        dev=eno1 skbaddr=0xffff92f45644f800 len=98
            ping-6644  [006]  9419.402809: net_dev_start_xmit:   dev=eno1 queue_mapping=6 skbaddr=0xffff92f45644f800 vlan_tagged=0 vlan_proto=0x0000 vlan_tci=0x0000 protocol=0x0800 ip_summed=0 len=98 data_len=0 network_offset=14 transport_offset_valid=1 transport_offset=34 tx_flags=0 gso_size=0 gso_segs=0 gso_type=0
            ping-6644  [006]  9419.402813: net_dev_xmit:         dev=eno1 skbaddr=0xffff92f45644f800 len=98 rc=0
            ping-6644  [006]  9419.402815: qdisc_dequeue:        dequeue ifindex=7 qdisc handle=0x0 parent=0x7 txq_state=0x0 packets=0 skbaddr=(nil)
            ping-6644  [006]  9419.402816: netif_receive_skb_exit: ret=0
            ping-6644  [006]  9419.402818: napi_poll:            napi poll on napi struct 0xffff92f69f1ac250 for device (no_device) work 1 budget 64
          <idle>-0     [040]  9419.402866: consume_skb:          skbaddr=0xffff92f45644f800
          <idle>-0     [040]  9419.402877: napi_poll:            napi poll on napi struct 0xffff92f43d7de050 for device eno1 work 0 budget 64
          <idle>-0     [058]  9419.403018: napi_gro_receive_entry: dev=eno1 napi_id=0x2118 queue_mapping=16 skbaddr=0xffff92f45645f300 vlan_tagged=0 vlan_proto=0x0000 vlan_tci=0x0000 protocol=0x0800 ip_summed=0 hash=0xc980c8cf l4_hash=0 len=84 data_len=0 truesize=2304 mac_header_valid=1 mac_header=-14 nr_frags=0 gso_size=0 gso_type=0
          <idle>-0     [058]  9419.403022: netif_receive_skb:    dev=eno1 skbaddr=0xffff92f45645f300 len=84
          <idle>-0     [058]  9419.403034: fib_table_lookup:     table 254 oif 0 iif 7 proto 0 10.54.81.172/0 -> 172.17.0.2/0 tos 0 scope 0 flags 0 ==> dev docker0 gw 0.0.0.8/3b:200:cfc8:80c9:69:700:5400:0 err 0
          <idle>-0     [058]  9419.403036: fib_table_lookup:     table 254 oif 0 iif 30 proto 0 172.17.0.2/0 -> 10.54.81.172/0 tos 0 scope 0 flags 0 ==> dev eno1 gw 0.0.0.8/3b:200:cfc8:80c9:69:700:5400:0 err 0
          <idle>-0     [058]  9419.403050: net_dev_queue:        dev=docker0 skbaddr=0xffff92f45645f300 len=98
          <idle>-0     [058]  9419.403052: net_dev_start_xmit:   dev=docker0 queue_mapping=0 skbaddr=0xffff92f45645f300 vlan_tagged=0 vlan_proto=0x0000 vlan_tci=0x0000 protocol=0x0800 ip_summed=0 len=98 data_len=0 network_offset=14 transport_offset_valid=1 transport_offset=34 tx_flags=0 gso_size=0 gso_segs=0 gso_type=0
          <idle>-0     [058]  9419.403057: net_dev_queue:        dev=veth32abe19 skbaddr=0xffff92f45645f300 len=98
          <idle>-0     [058]  9419.403058: net_dev_start_xmit:   dev=veth32abe19 queue_mapping=0 skbaddr=0xffff92f45645f300 vlan_tagged=0 vlan_proto=0x0000 vlan_tci=0x0000 protocol=0x0800 ip_summed=0 len=98 data_len=0 network_offset=14 transport_offset_valid=1 transport_offset=34 tx_flags=0 gso_size=0 gso_segs=0 gso_type=0
          <idle>-0     [058]  9419.403060: netif_rx_entry:       dev=eth0 napi_id=0x2118 queue_mapping=0 skbaddr=0xffff92f45645f300 vlan_tagged=0 vlan_proto=0x0000 vlan_tci=0x0000 protocol=0x0800 ip_summed=0 hash=0xc980c8cf l4_hash=0 len=84 data_len=0 truesize=2304 mac_header_valid=1 mac_header=-14 nr_frags=0 gso_size=0 gso_type=0
          <idle>-0     [058]  9419.403061: netif_rx:             dev=eth0 skbaddr=0xffff92f45645f300 len=84
          <idle>-0     [058]  9419.403063: netif_rx_exit:        ret=0
          <idle>-0     [058]  9419.403064: net_dev_xmit:         dev=veth32abe19 skbaddr=0xffff92f45645f300 len=98 rc=0
          <idle>-0     [058]  9419.403065: net_dev_xmit:         dev=docker0 skbaddr=0xffff92f45645f300 len=98 rc=0
          <idle>-0     [058]  9419.403066: napi_gro_receive_exit: ret=3
          <idle>-0     [058]  9419.403069: napi_poll:            napi poll on napi struct 0xffff92f43d680050 for device eno1 work 1 budget 64
          <idle>-0     [058]  9419.403070: netif_receive_skb:    dev=eth0 skbaddr=0xffff92f45645f300 len=84
          <idle>-0     [058]  9419.403072: fib_table_lookup:     table 254 oif 0 iif 35 proto 0 10.54.81.172/0 -> 172.17.0.2/0 tos 0 scope 0 flags 0 ==> dev eth0 gw 101.49.57.0/::cfc8:80c9:69:700:5400:0 err 0
          <idle>-0     [058]  9419.403073: fib_table_lookup:     table 254 oif 0 iif 1 proto 0 172.17.0.2/0 -> 10.54.81.172/0 tos 0 scope 0 flags 0 ==> dev eth0 gw 172.17.0.1/:: err 0
          <idle>-0     [058]  9419.403089: kfree_skb:            skbaddr=0xffff92f45645f300 protocol=2048 location=0xffffffff87393631
          <idle>-0     [058]  9419.403090: napi_poll:            napi poll on napi struct 0xffff92f69f92c250 for device (no_device) work 1 budget 64
            ping-6644  [006]  9419.403130: skb_copy_datagram_iovec: skbaddr=0xffff92f45645e400 len=84
            ping-6644  [006]  9419.403136: consume_skb:          skbaddr=0xffff92f45645e400

MACVLAN

ip netns del net1
ip netns add net1
ip link add macvlan1 link enp130s0f0 type macvlan mode bridge
ip link set macvlan1 netns net1 up
ip netns exec net1 ip a add 192.168.1.200/24 dev macvlan1
ip netns exec net1 ping 192.168.1.101 -c1

Output

ip netns exec net1 perf trace --no-syscalls --event 'net:*' ping 192.168.1.101 -c1 > /dev/null

0.000 ping/5136 net:net_dev_queue:dev=macvlan1 skbaddr=0xffff9046524c9b00 len=98
0.008 ping/5136 net:net_dev_start_xmit:dev=macvlan1 queue_mapping=0 skbaddr=0xffff9046524c9b00 vlan_tagged=0 vlan_proto=0x0000 vlan_tci=0x0000 protocol=0x0800 ip_summed=0 len=98 data_len=0 network_offset=14 transport_offset_valid=1 transport_offset=34 tx_flags=0 gso_size=0 gso_segs=0 gso_type=0
0.011 ping/5136 net:net_dev_queue:dev=enp130s0f0 skbaddr=0xffff9046524c9b00 len=98
0.016 ping/5136 net:net_dev_start_xmit:dev=enp130s0f0 queue_mapping=52 skbaddr=0xffff9046524c9b00 vlan_tagged=0 vlan_proto=0x0000 vlan_tci=0x0000 protocol=0x0800 ip_summed=0 len=98 data_len=0 network_offset=14 transport_offset_valid=1 transport_offset=34 tx_flags=0 gso_size=0 gso_segs=0 gso_type=0
0.025 ping/5136 net:net_dev_xmit:dev=enp130s0f0 skbaddr=0xffff9046524c9b00 len=98 rc=0
0.026 ping/5136 net:net_dev_xmit:dev=macvlan1 skbaddr=0xffff9046524c9b00 len=98 rc=0
ip netns exec net1 trace-cmd record -e bridge -e qdisc -e fib -e tcp -e udp -e sock -e napi -e net -e skb -e fib6 ping 192.168.1.101 -c1 > /dev/null
trace-cmd report

ping-5924  [072] 710625.579565: fib_table_lookup:     table 254 oif 0 iif 1 proto 17 0.0.0.0/53849 -> 192.168.1.101/1025 tos 0 scope 0 flags 0 ==> dev macvlan1 gw 0.0.0.0 src 192.168.1.200 err 0
ping-5924  [072] 710625.579573: fib_table_lookup:     table 254 oif 0 iif 1 proto 17 192.168.1.200/53849 -> 192.168.1.101/1025 tos 0 scope 0 flags 0 ==> dev macvlan1 gw 0.0.0.0 src 192.168.1.200 err 0
ping-5924  [072] 710625.579607: fib_table_lookup:     table 254 oif 0 iif 1 proto 1 0.0.0.0/0 -> 192.168.1.101/0 tos 0 scope 0 flags 0 ==> dev macvlan1 gw 0.0.0.0 src 192.168.1.200 err 0
ping-5924  [072] 710625.579613: net_dev_queue:        dev=macvlan1 skbaddr=0xffff9046524c9400 len=98
ping-5924  [072] 710625.579617: net_dev_start_xmit:   dev=macvlan1 queue_mapping=0 skbaddr=0xffff9046524c9400 vlan_tagged=0 vlan_proto=0x0000 vlan_tci=0x0000 protocol=0x0800 ip_summed=0 len=98 data_len=0 network_offset=14 transport_offset_valid=1 transport_offset=34 tx_flags=0 gso_size=0 gso_segs=0 gso_type=0
ping-5924  [072] 710625.579619: net_dev_queue:        dev=enp130s0f0 skbaddr=0xffff9046524c9400 len=98
ping-5924  [072] 710625.579624: qdisc_dequeue:        dequeue ifindex=6 qdisc handle=0x0 parent=0x49 txq_state=0x0 packets=1 skbaddr=0xffff9046524c9400
ping-5924  [072] 710625.579626: net_dev_start_xmit:   dev=enp130s0f0 queue_mapping=72 skbaddr=0xffff9046524c9400 vlan_tagged=0 vlan_proto=0x0000 vlan_tci=0x0000 protocol=0x0800 ip_summed=0 len=98 data_len=0 network_offset=14 transport_offset_valid=1 transport_offset=34 tx_flags=0 gso_size=0 gso_segs=0 gso_type=0
ping-5924  [072] 710625.579632: net_dev_xmit:         dev=enp130s0f0 skbaddr=0xffff9046524c9400 len=98 rc=0
ping-5924  [072] 710625.579635: net_dev_xmit:         dev=macvlan1 skbaddr=0xffff9046524c9400 len=98 rc=0
ping-5924  [072] 710625.579639: consume_skb:          skbaddr=0xffff9046524c9400
ping-5924  [072] 710625.579645: napi_poll:            napi poll on napi struct 0xffff904e52e82858 for device enp130s0f0 work 0 budget 64
ping-5924  [072] 710625.579648: qdisc_dequeue:        dequeue ifindex=6 qdisc handle=0x0 parent=0x49 txq_state=0x0 packets=0 skbaddr=(nil)
<idle>-0     [000] 710625.579724: napi_gro_receive_entry: dev=enp130s0f0 napi_id=0x161 queue_mapping=1 skbaddr=0xffff90462899bc00 vlan_tagged=0 vlan_proto=0x0000 vlan_tci=0x0000 protocol=0x0800 ip_summed=0 hash=0x00000000 l4_hash=0 len=84 data_len=0 truesize=896 mac_header_valid=1 mac_header=-14 nr_frags=0 gso_size=0 gso_type=0
<idle>-0     [000] 710625.579732: netif_receive_skb:    dev=enp130s0f0 skbaddr=0xffff90462899bc00 len=84
<idle>-0     [000] 710625.579755: fib_table_lookup:     table 254 oif 0 iif 28 proto 0 192.168.1.101/0 -> 192.168.1.200/0 tos 0 scope 0 flags 0 ==> dev macvlan1 gw 0.0.0.0 src 192.168.1.200 err 0
<idle>-0     [000] 710625.579758: fib_table_lookup:     table 254 oif 0 iif 1 proto 0 192.168.1.200/0 -> 192.168.1.101/0 tos 0 scope 0 flags 0 ==> dev macvlan1 gw 0.0.0.0 src 192.168.1.200 err 0
<idle>-0     [000] 710625.579764: kfree_skb:            skbaddr=0xffff90462899bc00 protocol=2048 location=0xffffffffbdc6126b
ping-5924  [072] 710625.579766: skb_copy_datagram_iovec: skbaddr=0xffff90462899b000 len=84
ping-5924  [072] 710625.579770: consume_skb:          skbaddr=0xffff90462899b000
<idle>-0     [000] 710625.579770: napi_poll:            napi poll on napi struct 0xffff904e563e4058 for device enp130s0f0 work 1 budget 64

IPVLAN L3

ip netns del net1
ip netns add net1
ip link add name ipvl1 link enp130s0f0 type ipvlan mode l3
ip link set dev ipvl1 netns net1 up
ip netns exec net1 ip a add 192.168.1.200/24 dev ipvl1
ip netns exec net1 ip route add default dev ipvl1
ip netns exec net1 ping 192.168.1.101 -c1

Output (inconsistent reply)

ip netns exec net1 perf trace --no-syscalls --event 'net:*' ping 192.168.1.101 -c1 > /dev/null

0.000 ping/5325 net:net_dev_queue:dev=ipvl1 skbaddr=0xffff90462961d400 len=98
0.008 ping/5325 net:net_dev_start_xmit:dev=ipvl1 queue_mapping=0 skbaddr=0xffff90462961d400 vlan_tagged=0 vlan_proto=0x0000 vlan_tci=0x0000 protocol=0x0800 ip_summed=0 len=98 data_len=0 network_offset=14 transport_offset_valid=1 transport_offset=34 tx_flags=0 gso_size=0 gso_segs=0 gso_type=0
0.016 ping/5325 net:net_dev_queue:dev=enp130s0f0 skbaddr=0xffff90462961d400 len=98
0.021 ping/5325 net:net_dev_start_xmit:dev=enp130s0f0 queue_mapping=52 skbaddr=0xffff90462961d400 vlan_tagged=0 vlan_proto=0x0000 vlan_tci=0x0000 protocol=0x0800 ip_summed=0 len=98 data_len=0 network_offset=14 transport_offset_valid=1 transport_offset=34 tx_flags=0 gso_size=0 gso_segs=0 gso_type=0
0.029 ping/5325 net:net_dev_xmit:dev=enp130s0f0 skbaddr=0xffff90462961d400 len=98 rc=0
0.031 ping/5325 net:net_dev_xmit:dev=ipvl1 skbaddr=0xffff90462961d400 len=98 rc=0
ip netns exec net1 trace-cmd record -e bridge -e qdisc -e fib -e tcp -e udp -e sock -e napi -e net -e skb -e fib6 ping 192.168.1.101 -c1 > /dev/null
trace-cmd report

ping-6117  [066] 710799.655465: fib_table_lookup:     table 254 oif 0 iif 1 proto 17 0.0.0.0/56476 -> 192.168.1.101/1025 tos 0 scope 0 flags 0 ==> dev ipvl1 gw 0.0.0.0 src 192.168.1.200 err 0
ping-6117  [066] 710799.655472: fib_table_lookup:     table 254 oif 0 iif 1 proto 17 192.168.1.200/56476 -> 192.168.1.101/1025 tos 0 scope 0 flags 0 ==> dev ipvl1 gw 0.0.0.0 src 192.168.1.200 err 0
ping-6117  [066] 710799.655506: fib_table_lookup:     table 254 oif 0 iif 1 proto 1 0.0.0.0/0 -> 192.168.1.101/0 tos 0 scope 0 flags 0 ==> dev ipvl1 gw 0.0.0.0 src 192.168.1.200 err 0
ping-6117  [066] 710799.655513: net_dev_queue:        dev=ipvl1 skbaddr=0xffff90464c7d2400 len=98
ping-6117  [066] 710799.655516: net_dev_start_xmit:   dev=ipvl1 queue_mapping=0 skbaddr=0xffff90464c7d2400 vlan_tagged=0 vlan_proto=0x0000 vlan_tci=0x0000 protocol=0x0800 ip_summed=0 len=98 data_len=0 network_offset=14 transport_offset_valid=1 transport_offset=34 tx_flags=0 gso_size=0 gso_segs=0 gso_type=0
ping-6117  [066] 710799.655519: fib_table_lookup:     table 254 oif 6 iif 1 proto 0 192.168.1.200/0 -> 192.168.1.101/0 tos 0 scope 0 flags 1 ==> dev enp130s0f0 gw 0.0.0.0 src 192.168.1.102 err 0
ping-6117  [066] 710799.655522: net_dev_queue:        dev=enp130s0f0 skbaddr=0xffff90464c7d2400 len=98
ping-6117  [066] 710799.655529: qdisc_dequeue:        dequeue ifindex=6 qdisc handle=0x0 parent=0x43 txq_state=0x0 packets=1 skbaddr=0xffff90464c7d2400
ping-6117  [066] 710799.655531: net_dev_start_xmit:   dev=enp130s0f0 queue_mapping=66 skbaddr=0xffff90464c7d2400 vlan_tagged=0 vlan_proto=0x0000 vlan_tci=0x0000 protocol=0x0800 ip_summed=0 len=98 data_len=0 network_offset=14 transport_offset_valid=1 transport_offset=34 tx_flags=0 gso_size=0 gso_segs=0 gso_type=0
ping-6117  [066] 710799.655536: net_dev_xmit:         dev=enp130s0f0 skbaddr=0xffff90464c7d2400 len=98 rc=0
ping-6117  [066] 710799.655539: qdisc_dequeue:        dequeue ifindex=6 qdisc handle=0x0 parent=0x43 txq_state=0x0 packets=0 skbaddr=(nil)
ping-6117  [066] 710799.655541: net_dev_xmit:         dev=ipvl1 skbaddr=0xffff90464c7d2400 len=98 rc=0
ping-6117  [066] 710799.655544: consume_skb:          skbaddr=0xffff90464c7d2400
ping-6117  [066] 710799.655549: napi_poll:            napi poll on napi struct 0xffff904e52e84c58 for device enp130s0f0 work 0 budget 64

......

IPVLAN L2

ip netns del net1
ip netns add net1
ip link add name ipvl1 link enp130s0f0 type ipvlan mode l2
ip link set dev ipvl1 netns net1 up
ip netns exec net1 ip a add 192.168.1.200/24 dev ipvl1
ip netns exec net1 ping 192.168.1.101 -c1
ip netns exec net1 perf trace --no-syscalls --event 'net:*' ping 192.168.1.101 -c1 > /dev/null

Output

0.000 ping/5182 net:net_dev_queue:dev=ipvl1 skbaddr=0xffff9045f6ea7500 len=98
0.009 ping/5182 net:net_dev_start_xmit:dev=ipvl1 queue_mapping=0 skbaddr=0xffff9045f6ea7500 vlan_tagged=0 vlan_proto=0x0000 vlan_tci=0x0000 protocol=0x0800 ip_summed=0 len=98 data_len=0 network_offset=14 transport_offset_valid=1 transport_offset=34 tx_flags=0 gso_size=0 gso_segs=0 gso_type=0
0.012 ping/5182 net:net_dev_queue:dev=enp130s0f0 skbaddr=0xffff9045f6ea7500 len=98
0.034 ping/5182 net:net_dev_start_xmit:dev=enp130s0f0 queue_mapping=52 skbaddr=0xffff9045f6ea7500 vlan_tagged=0 vlan_proto=0x0000 vlan_tci=0x0000 protocol=0x0800 ip_summed=0 len=98 data_len=0 network_offset=14 transport_offset_valid=1 transport_offset=34 tx_flags=0 gso_size=0 gso_segs=0 gso_type=0
0.042 ping/5182 net:net_dev_xmit:dev=enp130s0f0 skbaddr=0xffff9045f6ea7500 len=98 rc=0
0.045 ping/5182 net:net_dev_xmit:dev=ipvl1 skbaddr=0xffff9045f6ea7500 len=98 rc=0
ip netns exec net1 trace-cmd record -e bridge -e qdisc -e fib -e tcp -e udp -e sock -e napi -e net -e skb -e fib6 ping 192.168.1.101 -c1 > /dev/null
trace-cmd report

ping-6223  [064] 711150.615688: fib_table_lookup:     table 254 oif 0 iif 1 proto 17 0.0.0.0/46426 -> 192.168.1.101/1025 tos 0 scope 0 flags 0 ==> dev ipvl1 gw 0.0.0.0 src 192.168.1.200 err 0
ping-6223  [064] 711150.615695: fib_table_lookup:     table 254 oif 0 iif 1 proto 17 192.168.1.200/46426 -> 192.168.1.101/1025 tos 0 scope 0 flags 0 ==> dev ipvl1 gw 0.0.0.0 src 192.168.1.200 err 0
ping-6223  [064] 711150.615729: fib_table_lookup:     table 254 oif 0 iif 1 proto 1 0.0.0.0/0 -> 192.168.1.101/0 tos 0 scope 0 flags 0 ==> dev ipvl1 gw 0.0.0.0 src 192.168.1.200 err 0
ping-6223  [064] 711150.615736: net_dev_queue:        dev=ipvl1 skbaddr=0xffff90464b5b0c00 len=98
ping-6223  [064] 711150.615740: net_dev_start_xmit:   dev=ipvl1 queue_mapping=0 skbaddr=0xffff90464b5b0c00 vlan_tagged=0 vlan_proto=0x0000 vlan_tci=0x0000 protocol=0x0800 ip_summed=0 len=98 data_len=0 network_offset=14 transport_offset_valid=1 transport_offset=34 tx_flags=0 gso_size=0 gso_segs=0 gso_type=0
ping-6223  [064] 711150.615742: net_dev_queue:        dev=enp130s0f0 skbaddr=0xffff90464b5b0c00 len=98
ping-6223  [064] 711150.615746: qdisc_dequeue:        dequeue ifindex=6 qdisc handle=0x0 parent=0x41 txq_state=0x0 packets=1 skbaddr=0xffff90464b5b0c00
ping-6223  [064] 711150.615748: net_dev_start_xmit:   dev=enp130s0f0 queue_mapping=64 skbaddr=0xffff90464b5b0c00 vlan_tagged=0 vlan_proto=0x0000 vlan_tci=0x0000 protocol=0x0800 ip_summed=0 len=98 data_len=0 network_offset=14 transport_offset_valid=1 transport_offset=34 tx_flags=0 gso_size=0 gso_segs=0 gso_type=0
ping-6223  [064] 711150.615753: net_dev_xmit:         dev=enp130s0f0 skbaddr=0xffff90464b5b0c00 len=98 rc=0
ping-6223  [064] 711150.615757: qdisc_dequeue:        dequeue ifindex=6 qdisc handle=0x0 parent=0x41 txq_state=0x0 packets=0 skbaddr=(nil)
ping-6223  [064] 711150.615759: net_dev_xmit:         dev=ipvl1 skbaddr=0xffff90464b5b0c00 len=98 rc=0
ping-6223  [064] 711150.615762: consume_skb:          skbaddr=0xffff90464b5b0c00
ping-6223  [064] 711150.615767: napi_poll:            napi poll on napi struct 0xffff904e52e84458 for device enp130s0f0 work 0 budget 64
<idle>-0     [000] 711150.615821: napi_gro_receive_entry: dev=enp130s0f0 napi_id=0x161 queue_mapping=1 skbaddr=0xffff9045f68bc100 vlan_tagged=0 vlan_proto=0x0000 vlan_tci=0x0000 protocol=0x0800 ip_summed=0 hash=0x00000000 l4_hash=0 len=84 data_len=0 truesize=896 mac_header_valid=1 mac_header=-14 nr_frags=0 gso_size=0 gso_type=0
<idle>-0     [000] 711150.615829: netif_receive_skb:    dev=enp130s0f0 skbaddr=0xffff9045f68bc100 len=84
<idle>-0     [000] 711150.615852: fib_table_lookup:     table 254 oif 0 iif 30 proto 0 192.168.1.101/0 -> 192.168.1.200/0 tos 0 scope 0 flags 0 ==> dev ipvl1 gw 0.0.0.0 src 192.168.1.200 err 0
<idle>-0     [000] 711150.615854: fib_table_lookup:     table 254 oif 0 iif 1 proto 0 192.168.1.200/0 -> 192.168.1.101/0 tos 0 scope 0 flags 0 ==> dev ipvl1 gw 0.0.0.0 src 192.168.1.200 err 0
<idle>-0     [000] 711150.615860: kfree_skb:            skbaddr=0xffff9045f68bc100 protocol=2048 location=0xffffffffbdc6126b
ping-6223  [064] 711150.615863: skb_copy_datagram_iovec: skbaddr=0xffff90462899b800 len=84
ping-6223  [064] 711150.615866: consume_skb:          skbaddr=0xffff90462899b800
<idle>-0     [000] 711150.615867: napi_poll:            napi poll on napi struct 0xffff904e563e4058 for device enp130s0f0 work 1 budget 64

Anamoly

0.000 ping/5095 net:net_dev_queue:dev=ipvl1 skbaddr=0xffff904613f11b00 len=42
0.008 ping/5095 net:net_dev_start_xmit:dev=ipvl1 queue_mapping=0 skbaddr=0xffff904613f11b00 vlan_tagged=0 vlan_proto=0x0000 vlan_tci=0x0000 protocol=0x0806 ip_summed=0 len=42 data_len=0 network_offset=14 transport_offset_valid=0 transport_offset=65533 tx_flags=0 gso_size=0 gso_segs=0 gso_type=0
0.012 ping/5095 net:net_dev_xmit:dev=ipvl1 skbaddr=0xffff904613f11b00 len=42 rc=0

Appendix

perf list 'net:*'

List of pre-defined events (to be used in -e):

  net:napi_gro_frags_entry                           [Tracepoint event]
  net:napi_gro_receive_entry                         [Tracepoint event]
  net:net_dev_queue                                  [Tracepoint event]
  net:net_dev_start_xmit                             [Tracepoint event]
  net:net_dev_xmit                                   [Tracepoint event]
  net:netif_receive_skb                              [Tracepoint event]
  net:netif_receive_skb_entry                        [Tracepoint event]
  net:netif_receive_skb_list_entry                   [Tracepoint event]
  net:netif_rx                                       [Tracepoint event]
  net:netif_rx_entry                                 [Tracepoint event]
  net:netif_rx_ni_entry                              [Tracepoint event]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment