utilities: Add some GDB macros for ovs-vswitchd
This commit adds basic GDB macro's for ovs-vswitchd:
- ovs_dump_bridge [ports|wanted]
- ovs_dump_bridge_ports <struct bridge *>
- ovs_dump_dp_netdev [ports]
- ovs_dump_dp_netdev_ports <struct dp_netdev *>
- ovs_dump_netdev
These dump functions show limited info, but you can simply cut/paste
the address and get the full structure info. For example:
(gdb) ovs_dump_netdev
(struct netdev *) 0x555771ed89e0: name = ovs-netdev , auto_classified = false, netdev_class = 0x5557714413c0 <netdev_tap_class>
(struct netdev *) 0x555771fc62a0: name = ovs_pvp_br0 , auto_classified = false, netdev_class = 0x5557714413c0 <netdev_tap_class>
(struct netdev *) 0x555771fc9660: name = vnet0 , auto_classified = true , netdev_class = 0x555771445e00 <netdev_linux_class>
(struct netdev *) 0x555771fc78d0: name = virbr0 , auto_classified = true , netdev_class = 0x555771445e00 <netdev_linux_class>
(struct netdev *) 0x7fbefffb5540: name = dpdk0 , auto_classified = false, netdev_class = 0x5557714419e0 <dpdk_class>
(struct netdev *) 0x555771fc98b0: name = em3 , auto_classified = true , netdev_class = 0x555771445e00 <netdev_linux_class>
(struct netdev *) 0x7fbea0a31c40: name = vhost0 , auto_classified = false, netdev_class = 0x555771442040 <dpdk_vhost_client_class>
(gdb) p *((struct netdev *) 0x7fbefffb5540)
$1 = {name = 0x555771ecef70 "dpdk0", netdev_class = 0x5557714419e0 <dpdk_class>, auto_classified = false, mtu_user_config = true, ref_cnt = 2, change_seq = 12,
reconfigure_seq = 0x555771ecf2e0, last_reconfigure_seq = 110, n_txq = 2, n_rxq = 1, node = 0x555771efafe0, saved_flags_list = {prev = 0x7fbefffb5580, next = 0x7fbefffb5580}}
Signed-off-by: Eelco Chaudron <echaudro@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2018-05-09 13:47:26 +02:00
|
|
|
#
|
|
|
|
# Copyright (c) 2018 Eelco Chaudron
|
|
|
|
#
|
|
|
|
# This program is free software; you can redistribute it and/or
|
|
|
|
# modify it under the terms of the GNU General Public License
|
|
|
|
# as published by the Free Software Foundation; either version
|
|
|
|
# 2 of the License, or (at your option) any later version.
|
|
|
|
#
|
|
|
|
# Files name:
|
|
|
|
# ovs_gdb.py
|
|
|
|
#
|
|
|
|
# Description:
|
|
|
|
# GDB commands and functions for Open vSwitch debugging
|
|
|
|
#
|
|
|
|
# Author:
|
|
|
|
# Eelco Chaudron
|
|
|
|
#
|
|
|
|
# Initial Created:
|
|
|
|
# 23 April 2018
|
|
|
|
#
|
|
|
|
# Notes:
|
|
|
|
# It implements the following GDB commands:
|
2018-06-20 11:04:03 +02:00
|
|
|
# - ovs_dump_bridge {ports|wanted}
|
utilities: Add some GDB macros for ovs-vswitchd
This commit adds basic GDB macro's for ovs-vswitchd:
- ovs_dump_bridge [ports|wanted]
- ovs_dump_bridge_ports <struct bridge *>
- ovs_dump_dp_netdev [ports]
- ovs_dump_dp_netdev_ports <struct dp_netdev *>
- ovs_dump_netdev
These dump functions show limited info, but you can simply cut/paste
the address and get the full structure info. For example:
(gdb) ovs_dump_netdev
(struct netdev *) 0x555771ed89e0: name = ovs-netdev , auto_classified = false, netdev_class = 0x5557714413c0 <netdev_tap_class>
(struct netdev *) 0x555771fc62a0: name = ovs_pvp_br0 , auto_classified = false, netdev_class = 0x5557714413c0 <netdev_tap_class>
(struct netdev *) 0x555771fc9660: name = vnet0 , auto_classified = true , netdev_class = 0x555771445e00 <netdev_linux_class>
(struct netdev *) 0x555771fc78d0: name = virbr0 , auto_classified = true , netdev_class = 0x555771445e00 <netdev_linux_class>
(struct netdev *) 0x7fbefffb5540: name = dpdk0 , auto_classified = false, netdev_class = 0x5557714419e0 <dpdk_class>
(struct netdev *) 0x555771fc98b0: name = em3 , auto_classified = true , netdev_class = 0x555771445e00 <netdev_linux_class>
(struct netdev *) 0x7fbea0a31c40: name = vhost0 , auto_classified = false, netdev_class = 0x555771442040 <dpdk_vhost_client_class>
(gdb) p *((struct netdev *) 0x7fbefffb5540)
$1 = {name = 0x555771ecef70 "dpdk0", netdev_class = 0x5557714419e0 <dpdk_class>, auto_classified = false, mtu_user_config = true, ref_cnt = 2, change_seq = 12,
reconfigure_seq = 0x555771ecf2e0, last_reconfigure_seq = 110, n_txq = 2, n_rxq = 1, node = 0x555771efafe0, saved_flags_list = {prev = 0x7fbefffb5580, next = 0x7fbefffb5580}}
Signed-off-by: Eelco Chaudron <echaudro@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2018-05-09 13:47:26 +02:00
|
|
|
# - ovs_dump_bridge_ports <struct bridge *>
|
|
|
|
# - ovs_dump_dp_netdev [ports]
|
2018-05-16 17:37:11 +02:00
|
|
|
# - ovs_dump_dp_netdev_poll_threads <struct dp_netdev *>
|
utilities: Add some GDB macros for ovs-vswitchd
This commit adds basic GDB macro's for ovs-vswitchd:
- ovs_dump_bridge [ports|wanted]
- ovs_dump_bridge_ports <struct bridge *>
- ovs_dump_dp_netdev [ports]
- ovs_dump_dp_netdev_ports <struct dp_netdev *>
- ovs_dump_netdev
These dump functions show limited info, but you can simply cut/paste
the address and get the full structure info. For example:
(gdb) ovs_dump_netdev
(struct netdev *) 0x555771ed89e0: name = ovs-netdev , auto_classified = false, netdev_class = 0x5557714413c0 <netdev_tap_class>
(struct netdev *) 0x555771fc62a0: name = ovs_pvp_br0 , auto_classified = false, netdev_class = 0x5557714413c0 <netdev_tap_class>
(struct netdev *) 0x555771fc9660: name = vnet0 , auto_classified = true , netdev_class = 0x555771445e00 <netdev_linux_class>
(struct netdev *) 0x555771fc78d0: name = virbr0 , auto_classified = true , netdev_class = 0x555771445e00 <netdev_linux_class>
(struct netdev *) 0x7fbefffb5540: name = dpdk0 , auto_classified = false, netdev_class = 0x5557714419e0 <dpdk_class>
(struct netdev *) 0x555771fc98b0: name = em3 , auto_classified = true , netdev_class = 0x555771445e00 <netdev_linux_class>
(struct netdev *) 0x7fbea0a31c40: name = vhost0 , auto_classified = false, netdev_class = 0x555771442040 <dpdk_vhost_client_class>
(gdb) p *((struct netdev *) 0x7fbefffb5540)
$1 = {name = 0x555771ecef70 "dpdk0", netdev_class = 0x5557714419e0 <dpdk_class>, auto_classified = false, mtu_user_config = true, ref_cnt = 2, change_seq = 12,
reconfigure_seq = 0x555771ecf2e0, last_reconfigure_seq = 110, n_txq = 2, n_rxq = 1, node = 0x555771efafe0, saved_flags_list = {prev = 0x7fbefffb5580, next = 0x7fbefffb5580}}
Signed-off-by: Eelco Chaudron <echaudro@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2018-05-09 13:47:26 +02:00
|
|
|
# - ovs_dump_dp_netdev_ports <struct dp_netdev *>
|
2018-05-31 11:13:19 +02:00
|
|
|
# - ovs_dump_dp_provider
|
utilities: Add some GDB macros for ovs-vswitchd
This commit adds basic GDB macro's for ovs-vswitchd:
- ovs_dump_bridge [ports|wanted]
- ovs_dump_bridge_ports <struct bridge *>
- ovs_dump_dp_netdev [ports]
- ovs_dump_dp_netdev_ports <struct dp_netdev *>
- ovs_dump_netdev
These dump functions show limited info, but you can simply cut/paste
the address and get the full structure info. For example:
(gdb) ovs_dump_netdev
(struct netdev *) 0x555771ed89e0: name = ovs-netdev , auto_classified = false, netdev_class = 0x5557714413c0 <netdev_tap_class>
(struct netdev *) 0x555771fc62a0: name = ovs_pvp_br0 , auto_classified = false, netdev_class = 0x5557714413c0 <netdev_tap_class>
(struct netdev *) 0x555771fc9660: name = vnet0 , auto_classified = true , netdev_class = 0x555771445e00 <netdev_linux_class>
(struct netdev *) 0x555771fc78d0: name = virbr0 , auto_classified = true , netdev_class = 0x555771445e00 <netdev_linux_class>
(struct netdev *) 0x7fbefffb5540: name = dpdk0 , auto_classified = false, netdev_class = 0x5557714419e0 <dpdk_class>
(struct netdev *) 0x555771fc98b0: name = em3 , auto_classified = true , netdev_class = 0x555771445e00 <netdev_linux_class>
(struct netdev *) 0x7fbea0a31c40: name = vhost0 , auto_classified = false, netdev_class = 0x555771442040 <dpdk_vhost_client_class>
(gdb) p *((struct netdev *) 0x7fbefffb5540)
$1 = {name = 0x555771ecef70 "dpdk0", netdev_class = 0x5557714419e0 <dpdk_class>, auto_classified = false, mtu_user_config = true, ref_cnt = 2, change_seq = 12,
reconfigure_seq = 0x555771ecf2e0, last_reconfigure_seq = 110, n_txq = 2, n_rxq = 1, node = 0x555771efafe0, saved_flags_list = {prev = 0x7fbefffb5580, next = 0x7fbefffb5580}}
Signed-off-by: Eelco Chaudron <echaudro@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2018-05-09 13:47:26 +02:00
|
|
|
# - ovs_dump_netdev
|
Utilities: Add the simap and netdev_provider dump commands to gdb
This changes add two additional gdb commands:
- ovs_dump_netdev_provider
- ovs_dump_ovs_list <struct simap *>
Here are some examples of their output:
ovs_dump_netdev_provider:
=========================
(gdb) ovs_dump_netdev_provider
(struct netdev_registered_class *) 0x2b2c540: refcnt = {count = 3},
(struct netdev_class *) 0x9555c0 = {type = tap, is_pmd = false, ...},
(struct netdev_registered_class *) 0x2b2c5a0: refcnt = {count = 2},
(struct netdev_class *) 0xc439d8 = {type = vxlan, is_pmd = false, ...},
(struct vport_class *) 0xc439d0 = { dpif_port = vxlan_sys, ... }
(struct netdev_registered_class *) 0x2b2c960: refcnt = {count = 1},
(struct netdev_class *) 0xc442f8 = {type = ip6erspan, is_pmd = false, ...},
(struct vport_class *) 0xc442f0 = { dpif_port = ip6erspan_sys, ... }
(struct netdev_registered_class *) 0x2b2c980: refcnt = {count = 1},
(struct netdev_class *) 0xc44540 = {type = ip6gre, is_pmd = false, ...},
(struct vport_class *) 0xc44538 = { dpif_port = ip6gre_sys, ... }
(struct netdev_registered_class *) 0x2b2ebe0: refcnt = {count = 3},
(struct netdev_class *) 0x95b8c0 = {type = dpdk, is_pmd = true, ...},
ovs_dump_ovs_list:
==================
(gdb) b memory_report
Breakpoint 1 at 0x753190: file lib/memory.c, line 136.
(gdb) set want_report=1
(gdb) c
Continuing.
Breakpoint 1, memory_report (usage=usage@entry=0x7fff0683d920) at lib/memory.c:136
136 {
(gdb) p usage
$20 = (const struct simap *) 0x7fff0683d920
(gdb) p* usage
$21 = {map = {buckets = 0x2b64df0, one = 0x0, mask = 3, n = 4}}
(gdb) p *usage
(gdb) ovs_dump_simap usage
handlers : 40 / 0x28
ports : 6 / 0x6
revalidators: 16 / 0x10
rules : 10 / 0xa
Signed-off-by: Eelco Chaudron <echaudro@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2018-06-01 13:21:31 +02:00
|
|
|
# - ovs_dump_netdev_provider
|
2018-05-16 17:37:11 +02:00
|
|
|
# - ovs_dump_ovs_list <struct ovs_list *> {[<structure>] [<member>] {dump}]}
|
utilities: Add another GDB macro for ovs-vswitchd.
This commit adds a basic packet metadata macro to the already existing
macros in ovs_gdb.py, ovs_dump_packets will print out information about
one or more packets. It feeds packets into tcpdump, and the user can
pass in tcpdump options to modify how packets are parsed or even write
out packets to a pcap file.
Example usage:
(gdb) break fast_path_processing
(gdb) commands
ovs_dump_packets packets_
continue
end
(gdb) continue
Thread 1 "ovs-vswitchd" hit Breakpoint 2, fast_path_processing ...
12:01:05.962485 ARP, Ethernet (len 6), IPv4 (len 4), Request who-has
10.1.1.1 tell 10.1.1.2, length 28
Thread 1 "ovs-vswitchd" hit Breakpoint 1, fast_path_processing ...
12:01:05.981214 ARP, Ethernet (len 6), IPv4 (len 4), Reply 10.1.1.1
is-at a6:0f:c3:f0:5f:bd (oui Unknown), length 28
Signed-off-by: Mike Pattrick <mkp@redhat.com>
Acked-by: Eelco Chaudron <echaudro@redhat.com>
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
2021-12-17 09:09:17 -05:00
|
|
|
# - ovs_dump_packets <struct dp_packet_batch|dp_packet> [tcpdump options]
|
Utilities: Add the simap and netdev_provider dump commands to gdb
This changes add two additional gdb commands:
- ovs_dump_netdev_provider
- ovs_dump_ovs_list <struct simap *>
Here are some examples of their output:
ovs_dump_netdev_provider:
=========================
(gdb) ovs_dump_netdev_provider
(struct netdev_registered_class *) 0x2b2c540: refcnt = {count = 3},
(struct netdev_class *) 0x9555c0 = {type = tap, is_pmd = false, ...},
(struct netdev_registered_class *) 0x2b2c5a0: refcnt = {count = 2},
(struct netdev_class *) 0xc439d8 = {type = vxlan, is_pmd = false, ...},
(struct vport_class *) 0xc439d0 = { dpif_port = vxlan_sys, ... }
(struct netdev_registered_class *) 0x2b2c960: refcnt = {count = 1},
(struct netdev_class *) 0xc442f8 = {type = ip6erspan, is_pmd = false, ...},
(struct vport_class *) 0xc442f0 = { dpif_port = ip6erspan_sys, ... }
(struct netdev_registered_class *) 0x2b2c980: refcnt = {count = 1},
(struct netdev_class *) 0xc44540 = {type = ip6gre, is_pmd = false, ...},
(struct vport_class *) 0xc44538 = { dpif_port = ip6gre_sys, ... }
(struct netdev_registered_class *) 0x2b2ebe0: refcnt = {count = 3},
(struct netdev_class *) 0x95b8c0 = {type = dpdk, is_pmd = true, ...},
ovs_dump_ovs_list:
==================
(gdb) b memory_report
Breakpoint 1 at 0x753190: file lib/memory.c, line 136.
(gdb) set want_report=1
(gdb) c
Continuing.
Breakpoint 1, memory_report (usage=usage@entry=0x7fff0683d920) at lib/memory.c:136
136 {
(gdb) p usage
$20 = (const struct simap *) 0x7fff0683d920
(gdb) p* usage
$21 = {map = {buckets = 0x2b64df0, one = 0x0, mask = 3, n = 4}}
(gdb) p *usage
(gdb) ovs_dump_simap usage
handlers : 40 / 0x28
ports : 6 / 0x6
revalidators: 16 / 0x10
rules : 10 / 0xa
Signed-off-by: Eelco Chaudron <echaudro@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2018-06-01 13:21:31 +02:00
|
|
|
# - ovs_dump_simap <struct simap *>
|
2018-11-22 16:18:14 +01:00
|
|
|
# - ovs_dump_smap <struct smap *>
|
utilities: Add upcall related commands to the GDB script
This commit adds ovs_dump_udpif_keys and ovs_show_upcall commands to the GDB script.
Here are some examples of the output:
(gdb) ovs_show_upcall
netdev@ovs-netdev:
flows : (current 0) (avg 0) (max 0) (limit 10000)
dump duration : 1ms
ufid enabled : true
39: (keys 0)
42: (keys 0)
41: (keys 0)
43: (keys 0)
44: (keys 0)
45: (keys 0)
system@ovs-system:
flows : (current 4000) (avg 4031) (max 4064) (limit 139000)
dump duration : 4ms
ufid enabled : true
99: (keys 676)
102: (keys 665)
101: (keys 656)
103: (keys 648)
104: (keys 642)
105: (keys 713)
(gdb) ovs_dump_udpif_keys
(struct udpif *) 0x1ebb830: name = netdev@ovs-netdev, total keys = 2
(struct udpif *) 0x20c6f00: name = system@ovs-system, total keys = 0
(gdb) ovs_dump_udpif_keys 0x1ebb830
(struct umap *) 0x1ef9328:
(struct udpif_key *) 0x7f36e0004e40: key_len = 132, mask_len = 144
ufid = 3e529416-83bf-bab4-5c6e-421127a9143a
hash = 0x3d96b11d, pmd_id = 1
state = UKEY_OPERATIONAL
n_packets = 2, n_bytes = 68
used = 1397047436, tcp_flags = 0x0000
(struct umap *) 0x1efb740:
(struct udpif_key *) 0x7f36dc004c20: key_len = 132, mask_len = 144
ufid = ee98d69f-8298-04dd-844a-4d2abee9f773
hash = 0x2e8077c2, pmd_id = 15
state = UKEY_OPERATIONAL
n_packets = 0, n_bytes = 0
used = 0, tcp_flags = 0x0000
(gdb) ovs_dump_udpif_keys 0x1ebb830 short
(struct umap *) 0x1ef9328:
(struct udpif_key *) 0x7f36e0004e40:
(struct umap *) 0x1efb740:
(struct udpif_key *) 0x7f36dc004c20:
Signed-off-by: Eelco Chaudron <echaudro@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2018-07-02 14:00:10 +02:00
|
|
|
# - ovs_dump_udpif_keys {<udpif_name>|<udpif_address>} {short}
|
2018-06-20 11:04:03 +02:00
|
|
|
# - ovs_show_fdb {[<bridge_name>] {dbg} {hash}}
|
utilities: Add upcall related commands to the GDB script
This commit adds ovs_dump_udpif_keys and ovs_show_upcall commands to the GDB script.
Here are some examples of the output:
(gdb) ovs_show_upcall
netdev@ovs-netdev:
flows : (current 0) (avg 0) (max 0) (limit 10000)
dump duration : 1ms
ufid enabled : true
39: (keys 0)
42: (keys 0)
41: (keys 0)
43: (keys 0)
44: (keys 0)
45: (keys 0)
system@ovs-system:
flows : (current 4000) (avg 4031) (max 4064) (limit 139000)
dump duration : 4ms
ufid enabled : true
99: (keys 676)
102: (keys 665)
101: (keys 656)
103: (keys 648)
104: (keys 642)
105: (keys 713)
(gdb) ovs_dump_udpif_keys
(struct udpif *) 0x1ebb830: name = netdev@ovs-netdev, total keys = 2
(struct udpif *) 0x20c6f00: name = system@ovs-system, total keys = 0
(gdb) ovs_dump_udpif_keys 0x1ebb830
(struct umap *) 0x1ef9328:
(struct udpif_key *) 0x7f36e0004e40: key_len = 132, mask_len = 144
ufid = 3e529416-83bf-bab4-5c6e-421127a9143a
hash = 0x3d96b11d, pmd_id = 1
state = UKEY_OPERATIONAL
n_packets = 2, n_bytes = 68
used = 1397047436, tcp_flags = 0x0000
(struct umap *) 0x1efb740:
(struct udpif_key *) 0x7f36dc004c20: key_len = 132, mask_len = 144
ufid = ee98d69f-8298-04dd-844a-4d2abee9f773
hash = 0x2e8077c2, pmd_id = 15
state = UKEY_OPERATIONAL
n_packets = 0, n_bytes = 0
used = 0, tcp_flags = 0x0000
(gdb) ovs_dump_udpif_keys 0x1ebb830 short
(struct umap *) 0x1ef9328:
(struct udpif_key *) 0x7f36e0004e40:
(struct umap *) 0x1efb740:
(struct udpif_key *) 0x7f36dc004c20:
Signed-off-by: Eelco Chaudron <echaudro@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2018-07-02 14:00:10 +02:00
|
|
|
# - ovs_show_upcall {dbg}
|
utilities: Add some GDB macros for ovs-vswitchd
This commit adds basic GDB macro's for ovs-vswitchd:
- ovs_dump_bridge [ports|wanted]
- ovs_dump_bridge_ports <struct bridge *>
- ovs_dump_dp_netdev [ports]
- ovs_dump_dp_netdev_ports <struct dp_netdev *>
- ovs_dump_netdev
These dump functions show limited info, but you can simply cut/paste
the address and get the full structure info. For example:
(gdb) ovs_dump_netdev
(struct netdev *) 0x555771ed89e0: name = ovs-netdev , auto_classified = false, netdev_class = 0x5557714413c0 <netdev_tap_class>
(struct netdev *) 0x555771fc62a0: name = ovs_pvp_br0 , auto_classified = false, netdev_class = 0x5557714413c0 <netdev_tap_class>
(struct netdev *) 0x555771fc9660: name = vnet0 , auto_classified = true , netdev_class = 0x555771445e00 <netdev_linux_class>
(struct netdev *) 0x555771fc78d0: name = virbr0 , auto_classified = true , netdev_class = 0x555771445e00 <netdev_linux_class>
(struct netdev *) 0x7fbefffb5540: name = dpdk0 , auto_classified = false, netdev_class = 0x5557714419e0 <dpdk_class>
(struct netdev *) 0x555771fc98b0: name = em3 , auto_classified = true , netdev_class = 0x555771445e00 <netdev_linux_class>
(struct netdev *) 0x7fbea0a31c40: name = vhost0 , auto_classified = false, netdev_class = 0x555771442040 <dpdk_vhost_client_class>
(gdb) p *((struct netdev *) 0x7fbefffb5540)
$1 = {name = 0x555771ecef70 "dpdk0", netdev_class = 0x5557714419e0 <dpdk_class>, auto_classified = false, mtu_user_config = true, ref_cnt = 2, change_seq = 12,
reconfigure_seq = 0x555771ecf2e0, last_reconfigure_seq = 110, n_txq = 2, n_rxq = 1, node = 0x555771efafe0, saved_flags_list = {prev = 0x7fbefffb5580, next = 0x7fbefffb5580}}
Signed-off-by: Eelco Chaudron <echaudro@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2018-05-09 13:47:26 +02:00
|
|
|
#
|
|
|
|
# Example:
|
|
|
|
# $ gdb $(which ovs-vswitchd) $(pidof ovs-vswitchd)
|
|
|
|
# (gdb) source ./utilities/gdb/ovs_gdb.py
|
|
|
|
#
|
|
|
|
# (gdb) ovs_dump_<TAB>
|
|
|
|
# ovs_dump_bridge ovs_dump_bridge_ports ovs_dump_dp_netdev
|
|
|
|
# ovs_dump_dp_netdev_ports ovs_dump_netdev
|
|
|
|
#
|
|
|
|
# (gdb) ovs_dump_bridge
|
|
|
|
# (struct bridge *) 0x5615471ed2e0: name = br2, type = system
|
|
|
|
# (struct bridge *) 0x561547166350: name = br0, type = system
|
|
|
|
# (struct bridge *) 0x561547216de0: name = ovs_pvp_br0, type = netdev
|
|
|
|
# (struct bridge *) 0x5615471d0420: name = br1, type = system
|
|
|
|
#
|
|
|
|
# (gdb) p *(struct bridge *) 0x5615471d0420
|
|
|
|
# $1 = {node = {hash = 24776443, next = 0x0}, name = 0x5615471cca90 "br1",
|
|
|
|
# type = 0x561547163bb0 "system",
|
|
|
|
# ...
|
|
|
|
# ...
|
|
|
|
#
|
|
|
|
import gdb
|
utilities: Add another GDB macro for ovs-vswitchd.
This commit adds a basic packet metadata macro to the already existing
macros in ovs_gdb.py, ovs_dump_packets will print out information about
one or more packets. It feeds packets into tcpdump, and the user can
pass in tcpdump options to modify how packets are parsed or even write
out packets to a pcap file.
Example usage:
(gdb) break fast_path_processing
(gdb) commands
ovs_dump_packets packets_
continue
end
(gdb) continue
Thread 1 "ovs-vswitchd" hit Breakpoint 2, fast_path_processing ...
12:01:05.962485 ARP, Ethernet (len 6), IPv4 (len 4), Request who-has
10.1.1.1 tell 10.1.1.2, length 28
Thread 1 "ovs-vswitchd" hit Breakpoint 1, fast_path_processing ...
12:01:05.981214 ARP, Ethernet (len 6), IPv4 (len 4), Reply 10.1.1.1
is-at a6:0f:c3:f0:5f:bd (oui Unknown), length 28
Signed-off-by: Mike Pattrick <mkp@redhat.com>
Acked-by: Eelco Chaudron <echaudro@redhat.com>
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
2021-12-17 09:09:17 -05:00
|
|
|
import struct
|
2019-01-07 14:29:59 +00:00
|
|
|
import sys
|
utilities: Add upcall related commands to the GDB script
This commit adds ovs_dump_udpif_keys and ovs_show_upcall commands to the GDB script.
Here are some examples of the output:
(gdb) ovs_show_upcall
netdev@ovs-netdev:
flows : (current 0) (avg 0) (max 0) (limit 10000)
dump duration : 1ms
ufid enabled : true
39: (keys 0)
42: (keys 0)
41: (keys 0)
43: (keys 0)
44: (keys 0)
45: (keys 0)
system@ovs-system:
flows : (current 4000) (avg 4031) (max 4064) (limit 139000)
dump duration : 4ms
ufid enabled : true
99: (keys 676)
102: (keys 665)
101: (keys 656)
103: (keys 648)
104: (keys 642)
105: (keys 713)
(gdb) ovs_dump_udpif_keys
(struct udpif *) 0x1ebb830: name = netdev@ovs-netdev, total keys = 2
(struct udpif *) 0x20c6f00: name = system@ovs-system, total keys = 0
(gdb) ovs_dump_udpif_keys 0x1ebb830
(struct umap *) 0x1ef9328:
(struct udpif_key *) 0x7f36e0004e40: key_len = 132, mask_len = 144
ufid = 3e529416-83bf-bab4-5c6e-421127a9143a
hash = 0x3d96b11d, pmd_id = 1
state = UKEY_OPERATIONAL
n_packets = 2, n_bytes = 68
used = 1397047436, tcp_flags = 0x0000
(struct umap *) 0x1efb740:
(struct udpif_key *) 0x7f36dc004c20: key_len = 132, mask_len = 144
ufid = ee98d69f-8298-04dd-844a-4d2abee9f773
hash = 0x2e8077c2, pmd_id = 15
state = UKEY_OPERATIONAL
n_packets = 0, n_bytes = 0
used = 0, tcp_flags = 0x0000
(gdb) ovs_dump_udpif_keys 0x1ebb830 short
(struct umap *) 0x1ef9328:
(struct udpif_key *) 0x7f36e0004e40:
(struct umap *) 0x1efb740:
(struct udpif_key *) 0x7f36dc004c20:
Signed-off-by: Eelco Chaudron <echaudro@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2018-07-02 14:00:10 +02:00
|
|
|
import uuid
|
utilities: Add another GDB macro for ovs-vswitchd.
This commit adds a basic packet metadata macro to the already existing
macros in ovs_gdb.py, ovs_dump_packets will print out information about
one or more packets. It feeds packets into tcpdump, and the user can
pass in tcpdump options to modify how packets are parsed or even write
out packets to a pcap file.
Example usage:
(gdb) break fast_path_processing
(gdb) commands
ovs_dump_packets packets_
continue
end
(gdb) continue
Thread 1 "ovs-vswitchd" hit Breakpoint 2, fast_path_processing ...
12:01:05.962485 ARP, Ethernet (len 6), IPv4 (len 4), Request who-has
10.1.1.1 tell 10.1.1.2, length 28
Thread 1 "ovs-vswitchd" hit Breakpoint 1, fast_path_processing ...
12:01:05.981214 ARP, Ethernet (len 6), IPv4 (len 4), Reply 10.1.1.1
is-at a6:0f:c3:f0:5f:bd (oui Unknown), length 28
Signed-off-by: Mike Pattrick <mkp@redhat.com>
Acked-by: Eelco Chaudron <echaudro@redhat.com>
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
2021-12-17 09:09:17 -05:00
|
|
|
try:
|
|
|
|
from scapy.layers.l2 import Ether
|
|
|
|
from scapy.utils import tcpdump
|
|
|
|
except ModuleNotFoundError:
|
|
|
|
Ether = None
|
|
|
|
tcpdump = None
|
utilities: Add upcall related commands to the GDB script
This commit adds ovs_dump_udpif_keys and ovs_show_upcall commands to the GDB script.
Here are some examples of the output:
(gdb) ovs_show_upcall
netdev@ovs-netdev:
flows : (current 0) (avg 0) (max 0) (limit 10000)
dump duration : 1ms
ufid enabled : true
39: (keys 0)
42: (keys 0)
41: (keys 0)
43: (keys 0)
44: (keys 0)
45: (keys 0)
system@ovs-system:
flows : (current 4000) (avg 4031) (max 4064) (limit 139000)
dump duration : 4ms
ufid enabled : true
99: (keys 676)
102: (keys 665)
101: (keys 656)
103: (keys 648)
104: (keys 642)
105: (keys 713)
(gdb) ovs_dump_udpif_keys
(struct udpif *) 0x1ebb830: name = netdev@ovs-netdev, total keys = 2
(struct udpif *) 0x20c6f00: name = system@ovs-system, total keys = 0
(gdb) ovs_dump_udpif_keys 0x1ebb830
(struct umap *) 0x1ef9328:
(struct udpif_key *) 0x7f36e0004e40: key_len = 132, mask_len = 144
ufid = 3e529416-83bf-bab4-5c6e-421127a9143a
hash = 0x3d96b11d, pmd_id = 1
state = UKEY_OPERATIONAL
n_packets = 2, n_bytes = 68
used = 1397047436, tcp_flags = 0x0000
(struct umap *) 0x1efb740:
(struct udpif_key *) 0x7f36dc004c20: key_len = 132, mask_len = 144
ufid = ee98d69f-8298-04dd-844a-4d2abee9f773
hash = 0x2e8077c2, pmd_id = 15
state = UKEY_OPERATIONAL
n_packets = 0, n_bytes = 0
used = 0, tcp_flags = 0x0000
(gdb) ovs_dump_udpif_keys 0x1ebb830 short
(struct umap *) 0x1ef9328:
(struct udpif_key *) 0x7f36e0004e40:
(struct umap *) 0x1efb740:
(struct udpif_key *) 0x7f36dc004c20:
Signed-off-by: Eelco Chaudron <echaudro@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2018-07-02 14:00:10 +02:00
|
|
|
|
|
|
|
|
|
|
|
#
|
|
|
|
# Global #define's from OVS which might need updating based on a version.
|
|
|
|
#
|
|
|
|
N_UMAPS = 512
|
utilities: Add some GDB macros for ovs-vswitchd
This commit adds basic GDB macro's for ovs-vswitchd:
- ovs_dump_bridge [ports|wanted]
- ovs_dump_bridge_ports <struct bridge *>
- ovs_dump_dp_netdev [ports]
- ovs_dump_dp_netdev_ports <struct dp_netdev *>
- ovs_dump_netdev
These dump functions show limited info, but you can simply cut/paste
the address and get the full structure info. For example:
(gdb) ovs_dump_netdev
(struct netdev *) 0x555771ed89e0: name = ovs-netdev , auto_classified = false, netdev_class = 0x5557714413c0 <netdev_tap_class>
(struct netdev *) 0x555771fc62a0: name = ovs_pvp_br0 , auto_classified = false, netdev_class = 0x5557714413c0 <netdev_tap_class>
(struct netdev *) 0x555771fc9660: name = vnet0 , auto_classified = true , netdev_class = 0x555771445e00 <netdev_linux_class>
(struct netdev *) 0x555771fc78d0: name = virbr0 , auto_classified = true , netdev_class = 0x555771445e00 <netdev_linux_class>
(struct netdev *) 0x7fbefffb5540: name = dpdk0 , auto_classified = false, netdev_class = 0x5557714419e0 <dpdk_class>
(struct netdev *) 0x555771fc98b0: name = em3 , auto_classified = true , netdev_class = 0x555771445e00 <netdev_linux_class>
(struct netdev *) 0x7fbea0a31c40: name = vhost0 , auto_classified = false, netdev_class = 0x555771442040 <dpdk_vhost_client_class>
(gdb) p *((struct netdev *) 0x7fbefffb5540)
$1 = {name = 0x555771ecef70 "dpdk0", netdev_class = 0x5557714419e0 <dpdk_class>, auto_classified = false, mtu_user_config = true, ref_cnt = 2, change_seq = 12,
reconfigure_seq = 0x555771ecf2e0, last_reconfigure_seq = 110, n_txq = 2, n_rxq = 1, node = 0x555771efafe0, saved_flags_list = {prev = 0x7fbefffb5580, next = 0x7fbefffb5580}}
Signed-off-by: Eelco Chaudron <echaudro@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2018-05-09 13:47:26 +02:00
|
|
|
|
|
|
|
|
|
|
|
#
|
|
|
|
# The container_of code below is a copied from the Linux kernel project file,
|
|
|
|
# scripts/gdb/linux/utils.py. It has the following copyright header:
|
|
|
|
#
|
|
|
|
# # gdb helper commands and functions for Linux kernel debugging
|
|
|
|
# #
|
|
|
|
# # common utilities
|
|
|
|
# #
|
|
|
|
# # Copyright (c) Siemens AG, 2011-2013
|
|
|
|
# #
|
|
|
|
# # Authors:
|
|
|
|
# # Jan Kiszka <jan.kiszka@siemens.com>
|
|
|
|
# #
|
|
|
|
# # This work is licensed under the terms of the GNU GPL version 2.
|
|
|
|
#
|
utilities: Add another GDB macro for ovs-vswitchd.
This commit adds a basic packet metadata macro to the already existing
macros in ovs_gdb.py, ovs_dump_packets will print out information about
one or more packets. It feeds packets into tcpdump, and the user can
pass in tcpdump options to modify how packets are parsed or even write
out packets to a pcap file.
Example usage:
(gdb) break fast_path_processing
(gdb) commands
ovs_dump_packets packets_
continue
end
(gdb) continue
Thread 1 "ovs-vswitchd" hit Breakpoint 2, fast_path_processing ...
12:01:05.962485 ARP, Ethernet (len 6), IPv4 (len 4), Request who-has
10.1.1.1 tell 10.1.1.2, length 28
Thread 1 "ovs-vswitchd" hit Breakpoint 1, fast_path_processing ...
12:01:05.981214 ARP, Ethernet (len 6), IPv4 (len 4), Reply 10.1.1.1
is-at a6:0f:c3:f0:5f:bd (oui Unknown), length 28
Signed-off-by: Mike Pattrick <mkp@redhat.com>
Acked-by: Eelco Chaudron <echaudro@redhat.com>
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
2021-12-17 09:09:17 -05:00
|
|
|
class CachedType(object):
|
utilities: Add some GDB macros for ovs-vswitchd
This commit adds basic GDB macro's for ovs-vswitchd:
- ovs_dump_bridge [ports|wanted]
- ovs_dump_bridge_ports <struct bridge *>
- ovs_dump_dp_netdev [ports]
- ovs_dump_dp_netdev_ports <struct dp_netdev *>
- ovs_dump_netdev
These dump functions show limited info, but you can simply cut/paste
the address and get the full structure info. For example:
(gdb) ovs_dump_netdev
(struct netdev *) 0x555771ed89e0: name = ovs-netdev , auto_classified = false, netdev_class = 0x5557714413c0 <netdev_tap_class>
(struct netdev *) 0x555771fc62a0: name = ovs_pvp_br0 , auto_classified = false, netdev_class = 0x5557714413c0 <netdev_tap_class>
(struct netdev *) 0x555771fc9660: name = vnet0 , auto_classified = true , netdev_class = 0x555771445e00 <netdev_linux_class>
(struct netdev *) 0x555771fc78d0: name = virbr0 , auto_classified = true , netdev_class = 0x555771445e00 <netdev_linux_class>
(struct netdev *) 0x7fbefffb5540: name = dpdk0 , auto_classified = false, netdev_class = 0x5557714419e0 <dpdk_class>
(struct netdev *) 0x555771fc98b0: name = em3 , auto_classified = true , netdev_class = 0x555771445e00 <netdev_linux_class>
(struct netdev *) 0x7fbea0a31c40: name = vhost0 , auto_classified = false, netdev_class = 0x555771442040 <dpdk_vhost_client_class>
(gdb) p *((struct netdev *) 0x7fbefffb5540)
$1 = {name = 0x555771ecef70 "dpdk0", netdev_class = 0x5557714419e0 <dpdk_class>, auto_classified = false, mtu_user_config = true, ref_cnt = 2, change_seq = 12,
reconfigure_seq = 0x555771ecf2e0, last_reconfigure_seq = 110, n_txq = 2, n_rxq = 1, node = 0x555771efafe0, saved_flags_list = {prev = 0x7fbefffb5580, next = 0x7fbefffb5580}}
Signed-off-by: Eelco Chaudron <echaudro@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2018-05-09 13:47:26 +02:00
|
|
|
def __init__(self, name):
|
|
|
|
self._type = None
|
|
|
|
self._name = name
|
|
|
|
|
|
|
|
def _new_objfile_handler(self, event):
|
|
|
|
self._type = None
|
|
|
|
gdb.events.new_objfile.disconnect(self._new_objfile_handler)
|
|
|
|
|
|
|
|
def get_type(self):
|
|
|
|
if self._type is None:
|
|
|
|
self._type = gdb.lookup_type(self._name)
|
|
|
|
if self._type is None:
|
|
|
|
raise gdb.GdbError(
|
|
|
|
"cannot resolve type '{0}'".format(self._name))
|
|
|
|
if hasattr(gdb, 'events') and hasattr(gdb.events, 'new_objfile'):
|
|
|
|
gdb.events.new_objfile.connect(self._new_objfile_handler)
|
|
|
|
return self._type
|
|
|
|
|
|
|
|
|
|
|
|
long_type = CachedType("long")
|
|
|
|
|
|
|
|
|
|
|
|
def get_long_type():
|
|
|
|
global long_type
|
|
|
|
return long_type.get_type()
|
|
|
|
|
|
|
|
|
|
|
|
def offset_of(typeobj, field):
|
|
|
|
element = gdb.Value(0).cast(typeobj)
|
|
|
|
return int(str(element[field].address).split()[0], 16)
|
|
|
|
|
|
|
|
|
|
|
|
def container_of(ptr, typeobj, member):
|
|
|
|
return (ptr.cast(get_long_type()) -
|
|
|
|
offset_of(typeobj, member)).cast(typeobj)
|
|
|
|
|
|
|
|
|
2018-05-31 11:13:19 +02:00
|
|
|
def get_global_variable(name):
|
|
|
|
var = gdb.lookup_symbol(name)[0]
|
|
|
|
if var is None or not var.is_variable:
|
|
|
|
print("Can't find {} global variable, are you sure "
|
2019-01-01 09:34:09 -05:00
|
|
|
"you are debugging OVS?".format(name))
|
2018-05-31 11:13:19 +02:00
|
|
|
return None
|
|
|
|
return gdb.parse_and_eval(name)
|
|
|
|
|
|
|
|
|
2018-06-20 11:04:03 +02:00
|
|
|
def get_time_msec():
|
|
|
|
# There is no variable that stores the current time each iteration,
|
|
|
|
# to get a decent time time_now() value. For now we take the global
|
|
|
|
# "coverage_run_time" value, which is the current time + max 5 seconds
|
|
|
|
# (COVERAGE_RUN_INTERVAL)
|
2019-12-20 18:35:08 +01:00
|
|
|
return int(get_global_variable("coverage_run_time")), -5000
|
2018-06-20 11:04:03 +02:00
|
|
|
|
|
|
|
|
|
|
|
def get_time_now():
|
|
|
|
# See get_time_msec() above
|
utilities: Add another GDB macro for ovs-vswitchd.
This commit adds a basic packet metadata macro to the already existing
macros in ovs_gdb.py, ovs_dump_packets will print out information about
one or more packets. It feeds packets into tcpdump, and the user can
pass in tcpdump options to modify how packets are parsed or even write
out packets to a pcap file.
Example usage:
(gdb) break fast_path_processing
(gdb) commands
ovs_dump_packets packets_
continue
end
(gdb) continue
Thread 1 "ovs-vswitchd" hit Breakpoint 2, fast_path_processing ...
12:01:05.962485 ARP, Ethernet (len 6), IPv4 (len 4), Request who-has
10.1.1.1 tell 10.1.1.2, length 28
Thread 1 "ovs-vswitchd" hit Breakpoint 1, fast_path_processing ...
12:01:05.981214 ARP, Ethernet (len 6), IPv4 (len 4), Reply 10.1.1.1
is-at a6:0f:c3:f0:5f:bd (oui Unknown), length 28
Signed-off-by: Mike Pattrick <mkp@redhat.com>
Acked-by: Eelco Chaudron <echaudro@redhat.com>
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
2021-12-17 09:09:17 -05:00
|
|
|
return int(get_global_variable("coverage_run_time")) / 1000, -5
|
2018-06-20 11:04:03 +02:00
|
|
|
|
|
|
|
|
|
|
|
def eth_addr_to_string(eth_addr):
|
|
|
|
return "{:02x}:{:02x}:{:02x}:{:02x}:{:02x}:{:02x}".format(
|
2019-12-20 18:35:08 +01:00
|
|
|
int(eth_addr['ea'][0]),
|
|
|
|
int(eth_addr['ea'][1]),
|
|
|
|
int(eth_addr['ea'][2]),
|
|
|
|
int(eth_addr['ea'][3]),
|
|
|
|
int(eth_addr['ea'][4]),
|
|
|
|
int(eth_addr['ea'][5]))
|
2018-06-20 11:04:03 +02:00
|
|
|
|
utilities: Add upcall related commands to the GDB script
This commit adds ovs_dump_udpif_keys and ovs_show_upcall commands to the GDB script.
Here are some examples of the output:
(gdb) ovs_show_upcall
netdev@ovs-netdev:
flows : (current 0) (avg 0) (max 0) (limit 10000)
dump duration : 1ms
ufid enabled : true
39: (keys 0)
42: (keys 0)
41: (keys 0)
43: (keys 0)
44: (keys 0)
45: (keys 0)
system@ovs-system:
flows : (current 4000) (avg 4031) (max 4064) (limit 139000)
dump duration : 4ms
ufid enabled : true
99: (keys 676)
102: (keys 665)
101: (keys 656)
103: (keys 648)
104: (keys 642)
105: (keys 713)
(gdb) ovs_dump_udpif_keys
(struct udpif *) 0x1ebb830: name = netdev@ovs-netdev, total keys = 2
(struct udpif *) 0x20c6f00: name = system@ovs-system, total keys = 0
(gdb) ovs_dump_udpif_keys 0x1ebb830
(struct umap *) 0x1ef9328:
(struct udpif_key *) 0x7f36e0004e40: key_len = 132, mask_len = 144
ufid = 3e529416-83bf-bab4-5c6e-421127a9143a
hash = 0x3d96b11d, pmd_id = 1
state = UKEY_OPERATIONAL
n_packets = 2, n_bytes = 68
used = 1397047436, tcp_flags = 0x0000
(struct umap *) 0x1efb740:
(struct udpif_key *) 0x7f36dc004c20: key_len = 132, mask_len = 144
ufid = ee98d69f-8298-04dd-844a-4d2abee9f773
hash = 0x2e8077c2, pmd_id = 15
state = UKEY_OPERATIONAL
n_packets = 0, n_bytes = 0
used = 0, tcp_flags = 0x0000
(gdb) ovs_dump_udpif_keys 0x1ebb830 short
(struct umap *) 0x1ef9328:
(struct udpif_key *) 0x7f36e0004e40:
(struct umap *) 0x1efb740:
(struct udpif_key *) 0x7f36dc004c20:
Signed-off-by: Eelco Chaudron <echaudro@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2018-07-02 14:00:10 +02:00
|
|
|
|
2019-01-07 14:29:59 +00:00
|
|
|
#
|
|
|
|
# Simple class to print a spinner on the console
|
|
|
|
#
|
|
|
|
class ProgressIndicator(object):
|
|
|
|
def __init__(self, message=None):
|
utilities: Add another GDB macro for ovs-vswitchd.
This commit adds a basic packet metadata macro to the already existing
macros in ovs_gdb.py, ovs_dump_packets will print out information about
one or more packets. It feeds packets into tcpdump, and the user can
pass in tcpdump options to modify how packets are parsed or even write
out packets to a pcap file.
Example usage:
(gdb) break fast_path_processing
(gdb) commands
ovs_dump_packets packets_
continue
end
(gdb) continue
Thread 1 "ovs-vswitchd" hit Breakpoint 2, fast_path_processing ...
12:01:05.962485 ARP, Ethernet (len 6), IPv4 (len 4), Request who-has
10.1.1.1 tell 10.1.1.2, length 28
Thread 1 "ovs-vswitchd" hit Breakpoint 1, fast_path_processing ...
12:01:05.981214 ARP, Ethernet (len 6), IPv4 (len 4), Reply 10.1.1.1
is-at a6:0f:c3:f0:5f:bd (oui Unknown), length 28
Signed-off-by: Mike Pattrick <mkp@redhat.com>
Acked-by: Eelco Chaudron <echaudro@redhat.com>
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
2021-12-17 09:09:17 -05:00
|
|
|
self.spinner = "/-\\|"
|
2019-01-07 14:29:59 +00:00
|
|
|
self.spinner_index = 0
|
|
|
|
self.message = message
|
|
|
|
|
|
|
|
if self.message is not None:
|
|
|
|
print(self.message, end='')
|
|
|
|
|
|
|
|
def update(self):
|
|
|
|
print("{}\b".format(self.spinner[self.spinner_index]), end='')
|
|
|
|
sys.stdout.flush()
|
|
|
|
self.spinner_index += 1
|
|
|
|
if self.spinner_index >= len(self.spinner):
|
|
|
|
self.spinner_index = 0
|
|
|
|
|
|
|
|
def pause(self):
|
|
|
|
print("\r\033[K", end='')
|
|
|
|
|
|
|
|
def resume(self):
|
|
|
|
if self.message is not None:
|
|
|
|
print(self.message, end='')
|
|
|
|
self.update()
|
|
|
|
|
|
|
|
def done(self):
|
|
|
|
self.pause()
|
|
|
|
|
|
|
|
|
2018-05-16 17:37:11 +02:00
|
|
|
#
|
|
|
|
# Class that will provide an iterator over an OVS cmap.
|
|
|
|
#
|
|
|
|
class ForEachCMAP(object):
|
|
|
|
def __init__(self, cmap, typeobj=None, member='node'):
|
|
|
|
self.cmap = cmap
|
|
|
|
self.first = True
|
|
|
|
self.typeobj = typeobj
|
|
|
|
self.member = member
|
|
|
|
# Cursor values
|
|
|
|
self.node = 0
|
|
|
|
self.bucket_idx = 0
|
|
|
|
self.entry_idx = 0
|
|
|
|
|
|
|
|
def __iter__(self):
|
|
|
|
return self
|
|
|
|
|
|
|
|
def __get_CMAP_K(self):
|
|
|
|
ptr_type = gdb.lookup_type("void").pointer()
|
|
|
|
return (64 - 4) / (4 + ptr_type.sizeof)
|
|
|
|
|
|
|
|
def __next(self):
|
|
|
|
ipml = self.cmap['impl']['p']
|
|
|
|
|
|
|
|
if self.node != 0:
|
|
|
|
self.node = self.node['next']['p']
|
|
|
|
if self.node != 0:
|
|
|
|
return
|
|
|
|
|
|
|
|
while self.bucket_idx <= ipml['mask']:
|
|
|
|
buckets = ipml['buckets'][self.bucket_idx]
|
|
|
|
while self.entry_idx < self.__get_CMAP_K():
|
|
|
|
self.node = buckets['nodes'][self.entry_idx]['next']['p']
|
|
|
|
self.entry_idx += 1
|
|
|
|
if self.node != 0:
|
|
|
|
return
|
|
|
|
|
|
|
|
self.bucket_idx += 1
|
|
|
|
self.entry_idx = 0
|
|
|
|
|
|
|
|
raise StopIteration
|
|
|
|
|
2019-01-07 14:29:59 +00:00
|
|
|
def __next__(self):
|
2018-05-16 17:37:11 +02:00
|
|
|
ipml = self.cmap['impl']['p']
|
|
|
|
if ipml['n'] == 0:
|
|
|
|
raise StopIteration
|
|
|
|
|
|
|
|
self.__next()
|
|
|
|
|
|
|
|
if self.typeobj is None:
|
|
|
|
return self.node
|
|
|
|
|
|
|
|
return container_of(self.node,
|
|
|
|
gdb.lookup_type(self.typeobj).pointer(),
|
|
|
|
self.member)
|
|
|
|
|
2019-01-07 14:29:59 +00:00
|
|
|
def next(self):
|
|
|
|
return self.__next__()
|
|
|
|
|
2018-05-16 17:37:11 +02:00
|
|
|
|
utilities: Add some GDB macros for ovs-vswitchd
This commit adds basic GDB macro's for ovs-vswitchd:
- ovs_dump_bridge [ports|wanted]
- ovs_dump_bridge_ports <struct bridge *>
- ovs_dump_dp_netdev [ports]
- ovs_dump_dp_netdev_ports <struct dp_netdev *>
- ovs_dump_netdev
These dump functions show limited info, but you can simply cut/paste
the address and get the full structure info. For example:
(gdb) ovs_dump_netdev
(struct netdev *) 0x555771ed89e0: name = ovs-netdev , auto_classified = false, netdev_class = 0x5557714413c0 <netdev_tap_class>
(struct netdev *) 0x555771fc62a0: name = ovs_pvp_br0 , auto_classified = false, netdev_class = 0x5557714413c0 <netdev_tap_class>
(struct netdev *) 0x555771fc9660: name = vnet0 , auto_classified = true , netdev_class = 0x555771445e00 <netdev_linux_class>
(struct netdev *) 0x555771fc78d0: name = virbr0 , auto_classified = true , netdev_class = 0x555771445e00 <netdev_linux_class>
(struct netdev *) 0x7fbefffb5540: name = dpdk0 , auto_classified = false, netdev_class = 0x5557714419e0 <dpdk_class>
(struct netdev *) 0x555771fc98b0: name = em3 , auto_classified = true , netdev_class = 0x555771445e00 <netdev_linux_class>
(struct netdev *) 0x7fbea0a31c40: name = vhost0 , auto_classified = false, netdev_class = 0x555771442040 <dpdk_vhost_client_class>
(gdb) p *((struct netdev *) 0x7fbefffb5540)
$1 = {name = 0x555771ecef70 "dpdk0", netdev_class = 0x5557714419e0 <dpdk_class>, auto_classified = false, mtu_user_config = true, ref_cnt = 2, change_seq = 12,
reconfigure_seq = 0x555771ecf2e0, last_reconfigure_seq = 110, n_txq = 2, n_rxq = 1, node = 0x555771efafe0, saved_flags_list = {prev = 0x7fbefffb5580, next = 0x7fbefffb5580}}
Signed-off-by: Eelco Chaudron <echaudro@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2018-05-09 13:47:26 +02:00
|
|
|
#
|
|
|
|
# Class that will provide an iterator over an OVS hmap.
|
|
|
|
#
|
|
|
|
class ForEachHMAP(object):
|
|
|
|
def __init__(self, hmap, typeobj=None, member='node'):
|
|
|
|
self.hmap = hmap
|
|
|
|
self.node = None
|
|
|
|
self.first = True
|
|
|
|
self.typeobj = typeobj
|
|
|
|
self.member = member
|
|
|
|
|
|
|
|
def __iter__(self):
|
|
|
|
return self
|
|
|
|
|
|
|
|
def __next(self, start):
|
|
|
|
for i in range(start, (self.hmap['mask'] + 1)):
|
|
|
|
self.node = self.hmap['buckets'][i]
|
|
|
|
if self.node != 0:
|
|
|
|
return
|
|
|
|
|
|
|
|
raise StopIteration
|
|
|
|
|
2019-01-07 14:29:59 +00:00
|
|
|
def __next__(self):
|
utilities: Add some GDB macros for ovs-vswitchd
This commit adds basic GDB macro's for ovs-vswitchd:
- ovs_dump_bridge [ports|wanted]
- ovs_dump_bridge_ports <struct bridge *>
- ovs_dump_dp_netdev [ports]
- ovs_dump_dp_netdev_ports <struct dp_netdev *>
- ovs_dump_netdev
These dump functions show limited info, but you can simply cut/paste
the address and get the full structure info. For example:
(gdb) ovs_dump_netdev
(struct netdev *) 0x555771ed89e0: name = ovs-netdev , auto_classified = false, netdev_class = 0x5557714413c0 <netdev_tap_class>
(struct netdev *) 0x555771fc62a0: name = ovs_pvp_br0 , auto_classified = false, netdev_class = 0x5557714413c0 <netdev_tap_class>
(struct netdev *) 0x555771fc9660: name = vnet0 , auto_classified = true , netdev_class = 0x555771445e00 <netdev_linux_class>
(struct netdev *) 0x555771fc78d0: name = virbr0 , auto_classified = true , netdev_class = 0x555771445e00 <netdev_linux_class>
(struct netdev *) 0x7fbefffb5540: name = dpdk0 , auto_classified = false, netdev_class = 0x5557714419e0 <dpdk_class>
(struct netdev *) 0x555771fc98b0: name = em3 , auto_classified = true , netdev_class = 0x555771445e00 <netdev_linux_class>
(struct netdev *) 0x7fbea0a31c40: name = vhost0 , auto_classified = false, netdev_class = 0x555771442040 <dpdk_vhost_client_class>
(gdb) p *((struct netdev *) 0x7fbefffb5540)
$1 = {name = 0x555771ecef70 "dpdk0", netdev_class = 0x5557714419e0 <dpdk_class>, auto_classified = false, mtu_user_config = true, ref_cnt = 2, change_seq = 12,
reconfigure_seq = 0x555771ecf2e0, last_reconfigure_seq = 110, n_txq = 2, n_rxq = 1, node = 0x555771efafe0, saved_flags_list = {prev = 0x7fbefffb5580, next = 0x7fbefffb5580}}
Signed-off-by: Eelco Chaudron <echaudro@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2018-05-09 13:47:26 +02:00
|
|
|
#
|
|
|
|
# In the real implementation the n values is never checked,
|
|
|
|
# however when debugging we do, as we might try to access
|
|
|
|
# a hmap that has been cleared/hmap_destroy().
|
|
|
|
#
|
|
|
|
if self.hmap['n'] <= 0:
|
|
|
|
raise StopIteration
|
|
|
|
|
|
|
|
if self.first:
|
|
|
|
self.first = False
|
|
|
|
self.__next(0)
|
|
|
|
elif self.node['next'] != 0:
|
|
|
|
self.node = self.node['next']
|
|
|
|
else:
|
|
|
|
self.__next((self.node['hash'] & self.hmap['mask']) + 1)
|
|
|
|
|
|
|
|
if self.typeobj is None:
|
|
|
|
return self.node
|
|
|
|
|
|
|
|
return container_of(self.node,
|
|
|
|
gdb.lookup_type(self.typeobj).pointer(),
|
|
|
|
self.member)
|
|
|
|
|
2019-01-07 14:29:59 +00:00
|
|
|
def next(self):
|
|
|
|
return self.__next__()
|
|
|
|
|
utilities: Add some GDB macros for ovs-vswitchd
This commit adds basic GDB macro's for ovs-vswitchd:
- ovs_dump_bridge [ports|wanted]
- ovs_dump_bridge_ports <struct bridge *>
- ovs_dump_dp_netdev [ports]
- ovs_dump_dp_netdev_ports <struct dp_netdev *>
- ovs_dump_netdev
These dump functions show limited info, but you can simply cut/paste
the address and get the full structure info. For example:
(gdb) ovs_dump_netdev
(struct netdev *) 0x555771ed89e0: name = ovs-netdev , auto_classified = false, netdev_class = 0x5557714413c0 <netdev_tap_class>
(struct netdev *) 0x555771fc62a0: name = ovs_pvp_br0 , auto_classified = false, netdev_class = 0x5557714413c0 <netdev_tap_class>
(struct netdev *) 0x555771fc9660: name = vnet0 , auto_classified = true , netdev_class = 0x555771445e00 <netdev_linux_class>
(struct netdev *) 0x555771fc78d0: name = virbr0 , auto_classified = true , netdev_class = 0x555771445e00 <netdev_linux_class>
(struct netdev *) 0x7fbefffb5540: name = dpdk0 , auto_classified = false, netdev_class = 0x5557714419e0 <dpdk_class>
(struct netdev *) 0x555771fc98b0: name = em3 , auto_classified = true , netdev_class = 0x555771445e00 <netdev_linux_class>
(struct netdev *) 0x7fbea0a31c40: name = vhost0 , auto_classified = false, netdev_class = 0x555771442040 <dpdk_vhost_client_class>
(gdb) p *((struct netdev *) 0x7fbefffb5540)
$1 = {name = 0x555771ecef70 "dpdk0", netdev_class = 0x5557714419e0 <dpdk_class>, auto_classified = false, mtu_user_config = true, ref_cnt = 2, change_seq = 12,
reconfigure_seq = 0x555771ecf2e0, last_reconfigure_seq = 110, n_txq = 2, n_rxq = 1, node = 0x555771efafe0, saved_flags_list = {prev = 0x7fbefffb5580, next = 0x7fbefffb5580}}
Signed-off-by: Eelco Chaudron <echaudro@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2018-05-09 13:47:26 +02:00
|
|
|
|
utilities: Add upcall related commands to the GDB script
This commit adds ovs_dump_udpif_keys and ovs_show_upcall commands to the GDB script.
Here are some examples of the output:
(gdb) ovs_show_upcall
netdev@ovs-netdev:
flows : (current 0) (avg 0) (max 0) (limit 10000)
dump duration : 1ms
ufid enabled : true
39: (keys 0)
42: (keys 0)
41: (keys 0)
43: (keys 0)
44: (keys 0)
45: (keys 0)
system@ovs-system:
flows : (current 4000) (avg 4031) (max 4064) (limit 139000)
dump duration : 4ms
ufid enabled : true
99: (keys 676)
102: (keys 665)
101: (keys 656)
103: (keys 648)
104: (keys 642)
105: (keys 713)
(gdb) ovs_dump_udpif_keys
(struct udpif *) 0x1ebb830: name = netdev@ovs-netdev, total keys = 2
(struct udpif *) 0x20c6f00: name = system@ovs-system, total keys = 0
(gdb) ovs_dump_udpif_keys 0x1ebb830
(struct umap *) 0x1ef9328:
(struct udpif_key *) 0x7f36e0004e40: key_len = 132, mask_len = 144
ufid = 3e529416-83bf-bab4-5c6e-421127a9143a
hash = 0x3d96b11d, pmd_id = 1
state = UKEY_OPERATIONAL
n_packets = 2, n_bytes = 68
used = 1397047436, tcp_flags = 0x0000
(struct umap *) 0x1efb740:
(struct udpif_key *) 0x7f36dc004c20: key_len = 132, mask_len = 144
ufid = ee98d69f-8298-04dd-844a-4d2abee9f773
hash = 0x2e8077c2, pmd_id = 15
state = UKEY_OPERATIONAL
n_packets = 0, n_bytes = 0
used = 0, tcp_flags = 0x0000
(gdb) ovs_dump_udpif_keys 0x1ebb830 short
(struct umap *) 0x1ef9328:
(struct udpif_key *) 0x7f36e0004e40:
(struct umap *) 0x1efb740:
(struct udpif_key *) 0x7f36dc004c20:
Signed-off-by: Eelco Chaudron <echaudro@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2018-07-02 14:00:10 +02:00
|
|
|
#
|
|
|
|
# Class that will provide an iterator over an Netlink attributes
|
|
|
|
#
|
utilities: Add another GDB macro for ovs-vswitchd.
This commit adds a basic packet metadata macro to the already existing
macros in ovs_gdb.py, ovs_dump_packets will print out information about
one or more packets. It feeds packets into tcpdump, and the user can
pass in tcpdump options to modify how packets are parsed or even write
out packets to a pcap file.
Example usage:
(gdb) break fast_path_processing
(gdb) commands
ovs_dump_packets packets_
continue
end
(gdb) continue
Thread 1 "ovs-vswitchd" hit Breakpoint 2, fast_path_processing ...
12:01:05.962485 ARP, Ethernet (len 6), IPv4 (len 4), Request who-has
10.1.1.1 tell 10.1.1.2, length 28
Thread 1 "ovs-vswitchd" hit Breakpoint 1, fast_path_processing ...
12:01:05.981214 ARP, Ethernet (len 6), IPv4 (len 4), Reply 10.1.1.1
is-at a6:0f:c3:f0:5f:bd (oui Unknown), length 28
Signed-off-by: Mike Pattrick <mkp@redhat.com>
Acked-by: Eelco Chaudron <echaudro@redhat.com>
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
2021-12-17 09:09:17 -05:00
|
|
|
class ForEachNL(object):
|
utilities: Add upcall related commands to the GDB script
This commit adds ovs_dump_udpif_keys and ovs_show_upcall commands to the GDB script.
Here are some examples of the output:
(gdb) ovs_show_upcall
netdev@ovs-netdev:
flows : (current 0) (avg 0) (max 0) (limit 10000)
dump duration : 1ms
ufid enabled : true
39: (keys 0)
42: (keys 0)
41: (keys 0)
43: (keys 0)
44: (keys 0)
45: (keys 0)
system@ovs-system:
flows : (current 4000) (avg 4031) (max 4064) (limit 139000)
dump duration : 4ms
ufid enabled : true
99: (keys 676)
102: (keys 665)
101: (keys 656)
103: (keys 648)
104: (keys 642)
105: (keys 713)
(gdb) ovs_dump_udpif_keys
(struct udpif *) 0x1ebb830: name = netdev@ovs-netdev, total keys = 2
(struct udpif *) 0x20c6f00: name = system@ovs-system, total keys = 0
(gdb) ovs_dump_udpif_keys 0x1ebb830
(struct umap *) 0x1ef9328:
(struct udpif_key *) 0x7f36e0004e40: key_len = 132, mask_len = 144
ufid = 3e529416-83bf-bab4-5c6e-421127a9143a
hash = 0x3d96b11d, pmd_id = 1
state = UKEY_OPERATIONAL
n_packets = 2, n_bytes = 68
used = 1397047436, tcp_flags = 0x0000
(struct umap *) 0x1efb740:
(struct udpif_key *) 0x7f36dc004c20: key_len = 132, mask_len = 144
ufid = ee98d69f-8298-04dd-844a-4d2abee9f773
hash = 0x2e8077c2, pmd_id = 15
state = UKEY_OPERATIONAL
n_packets = 0, n_bytes = 0
used = 0, tcp_flags = 0x0000
(gdb) ovs_dump_udpif_keys 0x1ebb830 short
(struct umap *) 0x1ef9328:
(struct udpif_key *) 0x7f36e0004e40:
(struct umap *) 0x1efb740:
(struct udpif_key *) 0x7f36dc004c20:
Signed-off-by: Eelco Chaudron <echaudro@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2018-07-02 14:00:10 +02:00
|
|
|
def __init__(self, nlattrs, nlattrs_len):
|
|
|
|
self.attr = nlattrs.cast(gdb.lookup_type('struct nlattr').pointer())
|
2019-12-20 18:35:08 +01:00
|
|
|
self.attr_len = int(nlattrs_len)
|
utilities: Add upcall related commands to the GDB script
This commit adds ovs_dump_udpif_keys and ovs_show_upcall commands to the GDB script.
Here are some examples of the output:
(gdb) ovs_show_upcall
netdev@ovs-netdev:
flows : (current 0) (avg 0) (max 0) (limit 10000)
dump duration : 1ms
ufid enabled : true
39: (keys 0)
42: (keys 0)
41: (keys 0)
43: (keys 0)
44: (keys 0)
45: (keys 0)
system@ovs-system:
flows : (current 4000) (avg 4031) (max 4064) (limit 139000)
dump duration : 4ms
ufid enabled : true
99: (keys 676)
102: (keys 665)
101: (keys 656)
103: (keys 648)
104: (keys 642)
105: (keys 713)
(gdb) ovs_dump_udpif_keys
(struct udpif *) 0x1ebb830: name = netdev@ovs-netdev, total keys = 2
(struct udpif *) 0x20c6f00: name = system@ovs-system, total keys = 0
(gdb) ovs_dump_udpif_keys 0x1ebb830
(struct umap *) 0x1ef9328:
(struct udpif_key *) 0x7f36e0004e40: key_len = 132, mask_len = 144
ufid = 3e529416-83bf-bab4-5c6e-421127a9143a
hash = 0x3d96b11d, pmd_id = 1
state = UKEY_OPERATIONAL
n_packets = 2, n_bytes = 68
used = 1397047436, tcp_flags = 0x0000
(struct umap *) 0x1efb740:
(struct udpif_key *) 0x7f36dc004c20: key_len = 132, mask_len = 144
ufid = ee98d69f-8298-04dd-844a-4d2abee9f773
hash = 0x2e8077c2, pmd_id = 15
state = UKEY_OPERATIONAL
n_packets = 0, n_bytes = 0
used = 0, tcp_flags = 0x0000
(gdb) ovs_dump_udpif_keys 0x1ebb830 short
(struct umap *) 0x1ef9328:
(struct udpif_key *) 0x7f36e0004e40:
(struct umap *) 0x1efb740:
(struct udpif_key *) 0x7f36dc004c20:
Signed-off-by: Eelco Chaudron <echaudro@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2018-07-02 14:00:10 +02:00
|
|
|
|
|
|
|
def __iter__(self):
|
|
|
|
return self
|
|
|
|
|
|
|
|
def round_up(self, val, round_to):
|
|
|
|
return int(val) + (round_to - int(val)) % round_to
|
|
|
|
|
2019-01-07 14:29:59 +00:00
|
|
|
def __next__(self):
|
utilities: Add upcall related commands to the GDB script
This commit adds ovs_dump_udpif_keys and ovs_show_upcall commands to the GDB script.
Here are some examples of the output:
(gdb) ovs_show_upcall
netdev@ovs-netdev:
flows : (current 0) (avg 0) (max 0) (limit 10000)
dump duration : 1ms
ufid enabled : true
39: (keys 0)
42: (keys 0)
41: (keys 0)
43: (keys 0)
44: (keys 0)
45: (keys 0)
system@ovs-system:
flows : (current 4000) (avg 4031) (max 4064) (limit 139000)
dump duration : 4ms
ufid enabled : true
99: (keys 676)
102: (keys 665)
101: (keys 656)
103: (keys 648)
104: (keys 642)
105: (keys 713)
(gdb) ovs_dump_udpif_keys
(struct udpif *) 0x1ebb830: name = netdev@ovs-netdev, total keys = 2
(struct udpif *) 0x20c6f00: name = system@ovs-system, total keys = 0
(gdb) ovs_dump_udpif_keys 0x1ebb830
(struct umap *) 0x1ef9328:
(struct udpif_key *) 0x7f36e0004e40: key_len = 132, mask_len = 144
ufid = 3e529416-83bf-bab4-5c6e-421127a9143a
hash = 0x3d96b11d, pmd_id = 1
state = UKEY_OPERATIONAL
n_packets = 2, n_bytes = 68
used = 1397047436, tcp_flags = 0x0000
(struct umap *) 0x1efb740:
(struct udpif_key *) 0x7f36dc004c20: key_len = 132, mask_len = 144
ufid = ee98d69f-8298-04dd-844a-4d2abee9f773
hash = 0x2e8077c2, pmd_id = 15
state = UKEY_OPERATIONAL
n_packets = 0, n_bytes = 0
used = 0, tcp_flags = 0x0000
(gdb) ovs_dump_udpif_keys 0x1ebb830 short
(struct umap *) 0x1ef9328:
(struct udpif_key *) 0x7f36e0004e40:
(struct umap *) 0x1efb740:
(struct udpif_key *) 0x7f36dc004c20:
Signed-off-by: Eelco Chaudron <echaudro@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2018-07-02 14:00:10 +02:00
|
|
|
if self.attr is None or \
|
|
|
|
self.attr_len < 4 or self.attr['nla_len'] < 4 or \
|
|
|
|
self.attr['nla_len'] > self.attr_len:
|
|
|
|
#
|
|
|
|
# Invalid attr set, maybe we should raise an exception?
|
|
|
|
#
|
|
|
|
raise StopIteration
|
|
|
|
|
|
|
|
attr = self.attr
|
|
|
|
self.attr_len -= self.round_up(attr['nla_len'], 4)
|
|
|
|
|
|
|
|
self.attr = self.attr.cast(gdb.lookup_type('void').pointer()) \
|
|
|
|
+ self.round_up(attr['nla_len'], 4)
|
|
|
|
self.attr = self.attr.cast(gdb.lookup_type('struct nlattr').pointer())
|
|
|
|
|
|
|
|
return attr
|
|
|
|
|
2019-01-07 14:29:59 +00:00
|
|
|
def next(self):
|
|
|
|
return self.__next__()
|
|
|
|
|
utilities: Add upcall related commands to the GDB script
This commit adds ovs_dump_udpif_keys and ovs_show_upcall commands to the GDB script.
Here are some examples of the output:
(gdb) ovs_show_upcall
netdev@ovs-netdev:
flows : (current 0) (avg 0) (max 0) (limit 10000)
dump duration : 1ms
ufid enabled : true
39: (keys 0)
42: (keys 0)
41: (keys 0)
43: (keys 0)
44: (keys 0)
45: (keys 0)
system@ovs-system:
flows : (current 4000) (avg 4031) (max 4064) (limit 139000)
dump duration : 4ms
ufid enabled : true
99: (keys 676)
102: (keys 665)
101: (keys 656)
103: (keys 648)
104: (keys 642)
105: (keys 713)
(gdb) ovs_dump_udpif_keys
(struct udpif *) 0x1ebb830: name = netdev@ovs-netdev, total keys = 2
(struct udpif *) 0x20c6f00: name = system@ovs-system, total keys = 0
(gdb) ovs_dump_udpif_keys 0x1ebb830
(struct umap *) 0x1ef9328:
(struct udpif_key *) 0x7f36e0004e40: key_len = 132, mask_len = 144
ufid = 3e529416-83bf-bab4-5c6e-421127a9143a
hash = 0x3d96b11d, pmd_id = 1
state = UKEY_OPERATIONAL
n_packets = 2, n_bytes = 68
used = 1397047436, tcp_flags = 0x0000
(struct umap *) 0x1efb740:
(struct udpif_key *) 0x7f36dc004c20: key_len = 132, mask_len = 144
ufid = ee98d69f-8298-04dd-844a-4d2abee9f773
hash = 0x2e8077c2, pmd_id = 15
state = UKEY_OPERATIONAL
n_packets = 0, n_bytes = 0
used = 0, tcp_flags = 0x0000
(gdb) ovs_dump_udpif_keys 0x1ebb830 short
(struct umap *) 0x1ef9328:
(struct udpif_key *) 0x7f36e0004e40:
(struct umap *) 0x1efb740:
(struct udpif_key *) 0x7f36dc004c20:
Signed-off-by: Eelco Chaudron <echaudro@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2018-07-02 14:00:10 +02:00
|
|
|
|
utilities: Add some GDB macros for ovs-vswitchd
This commit adds basic GDB macro's for ovs-vswitchd:
- ovs_dump_bridge [ports|wanted]
- ovs_dump_bridge_ports <struct bridge *>
- ovs_dump_dp_netdev [ports]
- ovs_dump_dp_netdev_ports <struct dp_netdev *>
- ovs_dump_netdev
These dump functions show limited info, but you can simply cut/paste
the address and get the full structure info. For example:
(gdb) ovs_dump_netdev
(struct netdev *) 0x555771ed89e0: name = ovs-netdev , auto_classified = false, netdev_class = 0x5557714413c0 <netdev_tap_class>
(struct netdev *) 0x555771fc62a0: name = ovs_pvp_br0 , auto_classified = false, netdev_class = 0x5557714413c0 <netdev_tap_class>
(struct netdev *) 0x555771fc9660: name = vnet0 , auto_classified = true , netdev_class = 0x555771445e00 <netdev_linux_class>
(struct netdev *) 0x555771fc78d0: name = virbr0 , auto_classified = true , netdev_class = 0x555771445e00 <netdev_linux_class>
(struct netdev *) 0x7fbefffb5540: name = dpdk0 , auto_classified = false, netdev_class = 0x5557714419e0 <dpdk_class>
(struct netdev *) 0x555771fc98b0: name = em3 , auto_classified = true , netdev_class = 0x555771445e00 <netdev_linux_class>
(struct netdev *) 0x7fbea0a31c40: name = vhost0 , auto_classified = false, netdev_class = 0x555771442040 <dpdk_vhost_client_class>
(gdb) p *((struct netdev *) 0x7fbefffb5540)
$1 = {name = 0x555771ecef70 "dpdk0", netdev_class = 0x5557714419e0 <dpdk_class>, auto_classified = false, mtu_user_config = true, ref_cnt = 2, change_seq = 12,
reconfigure_seq = 0x555771ecf2e0, last_reconfigure_seq = 110, n_txq = 2, n_rxq = 1, node = 0x555771efafe0, saved_flags_list = {prev = 0x7fbefffb5580, next = 0x7fbefffb5580}}
Signed-off-by: Eelco Chaudron <echaudro@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2018-05-09 13:47:26 +02:00
|
|
|
#
|
|
|
|
# Class that will provide an iterator over an OVS shash.
|
|
|
|
#
|
|
|
|
class ForEachSHASH(ForEachHMAP):
|
|
|
|
def __init__(self, shash, typeobj=None):
|
|
|
|
|
|
|
|
self.data_typeobj = typeobj
|
|
|
|
|
|
|
|
super(ForEachSHASH, self).__init__(shash['map'],
|
|
|
|
"struct shash_node", "node")
|
|
|
|
|
2019-01-07 14:29:59 +00:00
|
|
|
def __next__(self):
|
|
|
|
node = super(ForEachSHASH, self).__next__()
|
utilities: Add some GDB macros for ovs-vswitchd
This commit adds basic GDB macro's for ovs-vswitchd:
- ovs_dump_bridge [ports|wanted]
- ovs_dump_bridge_ports <struct bridge *>
- ovs_dump_dp_netdev [ports]
- ovs_dump_dp_netdev_ports <struct dp_netdev *>
- ovs_dump_netdev
These dump functions show limited info, but you can simply cut/paste
the address and get the full structure info. For example:
(gdb) ovs_dump_netdev
(struct netdev *) 0x555771ed89e0: name = ovs-netdev , auto_classified = false, netdev_class = 0x5557714413c0 <netdev_tap_class>
(struct netdev *) 0x555771fc62a0: name = ovs_pvp_br0 , auto_classified = false, netdev_class = 0x5557714413c0 <netdev_tap_class>
(struct netdev *) 0x555771fc9660: name = vnet0 , auto_classified = true , netdev_class = 0x555771445e00 <netdev_linux_class>
(struct netdev *) 0x555771fc78d0: name = virbr0 , auto_classified = true , netdev_class = 0x555771445e00 <netdev_linux_class>
(struct netdev *) 0x7fbefffb5540: name = dpdk0 , auto_classified = false, netdev_class = 0x5557714419e0 <dpdk_class>
(struct netdev *) 0x555771fc98b0: name = em3 , auto_classified = true , netdev_class = 0x555771445e00 <netdev_linux_class>
(struct netdev *) 0x7fbea0a31c40: name = vhost0 , auto_classified = false, netdev_class = 0x555771442040 <dpdk_vhost_client_class>
(gdb) p *((struct netdev *) 0x7fbefffb5540)
$1 = {name = 0x555771ecef70 "dpdk0", netdev_class = 0x5557714419e0 <dpdk_class>, auto_classified = false, mtu_user_config = true, ref_cnt = 2, change_seq = 12,
reconfigure_seq = 0x555771ecf2e0, last_reconfigure_seq = 110, n_txq = 2, n_rxq = 1, node = 0x555771efafe0, saved_flags_list = {prev = 0x7fbefffb5580, next = 0x7fbefffb5580}}
Signed-off-by: Eelco Chaudron <echaudro@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2018-05-09 13:47:26 +02:00
|
|
|
|
|
|
|
if self.data_typeobj is None:
|
|
|
|
return node
|
|
|
|
|
|
|
|
return node['data'].cast(gdb.lookup_type(self.data_typeobj).pointer())
|
|
|
|
|
2019-01-07 14:29:59 +00:00
|
|
|
def next(self):
|
|
|
|
return self.__next__()
|
|
|
|
|
utilities: Add some GDB macros for ovs-vswitchd
This commit adds basic GDB macro's for ovs-vswitchd:
- ovs_dump_bridge [ports|wanted]
- ovs_dump_bridge_ports <struct bridge *>
- ovs_dump_dp_netdev [ports]
- ovs_dump_dp_netdev_ports <struct dp_netdev *>
- ovs_dump_netdev
These dump functions show limited info, but you can simply cut/paste
the address and get the full structure info. For example:
(gdb) ovs_dump_netdev
(struct netdev *) 0x555771ed89e0: name = ovs-netdev , auto_classified = false, netdev_class = 0x5557714413c0 <netdev_tap_class>
(struct netdev *) 0x555771fc62a0: name = ovs_pvp_br0 , auto_classified = false, netdev_class = 0x5557714413c0 <netdev_tap_class>
(struct netdev *) 0x555771fc9660: name = vnet0 , auto_classified = true , netdev_class = 0x555771445e00 <netdev_linux_class>
(struct netdev *) 0x555771fc78d0: name = virbr0 , auto_classified = true , netdev_class = 0x555771445e00 <netdev_linux_class>
(struct netdev *) 0x7fbefffb5540: name = dpdk0 , auto_classified = false, netdev_class = 0x5557714419e0 <dpdk_class>
(struct netdev *) 0x555771fc98b0: name = em3 , auto_classified = true , netdev_class = 0x555771445e00 <netdev_linux_class>
(struct netdev *) 0x7fbea0a31c40: name = vhost0 , auto_classified = false, netdev_class = 0x555771442040 <dpdk_vhost_client_class>
(gdb) p *((struct netdev *) 0x7fbefffb5540)
$1 = {name = 0x555771ecef70 "dpdk0", netdev_class = 0x5557714419e0 <dpdk_class>, auto_classified = false, mtu_user_config = true, ref_cnt = 2, change_seq = 12,
reconfigure_seq = 0x555771ecf2e0, last_reconfigure_seq = 110, n_txq = 2, n_rxq = 1, node = 0x555771efafe0, saved_flags_list = {prev = 0x7fbefffb5580, next = 0x7fbefffb5580}}
Signed-off-by: Eelco Chaudron <echaudro@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2018-05-09 13:47:26 +02:00
|
|
|
|
Utilities: Add the simap and netdev_provider dump commands to gdb
This changes add two additional gdb commands:
- ovs_dump_netdev_provider
- ovs_dump_ovs_list <struct simap *>
Here are some examples of their output:
ovs_dump_netdev_provider:
=========================
(gdb) ovs_dump_netdev_provider
(struct netdev_registered_class *) 0x2b2c540: refcnt = {count = 3},
(struct netdev_class *) 0x9555c0 = {type = tap, is_pmd = false, ...},
(struct netdev_registered_class *) 0x2b2c5a0: refcnt = {count = 2},
(struct netdev_class *) 0xc439d8 = {type = vxlan, is_pmd = false, ...},
(struct vport_class *) 0xc439d0 = { dpif_port = vxlan_sys, ... }
(struct netdev_registered_class *) 0x2b2c960: refcnt = {count = 1},
(struct netdev_class *) 0xc442f8 = {type = ip6erspan, is_pmd = false, ...},
(struct vport_class *) 0xc442f0 = { dpif_port = ip6erspan_sys, ... }
(struct netdev_registered_class *) 0x2b2c980: refcnt = {count = 1},
(struct netdev_class *) 0xc44540 = {type = ip6gre, is_pmd = false, ...},
(struct vport_class *) 0xc44538 = { dpif_port = ip6gre_sys, ... }
(struct netdev_registered_class *) 0x2b2ebe0: refcnt = {count = 3},
(struct netdev_class *) 0x95b8c0 = {type = dpdk, is_pmd = true, ...},
ovs_dump_ovs_list:
==================
(gdb) b memory_report
Breakpoint 1 at 0x753190: file lib/memory.c, line 136.
(gdb) set want_report=1
(gdb) c
Continuing.
Breakpoint 1, memory_report (usage=usage@entry=0x7fff0683d920) at lib/memory.c:136
136 {
(gdb) p usage
$20 = (const struct simap *) 0x7fff0683d920
(gdb) p* usage
$21 = {map = {buckets = 0x2b64df0, one = 0x0, mask = 3, n = 4}}
(gdb) p *usage
(gdb) ovs_dump_simap usage
handlers : 40 / 0x28
ports : 6 / 0x6
revalidators: 16 / 0x10
rules : 10 / 0xa
Signed-off-by: Eelco Chaudron <echaudro@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2018-06-01 13:21:31 +02:00
|
|
|
#
|
|
|
|
# Class that will provide an iterator over an OVS simap.
|
|
|
|
#
|
|
|
|
class ForEachSIMAP(ForEachHMAP):
|
|
|
|
def __init__(self, shash):
|
|
|
|
super(ForEachSIMAP, self).__init__(shash['map'],
|
|
|
|
"struct simap_node", "node")
|
|
|
|
|
2019-01-07 14:29:59 +00:00
|
|
|
def __next__(self):
|
|
|
|
node = super(ForEachSIMAP, self).__next__()
|
Utilities: Add the simap and netdev_provider dump commands to gdb
This changes add two additional gdb commands:
- ovs_dump_netdev_provider
- ovs_dump_ovs_list <struct simap *>
Here are some examples of their output:
ovs_dump_netdev_provider:
=========================
(gdb) ovs_dump_netdev_provider
(struct netdev_registered_class *) 0x2b2c540: refcnt = {count = 3},
(struct netdev_class *) 0x9555c0 = {type = tap, is_pmd = false, ...},
(struct netdev_registered_class *) 0x2b2c5a0: refcnt = {count = 2},
(struct netdev_class *) 0xc439d8 = {type = vxlan, is_pmd = false, ...},
(struct vport_class *) 0xc439d0 = { dpif_port = vxlan_sys, ... }
(struct netdev_registered_class *) 0x2b2c960: refcnt = {count = 1},
(struct netdev_class *) 0xc442f8 = {type = ip6erspan, is_pmd = false, ...},
(struct vport_class *) 0xc442f0 = { dpif_port = ip6erspan_sys, ... }
(struct netdev_registered_class *) 0x2b2c980: refcnt = {count = 1},
(struct netdev_class *) 0xc44540 = {type = ip6gre, is_pmd = false, ...},
(struct vport_class *) 0xc44538 = { dpif_port = ip6gre_sys, ... }
(struct netdev_registered_class *) 0x2b2ebe0: refcnt = {count = 3},
(struct netdev_class *) 0x95b8c0 = {type = dpdk, is_pmd = true, ...},
ovs_dump_ovs_list:
==================
(gdb) b memory_report
Breakpoint 1 at 0x753190: file lib/memory.c, line 136.
(gdb) set want_report=1
(gdb) c
Continuing.
Breakpoint 1, memory_report (usage=usage@entry=0x7fff0683d920) at lib/memory.c:136
136 {
(gdb) p usage
$20 = (const struct simap *) 0x7fff0683d920
(gdb) p* usage
$21 = {map = {buckets = 0x2b64df0, one = 0x0, mask = 3, n = 4}}
(gdb) p *usage
(gdb) ovs_dump_simap usage
handlers : 40 / 0x28
ports : 6 / 0x6
revalidators: 16 / 0x10
rules : 10 / 0xa
Signed-off-by: Eelco Chaudron <echaudro@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2018-06-01 13:21:31 +02:00
|
|
|
return node['name'], node['data']
|
|
|
|
|
2019-01-07 14:29:59 +00:00
|
|
|
def next(self):
|
|
|
|
return self.__next__()
|
|
|
|
|
Utilities: Add the simap and netdev_provider dump commands to gdb
This changes add two additional gdb commands:
- ovs_dump_netdev_provider
- ovs_dump_ovs_list <struct simap *>
Here are some examples of their output:
ovs_dump_netdev_provider:
=========================
(gdb) ovs_dump_netdev_provider
(struct netdev_registered_class *) 0x2b2c540: refcnt = {count = 3},
(struct netdev_class *) 0x9555c0 = {type = tap, is_pmd = false, ...},
(struct netdev_registered_class *) 0x2b2c5a0: refcnt = {count = 2},
(struct netdev_class *) 0xc439d8 = {type = vxlan, is_pmd = false, ...},
(struct vport_class *) 0xc439d0 = { dpif_port = vxlan_sys, ... }
(struct netdev_registered_class *) 0x2b2c960: refcnt = {count = 1},
(struct netdev_class *) 0xc442f8 = {type = ip6erspan, is_pmd = false, ...},
(struct vport_class *) 0xc442f0 = { dpif_port = ip6erspan_sys, ... }
(struct netdev_registered_class *) 0x2b2c980: refcnt = {count = 1},
(struct netdev_class *) 0xc44540 = {type = ip6gre, is_pmd = false, ...},
(struct vport_class *) 0xc44538 = { dpif_port = ip6gre_sys, ... }
(struct netdev_registered_class *) 0x2b2ebe0: refcnt = {count = 3},
(struct netdev_class *) 0x95b8c0 = {type = dpdk, is_pmd = true, ...},
ovs_dump_ovs_list:
==================
(gdb) b memory_report
Breakpoint 1 at 0x753190: file lib/memory.c, line 136.
(gdb) set want_report=1
(gdb) c
Continuing.
Breakpoint 1, memory_report (usage=usage@entry=0x7fff0683d920) at lib/memory.c:136
136 {
(gdb) p usage
$20 = (const struct simap *) 0x7fff0683d920
(gdb) p* usage
$21 = {map = {buckets = 0x2b64df0, one = 0x0, mask = 3, n = 4}}
(gdb) p *usage
(gdb) ovs_dump_simap usage
handlers : 40 / 0x28
ports : 6 / 0x6
revalidators: 16 / 0x10
rules : 10 / 0xa
Signed-off-by: Eelco Chaudron <echaudro@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2018-06-01 13:21:31 +02:00
|
|
|
|
2018-11-22 16:18:14 +01:00
|
|
|
#
|
|
|
|
# Class that will provide an iterator over an OVS smap.
|
|
|
|
#
|
|
|
|
class ForEachSMAP(ForEachHMAP):
|
|
|
|
def __init__(self, shash):
|
|
|
|
super(ForEachSMAP, self).__init__(shash['map'],
|
|
|
|
"struct smap_node", "node")
|
|
|
|
|
2019-01-07 14:29:59 +00:00
|
|
|
def __next__(self):
|
|
|
|
node = super(ForEachSMAP, self).__next__()
|
2018-11-22 16:18:14 +01:00
|
|
|
return node['key'], node['value']
|
|
|
|
|
2019-01-07 14:29:59 +00:00
|
|
|
def next(self):
|
|
|
|
return self.__next__()
|
|
|
|
|
2018-11-22 16:18:14 +01:00
|
|
|
|
utilities: Add some GDB macros for ovs-vswitchd
This commit adds basic GDB macro's for ovs-vswitchd:
- ovs_dump_bridge [ports|wanted]
- ovs_dump_bridge_ports <struct bridge *>
- ovs_dump_dp_netdev [ports]
- ovs_dump_dp_netdev_ports <struct dp_netdev *>
- ovs_dump_netdev
These dump functions show limited info, but you can simply cut/paste
the address and get the full structure info. For example:
(gdb) ovs_dump_netdev
(struct netdev *) 0x555771ed89e0: name = ovs-netdev , auto_classified = false, netdev_class = 0x5557714413c0 <netdev_tap_class>
(struct netdev *) 0x555771fc62a0: name = ovs_pvp_br0 , auto_classified = false, netdev_class = 0x5557714413c0 <netdev_tap_class>
(struct netdev *) 0x555771fc9660: name = vnet0 , auto_classified = true , netdev_class = 0x555771445e00 <netdev_linux_class>
(struct netdev *) 0x555771fc78d0: name = virbr0 , auto_classified = true , netdev_class = 0x555771445e00 <netdev_linux_class>
(struct netdev *) 0x7fbefffb5540: name = dpdk0 , auto_classified = false, netdev_class = 0x5557714419e0 <dpdk_class>
(struct netdev *) 0x555771fc98b0: name = em3 , auto_classified = true , netdev_class = 0x555771445e00 <netdev_linux_class>
(struct netdev *) 0x7fbea0a31c40: name = vhost0 , auto_classified = false, netdev_class = 0x555771442040 <dpdk_vhost_client_class>
(gdb) p *((struct netdev *) 0x7fbefffb5540)
$1 = {name = 0x555771ecef70 "dpdk0", netdev_class = 0x5557714419e0 <dpdk_class>, auto_classified = false, mtu_user_config = true, ref_cnt = 2, change_seq = 12,
reconfigure_seq = 0x555771ecf2e0, last_reconfigure_seq = 110, n_txq = 2, n_rxq = 1, node = 0x555771efafe0, saved_flags_list = {prev = 0x7fbefffb5580, next = 0x7fbefffb5580}}
Signed-off-by: Eelco Chaudron <echaudro@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2018-05-09 13:47:26 +02:00
|
|
|
#
|
|
|
|
# Class that will provide an iterator over an OVS list.
|
|
|
|
#
|
utilities: Add another GDB macro for ovs-vswitchd.
This commit adds a basic packet metadata macro to the already existing
macros in ovs_gdb.py, ovs_dump_packets will print out information about
one or more packets. It feeds packets into tcpdump, and the user can
pass in tcpdump options to modify how packets are parsed or even write
out packets to a pcap file.
Example usage:
(gdb) break fast_path_processing
(gdb) commands
ovs_dump_packets packets_
continue
end
(gdb) continue
Thread 1 "ovs-vswitchd" hit Breakpoint 2, fast_path_processing ...
12:01:05.962485 ARP, Ethernet (len 6), IPv4 (len 4), Request who-has
10.1.1.1 tell 10.1.1.2, length 28
Thread 1 "ovs-vswitchd" hit Breakpoint 1, fast_path_processing ...
12:01:05.981214 ARP, Ethernet (len 6), IPv4 (len 4), Reply 10.1.1.1
is-at a6:0f:c3:f0:5f:bd (oui Unknown), length 28
Signed-off-by: Mike Pattrick <mkp@redhat.com>
Acked-by: Eelco Chaudron <echaudro@redhat.com>
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
2021-12-17 09:09:17 -05:00
|
|
|
class ForEachLIST(object):
|
utilities: Add some GDB macros for ovs-vswitchd
This commit adds basic GDB macro's for ovs-vswitchd:
- ovs_dump_bridge [ports|wanted]
- ovs_dump_bridge_ports <struct bridge *>
- ovs_dump_dp_netdev [ports]
- ovs_dump_dp_netdev_ports <struct dp_netdev *>
- ovs_dump_netdev
These dump functions show limited info, but you can simply cut/paste
the address and get the full structure info. For example:
(gdb) ovs_dump_netdev
(struct netdev *) 0x555771ed89e0: name = ovs-netdev , auto_classified = false, netdev_class = 0x5557714413c0 <netdev_tap_class>
(struct netdev *) 0x555771fc62a0: name = ovs_pvp_br0 , auto_classified = false, netdev_class = 0x5557714413c0 <netdev_tap_class>
(struct netdev *) 0x555771fc9660: name = vnet0 , auto_classified = true , netdev_class = 0x555771445e00 <netdev_linux_class>
(struct netdev *) 0x555771fc78d0: name = virbr0 , auto_classified = true , netdev_class = 0x555771445e00 <netdev_linux_class>
(struct netdev *) 0x7fbefffb5540: name = dpdk0 , auto_classified = false, netdev_class = 0x5557714419e0 <dpdk_class>
(struct netdev *) 0x555771fc98b0: name = em3 , auto_classified = true , netdev_class = 0x555771445e00 <netdev_linux_class>
(struct netdev *) 0x7fbea0a31c40: name = vhost0 , auto_classified = false, netdev_class = 0x555771442040 <dpdk_vhost_client_class>
(gdb) p *((struct netdev *) 0x7fbefffb5540)
$1 = {name = 0x555771ecef70 "dpdk0", netdev_class = 0x5557714419e0 <dpdk_class>, auto_classified = false, mtu_user_config = true, ref_cnt = 2, change_seq = 12,
reconfigure_seq = 0x555771ecf2e0, last_reconfigure_seq = 110, n_txq = 2, n_rxq = 1, node = 0x555771efafe0, saved_flags_list = {prev = 0x7fbefffb5580, next = 0x7fbefffb5580}}
Signed-off-by: Eelco Chaudron <echaudro@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2018-05-09 13:47:26 +02:00
|
|
|
def __init__(self, list, typeobj=None, member='node'):
|
|
|
|
self.list = list
|
|
|
|
self.node = list
|
|
|
|
self.typeobj = typeobj
|
|
|
|
self.member = member
|
|
|
|
|
|
|
|
def __iter__(self):
|
|
|
|
return self
|
|
|
|
|
2019-01-07 14:29:59 +00:00
|
|
|
def __next__(self):
|
utilities: Add some GDB macros for ovs-vswitchd
This commit adds basic GDB macro's for ovs-vswitchd:
- ovs_dump_bridge [ports|wanted]
- ovs_dump_bridge_ports <struct bridge *>
- ovs_dump_dp_netdev [ports]
- ovs_dump_dp_netdev_ports <struct dp_netdev *>
- ovs_dump_netdev
These dump functions show limited info, but you can simply cut/paste
the address and get the full structure info. For example:
(gdb) ovs_dump_netdev
(struct netdev *) 0x555771ed89e0: name = ovs-netdev , auto_classified = false, netdev_class = 0x5557714413c0 <netdev_tap_class>
(struct netdev *) 0x555771fc62a0: name = ovs_pvp_br0 , auto_classified = false, netdev_class = 0x5557714413c0 <netdev_tap_class>
(struct netdev *) 0x555771fc9660: name = vnet0 , auto_classified = true , netdev_class = 0x555771445e00 <netdev_linux_class>
(struct netdev *) 0x555771fc78d0: name = virbr0 , auto_classified = true , netdev_class = 0x555771445e00 <netdev_linux_class>
(struct netdev *) 0x7fbefffb5540: name = dpdk0 , auto_classified = false, netdev_class = 0x5557714419e0 <dpdk_class>
(struct netdev *) 0x555771fc98b0: name = em3 , auto_classified = true , netdev_class = 0x555771445e00 <netdev_linux_class>
(struct netdev *) 0x7fbea0a31c40: name = vhost0 , auto_classified = false, netdev_class = 0x555771442040 <dpdk_vhost_client_class>
(gdb) p *((struct netdev *) 0x7fbefffb5540)
$1 = {name = 0x555771ecef70 "dpdk0", netdev_class = 0x5557714419e0 <dpdk_class>, auto_classified = false, mtu_user_config = true, ref_cnt = 2, change_seq = 12,
reconfigure_seq = 0x555771ecf2e0, last_reconfigure_seq = 110, n_txq = 2, n_rxq = 1, node = 0x555771efafe0, saved_flags_list = {prev = 0x7fbefffb5580, next = 0x7fbefffb5580}}
Signed-off-by: Eelco Chaudron <echaudro@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2018-05-09 13:47:26 +02:00
|
|
|
if self.list.address == self.node['next']:
|
|
|
|
raise StopIteration
|
|
|
|
|
|
|
|
self.node = self.node['next']
|
|
|
|
|
|
|
|
if self.typeobj is None:
|
|
|
|
return self.node
|
|
|
|
|
|
|
|
return container_of(self.node,
|
|
|
|
gdb.lookup_type(self.typeobj).pointer(),
|
|
|
|
self.member)
|
|
|
|
|
2019-01-07 14:29:59 +00:00
|
|
|
def next(self):
|
|
|
|
return self.__next__()
|
|
|
|
|
utilities: Add some GDB macros for ovs-vswitchd
This commit adds basic GDB macro's for ovs-vswitchd:
- ovs_dump_bridge [ports|wanted]
- ovs_dump_bridge_ports <struct bridge *>
- ovs_dump_dp_netdev [ports]
- ovs_dump_dp_netdev_ports <struct dp_netdev *>
- ovs_dump_netdev
These dump functions show limited info, but you can simply cut/paste
the address and get the full structure info. For example:
(gdb) ovs_dump_netdev
(struct netdev *) 0x555771ed89e0: name = ovs-netdev , auto_classified = false, netdev_class = 0x5557714413c0 <netdev_tap_class>
(struct netdev *) 0x555771fc62a0: name = ovs_pvp_br0 , auto_classified = false, netdev_class = 0x5557714413c0 <netdev_tap_class>
(struct netdev *) 0x555771fc9660: name = vnet0 , auto_classified = true , netdev_class = 0x555771445e00 <netdev_linux_class>
(struct netdev *) 0x555771fc78d0: name = virbr0 , auto_classified = true , netdev_class = 0x555771445e00 <netdev_linux_class>
(struct netdev *) 0x7fbefffb5540: name = dpdk0 , auto_classified = false, netdev_class = 0x5557714419e0 <dpdk_class>
(struct netdev *) 0x555771fc98b0: name = em3 , auto_classified = true , netdev_class = 0x555771445e00 <netdev_linux_class>
(struct netdev *) 0x7fbea0a31c40: name = vhost0 , auto_classified = false, netdev_class = 0x555771442040 <dpdk_vhost_client_class>
(gdb) p *((struct netdev *) 0x7fbefffb5540)
$1 = {name = 0x555771ecef70 "dpdk0", netdev_class = 0x5557714419e0 <dpdk_class>, auto_classified = false, mtu_user_config = true, ref_cnt = 2, change_seq = 12,
reconfigure_seq = 0x555771ecf2e0, last_reconfigure_seq = 110, n_txq = 2, n_rxq = 1, node = 0x555771efafe0, saved_flags_list = {prev = 0x7fbefffb5580, next = 0x7fbefffb5580}}
Signed-off-by: Eelco Chaudron <echaudro@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2018-05-09 13:47:26 +02:00
|
|
|
|
Utilities: Add the ovs_dump_ofpacts command to gdb
This adds the ovs_dump_ifpacts command:
(gdb) help ovs_dump_ofpacts
Dump all actions in an ofpacts set
Usage: ovs_dump_ofpacts <struct ofpact *> <ofpacts_len>
<struct ofpact *> : Pointer to set of ofpact structures.
<ofpacts_len> : Total length of the set.
Example dumping all actions when in the clone_xlate_actions() function:
(gdb) ovs_dump_ofpacts actions actions_len
(struct ofpact *) 0x561c7be487c8: {type = OFPACT_SET_FIELD, raw = 255 '', len = 24}
(struct ofpact *) 0x561c7be487e0: {type = OFPACT_SET_FIELD, raw = 255 '', len = 24}
(struct ofpact *) 0x561c7be487f8: {type = OFPACT_SET_FIELD, raw = 255 '', len = 24}
(struct ofpact *) 0x561c7be48810: {type = OFPACT_SET_FIELD, raw = 255 '', len = 32}
(struct ofpact *) 0x561c7be48830: {type = OFPACT_SET_FIELD, raw = 255 '', len = 24}
(struct ofpact *) 0x561c7be48848: {type = OFPACT_RESUBMIT, raw = 38 '&', len = 16}
Signed-off-by: Eelco Chaudron <echaudro@redhat.com>
Signed-off-by: William Tu <u9012063@gmail.com>
2020-04-17 14:51:34 +02:00
|
|
|
#
|
|
|
|
# Class that will provide an iterator over an OFPACTS.
|
|
|
|
#
|
utilities: Add another GDB macro for ovs-vswitchd.
This commit adds a basic packet metadata macro to the already existing
macros in ovs_gdb.py, ovs_dump_packets will print out information about
one or more packets. It feeds packets into tcpdump, and the user can
pass in tcpdump options to modify how packets are parsed or even write
out packets to a pcap file.
Example usage:
(gdb) break fast_path_processing
(gdb) commands
ovs_dump_packets packets_
continue
end
(gdb) continue
Thread 1 "ovs-vswitchd" hit Breakpoint 2, fast_path_processing ...
12:01:05.962485 ARP, Ethernet (len 6), IPv4 (len 4), Request who-has
10.1.1.1 tell 10.1.1.2, length 28
Thread 1 "ovs-vswitchd" hit Breakpoint 1, fast_path_processing ...
12:01:05.981214 ARP, Ethernet (len 6), IPv4 (len 4), Reply 10.1.1.1
is-at a6:0f:c3:f0:5f:bd (oui Unknown), length 28
Signed-off-by: Mike Pattrick <mkp@redhat.com>
Acked-by: Eelco Chaudron <echaudro@redhat.com>
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
2021-12-17 09:09:17 -05:00
|
|
|
class ForEachOFPACTS(object):
|
Utilities: Add the ovs_dump_ofpacts command to gdb
This adds the ovs_dump_ifpacts command:
(gdb) help ovs_dump_ofpacts
Dump all actions in an ofpacts set
Usage: ovs_dump_ofpacts <struct ofpact *> <ofpacts_len>
<struct ofpact *> : Pointer to set of ofpact structures.
<ofpacts_len> : Total length of the set.
Example dumping all actions when in the clone_xlate_actions() function:
(gdb) ovs_dump_ofpacts actions actions_len
(struct ofpact *) 0x561c7be487c8: {type = OFPACT_SET_FIELD, raw = 255 '', len = 24}
(struct ofpact *) 0x561c7be487e0: {type = OFPACT_SET_FIELD, raw = 255 '', len = 24}
(struct ofpact *) 0x561c7be487f8: {type = OFPACT_SET_FIELD, raw = 255 '', len = 24}
(struct ofpact *) 0x561c7be48810: {type = OFPACT_SET_FIELD, raw = 255 '', len = 32}
(struct ofpact *) 0x561c7be48830: {type = OFPACT_SET_FIELD, raw = 255 '', len = 24}
(struct ofpact *) 0x561c7be48848: {type = OFPACT_RESUBMIT, raw = 38 '&', len = 16}
Signed-off-by: Eelco Chaudron <echaudro@redhat.com>
Signed-off-by: William Tu <u9012063@gmail.com>
2020-04-17 14:51:34 +02:00
|
|
|
def __init__(self, ofpacts, ofpacts_len):
|
|
|
|
self.ofpact = ofpacts.cast(gdb.lookup_type('struct ofpact').pointer())
|
|
|
|
self.length = int(ofpacts_len)
|
|
|
|
|
|
|
|
def __round_up(self, val, round_to):
|
|
|
|
return int(val) + (round_to - int(val)) % round_to
|
|
|
|
|
|
|
|
def __iter__(self):
|
|
|
|
return self
|
|
|
|
|
|
|
|
def __next__(self):
|
|
|
|
if self.ofpact is None or self.length <= 0:
|
|
|
|
raise StopIteration
|
|
|
|
|
|
|
|
ofpact = self.ofpact
|
|
|
|
length = self.__round_up(ofpact['len'], 8)
|
|
|
|
|
|
|
|
self.length -= length
|
|
|
|
self.ofpact = self.ofpact.cast(
|
|
|
|
gdb.lookup_type('void').pointer()) + length
|
|
|
|
self.ofpact = self.ofpact.cast(
|
|
|
|
gdb.lookup_type('struct ofpact').pointer())
|
|
|
|
|
|
|
|
return ofpact
|
|
|
|
|
|
|
|
def next(self):
|
|
|
|
return self.__next__()
|
|
|
|
|
|
|
|
|
utilities: Add some GDB macros for ovs-vswitchd
This commit adds basic GDB macro's for ovs-vswitchd:
- ovs_dump_bridge [ports|wanted]
- ovs_dump_bridge_ports <struct bridge *>
- ovs_dump_dp_netdev [ports]
- ovs_dump_dp_netdev_ports <struct dp_netdev *>
- ovs_dump_netdev
These dump functions show limited info, but you can simply cut/paste
the address and get the full structure info. For example:
(gdb) ovs_dump_netdev
(struct netdev *) 0x555771ed89e0: name = ovs-netdev , auto_classified = false, netdev_class = 0x5557714413c0 <netdev_tap_class>
(struct netdev *) 0x555771fc62a0: name = ovs_pvp_br0 , auto_classified = false, netdev_class = 0x5557714413c0 <netdev_tap_class>
(struct netdev *) 0x555771fc9660: name = vnet0 , auto_classified = true , netdev_class = 0x555771445e00 <netdev_linux_class>
(struct netdev *) 0x555771fc78d0: name = virbr0 , auto_classified = true , netdev_class = 0x555771445e00 <netdev_linux_class>
(struct netdev *) 0x7fbefffb5540: name = dpdk0 , auto_classified = false, netdev_class = 0x5557714419e0 <dpdk_class>
(struct netdev *) 0x555771fc98b0: name = em3 , auto_classified = true , netdev_class = 0x555771445e00 <netdev_linux_class>
(struct netdev *) 0x7fbea0a31c40: name = vhost0 , auto_classified = false, netdev_class = 0x555771442040 <dpdk_vhost_client_class>
(gdb) p *((struct netdev *) 0x7fbefffb5540)
$1 = {name = 0x555771ecef70 "dpdk0", netdev_class = 0x5557714419e0 <dpdk_class>, auto_classified = false, mtu_user_config = true, ref_cnt = 2, change_seq = 12,
reconfigure_seq = 0x555771ecf2e0, last_reconfigure_seq = 110, n_txq = 2, n_rxq = 1, node = 0x555771efafe0, saved_flags_list = {prev = 0x7fbefffb5580, next = 0x7fbefffb5580}}
Signed-off-by: Eelco Chaudron <echaudro@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2018-05-09 13:47:26 +02:00
|
|
|
#
|
|
|
|
# Implements the GDB "ovs_dump_bridges" command
|
|
|
|
#
|
|
|
|
class CmdDumpBridge(gdb.Command):
|
|
|
|
"""Dump all configured bridges.
|
utilities: Add another GDB macro for ovs-vswitchd.
This commit adds a basic packet metadata macro to the already existing
macros in ovs_gdb.py, ovs_dump_packets will print out information about
one or more packets. It feeds packets into tcpdump, and the user can
pass in tcpdump options to modify how packets are parsed or even write
out packets to a pcap file.
Example usage:
(gdb) break fast_path_processing
(gdb) commands
ovs_dump_packets packets_
continue
end
(gdb) continue
Thread 1 "ovs-vswitchd" hit Breakpoint 2, fast_path_processing ...
12:01:05.962485 ARP, Ethernet (len 6), IPv4 (len 4), Request who-has
10.1.1.1 tell 10.1.1.2, length 28
Thread 1 "ovs-vswitchd" hit Breakpoint 1, fast_path_processing ...
12:01:05.981214 ARP, Ethernet (len 6), IPv4 (len 4), Reply 10.1.1.1
is-at a6:0f:c3:f0:5f:bd (oui Unknown), length 28
Signed-off-by: Mike Pattrick <mkp@redhat.com>
Acked-by: Eelco Chaudron <echaudro@redhat.com>
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
2021-12-17 09:09:17 -05:00
|
|
|
Usage:
|
|
|
|
ovs_dump_bridge {ports|wanted}
|
utilities: Add some GDB macros for ovs-vswitchd
This commit adds basic GDB macro's for ovs-vswitchd:
- ovs_dump_bridge [ports|wanted]
- ovs_dump_bridge_ports <struct bridge *>
- ovs_dump_dp_netdev [ports]
- ovs_dump_dp_netdev_ports <struct dp_netdev *>
- ovs_dump_netdev
These dump functions show limited info, but you can simply cut/paste
the address and get the full structure info. For example:
(gdb) ovs_dump_netdev
(struct netdev *) 0x555771ed89e0: name = ovs-netdev , auto_classified = false, netdev_class = 0x5557714413c0 <netdev_tap_class>
(struct netdev *) 0x555771fc62a0: name = ovs_pvp_br0 , auto_classified = false, netdev_class = 0x5557714413c0 <netdev_tap_class>
(struct netdev *) 0x555771fc9660: name = vnet0 , auto_classified = true , netdev_class = 0x555771445e00 <netdev_linux_class>
(struct netdev *) 0x555771fc78d0: name = virbr0 , auto_classified = true , netdev_class = 0x555771445e00 <netdev_linux_class>
(struct netdev *) 0x7fbefffb5540: name = dpdk0 , auto_classified = false, netdev_class = 0x5557714419e0 <dpdk_class>
(struct netdev *) 0x555771fc98b0: name = em3 , auto_classified = true , netdev_class = 0x555771445e00 <netdev_linux_class>
(struct netdev *) 0x7fbea0a31c40: name = vhost0 , auto_classified = false, netdev_class = 0x555771442040 <dpdk_vhost_client_class>
(gdb) p *((struct netdev *) 0x7fbefffb5540)
$1 = {name = 0x555771ecef70 "dpdk0", netdev_class = 0x5557714419e0 <dpdk_class>, auto_classified = false, mtu_user_config = true, ref_cnt = 2, change_seq = 12,
reconfigure_seq = 0x555771ecf2e0, last_reconfigure_seq = 110, n_txq = 2, n_rxq = 1, node = 0x555771efafe0, saved_flags_list = {prev = 0x7fbefffb5580, next = 0x7fbefffb5580}}
Signed-off-by: Eelco Chaudron <echaudro@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2018-05-09 13:47:26 +02:00
|
|
|
"""
|
|
|
|
def __init__(self):
|
|
|
|
super(CmdDumpBridge, self).__init__("ovs_dump_bridge",
|
|
|
|
gdb.COMMAND_DATA)
|
|
|
|
|
|
|
|
def invoke(self, arg, from_tty):
|
|
|
|
ports = False
|
|
|
|
wanted = False
|
|
|
|
arg_list = gdb.string_to_argv(arg)
|
|
|
|
if len(arg_list) > 1 or \
|
|
|
|
(len(arg_list) == 1 and arg_list[0] != "ports" and
|
|
|
|
arg_list[0] != "wanted"):
|
2018-06-20 11:04:03 +02:00
|
|
|
print("usage: ovs_dump_bridge {ports|wanted}")
|
utilities: Add some GDB macros for ovs-vswitchd
This commit adds basic GDB macro's for ovs-vswitchd:
- ovs_dump_bridge [ports|wanted]
- ovs_dump_bridge_ports <struct bridge *>
- ovs_dump_dp_netdev [ports]
- ovs_dump_dp_netdev_ports <struct dp_netdev *>
- ovs_dump_netdev
These dump functions show limited info, but you can simply cut/paste
the address and get the full structure info. For example:
(gdb) ovs_dump_netdev
(struct netdev *) 0x555771ed89e0: name = ovs-netdev , auto_classified = false, netdev_class = 0x5557714413c0 <netdev_tap_class>
(struct netdev *) 0x555771fc62a0: name = ovs_pvp_br0 , auto_classified = false, netdev_class = 0x5557714413c0 <netdev_tap_class>
(struct netdev *) 0x555771fc9660: name = vnet0 , auto_classified = true , netdev_class = 0x555771445e00 <netdev_linux_class>
(struct netdev *) 0x555771fc78d0: name = virbr0 , auto_classified = true , netdev_class = 0x555771445e00 <netdev_linux_class>
(struct netdev *) 0x7fbefffb5540: name = dpdk0 , auto_classified = false, netdev_class = 0x5557714419e0 <dpdk_class>
(struct netdev *) 0x555771fc98b0: name = em3 , auto_classified = true , netdev_class = 0x555771445e00 <netdev_linux_class>
(struct netdev *) 0x7fbea0a31c40: name = vhost0 , auto_classified = false, netdev_class = 0x555771442040 <dpdk_vhost_client_class>
(gdb) p *((struct netdev *) 0x7fbefffb5540)
$1 = {name = 0x555771ecef70 "dpdk0", netdev_class = 0x5557714419e0 <dpdk_class>, auto_classified = false, mtu_user_config = true, ref_cnt = 2, change_seq = 12,
reconfigure_seq = 0x555771ecf2e0, last_reconfigure_seq = 110, n_txq = 2, n_rxq = 1, node = 0x555771efafe0, saved_flags_list = {prev = 0x7fbefffb5580, next = 0x7fbefffb5580}}
Signed-off-by: Eelco Chaudron <echaudro@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2018-05-09 13:47:26 +02:00
|
|
|
return
|
|
|
|
elif len(arg_list) == 1:
|
|
|
|
if arg_list[0] == "ports":
|
|
|
|
ports = True
|
|
|
|
else:
|
|
|
|
wanted = True
|
|
|
|
|
2018-05-31 11:13:19 +02:00
|
|
|
all_bridges = get_global_variable('all_bridges')
|
|
|
|
if all_bridges is None:
|
utilities: Add some GDB macros for ovs-vswitchd
This commit adds basic GDB macro's for ovs-vswitchd:
- ovs_dump_bridge [ports|wanted]
- ovs_dump_bridge_ports <struct bridge *>
- ovs_dump_dp_netdev [ports]
- ovs_dump_dp_netdev_ports <struct dp_netdev *>
- ovs_dump_netdev
These dump functions show limited info, but you can simply cut/paste
the address and get the full structure info. For example:
(gdb) ovs_dump_netdev
(struct netdev *) 0x555771ed89e0: name = ovs-netdev , auto_classified = false, netdev_class = 0x5557714413c0 <netdev_tap_class>
(struct netdev *) 0x555771fc62a0: name = ovs_pvp_br0 , auto_classified = false, netdev_class = 0x5557714413c0 <netdev_tap_class>
(struct netdev *) 0x555771fc9660: name = vnet0 , auto_classified = true , netdev_class = 0x555771445e00 <netdev_linux_class>
(struct netdev *) 0x555771fc78d0: name = virbr0 , auto_classified = true , netdev_class = 0x555771445e00 <netdev_linux_class>
(struct netdev *) 0x7fbefffb5540: name = dpdk0 , auto_classified = false, netdev_class = 0x5557714419e0 <dpdk_class>
(struct netdev *) 0x555771fc98b0: name = em3 , auto_classified = true , netdev_class = 0x555771445e00 <netdev_linux_class>
(struct netdev *) 0x7fbea0a31c40: name = vhost0 , auto_classified = false, netdev_class = 0x555771442040 <dpdk_vhost_client_class>
(gdb) p *((struct netdev *) 0x7fbefffb5540)
$1 = {name = 0x555771ecef70 "dpdk0", netdev_class = 0x5557714419e0 <dpdk_class>, auto_classified = false, mtu_user_config = true, ref_cnt = 2, change_seq = 12,
reconfigure_seq = 0x555771ecf2e0, last_reconfigure_seq = 110, n_txq = 2, n_rxq = 1, node = 0x555771efafe0, saved_flags_list = {prev = 0x7fbefffb5580, next = 0x7fbefffb5580}}
Signed-off-by: Eelco Chaudron <echaudro@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2018-05-09 13:47:26 +02:00
|
|
|
return
|
2018-05-31 11:13:19 +02:00
|
|
|
|
utilities: Add some GDB macros for ovs-vswitchd
This commit adds basic GDB macro's for ovs-vswitchd:
- ovs_dump_bridge [ports|wanted]
- ovs_dump_bridge_ports <struct bridge *>
- ovs_dump_dp_netdev [ports]
- ovs_dump_dp_netdev_ports <struct dp_netdev *>
- ovs_dump_netdev
These dump functions show limited info, but you can simply cut/paste
the address and get the full structure info. For example:
(gdb) ovs_dump_netdev
(struct netdev *) 0x555771ed89e0: name = ovs-netdev , auto_classified = false, netdev_class = 0x5557714413c0 <netdev_tap_class>
(struct netdev *) 0x555771fc62a0: name = ovs_pvp_br0 , auto_classified = false, netdev_class = 0x5557714413c0 <netdev_tap_class>
(struct netdev *) 0x555771fc9660: name = vnet0 , auto_classified = true , netdev_class = 0x555771445e00 <netdev_linux_class>
(struct netdev *) 0x555771fc78d0: name = virbr0 , auto_classified = true , netdev_class = 0x555771445e00 <netdev_linux_class>
(struct netdev *) 0x7fbefffb5540: name = dpdk0 , auto_classified = false, netdev_class = 0x5557714419e0 <dpdk_class>
(struct netdev *) 0x555771fc98b0: name = em3 , auto_classified = true , netdev_class = 0x555771445e00 <netdev_linux_class>
(struct netdev *) 0x7fbea0a31c40: name = vhost0 , auto_classified = false, netdev_class = 0x555771442040 <dpdk_vhost_client_class>
(gdb) p *((struct netdev *) 0x7fbefffb5540)
$1 = {name = 0x555771ecef70 "dpdk0", netdev_class = 0x5557714419e0 <dpdk_class>, auto_classified = false, mtu_user_config = true, ref_cnt = 2, change_seq = 12,
reconfigure_seq = 0x555771ecf2e0, last_reconfigure_seq = 110, n_txq = 2, n_rxq = 1, node = 0x555771efafe0, saved_flags_list = {prev = 0x7fbefffb5580, next = 0x7fbefffb5580}}
Signed-off-by: Eelco Chaudron <echaudro@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2018-05-09 13:47:26 +02:00
|
|
|
for node in ForEachHMAP(all_bridges,
|
|
|
|
"struct bridge", "node"):
|
|
|
|
print("(struct bridge *) {}: name = {}, type = {}".
|
|
|
|
format(node, node['name'].string(),
|
|
|
|
node['type'].string()))
|
|
|
|
|
|
|
|
if ports:
|
|
|
|
for port in ForEachHMAP(node['ports'],
|
|
|
|
"struct port", "hmap_node"):
|
|
|
|
CmdDumpBridgePorts.display_single_port(port, 4)
|
|
|
|
|
|
|
|
if wanted:
|
|
|
|
for port in ForEachSHASH(node['wanted_ports'],
|
|
|
|
typeobj="struct ovsrec_port"):
|
|
|
|
print(" (struct ovsrec_port *) {}: name = {}".
|
|
|
|
format(port, port['name'].string()))
|
|
|
|
# print port.dereference()
|
|
|
|
|
|
|
|
|
|
|
|
#
|
|
|
|
# Implements the GDB "ovs_dump_bridge_ports" command
|
|
|
|
#
|
|
|
|
class CmdDumpBridgePorts(gdb.Command):
|
|
|
|
"""Dump all ports added to a specific struct bridge*.
|
utilities: Add another GDB macro for ovs-vswitchd.
This commit adds a basic packet metadata macro to the already existing
macros in ovs_gdb.py, ovs_dump_packets will print out information about
one or more packets. It feeds packets into tcpdump, and the user can
pass in tcpdump options to modify how packets are parsed or even write
out packets to a pcap file.
Example usage:
(gdb) break fast_path_processing
(gdb) commands
ovs_dump_packets packets_
continue
end
(gdb) continue
Thread 1 "ovs-vswitchd" hit Breakpoint 2, fast_path_processing ...
12:01:05.962485 ARP, Ethernet (len 6), IPv4 (len 4), Request who-has
10.1.1.1 tell 10.1.1.2, length 28
Thread 1 "ovs-vswitchd" hit Breakpoint 1, fast_path_processing ...
12:01:05.981214 ARP, Ethernet (len 6), IPv4 (len 4), Reply 10.1.1.1
is-at a6:0f:c3:f0:5f:bd (oui Unknown), length 28
Signed-off-by: Mike Pattrick <mkp@redhat.com>
Acked-by: Eelco Chaudron <echaudro@redhat.com>
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
2021-12-17 09:09:17 -05:00
|
|
|
Usage:
|
|
|
|
ovs_dump_bridge_ports <struct bridge *>
|
utilities: Add some GDB macros for ovs-vswitchd
This commit adds basic GDB macro's for ovs-vswitchd:
- ovs_dump_bridge [ports|wanted]
- ovs_dump_bridge_ports <struct bridge *>
- ovs_dump_dp_netdev [ports]
- ovs_dump_dp_netdev_ports <struct dp_netdev *>
- ovs_dump_netdev
These dump functions show limited info, but you can simply cut/paste
the address and get the full structure info. For example:
(gdb) ovs_dump_netdev
(struct netdev *) 0x555771ed89e0: name = ovs-netdev , auto_classified = false, netdev_class = 0x5557714413c0 <netdev_tap_class>
(struct netdev *) 0x555771fc62a0: name = ovs_pvp_br0 , auto_classified = false, netdev_class = 0x5557714413c0 <netdev_tap_class>
(struct netdev *) 0x555771fc9660: name = vnet0 , auto_classified = true , netdev_class = 0x555771445e00 <netdev_linux_class>
(struct netdev *) 0x555771fc78d0: name = virbr0 , auto_classified = true , netdev_class = 0x555771445e00 <netdev_linux_class>
(struct netdev *) 0x7fbefffb5540: name = dpdk0 , auto_classified = false, netdev_class = 0x5557714419e0 <dpdk_class>
(struct netdev *) 0x555771fc98b0: name = em3 , auto_classified = true , netdev_class = 0x555771445e00 <netdev_linux_class>
(struct netdev *) 0x7fbea0a31c40: name = vhost0 , auto_classified = false, netdev_class = 0x555771442040 <dpdk_vhost_client_class>
(gdb) p *((struct netdev *) 0x7fbefffb5540)
$1 = {name = 0x555771ecef70 "dpdk0", netdev_class = 0x5557714419e0 <dpdk_class>, auto_classified = false, mtu_user_config = true, ref_cnt = 2, change_seq = 12,
reconfigure_seq = 0x555771ecf2e0, last_reconfigure_seq = 110, n_txq = 2, n_rxq = 1, node = 0x555771efafe0, saved_flags_list = {prev = 0x7fbefffb5580, next = 0x7fbefffb5580}}
Signed-off-by: Eelco Chaudron <echaudro@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2018-05-09 13:47:26 +02:00
|
|
|
"""
|
|
|
|
def __init__(self):
|
|
|
|
super(CmdDumpBridgePorts, self).__init__("ovs_dump_bridge_ports",
|
|
|
|
gdb.COMMAND_DATA)
|
|
|
|
|
|
|
|
@staticmethod
|
|
|
|
def display_single_port(port, indent=0):
|
|
|
|
indent = " " * indent
|
|
|
|
port = port.cast(gdb.lookup_type('struct port').pointer())
|
2019-01-01 09:34:09 -05:00
|
|
|
print("{}(struct port *) {}: name = {}, bridge = (struct bridge *) {}".
|
utilities: Add some GDB macros for ovs-vswitchd
This commit adds basic GDB macro's for ovs-vswitchd:
- ovs_dump_bridge [ports|wanted]
- ovs_dump_bridge_ports <struct bridge *>
- ovs_dump_dp_netdev [ports]
- ovs_dump_dp_netdev_ports <struct dp_netdev *>
- ovs_dump_netdev
These dump functions show limited info, but you can simply cut/paste
the address and get the full structure info. For example:
(gdb) ovs_dump_netdev
(struct netdev *) 0x555771ed89e0: name = ovs-netdev , auto_classified = false, netdev_class = 0x5557714413c0 <netdev_tap_class>
(struct netdev *) 0x555771fc62a0: name = ovs_pvp_br0 , auto_classified = false, netdev_class = 0x5557714413c0 <netdev_tap_class>
(struct netdev *) 0x555771fc9660: name = vnet0 , auto_classified = true , netdev_class = 0x555771445e00 <netdev_linux_class>
(struct netdev *) 0x555771fc78d0: name = virbr0 , auto_classified = true , netdev_class = 0x555771445e00 <netdev_linux_class>
(struct netdev *) 0x7fbefffb5540: name = dpdk0 , auto_classified = false, netdev_class = 0x5557714419e0 <dpdk_class>
(struct netdev *) 0x555771fc98b0: name = em3 , auto_classified = true , netdev_class = 0x555771445e00 <netdev_linux_class>
(struct netdev *) 0x7fbea0a31c40: name = vhost0 , auto_classified = false, netdev_class = 0x555771442040 <dpdk_vhost_client_class>
(gdb) p *((struct netdev *) 0x7fbefffb5540)
$1 = {name = 0x555771ecef70 "dpdk0", netdev_class = 0x5557714419e0 <dpdk_class>, auto_classified = false, mtu_user_config = true, ref_cnt = 2, change_seq = 12,
reconfigure_seq = 0x555771ecf2e0, last_reconfigure_seq = 110, n_txq = 2, n_rxq = 1, node = 0x555771efafe0, saved_flags_list = {prev = 0x7fbefffb5580, next = 0x7fbefffb5580}}
Signed-off-by: Eelco Chaudron <echaudro@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2018-05-09 13:47:26 +02:00
|
|
|
format(indent, port, port['name'].string(),
|
|
|
|
port['bridge']))
|
|
|
|
|
|
|
|
indent += " " * 4
|
|
|
|
for iface in ForEachLIST(port['ifaces'], "struct iface", "port_elem"):
|
|
|
|
print("{}(struct iface *) {}: name = {}, ofp_port = {}, "
|
|
|
|
"netdev = (struct netdev *) {}".
|
|
|
|
format(indent, iface, iface['name'],
|
|
|
|
iface['ofp_port'], iface['netdev']))
|
|
|
|
|
|
|
|
def invoke(self, arg, from_tty):
|
|
|
|
arg_list = gdb.string_to_argv(arg)
|
|
|
|
if len(arg_list) != 1:
|
|
|
|
print("usage: ovs_dump_bridge_ports <struct bridge *>")
|
|
|
|
return
|
|
|
|
bridge = gdb.parse_and_eval(arg_list[0]).cast(
|
|
|
|
gdb.lookup_type('struct bridge').pointer())
|
|
|
|
for node in ForEachHMAP(bridge['ports'],
|
|
|
|
"struct port", "hmap_node"):
|
|
|
|
self.display_single_port(node)
|
|
|
|
|
|
|
|
|
|
|
|
#
|
|
|
|
# Implements the GDB "ovs_dump_dp_netdev" command
|
|
|
|
#
|
|
|
|
class CmdDumpDpNetdev(gdb.Command):
|
|
|
|
"""Dump all registered dp_netdev structures.
|
utilities: Add another GDB macro for ovs-vswitchd.
This commit adds a basic packet metadata macro to the already existing
macros in ovs_gdb.py, ovs_dump_packets will print out information about
one or more packets. It feeds packets into tcpdump, and the user can
pass in tcpdump options to modify how packets are parsed or even write
out packets to a pcap file.
Example usage:
(gdb) break fast_path_processing
(gdb) commands
ovs_dump_packets packets_
continue
end
(gdb) continue
Thread 1 "ovs-vswitchd" hit Breakpoint 2, fast_path_processing ...
12:01:05.962485 ARP, Ethernet (len 6), IPv4 (len 4), Request who-has
10.1.1.1 tell 10.1.1.2, length 28
Thread 1 "ovs-vswitchd" hit Breakpoint 1, fast_path_processing ...
12:01:05.981214 ARP, Ethernet (len 6), IPv4 (len 4), Reply 10.1.1.1
is-at a6:0f:c3:f0:5f:bd (oui Unknown), length 28
Signed-off-by: Mike Pattrick <mkp@redhat.com>
Acked-by: Eelco Chaudron <echaudro@redhat.com>
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
2021-12-17 09:09:17 -05:00
|
|
|
Usage:
|
|
|
|
ovs_dump_dp_netdev [ports]
|
utilities: Add some GDB macros for ovs-vswitchd
This commit adds basic GDB macro's for ovs-vswitchd:
- ovs_dump_bridge [ports|wanted]
- ovs_dump_bridge_ports <struct bridge *>
- ovs_dump_dp_netdev [ports]
- ovs_dump_dp_netdev_ports <struct dp_netdev *>
- ovs_dump_netdev
These dump functions show limited info, but you can simply cut/paste
the address and get the full structure info. For example:
(gdb) ovs_dump_netdev
(struct netdev *) 0x555771ed89e0: name = ovs-netdev , auto_classified = false, netdev_class = 0x5557714413c0 <netdev_tap_class>
(struct netdev *) 0x555771fc62a0: name = ovs_pvp_br0 , auto_classified = false, netdev_class = 0x5557714413c0 <netdev_tap_class>
(struct netdev *) 0x555771fc9660: name = vnet0 , auto_classified = true , netdev_class = 0x555771445e00 <netdev_linux_class>
(struct netdev *) 0x555771fc78d0: name = virbr0 , auto_classified = true , netdev_class = 0x555771445e00 <netdev_linux_class>
(struct netdev *) 0x7fbefffb5540: name = dpdk0 , auto_classified = false, netdev_class = 0x5557714419e0 <dpdk_class>
(struct netdev *) 0x555771fc98b0: name = em3 , auto_classified = true , netdev_class = 0x555771445e00 <netdev_linux_class>
(struct netdev *) 0x7fbea0a31c40: name = vhost0 , auto_classified = false, netdev_class = 0x555771442040 <dpdk_vhost_client_class>
(gdb) p *((struct netdev *) 0x7fbefffb5540)
$1 = {name = 0x555771ecef70 "dpdk0", netdev_class = 0x5557714419e0 <dpdk_class>, auto_classified = false, mtu_user_config = true, ref_cnt = 2, change_seq = 12,
reconfigure_seq = 0x555771ecf2e0, last_reconfigure_seq = 110, n_txq = 2, n_rxq = 1, node = 0x555771efafe0, saved_flags_list = {prev = 0x7fbefffb5580, next = 0x7fbefffb5580}}
Signed-off-by: Eelco Chaudron <echaudro@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2018-05-09 13:47:26 +02:00
|
|
|
"""
|
|
|
|
def __init__(self):
|
|
|
|
super(CmdDumpDpNetdev, self).__init__("ovs_dump_dp_netdev",
|
|
|
|
gdb.COMMAND_DATA)
|
|
|
|
|
|
|
|
def invoke(self, arg, from_tty):
|
|
|
|
ports = False
|
|
|
|
arg_list = gdb.string_to_argv(arg)
|
|
|
|
if len(arg_list) > 1 or \
|
|
|
|
(len(arg_list) == 1 and arg_list[0] != "ports"):
|
|
|
|
print("usage: ovs_dump_dp_netdev [ports]")
|
|
|
|
return
|
|
|
|
elif len(arg_list) == 1:
|
|
|
|
ports = True
|
|
|
|
|
2018-05-31 11:13:19 +02:00
|
|
|
dp_netdevs = get_global_variable('dp_netdevs')
|
|
|
|
if dp_netdevs is None:
|
utilities: Add some GDB macros for ovs-vswitchd
This commit adds basic GDB macro's for ovs-vswitchd:
- ovs_dump_bridge [ports|wanted]
- ovs_dump_bridge_ports <struct bridge *>
- ovs_dump_dp_netdev [ports]
- ovs_dump_dp_netdev_ports <struct dp_netdev *>
- ovs_dump_netdev
These dump functions show limited info, but you can simply cut/paste
the address and get the full structure info. For example:
(gdb) ovs_dump_netdev
(struct netdev *) 0x555771ed89e0: name = ovs-netdev , auto_classified = false, netdev_class = 0x5557714413c0 <netdev_tap_class>
(struct netdev *) 0x555771fc62a0: name = ovs_pvp_br0 , auto_classified = false, netdev_class = 0x5557714413c0 <netdev_tap_class>
(struct netdev *) 0x555771fc9660: name = vnet0 , auto_classified = true , netdev_class = 0x555771445e00 <netdev_linux_class>
(struct netdev *) 0x555771fc78d0: name = virbr0 , auto_classified = true , netdev_class = 0x555771445e00 <netdev_linux_class>
(struct netdev *) 0x7fbefffb5540: name = dpdk0 , auto_classified = false, netdev_class = 0x5557714419e0 <dpdk_class>
(struct netdev *) 0x555771fc98b0: name = em3 , auto_classified = true , netdev_class = 0x555771445e00 <netdev_linux_class>
(struct netdev *) 0x7fbea0a31c40: name = vhost0 , auto_classified = false, netdev_class = 0x555771442040 <dpdk_vhost_client_class>
(gdb) p *((struct netdev *) 0x7fbefffb5540)
$1 = {name = 0x555771ecef70 "dpdk0", netdev_class = 0x5557714419e0 <dpdk_class>, auto_classified = false, mtu_user_config = true, ref_cnt = 2, change_seq = 12,
reconfigure_seq = 0x555771ecf2e0, last_reconfigure_seq = 110, n_txq = 2, n_rxq = 1, node = 0x555771efafe0, saved_flags_list = {prev = 0x7fbefffb5580, next = 0x7fbefffb5580}}
Signed-off-by: Eelco Chaudron <echaudro@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2018-05-09 13:47:26 +02:00
|
|
|
return
|
2018-05-31 11:13:19 +02:00
|
|
|
|
|
|
|
for dp in ForEachSHASH(dp_netdevs, typeobj=('struct dp_netdev')):
|
utilities: Add some GDB macros for ovs-vswitchd
This commit adds basic GDB macro's for ovs-vswitchd:
- ovs_dump_bridge [ports|wanted]
- ovs_dump_bridge_ports <struct bridge *>
- ovs_dump_dp_netdev [ports]
- ovs_dump_dp_netdev_ports <struct dp_netdev *>
- ovs_dump_netdev
These dump functions show limited info, but you can simply cut/paste
the address and get the full structure info. For example:
(gdb) ovs_dump_netdev
(struct netdev *) 0x555771ed89e0: name = ovs-netdev , auto_classified = false, netdev_class = 0x5557714413c0 <netdev_tap_class>
(struct netdev *) 0x555771fc62a0: name = ovs_pvp_br0 , auto_classified = false, netdev_class = 0x5557714413c0 <netdev_tap_class>
(struct netdev *) 0x555771fc9660: name = vnet0 , auto_classified = true , netdev_class = 0x555771445e00 <netdev_linux_class>
(struct netdev *) 0x555771fc78d0: name = virbr0 , auto_classified = true , netdev_class = 0x555771445e00 <netdev_linux_class>
(struct netdev *) 0x7fbefffb5540: name = dpdk0 , auto_classified = false, netdev_class = 0x5557714419e0 <dpdk_class>
(struct netdev *) 0x555771fc98b0: name = em3 , auto_classified = true , netdev_class = 0x555771445e00 <netdev_linux_class>
(struct netdev *) 0x7fbea0a31c40: name = vhost0 , auto_classified = false, netdev_class = 0x555771442040 <dpdk_vhost_client_class>
(gdb) p *((struct netdev *) 0x7fbefffb5540)
$1 = {name = 0x555771ecef70 "dpdk0", netdev_class = 0x5557714419e0 <dpdk_class>, auto_classified = false, mtu_user_config = true, ref_cnt = 2, change_seq = 12,
reconfigure_seq = 0x555771ecf2e0, last_reconfigure_seq = 110, n_txq = 2, n_rxq = 1, node = 0x555771efafe0, saved_flags_list = {prev = 0x7fbefffb5580, next = 0x7fbefffb5580}}
Signed-off-by: Eelco Chaudron <echaudro@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2018-05-09 13:47:26 +02:00
|
|
|
|
|
|
|
print("(struct dp_netdev *) {}: name = {}, class = "
|
|
|
|
"(struct dpif_class *) {}".
|
2018-05-31 11:13:19 +02:00
|
|
|
format(dp, dp['name'].string(), dp['class']))
|
utilities: Add some GDB macros for ovs-vswitchd
This commit adds basic GDB macro's for ovs-vswitchd:
- ovs_dump_bridge [ports|wanted]
- ovs_dump_bridge_ports <struct bridge *>
- ovs_dump_dp_netdev [ports]
- ovs_dump_dp_netdev_ports <struct dp_netdev *>
- ovs_dump_netdev
These dump functions show limited info, but you can simply cut/paste
the address and get the full structure info. For example:
(gdb) ovs_dump_netdev
(struct netdev *) 0x555771ed89e0: name = ovs-netdev , auto_classified = false, netdev_class = 0x5557714413c0 <netdev_tap_class>
(struct netdev *) 0x555771fc62a0: name = ovs_pvp_br0 , auto_classified = false, netdev_class = 0x5557714413c0 <netdev_tap_class>
(struct netdev *) 0x555771fc9660: name = vnet0 , auto_classified = true , netdev_class = 0x555771445e00 <netdev_linux_class>
(struct netdev *) 0x555771fc78d0: name = virbr0 , auto_classified = true , netdev_class = 0x555771445e00 <netdev_linux_class>
(struct netdev *) 0x7fbefffb5540: name = dpdk0 , auto_classified = false, netdev_class = 0x5557714419e0 <dpdk_class>
(struct netdev *) 0x555771fc98b0: name = em3 , auto_classified = true , netdev_class = 0x555771445e00 <netdev_linux_class>
(struct netdev *) 0x7fbea0a31c40: name = vhost0 , auto_classified = false, netdev_class = 0x555771442040 <dpdk_vhost_client_class>
(gdb) p *((struct netdev *) 0x7fbefffb5540)
$1 = {name = 0x555771ecef70 "dpdk0", netdev_class = 0x5557714419e0 <dpdk_class>, auto_classified = false, mtu_user_config = true, ref_cnt = 2, change_seq = 12,
reconfigure_seq = 0x555771ecf2e0, last_reconfigure_seq = 110, n_txq = 2, n_rxq = 1, node = 0x555771efafe0, saved_flags_list = {prev = 0x7fbefffb5580, next = 0x7fbefffb5580}}
Signed-off-by: Eelco Chaudron <echaudro@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2018-05-09 13:47:26 +02:00
|
|
|
|
|
|
|
if ports:
|
|
|
|
for node in ForEachHMAP(dp['ports'],
|
|
|
|
"struct dp_netdev_port", "node"):
|
|
|
|
CmdDumpDpNetdevPorts.display_single_port(node, 4)
|
|
|
|
|
|
|
|
|
2018-05-16 17:37:11 +02:00
|
|
|
#
|
|
|
|
# Implements the GDB "ovs_dump_dp_netdev_poll_threads" command
|
|
|
|
#
|
|
|
|
class CmdDumpDpNetdevPollThreads(gdb.Command):
|
|
|
|
"""Dump all poll_thread info added to a specific struct dp_netdev*.
|
utilities: Add another GDB macro for ovs-vswitchd.
This commit adds a basic packet metadata macro to the already existing
macros in ovs_gdb.py, ovs_dump_packets will print out information about
one or more packets. It feeds packets into tcpdump, and the user can
pass in tcpdump options to modify how packets are parsed or even write
out packets to a pcap file.
Example usage:
(gdb) break fast_path_processing
(gdb) commands
ovs_dump_packets packets_
continue
end
(gdb) continue
Thread 1 "ovs-vswitchd" hit Breakpoint 2, fast_path_processing ...
12:01:05.962485 ARP, Ethernet (len 6), IPv4 (len 4), Request who-has
10.1.1.1 tell 10.1.1.2, length 28
Thread 1 "ovs-vswitchd" hit Breakpoint 1, fast_path_processing ...
12:01:05.981214 ARP, Ethernet (len 6), IPv4 (len 4), Reply 10.1.1.1
is-at a6:0f:c3:f0:5f:bd (oui Unknown), length 28
Signed-off-by: Mike Pattrick <mkp@redhat.com>
Acked-by: Eelco Chaudron <echaudro@redhat.com>
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
2021-12-17 09:09:17 -05:00
|
|
|
Usage:
|
|
|
|
ovs_dump_dp_netdev_poll_threads <struct dp_netdev *>
|
2018-05-16 17:37:11 +02:00
|
|
|
"""
|
|
|
|
def __init__(self):
|
|
|
|
super(CmdDumpDpNetdevPollThreads, self).__init__(
|
|
|
|
"ovs_dump_dp_netdev_poll_threads",
|
|
|
|
gdb.COMMAND_DATA)
|
|
|
|
|
|
|
|
@staticmethod
|
|
|
|
def display_single_poll_thread(pmd_thread, indent=0):
|
|
|
|
indent = " " * indent
|
2019-01-07 14:29:59 +00:00
|
|
|
print("{}(struct dp_netdev_pmd_thread *) {}: core_id = {}, "
|
2018-05-16 17:37:11 +02:00
|
|
|
"numa_id {}".format(indent,
|
|
|
|
pmd_thread, pmd_thread['core_id'],
|
|
|
|
pmd_thread['numa_id']))
|
|
|
|
|
|
|
|
def invoke(self, arg, from_tty):
|
|
|
|
arg_list = gdb.string_to_argv(arg)
|
|
|
|
if len(arg_list) != 1:
|
|
|
|
print("usage: ovs_dump_dp_netdev_poll_threads "
|
|
|
|
"<struct dp_netdev *>")
|
|
|
|
return
|
|
|
|
dp_netdev = gdb.parse_and_eval(arg_list[0]).cast(
|
|
|
|
gdb.lookup_type('struct dp_netdev').pointer())
|
|
|
|
for node in ForEachCMAP(dp_netdev['poll_threads'],
|
|
|
|
"struct dp_netdev_pmd_thread", "node"):
|
|
|
|
self.display_single_poll_thread(node)
|
|
|
|
|
|
|
|
|
utilities: Add some GDB macros for ovs-vswitchd
This commit adds basic GDB macro's for ovs-vswitchd:
- ovs_dump_bridge [ports|wanted]
- ovs_dump_bridge_ports <struct bridge *>
- ovs_dump_dp_netdev [ports]
- ovs_dump_dp_netdev_ports <struct dp_netdev *>
- ovs_dump_netdev
These dump functions show limited info, but you can simply cut/paste
the address and get the full structure info. For example:
(gdb) ovs_dump_netdev
(struct netdev *) 0x555771ed89e0: name = ovs-netdev , auto_classified = false, netdev_class = 0x5557714413c0 <netdev_tap_class>
(struct netdev *) 0x555771fc62a0: name = ovs_pvp_br0 , auto_classified = false, netdev_class = 0x5557714413c0 <netdev_tap_class>
(struct netdev *) 0x555771fc9660: name = vnet0 , auto_classified = true , netdev_class = 0x555771445e00 <netdev_linux_class>
(struct netdev *) 0x555771fc78d0: name = virbr0 , auto_classified = true , netdev_class = 0x555771445e00 <netdev_linux_class>
(struct netdev *) 0x7fbefffb5540: name = dpdk0 , auto_classified = false, netdev_class = 0x5557714419e0 <dpdk_class>
(struct netdev *) 0x555771fc98b0: name = em3 , auto_classified = true , netdev_class = 0x555771445e00 <netdev_linux_class>
(struct netdev *) 0x7fbea0a31c40: name = vhost0 , auto_classified = false, netdev_class = 0x555771442040 <dpdk_vhost_client_class>
(gdb) p *((struct netdev *) 0x7fbefffb5540)
$1 = {name = 0x555771ecef70 "dpdk0", netdev_class = 0x5557714419e0 <dpdk_class>, auto_classified = false, mtu_user_config = true, ref_cnt = 2, change_seq = 12,
reconfigure_seq = 0x555771ecf2e0, last_reconfigure_seq = 110, n_txq = 2, n_rxq = 1, node = 0x555771efafe0, saved_flags_list = {prev = 0x7fbefffb5580, next = 0x7fbefffb5580}}
Signed-off-by: Eelco Chaudron <echaudro@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2018-05-09 13:47:26 +02:00
|
|
|
#
|
|
|
|
# Implements the GDB "ovs_dump_dp_netdev_ports" command
|
|
|
|
#
|
|
|
|
class CmdDumpDpNetdevPorts(gdb.Command):
|
|
|
|
"""Dump all ports added to a specific struct dp_netdev*.
|
utilities: Add another GDB macro for ovs-vswitchd.
This commit adds a basic packet metadata macro to the already existing
macros in ovs_gdb.py, ovs_dump_packets will print out information about
one or more packets. It feeds packets into tcpdump, and the user can
pass in tcpdump options to modify how packets are parsed or even write
out packets to a pcap file.
Example usage:
(gdb) break fast_path_processing
(gdb) commands
ovs_dump_packets packets_
continue
end
(gdb) continue
Thread 1 "ovs-vswitchd" hit Breakpoint 2, fast_path_processing ...
12:01:05.962485 ARP, Ethernet (len 6), IPv4 (len 4), Request who-has
10.1.1.1 tell 10.1.1.2, length 28
Thread 1 "ovs-vswitchd" hit Breakpoint 1, fast_path_processing ...
12:01:05.981214 ARP, Ethernet (len 6), IPv4 (len 4), Reply 10.1.1.1
is-at a6:0f:c3:f0:5f:bd (oui Unknown), length 28
Signed-off-by: Mike Pattrick <mkp@redhat.com>
Acked-by: Eelco Chaudron <echaudro@redhat.com>
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
2021-12-17 09:09:17 -05:00
|
|
|
Usage:
|
|
|
|
ovs_dump_dp_netdev_ports <struct dp_netdev *>
|
utilities: Add some GDB macros for ovs-vswitchd
This commit adds basic GDB macro's for ovs-vswitchd:
- ovs_dump_bridge [ports|wanted]
- ovs_dump_bridge_ports <struct bridge *>
- ovs_dump_dp_netdev [ports]
- ovs_dump_dp_netdev_ports <struct dp_netdev *>
- ovs_dump_netdev
These dump functions show limited info, but you can simply cut/paste
the address and get the full structure info. For example:
(gdb) ovs_dump_netdev
(struct netdev *) 0x555771ed89e0: name = ovs-netdev , auto_classified = false, netdev_class = 0x5557714413c0 <netdev_tap_class>
(struct netdev *) 0x555771fc62a0: name = ovs_pvp_br0 , auto_classified = false, netdev_class = 0x5557714413c0 <netdev_tap_class>
(struct netdev *) 0x555771fc9660: name = vnet0 , auto_classified = true , netdev_class = 0x555771445e00 <netdev_linux_class>
(struct netdev *) 0x555771fc78d0: name = virbr0 , auto_classified = true , netdev_class = 0x555771445e00 <netdev_linux_class>
(struct netdev *) 0x7fbefffb5540: name = dpdk0 , auto_classified = false, netdev_class = 0x5557714419e0 <dpdk_class>
(struct netdev *) 0x555771fc98b0: name = em3 , auto_classified = true , netdev_class = 0x555771445e00 <netdev_linux_class>
(struct netdev *) 0x7fbea0a31c40: name = vhost0 , auto_classified = false, netdev_class = 0x555771442040 <dpdk_vhost_client_class>
(gdb) p *((struct netdev *) 0x7fbefffb5540)
$1 = {name = 0x555771ecef70 "dpdk0", netdev_class = 0x5557714419e0 <dpdk_class>, auto_classified = false, mtu_user_config = true, ref_cnt = 2, change_seq = 12,
reconfigure_seq = 0x555771ecf2e0, last_reconfigure_seq = 110, n_txq = 2, n_rxq = 1, node = 0x555771efafe0, saved_flags_list = {prev = 0x7fbefffb5580, next = 0x7fbefffb5580}}
Signed-off-by: Eelco Chaudron <echaudro@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2018-05-09 13:47:26 +02:00
|
|
|
"""
|
|
|
|
def __init__(self):
|
|
|
|
super(CmdDumpDpNetdevPorts, self).__init__("ovs_dump_dp_netdev_ports",
|
|
|
|
gdb.COMMAND_DATA)
|
|
|
|
|
|
|
|
@staticmethod
|
|
|
|
def display_single_port(port, indent=0):
|
|
|
|
indent = " " * indent
|
|
|
|
print("{}(struct dp_netdev_port *) {}:".format(indent, port))
|
|
|
|
print("{} port_no = {}, n_rxq = {}, type = {}".
|
|
|
|
format(indent, port['port_no'], port['n_rxq'],
|
|
|
|
port['type'].string()))
|
|
|
|
print("{} netdev = (struct netdev *) {}: name = {}, "
|
|
|
|
"n_txq/rxq = {}/{}".
|
|
|
|
format(indent, port['netdev'],
|
|
|
|
port['netdev']['name'].string(),
|
|
|
|
port['netdev']['n_txq'],
|
|
|
|
port['netdev']['n_rxq']))
|
|
|
|
|
|
|
|
def invoke(self, arg, from_tty):
|
|
|
|
arg_list = gdb.string_to_argv(arg)
|
|
|
|
if len(arg_list) != 1:
|
|
|
|
print("usage: ovs_dump_dp_netdev_ports <struct dp_netdev *>")
|
|
|
|
return
|
|
|
|
dp_netdev = gdb.parse_and_eval(arg_list[0]).cast(
|
|
|
|
gdb.lookup_type('struct dp_netdev').pointer())
|
|
|
|
for node in ForEachHMAP(dp_netdev['ports'],
|
|
|
|
"struct dp_netdev_port", "node"):
|
|
|
|
# print node.dereference()
|
|
|
|
self.display_single_port(node)
|
|
|
|
|
|
|
|
|
2018-05-31 11:13:19 +02:00
|
|
|
#
|
|
|
|
# Implements the GDB "ovs_dump_dp_provider" command
|
|
|
|
#
|
|
|
|
class CmdDumpDpProvider(gdb.Command):
|
|
|
|
"""Dump all registered registered_dpif_class structures.
|
utilities: Add another GDB macro for ovs-vswitchd.
This commit adds a basic packet metadata macro to the already existing
macros in ovs_gdb.py, ovs_dump_packets will print out information about
one or more packets. It feeds packets into tcpdump, and the user can
pass in tcpdump options to modify how packets are parsed or even write
out packets to a pcap file.
Example usage:
(gdb) break fast_path_processing
(gdb) commands
ovs_dump_packets packets_
continue
end
(gdb) continue
Thread 1 "ovs-vswitchd" hit Breakpoint 2, fast_path_processing ...
12:01:05.962485 ARP, Ethernet (len 6), IPv4 (len 4), Request who-has
10.1.1.1 tell 10.1.1.2, length 28
Thread 1 "ovs-vswitchd" hit Breakpoint 1, fast_path_processing ...
12:01:05.981214 ARP, Ethernet (len 6), IPv4 (len 4), Reply 10.1.1.1
is-at a6:0f:c3:f0:5f:bd (oui Unknown), length 28
Signed-off-by: Mike Pattrick <mkp@redhat.com>
Acked-by: Eelco Chaudron <echaudro@redhat.com>
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
2021-12-17 09:09:17 -05:00
|
|
|
Usage:
|
|
|
|
ovs_dump_dp_provider
|
2018-05-31 11:13:19 +02:00
|
|
|
"""
|
|
|
|
def __init__(self):
|
|
|
|
super(CmdDumpDpProvider, self).__init__("ovs_dump_dp_provider",
|
|
|
|
gdb.COMMAND_DATA)
|
|
|
|
|
|
|
|
def invoke(self, arg, from_tty):
|
|
|
|
dp_providers = get_global_variable('dpif_classes')
|
|
|
|
if dp_providers is None:
|
|
|
|
return
|
|
|
|
|
|
|
|
for dp_class in ForEachSHASH(dp_providers,
|
|
|
|
typeobj="struct registered_dpif_class"):
|
|
|
|
|
|
|
|
print("(struct registered_dpif_class *) {}: "
|
|
|
|
"(struct dpif_class *) 0x{:x} = {{type = {}, ...}}, "
|
|
|
|
"refcount = {}".
|
|
|
|
format(dp_class,
|
2019-12-20 18:35:08 +01:00
|
|
|
int(dp_class['dpif_class']),
|
2018-05-31 11:13:19 +02:00
|
|
|
dp_class['dpif_class']['type'].string(),
|
|
|
|
dp_class['refcount']))
|
|
|
|
|
|
|
|
|
utilities: Add some GDB macros for ovs-vswitchd
This commit adds basic GDB macro's for ovs-vswitchd:
- ovs_dump_bridge [ports|wanted]
- ovs_dump_bridge_ports <struct bridge *>
- ovs_dump_dp_netdev [ports]
- ovs_dump_dp_netdev_ports <struct dp_netdev *>
- ovs_dump_netdev
These dump functions show limited info, but you can simply cut/paste
the address and get the full structure info. For example:
(gdb) ovs_dump_netdev
(struct netdev *) 0x555771ed89e0: name = ovs-netdev , auto_classified = false, netdev_class = 0x5557714413c0 <netdev_tap_class>
(struct netdev *) 0x555771fc62a0: name = ovs_pvp_br0 , auto_classified = false, netdev_class = 0x5557714413c0 <netdev_tap_class>
(struct netdev *) 0x555771fc9660: name = vnet0 , auto_classified = true , netdev_class = 0x555771445e00 <netdev_linux_class>
(struct netdev *) 0x555771fc78d0: name = virbr0 , auto_classified = true , netdev_class = 0x555771445e00 <netdev_linux_class>
(struct netdev *) 0x7fbefffb5540: name = dpdk0 , auto_classified = false, netdev_class = 0x5557714419e0 <dpdk_class>
(struct netdev *) 0x555771fc98b0: name = em3 , auto_classified = true , netdev_class = 0x555771445e00 <netdev_linux_class>
(struct netdev *) 0x7fbea0a31c40: name = vhost0 , auto_classified = false, netdev_class = 0x555771442040 <dpdk_vhost_client_class>
(gdb) p *((struct netdev *) 0x7fbefffb5540)
$1 = {name = 0x555771ecef70 "dpdk0", netdev_class = 0x5557714419e0 <dpdk_class>, auto_classified = false, mtu_user_config = true, ref_cnt = 2, change_seq = 12,
reconfigure_seq = 0x555771ecf2e0, last_reconfigure_seq = 110, n_txq = 2, n_rxq = 1, node = 0x555771efafe0, saved_flags_list = {prev = 0x7fbefffb5580, next = 0x7fbefffb5580}}
Signed-off-by: Eelco Chaudron <echaudro@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2018-05-09 13:47:26 +02:00
|
|
|
#
|
|
|
|
# Implements the GDB "ovs_dump_netdev" command
|
|
|
|
#
|
|
|
|
class CmdDumpNetdev(gdb.Command):
|
|
|
|
"""Dump all registered netdev structures.
|
utilities: Add another GDB macro for ovs-vswitchd.
This commit adds a basic packet metadata macro to the already existing
macros in ovs_gdb.py, ovs_dump_packets will print out information about
one or more packets. It feeds packets into tcpdump, and the user can
pass in tcpdump options to modify how packets are parsed or even write
out packets to a pcap file.
Example usage:
(gdb) break fast_path_processing
(gdb) commands
ovs_dump_packets packets_
continue
end
(gdb) continue
Thread 1 "ovs-vswitchd" hit Breakpoint 2, fast_path_processing ...
12:01:05.962485 ARP, Ethernet (len 6), IPv4 (len 4), Request who-has
10.1.1.1 tell 10.1.1.2, length 28
Thread 1 "ovs-vswitchd" hit Breakpoint 1, fast_path_processing ...
12:01:05.981214 ARP, Ethernet (len 6), IPv4 (len 4), Reply 10.1.1.1
is-at a6:0f:c3:f0:5f:bd (oui Unknown), length 28
Signed-off-by: Mike Pattrick <mkp@redhat.com>
Acked-by: Eelco Chaudron <echaudro@redhat.com>
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
2021-12-17 09:09:17 -05:00
|
|
|
Usage:
|
|
|
|
ovs_dump_netdev
|
utilities: Add some GDB macros for ovs-vswitchd
This commit adds basic GDB macro's for ovs-vswitchd:
- ovs_dump_bridge [ports|wanted]
- ovs_dump_bridge_ports <struct bridge *>
- ovs_dump_dp_netdev [ports]
- ovs_dump_dp_netdev_ports <struct dp_netdev *>
- ovs_dump_netdev
These dump functions show limited info, but you can simply cut/paste
the address and get the full structure info. For example:
(gdb) ovs_dump_netdev
(struct netdev *) 0x555771ed89e0: name = ovs-netdev , auto_classified = false, netdev_class = 0x5557714413c0 <netdev_tap_class>
(struct netdev *) 0x555771fc62a0: name = ovs_pvp_br0 , auto_classified = false, netdev_class = 0x5557714413c0 <netdev_tap_class>
(struct netdev *) 0x555771fc9660: name = vnet0 , auto_classified = true , netdev_class = 0x555771445e00 <netdev_linux_class>
(struct netdev *) 0x555771fc78d0: name = virbr0 , auto_classified = true , netdev_class = 0x555771445e00 <netdev_linux_class>
(struct netdev *) 0x7fbefffb5540: name = dpdk0 , auto_classified = false, netdev_class = 0x5557714419e0 <dpdk_class>
(struct netdev *) 0x555771fc98b0: name = em3 , auto_classified = true , netdev_class = 0x555771445e00 <netdev_linux_class>
(struct netdev *) 0x7fbea0a31c40: name = vhost0 , auto_classified = false, netdev_class = 0x555771442040 <dpdk_vhost_client_class>
(gdb) p *((struct netdev *) 0x7fbefffb5540)
$1 = {name = 0x555771ecef70 "dpdk0", netdev_class = 0x5557714419e0 <dpdk_class>, auto_classified = false, mtu_user_config = true, ref_cnt = 2, change_seq = 12,
reconfigure_seq = 0x555771ecf2e0, last_reconfigure_seq = 110, n_txq = 2, n_rxq = 1, node = 0x555771efafe0, saved_flags_list = {prev = 0x7fbefffb5580, next = 0x7fbefffb5580}}
Signed-off-by: Eelco Chaudron <echaudro@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2018-05-09 13:47:26 +02:00
|
|
|
"""
|
|
|
|
def __init__(self):
|
|
|
|
super(CmdDumpNetdev, self).__init__("ovs_dump_netdev",
|
|
|
|
gdb.COMMAND_DATA)
|
|
|
|
|
|
|
|
@staticmethod
|
|
|
|
def display_single_netdev(netdev, indent=0):
|
|
|
|
indent = " " * indent
|
2019-01-07 14:29:59 +00:00
|
|
|
print("{}(struct netdev *) {}: name = {:15}, auto_classified = {}, "
|
utilities: Add some GDB macros for ovs-vswitchd
This commit adds basic GDB macro's for ovs-vswitchd:
- ovs_dump_bridge [ports|wanted]
- ovs_dump_bridge_ports <struct bridge *>
- ovs_dump_dp_netdev [ports]
- ovs_dump_dp_netdev_ports <struct dp_netdev *>
- ovs_dump_netdev
These dump functions show limited info, but you can simply cut/paste
the address and get the full structure info. For example:
(gdb) ovs_dump_netdev
(struct netdev *) 0x555771ed89e0: name = ovs-netdev , auto_classified = false, netdev_class = 0x5557714413c0 <netdev_tap_class>
(struct netdev *) 0x555771fc62a0: name = ovs_pvp_br0 , auto_classified = false, netdev_class = 0x5557714413c0 <netdev_tap_class>
(struct netdev *) 0x555771fc9660: name = vnet0 , auto_classified = true , netdev_class = 0x555771445e00 <netdev_linux_class>
(struct netdev *) 0x555771fc78d0: name = virbr0 , auto_classified = true , netdev_class = 0x555771445e00 <netdev_linux_class>
(struct netdev *) 0x7fbefffb5540: name = dpdk0 , auto_classified = false, netdev_class = 0x5557714419e0 <dpdk_class>
(struct netdev *) 0x555771fc98b0: name = em3 , auto_classified = true , netdev_class = 0x555771445e00 <netdev_linux_class>
(struct netdev *) 0x7fbea0a31c40: name = vhost0 , auto_classified = false, netdev_class = 0x555771442040 <dpdk_vhost_client_class>
(gdb) p *((struct netdev *) 0x7fbefffb5540)
$1 = {name = 0x555771ecef70 "dpdk0", netdev_class = 0x5557714419e0 <dpdk_class>, auto_classified = false, mtu_user_config = true, ref_cnt = 2, change_seq = 12,
reconfigure_seq = 0x555771ecf2e0, last_reconfigure_seq = 110, n_txq = 2, n_rxq = 1, node = 0x555771efafe0, saved_flags_list = {prev = 0x7fbefffb5580, next = 0x7fbefffb5580}}
Signed-off-by: Eelco Chaudron <echaudro@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2018-05-09 13:47:26 +02:00
|
|
|
"netdev_class = {}".
|
|
|
|
format(indent, netdev, netdev['name'].string(),
|
|
|
|
netdev['auto_classified'], netdev['netdev_class']))
|
|
|
|
|
|
|
|
def invoke(self, arg, from_tty):
|
2018-05-31 11:13:19 +02:00
|
|
|
netdev_shash = get_global_variable('netdev_shash')
|
|
|
|
if netdev_shash is None:
|
utilities: Add some GDB macros for ovs-vswitchd
This commit adds basic GDB macro's for ovs-vswitchd:
- ovs_dump_bridge [ports|wanted]
- ovs_dump_bridge_ports <struct bridge *>
- ovs_dump_dp_netdev [ports]
- ovs_dump_dp_netdev_ports <struct dp_netdev *>
- ovs_dump_netdev
These dump functions show limited info, but you can simply cut/paste
the address and get the full structure info. For example:
(gdb) ovs_dump_netdev
(struct netdev *) 0x555771ed89e0: name = ovs-netdev , auto_classified = false, netdev_class = 0x5557714413c0 <netdev_tap_class>
(struct netdev *) 0x555771fc62a0: name = ovs_pvp_br0 , auto_classified = false, netdev_class = 0x5557714413c0 <netdev_tap_class>
(struct netdev *) 0x555771fc9660: name = vnet0 , auto_classified = true , netdev_class = 0x555771445e00 <netdev_linux_class>
(struct netdev *) 0x555771fc78d0: name = virbr0 , auto_classified = true , netdev_class = 0x555771445e00 <netdev_linux_class>
(struct netdev *) 0x7fbefffb5540: name = dpdk0 , auto_classified = false, netdev_class = 0x5557714419e0 <dpdk_class>
(struct netdev *) 0x555771fc98b0: name = em3 , auto_classified = true , netdev_class = 0x555771445e00 <netdev_linux_class>
(struct netdev *) 0x7fbea0a31c40: name = vhost0 , auto_classified = false, netdev_class = 0x555771442040 <dpdk_vhost_client_class>
(gdb) p *((struct netdev *) 0x7fbefffb5540)
$1 = {name = 0x555771ecef70 "dpdk0", netdev_class = 0x5557714419e0 <dpdk_class>, auto_classified = false, mtu_user_config = true, ref_cnt = 2, change_seq = 12,
reconfigure_seq = 0x555771ecf2e0, last_reconfigure_seq = 110, n_txq = 2, n_rxq = 1, node = 0x555771efafe0, saved_flags_list = {prev = 0x7fbefffb5580, next = 0x7fbefffb5580}}
Signed-off-by: Eelco Chaudron <echaudro@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2018-05-09 13:47:26 +02:00
|
|
|
return
|
2018-05-31 11:13:19 +02:00
|
|
|
|
utilities: Add some GDB macros for ovs-vswitchd
This commit adds basic GDB macro's for ovs-vswitchd:
- ovs_dump_bridge [ports|wanted]
- ovs_dump_bridge_ports <struct bridge *>
- ovs_dump_dp_netdev [ports]
- ovs_dump_dp_netdev_ports <struct dp_netdev *>
- ovs_dump_netdev
These dump functions show limited info, but you can simply cut/paste
the address and get the full structure info. For example:
(gdb) ovs_dump_netdev
(struct netdev *) 0x555771ed89e0: name = ovs-netdev , auto_classified = false, netdev_class = 0x5557714413c0 <netdev_tap_class>
(struct netdev *) 0x555771fc62a0: name = ovs_pvp_br0 , auto_classified = false, netdev_class = 0x5557714413c0 <netdev_tap_class>
(struct netdev *) 0x555771fc9660: name = vnet0 , auto_classified = true , netdev_class = 0x555771445e00 <netdev_linux_class>
(struct netdev *) 0x555771fc78d0: name = virbr0 , auto_classified = true , netdev_class = 0x555771445e00 <netdev_linux_class>
(struct netdev *) 0x7fbefffb5540: name = dpdk0 , auto_classified = false, netdev_class = 0x5557714419e0 <dpdk_class>
(struct netdev *) 0x555771fc98b0: name = em3 , auto_classified = true , netdev_class = 0x555771445e00 <netdev_linux_class>
(struct netdev *) 0x7fbea0a31c40: name = vhost0 , auto_classified = false, netdev_class = 0x555771442040 <dpdk_vhost_client_class>
(gdb) p *((struct netdev *) 0x7fbefffb5540)
$1 = {name = 0x555771ecef70 "dpdk0", netdev_class = 0x5557714419e0 <dpdk_class>, auto_classified = false, mtu_user_config = true, ref_cnt = 2, change_seq = 12,
reconfigure_seq = 0x555771ecf2e0, last_reconfigure_seq = 110, n_txq = 2, n_rxq = 1, node = 0x555771efafe0, saved_flags_list = {prev = 0x7fbefffb5580, next = 0x7fbefffb5580}}
Signed-off-by: Eelco Chaudron <echaudro@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2018-05-09 13:47:26 +02:00
|
|
|
for netdev in ForEachSHASH(netdev_shash, "struct netdev"):
|
|
|
|
self.display_single_netdev(netdev)
|
|
|
|
|
|
|
|
|
Utilities: Add the simap and netdev_provider dump commands to gdb
This changes add two additional gdb commands:
- ovs_dump_netdev_provider
- ovs_dump_ovs_list <struct simap *>
Here are some examples of their output:
ovs_dump_netdev_provider:
=========================
(gdb) ovs_dump_netdev_provider
(struct netdev_registered_class *) 0x2b2c540: refcnt = {count = 3},
(struct netdev_class *) 0x9555c0 = {type = tap, is_pmd = false, ...},
(struct netdev_registered_class *) 0x2b2c5a0: refcnt = {count = 2},
(struct netdev_class *) 0xc439d8 = {type = vxlan, is_pmd = false, ...},
(struct vport_class *) 0xc439d0 = { dpif_port = vxlan_sys, ... }
(struct netdev_registered_class *) 0x2b2c960: refcnt = {count = 1},
(struct netdev_class *) 0xc442f8 = {type = ip6erspan, is_pmd = false, ...},
(struct vport_class *) 0xc442f0 = { dpif_port = ip6erspan_sys, ... }
(struct netdev_registered_class *) 0x2b2c980: refcnt = {count = 1},
(struct netdev_class *) 0xc44540 = {type = ip6gre, is_pmd = false, ...},
(struct vport_class *) 0xc44538 = { dpif_port = ip6gre_sys, ... }
(struct netdev_registered_class *) 0x2b2ebe0: refcnt = {count = 3},
(struct netdev_class *) 0x95b8c0 = {type = dpdk, is_pmd = true, ...},
ovs_dump_ovs_list:
==================
(gdb) b memory_report
Breakpoint 1 at 0x753190: file lib/memory.c, line 136.
(gdb) set want_report=1
(gdb) c
Continuing.
Breakpoint 1, memory_report (usage=usage@entry=0x7fff0683d920) at lib/memory.c:136
136 {
(gdb) p usage
$20 = (const struct simap *) 0x7fff0683d920
(gdb) p* usage
$21 = {map = {buckets = 0x2b64df0, one = 0x0, mask = 3, n = 4}}
(gdb) p *usage
(gdb) ovs_dump_simap usage
handlers : 40 / 0x28
ports : 6 / 0x6
revalidators: 16 / 0x10
rules : 10 / 0xa
Signed-off-by: Eelco Chaudron <echaudro@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2018-06-01 13:21:31 +02:00
|
|
|
#
|
|
|
|
# Implements the GDB "ovs_dump_netdev_provider" command
|
|
|
|
#
|
|
|
|
class CmdDumpNetdevProvider(gdb.Command):
|
|
|
|
"""Dump all registered netdev providers.
|
utilities: Add another GDB macro for ovs-vswitchd.
This commit adds a basic packet metadata macro to the already existing
macros in ovs_gdb.py, ovs_dump_packets will print out information about
one or more packets. It feeds packets into tcpdump, and the user can
pass in tcpdump options to modify how packets are parsed or even write
out packets to a pcap file.
Example usage:
(gdb) break fast_path_processing
(gdb) commands
ovs_dump_packets packets_
continue
end
(gdb) continue
Thread 1 "ovs-vswitchd" hit Breakpoint 2, fast_path_processing ...
12:01:05.962485 ARP, Ethernet (len 6), IPv4 (len 4), Request who-has
10.1.1.1 tell 10.1.1.2, length 28
Thread 1 "ovs-vswitchd" hit Breakpoint 1, fast_path_processing ...
12:01:05.981214 ARP, Ethernet (len 6), IPv4 (len 4), Reply 10.1.1.1
is-at a6:0f:c3:f0:5f:bd (oui Unknown), length 28
Signed-off-by: Mike Pattrick <mkp@redhat.com>
Acked-by: Eelco Chaudron <echaudro@redhat.com>
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
2021-12-17 09:09:17 -05:00
|
|
|
Usage:
|
|
|
|
ovs_dump_netdev_provider
|
Utilities: Add the simap and netdev_provider dump commands to gdb
This changes add two additional gdb commands:
- ovs_dump_netdev_provider
- ovs_dump_ovs_list <struct simap *>
Here are some examples of their output:
ovs_dump_netdev_provider:
=========================
(gdb) ovs_dump_netdev_provider
(struct netdev_registered_class *) 0x2b2c540: refcnt = {count = 3},
(struct netdev_class *) 0x9555c0 = {type = tap, is_pmd = false, ...},
(struct netdev_registered_class *) 0x2b2c5a0: refcnt = {count = 2},
(struct netdev_class *) 0xc439d8 = {type = vxlan, is_pmd = false, ...},
(struct vport_class *) 0xc439d0 = { dpif_port = vxlan_sys, ... }
(struct netdev_registered_class *) 0x2b2c960: refcnt = {count = 1},
(struct netdev_class *) 0xc442f8 = {type = ip6erspan, is_pmd = false, ...},
(struct vport_class *) 0xc442f0 = { dpif_port = ip6erspan_sys, ... }
(struct netdev_registered_class *) 0x2b2c980: refcnt = {count = 1},
(struct netdev_class *) 0xc44540 = {type = ip6gre, is_pmd = false, ...},
(struct vport_class *) 0xc44538 = { dpif_port = ip6gre_sys, ... }
(struct netdev_registered_class *) 0x2b2ebe0: refcnt = {count = 3},
(struct netdev_class *) 0x95b8c0 = {type = dpdk, is_pmd = true, ...},
ovs_dump_ovs_list:
==================
(gdb) b memory_report
Breakpoint 1 at 0x753190: file lib/memory.c, line 136.
(gdb) set want_report=1
(gdb) c
Continuing.
Breakpoint 1, memory_report (usage=usage@entry=0x7fff0683d920) at lib/memory.c:136
136 {
(gdb) p usage
$20 = (const struct simap *) 0x7fff0683d920
(gdb) p* usage
$21 = {map = {buckets = 0x2b64df0, one = 0x0, mask = 3, n = 4}}
(gdb) p *usage
(gdb) ovs_dump_simap usage
handlers : 40 / 0x28
ports : 6 / 0x6
revalidators: 16 / 0x10
rules : 10 / 0xa
Signed-off-by: Eelco Chaudron <echaudro@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2018-06-01 13:21:31 +02:00
|
|
|
"""
|
|
|
|
def __init__(self):
|
|
|
|
super(CmdDumpNetdevProvider, self).__init__("ovs_dump_netdev_provider",
|
|
|
|
gdb.COMMAND_DATA)
|
|
|
|
|
|
|
|
@staticmethod
|
|
|
|
def is_class_vport_class(netdev_class):
|
|
|
|
netdev_class = netdev_class.cast(
|
|
|
|
gdb.lookup_type('struct netdev_class').pointer())
|
|
|
|
|
|
|
|
vport_construct = gdb.lookup_symbol('netdev_vport_construct')[0]
|
|
|
|
|
|
|
|
if netdev_class['construct'] == vport_construct.value():
|
|
|
|
return True
|
|
|
|
return False
|
|
|
|
|
|
|
|
@staticmethod
|
|
|
|
def display_single_netdev_provider(reg_class, indent=0):
|
|
|
|
indent = " " * indent
|
|
|
|
print("{}(struct netdev_registered_class *) {}: refcnt = {},".
|
|
|
|
format(indent, reg_class, reg_class['refcnt']))
|
|
|
|
|
|
|
|
print("{} (struct netdev_class *) 0x{:x} = {{type = {}, "
|
|
|
|
"is_pmd = {}, ...}}, ".
|
2019-12-20 18:35:08 +01:00
|
|
|
format(indent, int(reg_class['class']),
|
Utilities: Add the simap and netdev_provider dump commands to gdb
This changes add two additional gdb commands:
- ovs_dump_netdev_provider
- ovs_dump_ovs_list <struct simap *>
Here are some examples of their output:
ovs_dump_netdev_provider:
=========================
(gdb) ovs_dump_netdev_provider
(struct netdev_registered_class *) 0x2b2c540: refcnt = {count = 3},
(struct netdev_class *) 0x9555c0 = {type = tap, is_pmd = false, ...},
(struct netdev_registered_class *) 0x2b2c5a0: refcnt = {count = 2},
(struct netdev_class *) 0xc439d8 = {type = vxlan, is_pmd = false, ...},
(struct vport_class *) 0xc439d0 = { dpif_port = vxlan_sys, ... }
(struct netdev_registered_class *) 0x2b2c960: refcnt = {count = 1},
(struct netdev_class *) 0xc442f8 = {type = ip6erspan, is_pmd = false, ...},
(struct vport_class *) 0xc442f0 = { dpif_port = ip6erspan_sys, ... }
(struct netdev_registered_class *) 0x2b2c980: refcnt = {count = 1},
(struct netdev_class *) 0xc44540 = {type = ip6gre, is_pmd = false, ...},
(struct vport_class *) 0xc44538 = { dpif_port = ip6gre_sys, ... }
(struct netdev_registered_class *) 0x2b2ebe0: refcnt = {count = 3},
(struct netdev_class *) 0x95b8c0 = {type = dpdk, is_pmd = true, ...},
ovs_dump_ovs_list:
==================
(gdb) b memory_report
Breakpoint 1 at 0x753190: file lib/memory.c, line 136.
(gdb) set want_report=1
(gdb) c
Continuing.
Breakpoint 1, memory_report (usage=usage@entry=0x7fff0683d920) at lib/memory.c:136
136 {
(gdb) p usage
$20 = (const struct simap *) 0x7fff0683d920
(gdb) p* usage
$21 = {map = {buckets = 0x2b64df0, one = 0x0, mask = 3, n = 4}}
(gdb) p *usage
(gdb) ovs_dump_simap usage
handlers : 40 / 0x28
ports : 6 / 0x6
revalidators: 16 / 0x10
rules : 10 / 0xa
Signed-off-by: Eelco Chaudron <echaudro@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2018-06-01 13:21:31 +02:00
|
|
|
reg_class['class']['type'].string(),
|
|
|
|
reg_class['class']['is_pmd']))
|
|
|
|
|
|
|
|
if CmdDumpNetdevProvider.is_class_vport_class(reg_class['class']):
|
|
|
|
vport = container_of(
|
|
|
|
reg_class['class'],
|
|
|
|
gdb.lookup_type('struct vport_class').pointer(),
|
|
|
|
'netdev_class')
|
|
|
|
|
|
|
|
if vport['dpif_port'] != 0:
|
|
|
|
dpif_port = vport['dpif_port'].string()
|
|
|
|
else:
|
|
|
|
dpif_port = "\"\""
|
|
|
|
|
|
|
|
print("{} (struct vport_class *) 0x{:x} = "
|
|
|
|
"{{ dpif_port = {}, ... }}".
|
2019-12-20 18:35:08 +01:00
|
|
|
format(indent, int(vport), dpif_port))
|
Utilities: Add the simap and netdev_provider dump commands to gdb
This changes add two additional gdb commands:
- ovs_dump_netdev_provider
- ovs_dump_ovs_list <struct simap *>
Here are some examples of their output:
ovs_dump_netdev_provider:
=========================
(gdb) ovs_dump_netdev_provider
(struct netdev_registered_class *) 0x2b2c540: refcnt = {count = 3},
(struct netdev_class *) 0x9555c0 = {type = tap, is_pmd = false, ...},
(struct netdev_registered_class *) 0x2b2c5a0: refcnt = {count = 2},
(struct netdev_class *) 0xc439d8 = {type = vxlan, is_pmd = false, ...},
(struct vport_class *) 0xc439d0 = { dpif_port = vxlan_sys, ... }
(struct netdev_registered_class *) 0x2b2c960: refcnt = {count = 1},
(struct netdev_class *) 0xc442f8 = {type = ip6erspan, is_pmd = false, ...},
(struct vport_class *) 0xc442f0 = { dpif_port = ip6erspan_sys, ... }
(struct netdev_registered_class *) 0x2b2c980: refcnt = {count = 1},
(struct netdev_class *) 0xc44540 = {type = ip6gre, is_pmd = false, ...},
(struct vport_class *) 0xc44538 = { dpif_port = ip6gre_sys, ... }
(struct netdev_registered_class *) 0x2b2ebe0: refcnt = {count = 3},
(struct netdev_class *) 0x95b8c0 = {type = dpdk, is_pmd = true, ...},
ovs_dump_ovs_list:
==================
(gdb) b memory_report
Breakpoint 1 at 0x753190: file lib/memory.c, line 136.
(gdb) set want_report=1
(gdb) c
Continuing.
Breakpoint 1, memory_report (usage=usage@entry=0x7fff0683d920) at lib/memory.c:136
136 {
(gdb) p usage
$20 = (const struct simap *) 0x7fff0683d920
(gdb) p* usage
$21 = {map = {buckets = 0x2b64df0, one = 0x0, mask = 3, n = 4}}
(gdb) p *usage
(gdb) ovs_dump_simap usage
handlers : 40 / 0x28
ports : 6 / 0x6
revalidators: 16 / 0x10
rules : 10 / 0xa
Signed-off-by: Eelco Chaudron <echaudro@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2018-06-01 13:21:31 +02:00
|
|
|
|
|
|
|
def invoke(self, arg, from_tty):
|
|
|
|
netdev_classes = get_global_variable('netdev_classes')
|
|
|
|
if netdev_classes is None:
|
|
|
|
return
|
|
|
|
|
|
|
|
for reg_class in ForEachCMAP(netdev_classes,
|
|
|
|
"struct netdev_registered_class",
|
|
|
|
"cmap_node"):
|
|
|
|
self.display_single_netdev_provider(reg_class)
|
|
|
|
|
|
|
|
|
2018-05-16 17:37:11 +02:00
|
|
|
#
|
|
|
|
# Implements the GDB "ovs_dump_ovs_list" command
|
|
|
|
#
|
|
|
|
class CmdDumpOvsList(gdb.Command):
|
|
|
|
"""Dump all nodes of an ovs_list give
|
utilities: Add another GDB macro for ovs-vswitchd.
This commit adds a basic packet metadata macro to the already existing
macros in ovs_gdb.py, ovs_dump_packets will print out information about
one or more packets. It feeds packets into tcpdump, and the user can
pass in tcpdump options to modify how packets are parsed or even write
out packets to a pcap file.
Example usage:
(gdb) break fast_path_processing
(gdb) commands
ovs_dump_packets packets_
continue
end
(gdb) continue
Thread 1 "ovs-vswitchd" hit Breakpoint 2, fast_path_processing ...
12:01:05.962485 ARP, Ethernet (len 6), IPv4 (len 4), Request who-has
10.1.1.1 tell 10.1.1.2, length 28
Thread 1 "ovs-vswitchd" hit Breakpoint 1, fast_path_processing ...
12:01:05.981214 ARP, Ethernet (len 6), IPv4 (len 4), Reply 10.1.1.1
is-at a6:0f:c3:f0:5f:bd (oui Unknown), length 28
Signed-off-by: Mike Pattrick <mkp@redhat.com>
Acked-by: Eelco Chaudron <echaudro@redhat.com>
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
2021-12-17 09:09:17 -05:00
|
|
|
Usage:
|
|
|
|
ovs_dump_ovs_list <struct ovs_list *> {[<structure>] [<member>] {dump}]}
|
2018-05-16 17:37:11 +02:00
|
|
|
|
|
|
|
For example dump all the none quiescent OvS RCU threads:
|
|
|
|
|
|
|
|
(gdb) ovs_dump_ovs_list &ovsrcu_threads
|
utilities: Add another GDB macro for ovs-vswitchd.
This commit adds a basic packet metadata macro to the already existing
macros in ovs_gdb.py, ovs_dump_packets will print out information about
one or more packets. It feeds packets into tcpdump, and the user can
pass in tcpdump options to modify how packets are parsed or even write
out packets to a pcap file.
Example usage:
(gdb) break fast_path_processing
(gdb) commands
ovs_dump_packets packets_
continue
end
(gdb) continue
Thread 1 "ovs-vswitchd" hit Breakpoint 2, fast_path_processing ...
12:01:05.962485 ARP, Ethernet (len 6), IPv4 (len 4), Request who-has
10.1.1.1 tell 10.1.1.2, length 28
Thread 1 "ovs-vswitchd" hit Breakpoint 1, fast_path_processing ...
12:01:05.981214 ARP, Ethernet (len 6), IPv4 (len 4), Reply 10.1.1.1
is-at a6:0f:c3:f0:5f:bd (oui Unknown), length 28
Signed-off-by: Mike Pattrick <mkp@redhat.com>
Acked-by: Eelco Chaudron <echaudro@redhat.com>
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
2021-12-17 09:09:17 -05:00
|
|
|
(struct ovs_list *) 0x1400
|
|
|
|
(struct ovs_list *) 0xcc00
|
|
|
|
(struct ovs_list *) 0x6806
|
2018-05-16 17:37:11 +02:00
|
|
|
|
|
|
|
This is not very useful, so please use this with the container_of mode:
|
|
|
|
|
utilities: Add another GDB macro for ovs-vswitchd.
This commit adds a basic packet metadata macro to the already existing
macros in ovs_gdb.py, ovs_dump_packets will print out information about
one or more packets. It feeds packets into tcpdump, and the user can
pass in tcpdump options to modify how packets are parsed or even write
out packets to a pcap file.
Example usage:
(gdb) break fast_path_processing
(gdb) commands
ovs_dump_packets packets_
continue
end
(gdb) continue
Thread 1 "ovs-vswitchd" hit Breakpoint 2, fast_path_processing ...
12:01:05.962485 ARP, Ethernet (len 6), IPv4 (len 4), Request who-has
10.1.1.1 tell 10.1.1.2, length 28
Thread 1 "ovs-vswitchd" hit Breakpoint 1, fast_path_processing ...
12:01:05.981214 ARP, Ethernet (len 6), IPv4 (len 4), Reply 10.1.1.1
is-at a6:0f:c3:f0:5f:bd (oui Unknown), length 28
Signed-off-by: Mike Pattrick <mkp@redhat.com>
Acked-by: Eelco Chaudron <echaudro@redhat.com>
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
2021-12-17 09:09:17 -05:00
|
|
|
(gdb) set $threads = &ovsrcu_threads
|
|
|
|
(gdb) ovs_dump_ovs_list $threads 'struct ovsrcu_perthread' list_node
|
|
|
|
(struct ovsrcu_perthread *) 0x1400
|
|
|
|
(struct ovsrcu_perthread *) 0xcc00
|
|
|
|
(struct ovsrcu_perthread *) 0x6806
|
2018-05-16 17:37:11 +02:00
|
|
|
|
|
|
|
Now you can manually use the print command to show the content, or use the
|
|
|
|
dump option to dump the structure for all nodes:
|
|
|
|
|
utilities: Add another GDB macro for ovs-vswitchd.
This commit adds a basic packet metadata macro to the already existing
macros in ovs_gdb.py, ovs_dump_packets will print out information about
one or more packets. It feeds packets into tcpdump, and the user can
pass in tcpdump options to modify how packets are parsed or even write
out packets to a pcap file.
Example usage:
(gdb) break fast_path_processing
(gdb) commands
ovs_dump_packets packets_
continue
end
(gdb) continue
Thread 1 "ovs-vswitchd" hit Breakpoint 2, fast_path_processing ...
12:01:05.962485 ARP, Ethernet (len 6), IPv4 (len 4), Request who-has
10.1.1.1 tell 10.1.1.2, length 28
Thread 1 "ovs-vswitchd" hit Breakpoint 1, fast_path_processing ...
12:01:05.981214 ARP, Ethernet (len 6), IPv4 (len 4), Reply 10.1.1.1
is-at a6:0f:c3:f0:5f:bd (oui Unknown), length 28
Signed-off-by: Mike Pattrick <mkp@redhat.com>
Acked-by: Eelco Chaudron <echaudro@redhat.com>
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
2021-12-17 09:09:17 -05:00
|
|
|
(gdb) ovs_dump_ovs_list $threads 'struct ovsrcu_perthread' list_node dump
|
|
|
|
(struct ovsrcu_perthread *) 0x1400 =
|
|
|
|
{list_node = {prev = 0x48e80 <ovsrcu_threads>, next = 0xcc00}, mutex...
|
2018-05-16 17:37:11 +02:00
|
|
|
|
utilities: Add another GDB macro for ovs-vswitchd.
This commit adds a basic packet metadata macro to the already existing
macros in ovs_gdb.py, ovs_dump_packets will print out information about
one or more packets. It feeds packets into tcpdump, and the user can
pass in tcpdump options to modify how packets are parsed or even write
out packets to a pcap file.
Example usage:
(gdb) break fast_path_processing
(gdb) commands
ovs_dump_packets packets_
continue
end
(gdb) continue
Thread 1 "ovs-vswitchd" hit Breakpoint 2, fast_path_processing ...
12:01:05.962485 ARP, Ethernet (len 6), IPv4 (len 4), Request who-has
10.1.1.1 tell 10.1.1.2, length 28
Thread 1 "ovs-vswitchd" hit Breakpoint 1, fast_path_processing ...
12:01:05.981214 ARP, Ethernet (len 6), IPv4 (len 4), Reply 10.1.1.1
is-at a6:0f:c3:f0:5f:bd (oui Unknown), length 28
Signed-off-by: Mike Pattrick <mkp@redhat.com>
Acked-by: Eelco Chaudron <echaudro@redhat.com>
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
2021-12-17 09:09:17 -05:00
|
|
|
(struct ovsrcu_perthread *) 0xcc00 =
|
|
|
|
{list_node = {prev = 0x1400, next = 0x6806}, mutex ...
|
2018-05-16 17:37:11 +02:00
|
|
|
|
utilities: Add another GDB macro for ovs-vswitchd.
This commit adds a basic packet metadata macro to the already existing
macros in ovs_gdb.py, ovs_dump_packets will print out information about
one or more packets. It feeds packets into tcpdump, and the user can
pass in tcpdump options to modify how packets are parsed or even write
out packets to a pcap file.
Example usage:
(gdb) break fast_path_processing
(gdb) commands
ovs_dump_packets packets_
continue
end
(gdb) continue
Thread 1 "ovs-vswitchd" hit Breakpoint 2, fast_path_processing ...
12:01:05.962485 ARP, Ethernet (len 6), IPv4 (len 4), Request who-has
10.1.1.1 tell 10.1.1.2, length 28
Thread 1 "ovs-vswitchd" hit Breakpoint 1, fast_path_processing ...
12:01:05.981214 ARP, Ethernet (len 6), IPv4 (len 4), Reply 10.1.1.1
is-at a6:0f:c3:f0:5f:bd (oui Unknown), length 28
Signed-off-by: Mike Pattrick <mkp@redhat.com>
Acked-by: Eelco Chaudron <echaudro@redhat.com>
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
2021-12-17 09:09:17 -05:00
|
|
|
(struct ovsrcu_perthread *) 0x6806 =
|
|
|
|
{list_node = {prev = 0xcc00, next = 0x48e80 <ovsrcu_threads>}, ...
|
2018-05-16 17:37:11 +02:00
|
|
|
"""
|
|
|
|
def __init__(self):
|
|
|
|
super(CmdDumpOvsList, self).__init__("ovs_dump_ovs_list",
|
|
|
|
gdb.COMMAND_DATA)
|
|
|
|
|
|
|
|
def invoke(self, arg, from_tty):
|
|
|
|
arg_list = gdb.string_to_argv(arg)
|
|
|
|
typeobj = None
|
|
|
|
member = None
|
|
|
|
dump = False
|
|
|
|
|
|
|
|
if len(arg_list) != 1 and len(arg_list) != 3 and len(arg_list) != 4:
|
|
|
|
print("usage: ovs_dump_ovs_list <struct ovs_list *> "
|
|
|
|
"{[<structure>] [<member>] {dump}]}")
|
|
|
|
return
|
|
|
|
|
|
|
|
header = gdb.parse_and_eval(arg_list[0]).cast(
|
|
|
|
gdb.lookup_type('struct ovs_list').pointer())
|
|
|
|
|
|
|
|
if len(arg_list) >= 3:
|
|
|
|
typeobj = arg_list[1]
|
|
|
|
member = arg_list[2]
|
|
|
|
if len(arg_list) == 4 and arg_list[3] == "dump":
|
|
|
|
dump = True
|
|
|
|
|
|
|
|
for node in ForEachLIST(header.dereference()):
|
|
|
|
if typeobj is None or member is None:
|
|
|
|
print("(struct ovs_list *) {}".format(node))
|
|
|
|
else:
|
2019-01-07 14:29:59 +00:00
|
|
|
print("({} *) {} {}".format(
|
2018-05-16 17:37:11 +02:00
|
|
|
typeobj,
|
|
|
|
container_of(node,
|
2019-01-07 14:29:59 +00:00
|
|
|
gdb.lookup_type(typeobj).pointer(), member),
|
|
|
|
"=" if dump else ""))
|
2018-05-16 17:37:11 +02:00
|
|
|
if dump:
|
|
|
|
print(" {}\n".format(container_of(
|
|
|
|
node,
|
|
|
|
gdb.lookup_type(typeobj).pointer(),
|
|
|
|
member).dereference()))
|
|
|
|
|
|
|
|
|
Utilities: Add the simap and netdev_provider dump commands to gdb
This changes add two additional gdb commands:
- ovs_dump_netdev_provider
- ovs_dump_ovs_list <struct simap *>
Here are some examples of their output:
ovs_dump_netdev_provider:
=========================
(gdb) ovs_dump_netdev_provider
(struct netdev_registered_class *) 0x2b2c540: refcnt = {count = 3},
(struct netdev_class *) 0x9555c0 = {type = tap, is_pmd = false, ...},
(struct netdev_registered_class *) 0x2b2c5a0: refcnt = {count = 2},
(struct netdev_class *) 0xc439d8 = {type = vxlan, is_pmd = false, ...},
(struct vport_class *) 0xc439d0 = { dpif_port = vxlan_sys, ... }
(struct netdev_registered_class *) 0x2b2c960: refcnt = {count = 1},
(struct netdev_class *) 0xc442f8 = {type = ip6erspan, is_pmd = false, ...},
(struct vport_class *) 0xc442f0 = { dpif_port = ip6erspan_sys, ... }
(struct netdev_registered_class *) 0x2b2c980: refcnt = {count = 1},
(struct netdev_class *) 0xc44540 = {type = ip6gre, is_pmd = false, ...},
(struct vport_class *) 0xc44538 = { dpif_port = ip6gre_sys, ... }
(struct netdev_registered_class *) 0x2b2ebe0: refcnt = {count = 3},
(struct netdev_class *) 0x95b8c0 = {type = dpdk, is_pmd = true, ...},
ovs_dump_ovs_list:
==================
(gdb) b memory_report
Breakpoint 1 at 0x753190: file lib/memory.c, line 136.
(gdb) set want_report=1
(gdb) c
Continuing.
Breakpoint 1, memory_report (usage=usage@entry=0x7fff0683d920) at lib/memory.c:136
136 {
(gdb) p usage
$20 = (const struct simap *) 0x7fff0683d920
(gdb) p* usage
$21 = {map = {buckets = 0x2b64df0, one = 0x0, mask = 3, n = 4}}
(gdb) p *usage
(gdb) ovs_dump_simap usage
handlers : 40 / 0x28
ports : 6 / 0x6
revalidators: 16 / 0x10
rules : 10 / 0xa
Signed-off-by: Eelco Chaudron <echaudro@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2018-06-01 13:21:31 +02:00
|
|
|
#
|
|
|
|
# Implements the GDB "ovs_dump_simap" command
|
|
|
|
#
|
|
|
|
class CmdDumpSimap(gdb.Command):
|
2018-11-22 16:18:14 +01:00
|
|
|
"""Dump all key, value entries of a simap
|
utilities: Add another GDB macro for ovs-vswitchd.
This commit adds a basic packet metadata macro to the already existing
macros in ovs_gdb.py, ovs_dump_packets will print out information about
one or more packets. It feeds packets into tcpdump, and the user can
pass in tcpdump options to modify how packets are parsed or even write
out packets to a pcap file.
Example usage:
(gdb) break fast_path_processing
(gdb) commands
ovs_dump_packets packets_
continue
end
(gdb) continue
Thread 1 "ovs-vswitchd" hit Breakpoint 2, fast_path_processing ...
12:01:05.962485 ARP, Ethernet (len 6), IPv4 (len 4), Request who-has
10.1.1.1 tell 10.1.1.2, length 28
Thread 1 "ovs-vswitchd" hit Breakpoint 1, fast_path_processing ...
12:01:05.981214 ARP, Ethernet (len 6), IPv4 (len 4), Reply 10.1.1.1
is-at a6:0f:c3:f0:5f:bd (oui Unknown), length 28
Signed-off-by: Mike Pattrick <mkp@redhat.com>
Acked-by: Eelco Chaudron <echaudro@redhat.com>
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
2021-12-17 09:09:17 -05:00
|
|
|
Usage:
|
|
|
|
ovs_dump_simap <struct simap *>
|
Utilities: Add the simap and netdev_provider dump commands to gdb
This changes add two additional gdb commands:
- ovs_dump_netdev_provider
- ovs_dump_ovs_list <struct simap *>
Here are some examples of their output:
ovs_dump_netdev_provider:
=========================
(gdb) ovs_dump_netdev_provider
(struct netdev_registered_class *) 0x2b2c540: refcnt = {count = 3},
(struct netdev_class *) 0x9555c0 = {type = tap, is_pmd = false, ...},
(struct netdev_registered_class *) 0x2b2c5a0: refcnt = {count = 2},
(struct netdev_class *) 0xc439d8 = {type = vxlan, is_pmd = false, ...},
(struct vport_class *) 0xc439d0 = { dpif_port = vxlan_sys, ... }
(struct netdev_registered_class *) 0x2b2c960: refcnt = {count = 1},
(struct netdev_class *) 0xc442f8 = {type = ip6erspan, is_pmd = false, ...},
(struct vport_class *) 0xc442f0 = { dpif_port = ip6erspan_sys, ... }
(struct netdev_registered_class *) 0x2b2c980: refcnt = {count = 1},
(struct netdev_class *) 0xc44540 = {type = ip6gre, is_pmd = false, ...},
(struct vport_class *) 0xc44538 = { dpif_port = ip6gre_sys, ... }
(struct netdev_registered_class *) 0x2b2ebe0: refcnt = {count = 3},
(struct netdev_class *) 0x95b8c0 = {type = dpdk, is_pmd = true, ...},
ovs_dump_ovs_list:
==================
(gdb) b memory_report
Breakpoint 1 at 0x753190: file lib/memory.c, line 136.
(gdb) set want_report=1
(gdb) c
Continuing.
Breakpoint 1, memory_report (usage=usage@entry=0x7fff0683d920) at lib/memory.c:136
136 {
(gdb) p usage
$20 = (const struct simap *) 0x7fff0683d920
(gdb) p* usage
$21 = {map = {buckets = 0x2b64df0, one = 0x0, mask = 3, n = 4}}
(gdb) p *usage
(gdb) ovs_dump_simap usage
handlers : 40 / 0x28
ports : 6 / 0x6
revalidators: 16 / 0x10
rules : 10 / 0xa
Signed-off-by: Eelco Chaudron <echaudro@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2018-06-01 13:21:31 +02:00
|
|
|
"""
|
|
|
|
|
|
|
|
def __init__(self):
|
|
|
|
super(CmdDumpSimap, self).__init__("ovs_dump_simap",
|
|
|
|
gdb.COMMAND_DATA)
|
|
|
|
|
|
|
|
def invoke(self, arg, from_tty):
|
|
|
|
arg_list = gdb.string_to_argv(arg)
|
|
|
|
|
|
|
|
if len(arg_list) != 1:
|
|
|
|
print("ERROR: Missing argument!\n")
|
|
|
|
print(self.__doc__)
|
|
|
|
return
|
|
|
|
|
|
|
|
simap = gdb.parse_and_eval(arg_list[0]).cast(
|
|
|
|
gdb.lookup_type('struct simap').pointer())
|
|
|
|
|
|
|
|
values = dict()
|
|
|
|
max_name_len = 0
|
|
|
|
for name, value in ForEachSIMAP(simap.dereference()):
|
2019-12-20 18:35:08 +01:00
|
|
|
values[name.string()] = int(value)
|
Utilities: Add the simap and netdev_provider dump commands to gdb
This changes add two additional gdb commands:
- ovs_dump_netdev_provider
- ovs_dump_ovs_list <struct simap *>
Here are some examples of their output:
ovs_dump_netdev_provider:
=========================
(gdb) ovs_dump_netdev_provider
(struct netdev_registered_class *) 0x2b2c540: refcnt = {count = 3},
(struct netdev_class *) 0x9555c0 = {type = tap, is_pmd = false, ...},
(struct netdev_registered_class *) 0x2b2c5a0: refcnt = {count = 2},
(struct netdev_class *) 0xc439d8 = {type = vxlan, is_pmd = false, ...},
(struct vport_class *) 0xc439d0 = { dpif_port = vxlan_sys, ... }
(struct netdev_registered_class *) 0x2b2c960: refcnt = {count = 1},
(struct netdev_class *) 0xc442f8 = {type = ip6erspan, is_pmd = false, ...},
(struct vport_class *) 0xc442f0 = { dpif_port = ip6erspan_sys, ... }
(struct netdev_registered_class *) 0x2b2c980: refcnt = {count = 1},
(struct netdev_class *) 0xc44540 = {type = ip6gre, is_pmd = false, ...},
(struct vport_class *) 0xc44538 = { dpif_port = ip6gre_sys, ... }
(struct netdev_registered_class *) 0x2b2ebe0: refcnt = {count = 3},
(struct netdev_class *) 0x95b8c0 = {type = dpdk, is_pmd = true, ...},
ovs_dump_ovs_list:
==================
(gdb) b memory_report
Breakpoint 1 at 0x753190: file lib/memory.c, line 136.
(gdb) set want_report=1
(gdb) c
Continuing.
Breakpoint 1, memory_report (usage=usage@entry=0x7fff0683d920) at lib/memory.c:136
136 {
(gdb) p usage
$20 = (const struct simap *) 0x7fff0683d920
(gdb) p* usage
$21 = {map = {buckets = 0x2b64df0, one = 0x0, mask = 3, n = 4}}
(gdb) p *usage
(gdb) ovs_dump_simap usage
handlers : 40 / 0x28
ports : 6 / 0x6
revalidators: 16 / 0x10
rules : 10 / 0xa
Signed-off-by: Eelco Chaudron <echaudro@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2018-06-01 13:21:31 +02:00
|
|
|
if len(name.string()) > max_name_len:
|
|
|
|
max_name_len = len(name.string())
|
|
|
|
|
2019-12-20 18:35:08 +01:00
|
|
|
for name in sorted(values.keys()):
|
Utilities: Add the simap and netdev_provider dump commands to gdb
This changes add two additional gdb commands:
- ovs_dump_netdev_provider
- ovs_dump_ovs_list <struct simap *>
Here are some examples of their output:
ovs_dump_netdev_provider:
=========================
(gdb) ovs_dump_netdev_provider
(struct netdev_registered_class *) 0x2b2c540: refcnt = {count = 3},
(struct netdev_class *) 0x9555c0 = {type = tap, is_pmd = false, ...},
(struct netdev_registered_class *) 0x2b2c5a0: refcnt = {count = 2},
(struct netdev_class *) 0xc439d8 = {type = vxlan, is_pmd = false, ...},
(struct vport_class *) 0xc439d0 = { dpif_port = vxlan_sys, ... }
(struct netdev_registered_class *) 0x2b2c960: refcnt = {count = 1},
(struct netdev_class *) 0xc442f8 = {type = ip6erspan, is_pmd = false, ...},
(struct vport_class *) 0xc442f0 = { dpif_port = ip6erspan_sys, ... }
(struct netdev_registered_class *) 0x2b2c980: refcnt = {count = 1},
(struct netdev_class *) 0xc44540 = {type = ip6gre, is_pmd = false, ...},
(struct vport_class *) 0xc44538 = { dpif_port = ip6gre_sys, ... }
(struct netdev_registered_class *) 0x2b2ebe0: refcnt = {count = 3},
(struct netdev_class *) 0x95b8c0 = {type = dpdk, is_pmd = true, ...},
ovs_dump_ovs_list:
==================
(gdb) b memory_report
Breakpoint 1 at 0x753190: file lib/memory.c, line 136.
(gdb) set want_report=1
(gdb) c
Continuing.
Breakpoint 1, memory_report (usage=usage@entry=0x7fff0683d920) at lib/memory.c:136
136 {
(gdb) p usage
$20 = (const struct simap *) 0x7fff0683d920
(gdb) p* usage
$21 = {map = {buckets = 0x2b64df0, one = 0x0, mask = 3, n = 4}}
(gdb) p *usage
(gdb) ovs_dump_simap usage
handlers : 40 / 0x28
ports : 6 / 0x6
revalidators: 16 / 0x10
rules : 10 / 0xa
Signed-off-by: Eelco Chaudron <echaudro@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2018-06-01 13:21:31 +02:00
|
|
|
print("{}: {} / 0x{:x}".format(name.ljust(max_name_len),
|
|
|
|
values[name], values[name]))
|
|
|
|
|
|
|
|
|
utilities: Add upcall related commands to the GDB script
This commit adds ovs_dump_udpif_keys and ovs_show_upcall commands to the GDB script.
Here are some examples of the output:
(gdb) ovs_show_upcall
netdev@ovs-netdev:
flows : (current 0) (avg 0) (max 0) (limit 10000)
dump duration : 1ms
ufid enabled : true
39: (keys 0)
42: (keys 0)
41: (keys 0)
43: (keys 0)
44: (keys 0)
45: (keys 0)
system@ovs-system:
flows : (current 4000) (avg 4031) (max 4064) (limit 139000)
dump duration : 4ms
ufid enabled : true
99: (keys 676)
102: (keys 665)
101: (keys 656)
103: (keys 648)
104: (keys 642)
105: (keys 713)
(gdb) ovs_dump_udpif_keys
(struct udpif *) 0x1ebb830: name = netdev@ovs-netdev, total keys = 2
(struct udpif *) 0x20c6f00: name = system@ovs-system, total keys = 0
(gdb) ovs_dump_udpif_keys 0x1ebb830
(struct umap *) 0x1ef9328:
(struct udpif_key *) 0x7f36e0004e40: key_len = 132, mask_len = 144
ufid = 3e529416-83bf-bab4-5c6e-421127a9143a
hash = 0x3d96b11d, pmd_id = 1
state = UKEY_OPERATIONAL
n_packets = 2, n_bytes = 68
used = 1397047436, tcp_flags = 0x0000
(struct umap *) 0x1efb740:
(struct udpif_key *) 0x7f36dc004c20: key_len = 132, mask_len = 144
ufid = ee98d69f-8298-04dd-844a-4d2abee9f773
hash = 0x2e8077c2, pmd_id = 15
state = UKEY_OPERATIONAL
n_packets = 0, n_bytes = 0
used = 0, tcp_flags = 0x0000
(gdb) ovs_dump_udpif_keys 0x1ebb830 short
(struct umap *) 0x1ef9328:
(struct udpif_key *) 0x7f36e0004e40:
(struct umap *) 0x1efb740:
(struct udpif_key *) 0x7f36dc004c20:
Signed-off-by: Eelco Chaudron <echaudro@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2018-07-02 14:00:10 +02:00
|
|
|
#
|
2018-11-22 16:18:14 +01:00
|
|
|
# Implements the GDB "ovs_dump_smap" command
|
|
|
|
#
|
|
|
|
class CmdDumpSmap(gdb.Command):
|
|
|
|
"""Dump all key, value pairs of a smap
|
utilities: Add another GDB macro for ovs-vswitchd.
This commit adds a basic packet metadata macro to the already existing
macros in ovs_gdb.py, ovs_dump_packets will print out information about
one or more packets. It feeds packets into tcpdump, and the user can
pass in tcpdump options to modify how packets are parsed or even write
out packets to a pcap file.
Example usage:
(gdb) break fast_path_processing
(gdb) commands
ovs_dump_packets packets_
continue
end
(gdb) continue
Thread 1 "ovs-vswitchd" hit Breakpoint 2, fast_path_processing ...
12:01:05.962485 ARP, Ethernet (len 6), IPv4 (len 4), Request who-has
10.1.1.1 tell 10.1.1.2, length 28
Thread 1 "ovs-vswitchd" hit Breakpoint 1, fast_path_processing ...
12:01:05.981214 ARP, Ethernet (len 6), IPv4 (len 4), Reply 10.1.1.1
is-at a6:0f:c3:f0:5f:bd (oui Unknown), length 28
Signed-off-by: Mike Pattrick <mkp@redhat.com>
Acked-by: Eelco Chaudron <echaudro@redhat.com>
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
2021-12-17 09:09:17 -05:00
|
|
|
Usage:
|
|
|
|
ovs_dump_smap <struct smap *>
|
2018-11-22 16:18:14 +01:00
|
|
|
"""
|
|
|
|
|
|
|
|
def __init__(self):
|
|
|
|
super(CmdDumpSmap, self).__init__("ovs_dump_smap",
|
|
|
|
gdb.COMMAND_DATA)
|
|
|
|
|
|
|
|
def invoke(self, arg, from_tty):
|
|
|
|
arg_list = gdb.string_to_argv(arg)
|
|
|
|
|
|
|
|
if len(arg_list) != 1:
|
|
|
|
print("ERROR: Missing argument!\n")
|
|
|
|
print(self.__doc__)
|
|
|
|
return
|
|
|
|
|
|
|
|
smap = gdb.parse_and_eval(arg_list[0]).cast(
|
|
|
|
gdb.lookup_type('struct smap').pointer())
|
|
|
|
|
|
|
|
values = dict()
|
|
|
|
max_key_len = 0
|
|
|
|
for key, value in ForEachSMAP(smap.dereference()):
|
|
|
|
values[key.string()] = value.string()
|
|
|
|
if len(key.string()) > max_key_len:
|
|
|
|
max_key_len = len(key.string())
|
|
|
|
|
2019-12-20 18:35:08 +01:00
|
|
|
for key in sorted(values.keys()):
|
2018-11-22 16:18:14 +01:00
|
|
|
print("{}: {}".format(key.ljust(max_key_len),
|
|
|
|
values[key]))
|
|
|
|
|
|
|
|
|
|
|
|
#
|
|
|
|
# Implements the GDB "ovs_dump_udpif_keys" command
|
utilities: Add upcall related commands to the GDB script
This commit adds ovs_dump_udpif_keys and ovs_show_upcall commands to the GDB script.
Here are some examples of the output:
(gdb) ovs_show_upcall
netdev@ovs-netdev:
flows : (current 0) (avg 0) (max 0) (limit 10000)
dump duration : 1ms
ufid enabled : true
39: (keys 0)
42: (keys 0)
41: (keys 0)
43: (keys 0)
44: (keys 0)
45: (keys 0)
system@ovs-system:
flows : (current 4000) (avg 4031) (max 4064) (limit 139000)
dump duration : 4ms
ufid enabled : true
99: (keys 676)
102: (keys 665)
101: (keys 656)
103: (keys 648)
104: (keys 642)
105: (keys 713)
(gdb) ovs_dump_udpif_keys
(struct udpif *) 0x1ebb830: name = netdev@ovs-netdev, total keys = 2
(struct udpif *) 0x20c6f00: name = system@ovs-system, total keys = 0
(gdb) ovs_dump_udpif_keys 0x1ebb830
(struct umap *) 0x1ef9328:
(struct udpif_key *) 0x7f36e0004e40: key_len = 132, mask_len = 144
ufid = 3e529416-83bf-bab4-5c6e-421127a9143a
hash = 0x3d96b11d, pmd_id = 1
state = UKEY_OPERATIONAL
n_packets = 2, n_bytes = 68
used = 1397047436, tcp_flags = 0x0000
(struct umap *) 0x1efb740:
(struct udpif_key *) 0x7f36dc004c20: key_len = 132, mask_len = 144
ufid = ee98d69f-8298-04dd-844a-4d2abee9f773
hash = 0x2e8077c2, pmd_id = 15
state = UKEY_OPERATIONAL
n_packets = 0, n_bytes = 0
used = 0, tcp_flags = 0x0000
(gdb) ovs_dump_udpif_keys 0x1ebb830 short
(struct umap *) 0x1ef9328:
(struct udpif_key *) 0x7f36e0004e40:
(struct umap *) 0x1efb740:
(struct udpif_key *) 0x7f36dc004c20:
Signed-off-by: Eelco Chaudron <echaudro@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2018-07-02 14:00:10 +02:00
|
|
|
#
|
|
|
|
class CmdDumpUdpifKeys(gdb.Command):
|
|
|
|
"""Dump all nodes of an ovs_list give
|
utilities: Add another GDB macro for ovs-vswitchd.
This commit adds a basic packet metadata macro to the already existing
macros in ovs_gdb.py, ovs_dump_packets will print out information about
one or more packets. It feeds packets into tcpdump, and the user can
pass in tcpdump options to modify how packets are parsed or even write
out packets to a pcap file.
Example usage:
(gdb) break fast_path_processing
(gdb) commands
ovs_dump_packets packets_
continue
end
(gdb) continue
Thread 1 "ovs-vswitchd" hit Breakpoint 2, fast_path_processing ...
12:01:05.962485 ARP, Ethernet (len 6), IPv4 (len 4), Request who-has
10.1.1.1 tell 10.1.1.2, length 28
Thread 1 "ovs-vswitchd" hit Breakpoint 1, fast_path_processing ...
12:01:05.981214 ARP, Ethernet (len 6), IPv4 (len 4), Reply 10.1.1.1
is-at a6:0f:c3:f0:5f:bd (oui Unknown), length 28
Signed-off-by: Mike Pattrick <mkp@redhat.com>
Acked-by: Eelco Chaudron <echaudro@redhat.com>
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
2021-12-17 09:09:17 -05:00
|
|
|
Usage:
|
|
|
|
ovs_dump_udpif_keys {<udpif_name>|<udpif_address>} {short}
|
utilities: Add upcall related commands to the GDB script
This commit adds ovs_dump_udpif_keys and ovs_show_upcall commands to the GDB script.
Here are some examples of the output:
(gdb) ovs_show_upcall
netdev@ovs-netdev:
flows : (current 0) (avg 0) (max 0) (limit 10000)
dump duration : 1ms
ufid enabled : true
39: (keys 0)
42: (keys 0)
41: (keys 0)
43: (keys 0)
44: (keys 0)
45: (keys 0)
system@ovs-system:
flows : (current 4000) (avg 4031) (max 4064) (limit 139000)
dump duration : 4ms
ufid enabled : true
99: (keys 676)
102: (keys 665)
101: (keys 656)
103: (keys 648)
104: (keys 642)
105: (keys 713)
(gdb) ovs_dump_udpif_keys
(struct udpif *) 0x1ebb830: name = netdev@ovs-netdev, total keys = 2
(struct udpif *) 0x20c6f00: name = system@ovs-system, total keys = 0
(gdb) ovs_dump_udpif_keys 0x1ebb830
(struct umap *) 0x1ef9328:
(struct udpif_key *) 0x7f36e0004e40: key_len = 132, mask_len = 144
ufid = 3e529416-83bf-bab4-5c6e-421127a9143a
hash = 0x3d96b11d, pmd_id = 1
state = UKEY_OPERATIONAL
n_packets = 2, n_bytes = 68
used = 1397047436, tcp_flags = 0x0000
(struct umap *) 0x1efb740:
(struct udpif_key *) 0x7f36dc004c20: key_len = 132, mask_len = 144
ufid = ee98d69f-8298-04dd-844a-4d2abee9f773
hash = 0x2e8077c2, pmd_id = 15
state = UKEY_OPERATIONAL
n_packets = 0, n_bytes = 0
used = 0, tcp_flags = 0x0000
(gdb) ovs_dump_udpif_keys 0x1ebb830 short
(struct umap *) 0x1ef9328:
(struct udpif_key *) 0x7f36e0004e40:
(struct umap *) 0x1efb740:
(struct udpif_key *) 0x7f36dc004c20:
Signed-off-by: Eelco Chaudron <echaudro@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2018-07-02 14:00:10 +02:00
|
|
|
|
|
|
|
<udpif_name> : Full name of the udpif's dpif to dump
|
|
|
|
<udpif_address> : Address of the udpif structure to dump. If both the
|
|
|
|
<udpif_name> and <udpif_address> are omitted the
|
|
|
|
available udpif structures are displayed.
|
|
|
|
short : Only dump ukey structure addresses, no content details
|
2019-01-07 14:29:59 +00:00
|
|
|
no_count : Do not count the number of ukeys, as it might be slow
|
utilities: Add upcall related commands to the GDB script
This commit adds ovs_dump_udpif_keys and ovs_show_upcall commands to the GDB script.
Here are some examples of the output:
(gdb) ovs_show_upcall
netdev@ovs-netdev:
flows : (current 0) (avg 0) (max 0) (limit 10000)
dump duration : 1ms
ufid enabled : true
39: (keys 0)
42: (keys 0)
41: (keys 0)
43: (keys 0)
44: (keys 0)
45: (keys 0)
system@ovs-system:
flows : (current 4000) (avg 4031) (max 4064) (limit 139000)
dump duration : 4ms
ufid enabled : true
99: (keys 676)
102: (keys 665)
101: (keys 656)
103: (keys 648)
104: (keys 642)
105: (keys 713)
(gdb) ovs_dump_udpif_keys
(struct udpif *) 0x1ebb830: name = netdev@ovs-netdev, total keys = 2
(struct udpif *) 0x20c6f00: name = system@ovs-system, total keys = 0
(gdb) ovs_dump_udpif_keys 0x1ebb830
(struct umap *) 0x1ef9328:
(struct udpif_key *) 0x7f36e0004e40: key_len = 132, mask_len = 144
ufid = 3e529416-83bf-bab4-5c6e-421127a9143a
hash = 0x3d96b11d, pmd_id = 1
state = UKEY_OPERATIONAL
n_packets = 2, n_bytes = 68
used = 1397047436, tcp_flags = 0x0000
(struct umap *) 0x1efb740:
(struct udpif_key *) 0x7f36dc004c20: key_len = 132, mask_len = 144
ufid = ee98d69f-8298-04dd-844a-4d2abee9f773
hash = 0x2e8077c2, pmd_id = 15
state = UKEY_OPERATIONAL
n_packets = 0, n_bytes = 0
used = 0, tcp_flags = 0x0000
(gdb) ovs_dump_udpif_keys 0x1ebb830 short
(struct umap *) 0x1ef9328:
(struct udpif_key *) 0x7f36e0004e40:
(struct umap *) 0x1efb740:
(struct udpif_key *) 0x7f36dc004c20:
Signed-off-by: Eelco Chaudron <echaudro@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2018-07-02 14:00:10 +02:00
|
|
|
"""
|
|
|
|
|
|
|
|
def __init__(self):
|
|
|
|
super(CmdDumpUdpifKeys, self).__init__("ovs_dump_udpif_keys",
|
|
|
|
gdb.COMMAND_DATA)
|
|
|
|
|
|
|
|
def count_all_ukeys(self, udpif):
|
|
|
|
count = 0
|
2019-01-07 14:29:59 +00:00
|
|
|
spinner = ProgressIndicator("Counting all ukeys: ")
|
|
|
|
|
utilities: Add upcall related commands to the GDB script
This commit adds ovs_dump_udpif_keys and ovs_show_upcall commands to the GDB script.
Here are some examples of the output:
(gdb) ovs_show_upcall
netdev@ovs-netdev:
flows : (current 0) (avg 0) (max 0) (limit 10000)
dump duration : 1ms
ufid enabled : true
39: (keys 0)
42: (keys 0)
41: (keys 0)
43: (keys 0)
44: (keys 0)
45: (keys 0)
system@ovs-system:
flows : (current 4000) (avg 4031) (max 4064) (limit 139000)
dump duration : 4ms
ufid enabled : true
99: (keys 676)
102: (keys 665)
101: (keys 656)
103: (keys 648)
104: (keys 642)
105: (keys 713)
(gdb) ovs_dump_udpif_keys
(struct udpif *) 0x1ebb830: name = netdev@ovs-netdev, total keys = 2
(struct udpif *) 0x20c6f00: name = system@ovs-system, total keys = 0
(gdb) ovs_dump_udpif_keys 0x1ebb830
(struct umap *) 0x1ef9328:
(struct udpif_key *) 0x7f36e0004e40: key_len = 132, mask_len = 144
ufid = 3e529416-83bf-bab4-5c6e-421127a9143a
hash = 0x3d96b11d, pmd_id = 1
state = UKEY_OPERATIONAL
n_packets = 2, n_bytes = 68
used = 1397047436, tcp_flags = 0x0000
(struct umap *) 0x1efb740:
(struct udpif_key *) 0x7f36dc004c20: key_len = 132, mask_len = 144
ufid = ee98d69f-8298-04dd-844a-4d2abee9f773
hash = 0x2e8077c2, pmd_id = 15
state = UKEY_OPERATIONAL
n_packets = 0, n_bytes = 0
used = 0, tcp_flags = 0x0000
(gdb) ovs_dump_udpif_keys 0x1ebb830 short
(struct umap *) 0x1ef9328:
(struct udpif_key *) 0x7f36e0004e40:
(struct umap *) 0x1efb740:
(struct udpif_key *) 0x7f36dc004c20:
Signed-off-by: Eelco Chaudron <echaudro@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2018-07-02 14:00:10 +02:00
|
|
|
for j in range(0, N_UMAPS):
|
2019-01-07 14:29:59 +00:00
|
|
|
spinner.update()
|
utilities: Add upcall related commands to the GDB script
This commit adds ovs_dump_udpif_keys and ovs_show_upcall commands to the GDB script.
Here are some examples of the output:
(gdb) ovs_show_upcall
netdev@ovs-netdev:
flows : (current 0) (avg 0) (max 0) (limit 10000)
dump duration : 1ms
ufid enabled : true
39: (keys 0)
42: (keys 0)
41: (keys 0)
43: (keys 0)
44: (keys 0)
45: (keys 0)
system@ovs-system:
flows : (current 4000) (avg 4031) (max 4064) (limit 139000)
dump duration : 4ms
ufid enabled : true
99: (keys 676)
102: (keys 665)
101: (keys 656)
103: (keys 648)
104: (keys 642)
105: (keys 713)
(gdb) ovs_dump_udpif_keys
(struct udpif *) 0x1ebb830: name = netdev@ovs-netdev, total keys = 2
(struct udpif *) 0x20c6f00: name = system@ovs-system, total keys = 0
(gdb) ovs_dump_udpif_keys 0x1ebb830
(struct umap *) 0x1ef9328:
(struct udpif_key *) 0x7f36e0004e40: key_len = 132, mask_len = 144
ufid = 3e529416-83bf-bab4-5c6e-421127a9143a
hash = 0x3d96b11d, pmd_id = 1
state = UKEY_OPERATIONAL
n_packets = 2, n_bytes = 68
used = 1397047436, tcp_flags = 0x0000
(struct umap *) 0x1efb740:
(struct udpif_key *) 0x7f36dc004c20: key_len = 132, mask_len = 144
ufid = ee98d69f-8298-04dd-844a-4d2abee9f773
hash = 0x2e8077c2, pmd_id = 15
state = UKEY_OPERATIONAL
n_packets = 0, n_bytes = 0
used = 0, tcp_flags = 0x0000
(gdb) ovs_dump_udpif_keys 0x1ebb830 short
(struct umap *) 0x1ef9328:
(struct udpif_key *) 0x7f36e0004e40:
(struct umap *) 0x1efb740:
(struct udpif_key *) 0x7f36dc004c20:
Signed-off-by: Eelco Chaudron <echaudro@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2018-07-02 14:00:10 +02:00
|
|
|
count += udpif['ukeys'][j]['cmap']['impl']['p']['n']
|
2019-01-07 14:29:59 +00:00
|
|
|
|
|
|
|
spinner.done()
|
utilities: Add upcall related commands to the GDB script
This commit adds ovs_dump_udpif_keys and ovs_show_upcall commands to the GDB script.
Here are some examples of the output:
(gdb) ovs_show_upcall
netdev@ovs-netdev:
flows : (current 0) (avg 0) (max 0) (limit 10000)
dump duration : 1ms
ufid enabled : true
39: (keys 0)
42: (keys 0)
41: (keys 0)
43: (keys 0)
44: (keys 0)
45: (keys 0)
system@ovs-system:
flows : (current 4000) (avg 4031) (max 4064) (limit 139000)
dump duration : 4ms
ufid enabled : true
99: (keys 676)
102: (keys 665)
101: (keys 656)
103: (keys 648)
104: (keys 642)
105: (keys 713)
(gdb) ovs_dump_udpif_keys
(struct udpif *) 0x1ebb830: name = netdev@ovs-netdev, total keys = 2
(struct udpif *) 0x20c6f00: name = system@ovs-system, total keys = 0
(gdb) ovs_dump_udpif_keys 0x1ebb830
(struct umap *) 0x1ef9328:
(struct udpif_key *) 0x7f36e0004e40: key_len = 132, mask_len = 144
ufid = 3e529416-83bf-bab4-5c6e-421127a9143a
hash = 0x3d96b11d, pmd_id = 1
state = UKEY_OPERATIONAL
n_packets = 2, n_bytes = 68
used = 1397047436, tcp_flags = 0x0000
(struct umap *) 0x1efb740:
(struct udpif_key *) 0x7f36dc004c20: key_len = 132, mask_len = 144
ufid = ee98d69f-8298-04dd-844a-4d2abee9f773
hash = 0x2e8077c2, pmd_id = 15
state = UKEY_OPERATIONAL
n_packets = 0, n_bytes = 0
used = 0, tcp_flags = 0x0000
(gdb) ovs_dump_udpif_keys 0x1ebb830 short
(struct umap *) 0x1ef9328:
(struct udpif_key *) 0x7f36e0004e40:
(struct umap *) 0x1efb740:
(struct udpif_key *) 0x7f36dc004c20:
Signed-off-by: Eelco Chaudron <echaudro@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2018-07-02 14:00:10 +02:00
|
|
|
return count
|
|
|
|
|
|
|
|
def dump_all_ukeys(self, udpif, indent=0, short=False):
|
|
|
|
indent = " " * indent
|
2019-01-07 14:29:59 +00:00
|
|
|
spinner = ProgressIndicator("Walking ukeys: ")
|
utilities: Add upcall related commands to the GDB script
This commit adds ovs_dump_udpif_keys and ovs_show_upcall commands to the GDB script.
Here are some examples of the output:
(gdb) ovs_show_upcall
netdev@ovs-netdev:
flows : (current 0) (avg 0) (max 0) (limit 10000)
dump duration : 1ms
ufid enabled : true
39: (keys 0)
42: (keys 0)
41: (keys 0)
43: (keys 0)
44: (keys 0)
45: (keys 0)
system@ovs-system:
flows : (current 4000) (avg 4031) (max 4064) (limit 139000)
dump duration : 4ms
ufid enabled : true
99: (keys 676)
102: (keys 665)
101: (keys 656)
103: (keys 648)
104: (keys 642)
105: (keys 713)
(gdb) ovs_dump_udpif_keys
(struct udpif *) 0x1ebb830: name = netdev@ovs-netdev, total keys = 2
(struct udpif *) 0x20c6f00: name = system@ovs-system, total keys = 0
(gdb) ovs_dump_udpif_keys 0x1ebb830
(struct umap *) 0x1ef9328:
(struct udpif_key *) 0x7f36e0004e40: key_len = 132, mask_len = 144
ufid = 3e529416-83bf-bab4-5c6e-421127a9143a
hash = 0x3d96b11d, pmd_id = 1
state = UKEY_OPERATIONAL
n_packets = 2, n_bytes = 68
used = 1397047436, tcp_flags = 0x0000
(struct umap *) 0x1efb740:
(struct udpif_key *) 0x7f36dc004c20: key_len = 132, mask_len = 144
ufid = ee98d69f-8298-04dd-844a-4d2abee9f773
hash = 0x2e8077c2, pmd_id = 15
state = UKEY_OPERATIONAL
n_packets = 0, n_bytes = 0
used = 0, tcp_flags = 0x0000
(gdb) ovs_dump_udpif_keys 0x1ebb830 short
(struct umap *) 0x1ef9328:
(struct udpif_key *) 0x7f36e0004e40:
(struct umap *) 0x1efb740:
(struct udpif_key *) 0x7f36dc004c20:
Signed-off-by: Eelco Chaudron <echaudro@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2018-07-02 14:00:10 +02:00
|
|
|
for j in range(0, N_UMAPS):
|
2019-01-07 14:29:59 +00:00
|
|
|
spinner.update()
|
utilities: Add upcall related commands to the GDB script
This commit adds ovs_dump_udpif_keys and ovs_show_upcall commands to the GDB script.
Here are some examples of the output:
(gdb) ovs_show_upcall
netdev@ovs-netdev:
flows : (current 0) (avg 0) (max 0) (limit 10000)
dump duration : 1ms
ufid enabled : true
39: (keys 0)
42: (keys 0)
41: (keys 0)
43: (keys 0)
44: (keys 0)
45: (keys 0)
system@ovs-system:
flows : (current 4000) (avg 4031) (max 4064) (limit 139000)
dump duration : 4ms
ufid enabled : true
99: (keys 676)
102: (keys 665)
101: (keys 656)
103: (keys 648)
104: (keys 642)
105: (keys 713)
(gdb) ovs_dump_udpif_keys
(struct udpif *) 0x1ebb830: name = netdev@ovs-netdev, total keys = 2
(struct udpif *) 0x20c6f00: name = system@ovs-system, total keys = 0
(gdb) ovs_dump_udpif_keys 0x1ebb830
(struct umap *) 0x1ef9328:
(struct udpif_key *) 0x7f36e0004e40: key_len = 132, mask_len = 144
ufid = 3e529416-83bf-bab4-5c6e-421127a9143a
hash = 0x3d96b11d, pmd_id = 1
state = UKEY_OPERATIONAL
n_packets = 2, n_bytes = 68
used = 1397047436, tcp_flags = 0x0000
(struct umap *) 0x1efb740:
(struct udpif_key *) 0x7f36dc004c20: key_len = 132, mask_len = 144
ufid = ee98d69f-8298-04dd-844a-4d2abee9f773
hash = 0x2e8077c2, pmd_id = 15
state = UKEY_OPERATIONAL
n_packets = 0, n_bytes = 0
used = 0, tcp_flags = 0x0000
(gdb) ovs_dump_udpif_keys 0x1ebb830 short
(struct umap *) 0x1ef9328:
(struct udpif_key *) 0x7f36e0004e40:
(struct umap *) 0x1efb740:
(struct udpif_key *) 0x7f36dc004c20:
Signed-off-by: Eelco Chaudron <echaudro@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2018-07-02 14:00:10 +02:00
|
|
|
if udpif['ukeys'][j]['cmap']['impl']['p']['n'] != 0:
|
2019-01-07 14:29:59 +00:00
|
|
|
spinner.pause()
|
utilities: Add upcall related commands to the GDB script
This commit adds ovs_dump_udpif_keys and ovs_show_upcall commands to the GDB script.
Here are some examples of the output:
(gdb) ovs_show_upcall
netdev@ovs-netdev:
flows : (current 0) (avg 0) (max 0) (limit 10000)
dump duration : 1ms
ufid enabled : true
39: (keys 0)
42: (keys 0)
41: (keys 0)
43: (keys 0)
44: (keys 0)
45: (keys 0)
system@ovs-system:
flows : (current 4000) (avg 4031) (max 4064) (limit 139000)
dump duration : 4ms
ufid enabled : true
99: (keys 676)
102: (keys 665)
101: (keys 656)
103: (keys 648)
104: (keys 642)
105: (keys 713)
(gdb) ovs_dump_udpif_keys
(struct udpif *) 0x1ebb830: name = netdev@ovs-netdev, total keys = 2
(struct udpif *) 0x20c6f00: name = system@ovs-system, total keys = 0
(gdb) ovs_dump_udpif_keys 0x1ebb830
(struct umap *) 0x1ef9328:
(struct udpif_key *) 0x7f36e0004e40: key_len = 132, mask_len = 144
ufid = 3e529416-83bf-bab4-5c6e-421127a9143a
hash = 0x3d96b11d, pmd_id = 1
state = UKEY_OPERATIONAL
n_packets = 2, n_bytes = 68
used = 1397047436, tcp_flags = 0x0000
(struct umap *) 0x1efb740:
(struct udpif_key *) 0x7f36dc004c20: key_len = 132, mask_len = 144
ufid = ee98d69f-8298-04dd-844a-4d2abee9f773
hash = 0x2e8077c2, pmd_id = 15
state = UKEY_OPERATIONAL
n_packets = 0, n_bytes = 0
used = 0, tcp_flags = 0x0000
(gdb) ovs_dump_udpif_keys 0x1ebb830 short
(struct umap *) 0x1ef9328:
(struct udpif_key *) 0x7f36e0004e40:
(struct umap *) 0x1efb740:
(struct udpif_key *) 0x7f36dc004c20:
Signed-off-by: Eelco Chaudron <echaudro@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2018-07-02 14:00:10 +02:00
|
|
|
print("{}(struct umap *) {}:".
|
|
|
|
format(indent, udpif['ukeys'][j].address))
|
|
|
|
for ukey in ForEachCMAP(udpif['ukeys'][j]['cmap'],
|
|
|
|
"struct udpif_key", "cmap_node"):
|
|
|
|
|
|
|
|
base_str = "{} (struct udpif_key *) {}: ". \
|
|
|
|
format(indent, ukey)
|
|
|
|
if short:
|
|
|
|
print(base_str)
|
|
|
|
continue
|
|
|
|
|
|
|
|
print("{}key_len = {}, mask_len = {}".
|
|
|
|
format(base_str, ukey['key_len'], ukey['mask_len']))
|
|
|
|
|
|
|
|
indent_b = " " * len(base_str)
|
|
|
|
if ukey['ufid_present']:
|
|
|
|
print("{}ufid = {}".
|
|
|
|
format(
|
|
|
|
indent_b, str(uuid.UUID(
|
|
|
|
"{:08x}{:08x}{:08x}{:08x}".
|
2019-12-20 18:35:08 +01:00
|
|
|
format(int(ukey['ufid']['u32'][3]),
|
|
|
|
int(ukey['ufid']['u32'][2]),
|
|
|
|
int(ukey['ufid']['u32'][1]),
|
|
|
|
int(ukey['ufid']['u32'][0]))))))
|
utilities: Add upcall related commands to the GDB script
This commit adds ovs_dump_udpif_keys and ovs_show_upcall commands to the GDB script.
Here are some examples of the output:
(gdb) ovs_show_upcall
netdev@ovs-netdev:
flows : (current 0) (avg 0) (max 0) (limit 10000)
dump duration : 1ms
ufid enabled : true
39: (keys 0)
42: (keys 0)
41: (keys 0)
43: (keys 0)
44: (keys 0)
45: (keys 0)
system@ovs-system:
flows : (current 4000) (avg 4031) (max 4064) (limit 139000)
dump duration : 4ms
ufid enabled : true
99: (keys 676)
102: (keys 665)
101: (keys 656)
103: (keys 648)
104: (keys 642)
105: (keys 713)
(gdb) ovs_dump_udpif_keys
(struct udpif *) 0x1ebb830: name = netdev@ovs-netdev, total keys = 2
(struct udpif *) 0x20c6f00: name = system@ovs-system, total keys = 0
(gdb) ovs_dump_udpif_keys 0x1ebb830
(struct umap *) 0x1ef9328:
(struct udpif_key *) 0x7f36e0004e40: key_len = 132, mask_len = 144
ufid = 3e529416-83bf-bab4-5c6e-421127a9143a
hash = 0x3d96b11d, pmd_id = 1
state = UKEY_OPERATIONAL
n_packets = 2, n_bytes = 68
used = 1397047436, tcp_flags = 0x0000
(struct umap *) 0x1efb740:
(struct udpif_key *) 0x7f36dc004c20: key_len = 132, mask_len = 144
ufid = ee98d69f-8298-04dd-844a-4d2abee9f773
hash = 0x2e8077c2, pmd_id = 15
state = UKEY_OPERATIONAL
n_packets = 0, n_bytes = 0
used = 0, tcp_flags = 0x0000
(gdb) ovs_dump_udpif_keys 0x1ebb830 short
(struct umap *) 0x1ef9328:
(struct udpif_key *) 0x7f36e0004e40:
(struct umap *) 0x1efb740:
(struct udpif_key *) 0x7f36dc004c20:
Signed-off-by: Eelco Chaudron <echaudro@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2018-07-02 14:00:10 +02:00
|
|
|
|
|
|
|
print("{}hash = 0x{:8x}, pmd_id = {}".
|
2019-12-20 18:35:08 +01:00
|
|
|
format(indent_b, int(ukey['hash']), ukey['pmd_id']))
|
utilities: Add upcall related commands to the GDB script
This commit adds ovs_dump_udpif_keys and ovs_show_upcall commands to the GDB script.
Here are some examples of the output:
(gdb) ovs_show_upcall
netdev@ovs-netdev:
flows : (current 0) (avg 0) (max 0) (limit 10000)
dump duration : 1ms
ufid enabled : true
39: (keys 0)
42: (keys 0)
41: (keys 0)
43: (keys 0)
44: (keys 0)
45: (keys 0)
system@ovs-system:
flows : (current 4000) (avg 4031) (max 4064) (limit 139000)
dump duration : 4ms
ufid enabled : true
99: (keys 676)
102: (keys 665)
101: (keys 656)
103: (keys 648)
104: (keys 642)
105: (keys 713)
(gdb) ovs_dump_udpif_keys
(struct udpif *) 0x1ebb830: name = netdev@ovs-netdev, total keys = 2
(struct udpif *) 0x20c6f00: name = system@ovs-system, total keys = 0
(gdb) ovs_dump_udpif_keys 0x1ebb830
(struct umap *) 0x1ef9328:
(struct udpif_key *) 0x7f36e0004e40: key_len = 132, mask_len = 144
ufid = 3e529416-83bf-bab4-5c6e-421127a9143a
hash = 0x3d96b11d, pmd_id = 1
state = UKEY_OPERATIONAL
n_packets = 2, n_bytes = 68
used = 1397047436, tcp_flags = 0x0000
(struct umap *) 0x1efb740:
(struct udpif_key *) 0x7f36dc004c20: key_len = 132, mask_len = 144
ufid = ee98d69f-8298-04dd-844a-4d2abee9f773
hash = 0x2e8077c2, pmd_id = 15
state = UKEY_OPERATIONAL
n_packets = 0, n_bytes = 0
used = 0, tcp_flags = 0x0000
(gdb) ovs_dump_udpif_keys 0x1ebb830 short
(struct umap *) 0x1ef9328:
(struct udpif_key *) 0x7f36e0004e40:
(struct umap *) 0x1efb740:
(struct udpif_key *) 0x7f36dc004c20:
Signed-off-by: Eelco Chaudron <echaudro@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2018-07-02 14:00:10 +02:00
|
|
|
print("{}state = {}".format(indent_b, ukey['state']))
|
|
|
|
print("{}n_packets = {}, n_bytes = {}".
|
|
|
|
format(indent_b,
|
|
|
|
ukey['stats']['n_packets'],
|
|
|
|
ukey['stats']['n_bytes']))
|
|
|
|
print("{}used = {}, tcp_flags = 0x{:04x}".
|
|
|
|
format(indent_b,
|
|
|
|
ukey['stats']['used'],
|
2019-12-20 18:35:08 +01:00
|
|
|
int(ukey['stats']['tcp_flags'])))
|
utilities: Add upcall related commands to the GDB script
This commit adds ovs_dump_udpif_keys and ovs_show_upcall commands to the GDB script.
Here are some examples of the output:
(gdb) ovs_show_upcall
netdev@ovs-netdev:
flows : (current 0) (avg 0) (max 0) (limit 10000)
dump duration : 1ms
ufid enabled : true
39: (keys 0)
42: (keys 0)
41: (keys 0)
43: (keys 0)
44: (keys 0)
45: (keys 0)
system@ovs-system:
flows : (current 4000) (avg 4031) (max 4064) (limit 139000)
dump duration : 4ms
ufid enabled : true
99: (keys 676)
102: (keys 665)
101: (keys 656)
103: (keys 648)
104: (keys 642)
105: (keys 713)
(gdb) ovs_dump_udpif_keys
(struct udpif *) 0x1ebb830: name = netdev@ovs-netdev, total keys = 2
(struct udpif *) 0x20c6f00: name = system@ovs-system, total keys = 0
(gdb) ovs_dump_udpif_keys 0x1ebb830
(struct umap *) 0x1ef9328:
(struct udpif_key *) 0x7f36e0004e40: key_len = 132, mask_len = 144
ufid = 3e529416-83bf-bab4-5c6e-421127a9143a
hash = 0x3d96b11d, pmd_id = 1
state = UKEY_OPERATIONAL
n_packets = 2, n_bytes = 68
used = 1397047436, tcp_flags = 0x0000
(struct umap *) 0x1efb740:
(struct udpif_key *) 0x7f36dc004c20: key_len = 132, mask_len = 144
ufid = ee98d69f-8298-04dd-844a-4d2abee9f773
hash = 0x2e8077c2, pmd_id = 15
state = UKEY_OPERATIONAL
n_packets = 0, n_bytes = 0
used = 0, tcp_flags = 0x0000
(gdb) ovs_dump_udpif_keys 0x1ebb830 short
(struct umap *) 0x1ef9328:
(struct udpif_key *) 0x7f36e0004e40:
(struct umap *) 0x1efb740:
(struct udpif_key *) 0x7f36dc004c20:
Signed-off-by: Eelco Chaudron <echaudro@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2018-07-02 14:00:10 +02:00
|
|
|
|
|
|
|
#
|
|
|
|
# TODO: Would like to add support for dumping key, mask
|
|
|
|
# actions, and xlate_cache
|
|
|
|
#
|
|
|
|
# key = ""
|
|
|
|
# for nlattr in ForEachNL(ukey['key'], ukey['key_len']):
|
|
|
|
# key += "{}{}".format(
|
|
|
|
# "" if len(key) == 0 else ", ",
|
|
|
|
# nlattr['nla_type'].cast(
|
|
|
|
# gdb.lookup_type('enum ovs_key_attr')))
|
|
|
|
# print("{}key attributes = {}".format(indent_b, key))
|
2019-01-07 14:29:59 +00:00
|
|
|
spinner.resume()
|
|
|
|
spinner.done()
|
utilities: Add upcall related commands to the GDB script
This commit adds ovs_dump_udpif_keys and ovs_show_upcall commands to the GDB script.
Here are some examples of the output:
(gdb) ovs_show_upcall
netdev@ovs-netdev:
flows : (current 0) (avg 0) (max 0) (limit 10000)
dump duration : 1ms
ufid enabled : true
39: (keys 0)
42: (keys 0)
41: (keys 0)
43: (keys 0)
44: (keys 0)
45: (keys 0)
system@ovs-system:
flows : (current 4000) (avg 4031) (max 4064) (limit 139000)
dump duration : 4ms
ufid enabled : true
99: (keys 676)
102: (keys 665)
101: (keys 656)
103: (keys 648)
104: (keys 642)
105: (keys 713)
(gdb) ovs_dump_udpif_keys
(struct udpif *) 0x1ebb830: name = netdev@ovs-netdev, total keys = 2
(struct udpif *) 0x20c6f00: name = system@ovs-system, total keys = 0
(gdb) ovs_dump_udpif_keys 0x1ebb830
(struct umap *) 0x1ef9328:
(struct udpif_key *) 0x7f36e0004e40: key_len = 132, mask_len = 144
ufid = 3e529416-83bf-bab4-5c6e-421127a9143a
hash = 0x3d96b11d, pmd_id = 1
state = UKEY_OPERATIONAL
n_packets = 2, n_bytes = 68
used = 1397047436, tcp_flags = 0x0000
(struct umap *) 0x1efb740:
(struct udpif_key *) 0x7f36dc004c20: key_len = 132, mask_len = 144
ufid = ee98d69f-8298-04dd-844a-4d2abee9f773
hash = 0x2e8077c2, pmd_id = 15
state = UKEY_OPERATIONAL
n_packets = 0, n_bytes = 0
used = 0, tcp_flags = 0x0000
(gdb) ovs_dump_udpif_keys 0x1ebb830 short
(struct umap *) 0x1ef9328:
(struct udpif_key *) 0x7f36e0004e40:
(struct umap *) 0x1efb740:
(struct udpif_key *) 0x7f36dc004c20:
Signed-off-by: Eelco Chaudron <echaudro@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2018-07-02 14:00:10 +02:00
|
|
|
|
|
|
|
def invoke(self, arg, from_tty):
|
|
|
|
arg_list = gdb.string_to_argv(arg)
|
|
|
|
all_udpifs = get_global_variable('all_udpifs')
|
2019-01-07 14:29:59 +00:00
|
|
|
no_count = "no_count" in arg_list
|
|
|
|
|
utilities: Add upcall related commands to the GDB script
This commit adds ovs_dump_udpif_keys and ovs_show_upcall commands to the GDB script.
Here are some examples of the output:
(gdb) ovs_show_upcall
netdev@ovs-netdev:
flows : (current 0) (avg 0) (max 0) (limit 10000)
dump duration : 1ms
ufid enabled : true
39: (keys 0)
42: (keys 0)
41: (keys 0)
43: (keys 0)
44: (keys 0)
45: (keys 0)
system@ovs-system:
flows : (current 4000) (avg 4031) (max 4064) (limit 139000)
dump duration : 4ms
ufid enabled : true
99: (keys 676)
102: (keys 665)
101: (keys 656)
103: (keys 648)
104: (keys 642)
105: (keys 713)
(gdb) ovs_dump_udpif_keys
(struct udpif *) 0x1ebb830: name = netdev@ovs-netdev, total keys = 2
(struct udpif *) 0x20c6f00: name = system@ovs-system, total keys = 0
(gdb) ovs_dump_udpif_keys 0x1ebb830
(struct umap *) 0x1ef9328:
(struct udpif_key *) 0x7f36e0004e40: key_len = 132, mask_len = 144
ufid = 3e529416-83bf-bab4-5c6e-421127a9143a
hash = 0x3d96b11d, pmd_id = 1
state = UKEY_OPERATIONAL
n_packets = 2, n_bytes = 68
used = 1397047436, tcp_flags = 0x0000
(struct umap *) 0x1efb740:
(struct udpif_key *) 0x7f36dc004c20: key_len = 132, mask_len = 144
ufid = ee98d69f-8298-04dd-844a-4d2abee9f773
hash = 0x2e8077c2, pmd_id = 15
state = UKEY_OPERATIONAL
n_packets = 0, n_bytes = 0
used = 0, tcp_flags = 0x0000
(gdb) ovs_dump_udpif_keys 0x1ebb830 short
(struct umap *) 0x1ef9328:
(struct udpif_key *) 0x7f36e0004e40:
(struct umap *) 0x1efb740:
(struct udpif_key *) 0x7f36dc004c20:
Signed-off-by: Eelco Chaudron <echaudro@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2018-07-02 14:00:10 +02:00
|
|
|
if all_udpifs is None:
|
|
|
|
return
|
|
|
|
|
|
|
|
udpifs = dict()
|
|
|
|
for udpif in ForEachLIST(all_udpifs, "struct udpif", "list_node"):
|
|
|
|
udpifs[udpif['dpif']['full_name'].string()] = udpif
|
|
|
|
|
2019-01-07 14:29:59 +00:00
|
|
|
if len(arg_list) == 0 or (
|
|
|
|
len(arg_list) == 1 and arg_list[0] == "no_count"):
|
utilities: Add upcall related commands to the GDB script
This commit adds ovs_dump_udpif_keys and ovs_show_upcall commands to the GDB script.
Here are some examples of the output:
(gdb) ovs_show_upcall
netdev@ovs-netdev:
flows : (current 0) (avg 0) (max 0) (limit 10000)
dump duration : 1ms
ufid enabled : true
39: (keys 0)
42: (keys 0)
41: (keys 0)
43: (keys 0)
44: (keys 0)
45: (keys 0)
system@ovs-system:
flows : (current 4000) (avg 4031) (max 4064) (limit 139000)
dump duration : 4ms
ufid enabled : true
99: (keys 676)
102: (keys 665)
101: (keys 656)
103: (keys 648)
104: (keys 642)
105: (keys 713)
(gdb) ovs_dump_udpif_keys
(struct udpif *) 0x1ebb830: name = netdev@ovs-netdev, total keys = 2
(struct udpif *) 0x20c6f00: name = system@ovs-system, total keys = 0
(gdb) ovs_dump_udpif_keys 0x1ebb830
(struct umap *) 0x1ef9328:
(struct udpif_key *) 0x7f36e0004e40: key_len = 132, mask_len = 144
ufid = 3e529416-83bf-bab4-5c6e-421127a9143a
hash = 0x3d96b11d, pmd_id = 1
state = UKEY_OPERATIONAL
n_packets = 2, n_bytes = 68
used = 1397047436, tcp_flags = 0x0000
(struct umap *) 0x1efb740:
(struct udpif_key *) 0x7f36dc004c20: key_len = 132, mask_len = 144
ufid = ee98d69f-8298-04dd-844a-4d2abee9f773
hash = 0x2e8077c2, pmd_id = 15
state = UKEY_OPERATIONAL
n_packets = 0, n_bytes = 0
used = 0, tcp_flags = 0x0000
(gdb) ovs_dump_udpif_keys 0x1ebb830 short
(struct umap *) 0x1ef9328:
(struct udpif_key *) 0x7f36e0004e40:
(struct umap *) 0x1efb740:
(struct udpif_key *) 0x7f36dc004c20:
Signed-off-by: Eelco Chaudron <echaudro@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2018-07-02 14:00:10 +02:00
|
|
|
print("(struct udpif *) {}: name = {}, total keys = {}".
|
|
|
|
format(udpif, udpif['dpif']['full_name'].string(),
|
2019-01-07 14:29:59 +00:00
|
|
|
self.count_all_ukeys(udpif) if not no_count
|
|
|
|
else "<not counted!>"))
|
utilities: Add upcall related commands to the GDB script
This commit adds ovs_dump_udpif_keys and ovs_show_upcall commands to the GDB script.
Here are some examples of the output:
(gdb) ovs_show_upcall
netdev@ovs-netdev:
flows : (current 0) (avg 0) (max 0) (limit 10000)
dump duration : 1ms
ufid enabled : true
39: (keys 0)
42: (keys 0)
41: (keys 0)
43: (keys 0)
44: (keys 0)
45: (keys 0)
system@ovs-system:
flows : (current 4000) (avg 4031) (max 4064) (limit 139000)
dump duration : 4ms
ufid enabled : true
99: (keys 676)
102: (keys 665)
101: (keys 656)
103: (keys 648)
104: (keys 642)
105: (keys 713)
(gdb) ovs_dump_udpif_keys
(struct udpif *) 0x1ebb830: name = netdev@ovs-netdev, total keys = 2
(struct udpif *) 0x20c6f00: name = system@ovs-system, total keys = 0
(gdb) ovs_dump_udpif_keys 0x1ebb830
(struct umap *) 0x1ef9328:
(struct udpif_key *) 0x7f36e0004e40: key_len = 132, mask_len = 144
ufid = 3e529416-83bf-bab4-5c6e-421127a9143a
hash = 0x3d96b11d, pmd_id = 1
state = UKEY_OPERATIONAL
n_packets = 2, n_bytes = 68
used = 1397047436, tcp_flags = 0x0000
(struct umap *) 0x1efb740:
(struct udpif_key *) 0x7f36dc004c20: key_len = 132, mask_len = 144
ufid = ee98d69f-8298-04dd-844a-4d2abee9f773
hash = 0x2e8077c2, pmd_id = 15
state = UKEY_OPERATIONAL
n_packets = 0, n_bytes = 0
used = 0, tcp_flags = 0x0000
(gdb) ovs_dump_udpif_keys 0x1ebb830 short
(struct umap *) 0x1ef9328:
(struct udpif_key *) 0x7f36e0004e40:
(struct umap *) 0x1efb740:
(struct udpif_key *) 0x7f36dc004c20:
Signed-off-by: Eelco Chaudron <echaudro@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2018-07-02 14:00:10 +02:00
|
|
|
|
2019-01-07 14:29:59 +00:00
|
|
|
if len(arg_list) == 0 or (
|
|
|
|
len(arg_list) == 1 and arg_list[0] == "no_count"):
|
utilities: Add upcall related commands to the GDB script
This commit adds ovs_dump_udpif_keys and ovs_show_upcall commands to the GDB script.
Here are some examples of the output:
(gdb) ovs_show_upcall
netdev@ovs-netdev:
flows : (current 0) (avg 0) (max 0) (limit 10000)
dump duration : 1ms
ufid enabled : true
39: (keys 0)
42: (keys 0)
41: (keys 0)
43: (keys 0)
44: (keys 0)
45: (keys 0)
system@ovs-system:
flows : (current 4000) (avg 4031) (max 4064) (limit 139000)
dump duration : 4ms
ufid enabled : true
99: (keys 676)
102: (keys 665)
101: (keys 656)
103: (keys 648)
104: (keys 642)
105: (keys 713)
(gdb) ovs_dump_udpif_keys
(struct udpif *) 0x1ebb830: name = netdev@ovs-netdev, total keys = 2
(struct udpif *) 0x20c6f00: name = system@ovs-system, total keys = 0
(gdb) ovs_dump_udpif_keys 0x1ebb830
(struct umap *) 0x1ef9328:
(struct udpif_key *) 0x7f36e0004e40: key_len = 132, mask_len = 144
ufid = 3e529416-83bf-bab4-5c6e-421127a9143a
hash = 0x3d96b11d, pmd_id = 1
state = UKEY_OPERATIONAL
n_packets = 2, n_bytes = 68
used = 1397047436, tcp_flags = 0x0000
(struct umap *) 0x1efb740:
(struct udpif_key *) 0x7f36dc004c20: key_len = 132, mask_len = 144
ufid = ee98d69f-8298-04dd-844a-4d2abee9f773
hash = 0x2e8077c2, pmd_id = 15
state = UKEY_OPERATIONAL
n_packets = 0, n_bytes = 0
used = 0, tcp_flags = 0x0000
(gdb) ovs_dump_udpif_keys 0x1ebb830 short
(struct umap *) 0x1ef9328:
(struct udpif_key *) 0x7f36e0004e40:
(struct umap *) 0x1efb740:
(struct udpif_key *) 0x7f36dc004c20:
Signed-off-by: Eelco Chaudron <echaudro@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2018-07-02 14:00:10 +02:00
|
|
|
return
|
|
|
|
|
|
|
|
if arg_list[0] in udpifs:
|
|
|
|
udpif = udpifs[arg_list[0]]
|
|
|
|
else:
|
|
|
|
try:
|
|
|
|
udpif = gdb.parse_and_eval(arg_list[0]).cast(
|
|
|
|
gdb.lookup_type('struct udpif').pointer())
|
|
|
|
except Exception:
|
|
|
|
udpif = None
|
|
|
|
|
|
|
|
if udpif is None:
|
|
|
|
print("Can't find provided udpif address!")
|
|
|
|
return
|
|
|
|
|
|
|
|
self.dump_all_ukeys(udpif, 0, "short" in arg_list[1:])
|
|
|
|
|
|
|
|
|
2018-06-20 11:04:03 +02:00
|
|
|
#
|
|
|
|
# Implements the GDB "ovs_show_fdb" command
|
|
|
|
#
|
|
|
|
class CmdShowFDB(gdb.Command):
|
|
|
|
"""Show FDB information
|
utilities: Add another GDB macro for ovs-vswitchd.
This commit adds a basic packet metadata macro to the already existing
macros in ovs_gdb.py, ovs_dump_packets will print out information about
one or more packets. It feeds packets into tcpdump, and the user can
pass in tcpdump options to modify how packets are parsed or even write
out packets to a pcap file.
Example usage:
(gdb) break fast_path_processing
(gdb) commands
ovs_dump_packets packets_
continue
end
(gdb) continue
Thread 1 "ovs-vswitchd" hit Breakpoint 2, fast_path_processing ...
12:01:05.962485 ARP, Ethernet (len 6), IPv4 (len 4), Request who-has
10.1.1.1 tell 10.1.1.2, length 28
Thread 1 "ovs-vswitchd" hit Breakpoint 1, fast_path_processing ...
12:01:05.981214 ARP, Ethernet (len 6), IPv4 (len 4), Reply 10.1.1.1
is-at a6:0f:c3:f0:5f:bd (oui Unknown), length 28
Signed-off-by: Mike Pattrick <mkp@redhat.com>
Acked-by: Eelco Chaudron <echaudro@redhat.com>
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
2021-12-17 09:09:17 -05:00
|
|
|
Usage:
|
|
|
|
ovs_show_fdb {<bridge_name> {dbg} {hash}}
|
2018-06-20 11:04:03 +02:00
|
|
|
|
|
|
|
<bridge_name> : Optional bridge name, if not supplied FDB summary
|
|
|
|
information is displayed for all bridges.
|
|
|
|
dbg : Will show structure address information
|
|
|
|
hash : Will display the forwarding table using the hash
|
|
|
|
table, rather than the rlu list.
|
|
|
|
"""
|
|
|
|
|
|
|
|
def __init__(self):
|
|
|
|
super(CmdShowFDB, self).__init__("ovs_show_fdb",
|
|
|
|
gdb.COMMAND_DATA)
|
|
|
|
|
|
|
|
@staticmethod
|
|
|
|
def __get_port_name_num(mac_entry):
|
|
|
|
if mac_entry['mlport'] is not None:
|
|
|
|
port = mac_entry['mlport']['port'].cast(
|
|
|
|
gdb.lookup_type('struct ofbundle').pointer())
|
|
|
|
|
|
|
|
port_name = port['name'].string()
|
2019-12-20 18:35:08 +01:00
|
|
|
port_no = int(container_of(
|
2018-06-20 11:04:03 +02:00
|
|
|
port['ports']['next'],
|
|
|
|
gdb.lookup_type('struct ofport_dpif').pointer(),
|
|
|
|
'bundle_node')['up']['ofp_port'])
|
|
|
|
|
|
|
|
if port_no == 0xfff7:
|
|
|
|
port_no = "UNSET"
|
|
|
|
elif port_no == 0xfff8:
|
|
|
|
port_no = "IN_PORT"
|
|
|
|
elif port_no == 0xfff9:
|
|
|
|
port_no = "TABLE"
|
|
|
|
elif port_no == 0xfffa:
|
|
|
|
port_no = "NORMAL"
|
|
|
|
elif port_no == 0xfffb:
|
|
|
|
port_no = "FLOOD"
|
|
|
|
elif port_no == 0xfffc:
|
|
|
|
port_no = "ALL"
|
|
|
|
elif port_no == 0xfffd:
|
|
|
|
port_no = "CONTROLLER"
|
|
|
|
elif port_no == 0xfffe:
|
|
|
|
port_no = "LOCAL"
|
|
|
|
elif port_no == 0xffff:
|
|
|
|
port_no = "NONE"
|
|
|
|
else:
|
|
|
|
port_no = str(port_no)
|
|
|
|
else:
|
|
|
|
port_name = "-"
|
|
|
|
port_no = "?"
|
|
|
|
|
|
|
|
return port_name, port_no
|
|
|
|
|
|
|
|
@staticmethod
|
|
|
|
def display_ml_summary(ml, indent=0, dbg=False):
|
|
|
|
indent = " " * indent
|
|
|
|
if ml is None:
|
|
|
|
return
|
|
|
|
|
|
|
|
if dbg:
|
|
|
|
print("[(struct mac_learning *) {}]".format(ml))
|
|
|
|
|
|
|
|
print("{}table.n : {}".format(indent, ml['table']['n']))
|
2019-12-20 18:35:08 +01:00
|
|
|
print("{}secret : 0x{:x}".format(indent, int(ml['secret'])))
|
2018-06-20 11:04:03 +02:00
|
|
|
print("{}idle_time : {}".format(indent, ml['idle_time']))
|
|
|
|
print("{}max_entries : {}".format(indent, ml['max_entries']))
|
|
|
|
print("{}ref_count : {}".format(indent, ml['ref_cnt']['count']))
|
|
|
|
print("{}need_revalidate : {}".format(indent, ml['need_revalidate']))
|
|
|
|
print("{}ports_by_ptr.n : {}".format(indent, ml['ports_by_ptr']['n']))
|
|
|
|
print("{}ports_by_usage.n: {}".format(indent,
|
|
|
|
ml['ports_by_usage']['n']))
|
2018-06-25 12:57:52 +02:00
|
|
|
print("{}total_learned : {}".format(indent, ml['total_learned']))
|
|
|
|
print("{}total_expired : {}".format(indent, ml['total_expired']))
|
|
|
|
print("{}total_evicted : {}".format(indent, ml['total_evicted']))
|
|
|
|
print("{}total_moved : {}".format(indent, ml['total_moved']))
|
2018-06-20 11:04:03 +02:00
|
|
|
|
|
|
|
@staticmethod
|
|
|
|
def display_mac_entry(mac_entry, indent=0, dbg=False):
|
|
|
|
port_name, port_no = CmdShowFDB.__get_port_name_num(mac_entry)
|
|
|
|
|
|
|
|
line = "{}{:16.16} {:-4} {} {:-9}".format(
|
|
|
|
indent,
|
|
|
|
"{}[{}]".format(port_no, port_name),
|
2019-12-20 18:35:08 +01:00
|
|
|
int(mac_entry['vlan']),
|
2018-06-20 11:04:03 +02:00
|
|
|
eth_addr_to_string(mac_entry['mac']),
|
2019-12-20 18:35:08 +01:00
|
|
|
int(mac_entry['expires']))
|
2018-06-20 11:04:03 +02:00
|
|
|
|
|
|
|
if dbg:
|
|
|
|
line += " [(struct mac_entry *) {}]".format(mac_entry)
|
|
|
|
|
|
|
|
print(line)
|
|
|
|
|
|
|
|
@staticmethod
|
|
|
|
def display_ml_entries(ml, indent=0, hash=False, dbg=False):
|
|
|
|
indent = " " * indent
|
|
|
|
if ml is None:
|
|
|
|
return
|
|
|
|
|
|
|
|
print("\n{}FDB \"{}\" table:".format(indent,
|
|
|
|
"lrus" if not hash else "hash"))
|
|
|
|
print("{}port VLAN MAC Age out @".
|
|
|
|
format(indent))
|
|
|
|
print("{}----------------- ---- ----------------- ---------".
|
|
|
|
format(indent))
|
|
|
|
|
|
|
|
mac_entries = 0
|
|
|
|
|
|
|
|
if hash:
|
|
|
|
for mac_entry in ForEachHMAP(ml['table'],
|
|
|
|
"struct mac_entry",
|
|
|
|
"hmap_node"):
|
|
|
|
CmdShowFDB.display_mac_entry(mac_entry, len(indent), dbg)
|
|
|
|
mac_entries += 1
|
|
|
|
else:
|
|
|
|
for mac_entry in ForEachLIST(ml['lrus'],
|
|
|
|
"struct mac_entry",
|
|
|
|
"lru_node"):
|
|
|
|
CmdShowFDB.display_mac_entry(mac_entry, len(indent), dbg)
|
|
|
|
mac_entries += 1
|
|
|
|
|
|
|
|
print("\nTotal MAC entries: {}".format(mac_entries))
|
|
|
|
time_now = list(get_time_now())
|
|
|
|
time_now[1] = time_now[0] + time_now[1]
|
|
|
|
print("\n{}Current time is between {} and {} seconds.\n".
|
|
|
|
format(indent, min(time_now[0], time_now[1]),
|
|
|
|
max(time_now[0], time_now[1])))
|
|
|
|
|
|
|
|
def invoke(self, arg, from_tty):
|
|
|
|
arg_list = gdb.string_to_argv(arg)
|
|
|
|
|
|
|
|
all_ofproto_dpifs_by_name = get_global_variable(
|
|
|
|
'all_ofproto_dpifs_by_name')
|
|
|
|
if all_ofproto_dpifs_by_name is None:
|
|
|
|
return
|
|
|
|
|
|
|
|
all_name = dict()
|
|
|
|
max_name_len = 0
|
|
|
|
for node in ForEachHMAP(all_ofproto_dpifs_by_name,
|
|
|
|
"struct ofproto_dpif",
|
|
|
|
"all_ofproto_dpifs_by_name_node"):
|
|
|
|
|
|
|
|
all_name[node['up']['name'].string()] = node
|
|
|
|
if len(node['up']['name'].string()) > max_name_len:
|
|
|
|
max_name_len = len(node['up']['name'].string())
|
|
|
|
|
|
|
|
if len(arg_list) == 0:
|
2019-12-20 18:35:08 +01:00
|
|
|
for name in sorted(all_name.keys()):
|
2018-06-20 11:04:03 +02:00
|
|
|
print("{}: (struct mac_learning *) {}".
|
|
|
|
format(name.ljust(max_name_len),
|
|
|
|
all_name[name]['ml']))
|
|
|
|
|
|
|
|
self.display_ml_summary(all_name[name]['ml'], 4)
|
|
|
|
else:
|
|
|
|
if not arg_list[0] in all_name:
|
|
|
|
print("ERROR: Given bridge name is not known!")
|
|
|
|
return
|
|
|
|
|
|
|
|
ml = all_name[arg_list[0]]['ml']
|
|
|
|
self.display_ml_summary(ml, 0, "dbg" in arg_list[1:])
|
|
|
|
self.display_ml_entries(ml, 0, "hash" in arg_list[1:],
|
|
|
|
"dbg" in arg_list[1:])
|
|
|
|
|
utilities: Add upcall related commands to the GDB script
This commit adds ovs_dump_udpif_keys and ovs_show_upcall commands to the GDB script.
Here are some examples of the output:
(gdb) ovs_show_upcall
netdev@ovs-netdev:
flows : (current 0) (avg 0) (max 0) (limit 10000)
dump duration : 1ms
ufid enabled : true
39: (keys 0)
42: (keys 0)
41: (keys 0)
43: (keys 0)
44: (keys 0)
45: (keys 0)
system@ovs-system:
flows : (current 4000) (avg 4031) (max 4064) (limit 139000)
dump duration : 4ms
ufid enabled : true
99: (keys 676)
102: (keys 665)
101: (keys 656)
103: (keys 648)
104: (keys 642)
105: (keys 713)
(gdb) ovs_dump_udpif_keys
(struct udpif *) 0x1ebb830: name = netdev@ovs-netdev, total keys = 2
(struct udpif *) 0x20c6f00: name = system@ovs-system, total keys = 0
(gdb) ovs_dump_udpif_keys 0x1ebb830
(struct umap *) 0x1ef9328:
(struct udpif_key *) 0x7f36e0004e40: key_len = 132, mask_len = 144
ufid = 3e529416-83bf-bab4-5c6e-421127a9143a
hash = 0x3d96b11d, pmd_id = 1
state = UKEY_OPERATIONAL
n_packets = 2, n_bytes = 68
used = 1397047436, tcp_flags = 0x0000
(struct umap *) 0x1efb740:
(struct udpif_key *) 0x7f36dc004c20: key_len = 132, mask_len = 144
ufid = ee98d69f-8298-04dd-844a-4d2abee9f773
hash = 0x2e8077c2, pmd_id = 15
state = UKEY_OPERATIONAL
n_packets = 0, n_bytes = 0
used = 0, tcp_flags = 0x0000
(gdb) ovs_dump_udpif_keys 0x1ebb830 short
(struct umap *) 0x1ef9328:
(struct udpif_key *) 0x7f36e0004e40:
(struct umap *) 0x1efb740:
(struct udpif_key *) 0x7f36dc004c20:
Signed-off-by: Eelco Chaudron <echaudro@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2018-07-02 14:00:10 +02:00
|
|
|
|
|
|
|
#
|
|
|
|
# Implements the GDB "ovs_show_fdb" command
|
|
|
|
#
|
|
|
|
class CmdShowUpcall(gdb.Command):
|
|
|
|
"""Show upcall information
|
utilities: Add another GDB macro for ovs-vswitchd.
This commit adds a basic packet metadata macro to the already existing
macros in ovs_gdb.py, ovs_dump_packets will print out information about
one or more packets. It feeds packets into tcpdump, and the user can
pass in tcpdump options to modify how packets are parsed or even write
out packets to a pcap file.
Example usage:
(gdb) break fast_path_processing
(gdb) commands
ovs_dump_packets packets_
continue
end
(gdb) continue
Thread 1 "ovs-vswitchd" hit Breakpoint 2, fast_path_processing ...
12:01:05.962485 ARP, Ethernet (len 6), IPv4 (len 4), Request who-has
10.1.1.1 tell 10.1.1.2, length 28
Thread 1 "ovs-vswitchd" hit Breakpoint 1, fast_path_processing ...
12:01:05.981214 ARP, Ethernet (len 6), IPv4 (len 4), Reply 10.1.1.1
is-at a6:0f:c3:f0:5f:bd (oui Unknown), length 28
Signed-off-by: Mike Pattrick <mkp@redhat.com>
Acked-by: Eelco Chaudron <echaudro@redhat.com>
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
2021-12-17 09:09:17 -05:00
|
|
|
Usage:
|
|
|
|
ovs_show_upcall {dbg}
|
utilities: Add upcall related commands to the GDB script
This commit adds ovs_dump_udpif_keys and ovs_show_upcall commands to the GDB script.
Here are some examples of the output:
(gdb) ovs_show_upcall
netdev@ovs-netdev:
flows : (current 0) (avg 0) (max 0) (limit 10000)
dump duration : 1ms
ufid enabled : true
39: (keys 0)
42: (keys 0)
41: (keys 0)
43: (keys 0)
44: (keys 0)
45: (keys 0)
system@ovs-system:
flows : (current 4000) (avg 4031) (max 4064) (limit 139000)
dump duration : 4ms
ufid enabled : true
99: (keys 676)
102: (keys 665)
101: (keys 656)
103: (keys 648)
104: (keys 642)
105: (keys 713)
(gdb) ovs_dump_udpif_keys
(struct udpif *) 0x1ebb830: name = netdev@ovs-netdev, total keys = 2
(struct udpif *) 0x20c6f00: name = system@ovs-system, total keys = 0
(gdb) ovs_dump_udpif_keys 0x1ebb830
(struct umap *) 0x1ef9328:
(struct udpif_key *) 0x7f36e0004e40: key_len = 132, mask_len = 144
ufid = 3e529416-83bf-bab4-5c6e-421127a9143a
hash = 0x3d96b11d, pmd_id = 1
state = UKEY_OPERATIONAL
n_packets = 2, n_bytes = 68
used = 1397047436, tcp_flags = 0x0000
(struct umap *) 0x1efb740:
(struct udpif_key *) 0x7f36dc004c20: key_len = 132, mask_len = 144
ufid = ee98d69f-8298-04dd-844a-4d2abee9f773
hash = 0x2e8077c2, pmd_id = 15
state = UKEY_OPERATIONAL
n_packets = 0, n_bytes = 0
used = 0, tcp_flags = 0x0000
(gdb) ovs_dump_udpif_keys 0x1ebb830 short
(struct umap *) 0x1ef9328:
(struct udpif_key *) 0x7f36e0004e40:
(struct umap *) 0x1efb740:
(struct udpif_key *) 0x7f36dc004c20:
Signed-off-by: Eelco Chaudron <echaudro@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2018-07-02 14:00:10 +02:00
|
|
|
|
|
|
|
dbg : Will show structure address information
|
|
|
|
"""
|
|
|
|
|
|
|
|
def __init__(self):
|
|
|
|
super(CmdShowUpcall, self).__init__("ovs_show_upcall",
|
|
|
|
gdb.COMMAND_DATA)
|
|
|
|
|
|
|
|
@staticmethod
|
|
|
|
def display_udpif_upcall(udpif, indent=0, dbg=False):
|
|
|
|
indent = " " * indent
|
|
|
|
|
|
|
|
enable_ufid = get_global_variable('enable_ufid')
|
|
|
|
if enable_ufid is None:
|
|
|
|
return
|
|
|
|
|
|
|
|
dbg_str = ""
|
|
|
|
if dbg:
|
|
|
|
dbg_str = ", ((struct udpif *) {})".format(udpif)
|
|
|
|
|
|
|
|
print("{}{}{}:".format(
|
|
|
|
indent, udpif['dpif']['full_name'].string(),
|
|
|
|
dbg_str))
|
|
|
|
|
|
|
|
print("{} flows : (current {}) (avg {}) (max {}) (limit {})".
|
|
|
|
format(indent, udpif['n_flows'], udpif['avg_n_flows'],
|
|
|
|
udpif['max_n_flows'], udpif['flow_limit']))
|
|
|
|
print("{} dump duration : {}ms".
|
|
|
|
format(indent, udpif['dump_duration']))
|
|
|
|
print("{} ufid enabled : {}\n".
|
|
|
|
format(indent, enable_ufid &
|
|
|
|
udpif['backer']['rt_support']['ufid']))
|
|
|
|
|
|
|
|
for i in range(0, int(udpif['n_revalidators'])):
|
|
|
|
revalidator = udpif['revalidators'][i]
|
|
|
|
|
|
|
|
dbg_str = ""
|
|
|
|
if dbg:
|
|
|
|
dbg_str = ", ((struct revalidator *) {})".\
|
|
|
|
format(revalidator.address)
|
|
|
|
|
|
|
|
count = 0
|
|
|
|
j = i
|
2019-01-07 14:29:59 +00:00
|
|
|
spinner = ProgressIndicator("Counting all ukeys: ")
|
utilities: Add upcall related commands to the GDB script
This commit adds ovs_dump_udpif_keys and ovs_show_upcall commands to the GDB script.
Here are some examples of the output:
(gdb) ovs_show_upcall
netdev@ovs-netdev:
flows : (current 0) (avg 0) (max 0) (limit 10000)
dump duration : 1ms
ufid enabled : true
39: (keys 0)
42: (keys 0)
41: (keys 0)
43: (keys 0)
44: (keys 0)
45: (keys 0)
system@ovs-system:
flows : (current 4000) (avg 4031) (max 4064) (limit 139000)
dump duration : 4ms
ufid enabled : true
99: (keys 676)
102: (keys 665)
101: (keys 656)
103: (keys 648)
104: (keys 642)
105: (keys 713)
(gdb) ovs_dump_udpif_keys
(struct udpif *) 0x1ebb830: name = netdev@ovs-netdev, total keys = 2
(struct udpif *) 0x20c6f00: name = system@ovs-system, total keys = 0
(gdb) ovs_dump_udpif_keys 0x1ebb830
(struct umap *) 0x1ef9328:
(struct udpif_key *) 0x7f36e0004e40: key_len = 132, mask_len = 144
ufid = 3e529416-83bf-bab4-5c6e-421127a9143a
hash = 0x3d96b11d, pmd_id = 1
state = UKEY_OPERATIONAL
n_packets = 2, n_bytes = 68
used = 1397047436, tcp_flags = 0x0000
(struct umap *) 0x1efb740:
(struct udpif_key *) 0x7f36dc004c20: key_len = 132, mask_len = 144
ufid = ee98d69f-8298-04dd-844a-4d2abee9f773
hash = 0x2e8077c2, pmd_id = 15
state = UKEY_OPERATIONAL
n_packets = 0, n_bytes = 0
used = 0, tcp_flags = 0x0000
(gdb) ovs_dump_udpif_keys 0x1ebb830 short
(struct umap *) 0x1ef9328:
(struct udpif_key *) 0x7f36e0004e40:
(struct umap *) 0x1efb740:
(struct udpif_key *) 0x7f36dc004c20:
Signed-off-by: Eelco Chaudron <echaudro@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2018-07-02 14:00:10 +02:00
|
|
|
while j < N_UMAPS:
|
2019-01-07 14:29:59 +00:00
|
|
|
spinner.update()
|
utilities: Add upcall related commands to the GDB script
This commit adds ovs_dump_udpif_keys and ovs_show_upcall commands to the GDB script.
Here are some examples of the output:
(gdb) ovs_show_upcall
netdev@ovs-netdev:
flows : (current 0) (avg 0) (max 0) (limit 10000)
dump duration : 1ms
ufid enabled : true
39: (keys 0)
42: (keys 0)
41: (keys 0)
43: (keys 0)
44: (keys 0)
45: (keys 0)
system@ovs-system:
flows : (current 4000) (avg 4031) (max 4064) (limit 139000)
dump duration : 4ms
ufid enabled : true
99: (keys 676)
102: (keys 665)
101: (keys 656)
103: (keys 648)
104: (keys 642)
105: (keys 713)
(gdb) ovs_dump_udpif_keys
(struct udpif *) 0x1ebb830: name = netdev@ovs-netdev, total keys = 2
(struct udpif *) 0x20c6f00: name = system@ovs-system, total keys = 0
(gdb) ovs_dump_udpif_keys 0x1ebb830
(struct umap *) 0x1ef9328:
(struct udpif_key *) 0x7f36e0004e40: key_len = 132, mask_len = 144
ufid = 3e529416-83bf-bab4-5c6e-421127a9143a
hash = 0x3d96b11d, pmd_id = 1
state = UKEY_OPERATIONAL
n_packets = 2, n_bytes = 68
used = 1397047436, tcp_flags = 0x0000
(struct umap *) 0x1efb740:
(struct udpif_key *) 0x7f36dc004c20: key_len = 132, mask_len = 144
ufid = ee98d69f-8298-04dd-844a-4d2abee9f773
hash = 0x2e8077c2, pmd_id = 15
state = UKEY_OPERATIONAL
n_packets = 0, n_bytes = 0
used = 0, tcp_flags = 0x0000
(gdb) ovs_dump_udpif_keys 0x1ebb830 short
(struct umap *) 0x1ef9328:
(struct udpif_key *) 0x7f36e0004e40:
(struct umap *) 0x1efb740:
(struct udpif_key *) 0x7f36dc004c20:
Signed-off-by: Eelco Chaudron <echaudro@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2018-07-02 14:00:10 +02:00
|
|
|
count += udpif['ukeys'][j]['cmap']['impl']['p']['n']
|
|
|
|
j += int(udpif['n_revalidators'])
|
|
|
|
|
2019-01-07 14:29:59 +00:00
|
|
|
spinner.done()
|
utilities: Add upcall related commands to the GDB script
This commit adds ovs_dump_udpif_keys and ovs_show_upcall commands to the GDB script.
Here are some examples of the output:
(gdb) ovs_show_upcall
netdev@ovs-netdev:
flows : (current 0) (avg 0) (max 0) (limit 10000)
dump duration : 1ms
ufid enabled : true
39: (keys 0)
42: (keys 0)
41: (keys 0)
43: (keys 0)
44: (keys 0)
45: (keys 0)
system@ovs-system:
flows : (current 4000) (avg 4031) (max 4064) (limit 139000)
dump duration : 4ms
ufid enabled : true
99: (keys 676)
102: (keys 665)
101: (keys 656)
103: (keys 648)
104: (keys 642)
105: (keys 713)
(gdb) ovs_dump_udpif_keys
(struct udpif *) 0x1ebb830: name = netdev@ovs-netdev, total keys = 2
(struct udpif *) 0x20c6f00: name = system@ovs-system, total keys = 0
(gdb) ovs_dump_udpif_keys 0x1ebb830
(struct umap *) 0x1ef9328:
(struct udpif_key *) 0x7f36e0004e40: key_len = 132, mask_len = 144
ufid = 3e529416-83bf-bab4-5c6e-421127a9143a
hash = 0x3d96b11d, pmd_id = 1
state = UKEY_OPERATIONAL
n_packets = 2, n_bytes = 68
used = 1397047436, tcp_flags = 0x0000
(struct umap *) 0x1efb740:
(struct udpif_key *) 0x7f36dc004c20: key_len = 132, mask_len = 144
ufid = ee98d69f-8298-04dd-844a-4d2abee9f773
hash = 0x2e8077c2, pmd_id = 15
state = UKEY_OPERATIONAL
n_packets = 0, n_bytes = 0
used = 0, tcp_flags = 0x0000
(gdb) ovs_dump_udpif_keys 0x1ebb830 short
(struct umap *) 0x1ef9328:
(struct udpif_key *) 0x7f36e0004e40:
(struct umap *) 0x1efb740:
(struct udpif_key *) 0x7f36dc004c20:
Signed-off-by: Eelco Chaudron <echaudro@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2018-07-02 14:00:10 +02:00
|
|
|
print("{} {}: (keys {}){}".
|
|
|
|
format(indent, revalidator['id'], count, dbg_str))
|
|
|
|
|
|
|
|
print("")
|
|
|
|
|
|
|
|
def invoke(self, arg, from_tty):
|
|
|
|
arg_list = gdb.string_to_argv(arg)
|
|
|
|
|
|
|
|
all_udpifs = get_global_variable('all_udpifs')
|
|
|
|
if all_udpifs is None:
|
|
|
|
return
|
|
|
|
|
|
|
|
for udpif in ForEachLIST(all_udpifs, "struct udpif", "list_node"):
|
|
|
|
self.display_udpif_upcall(udpif, 0, "dbg" in arg_list)
|
|
|
|
|
|
|
|
|
Utilities: Add the ovs_dump_ofpacts command to gdb
This adds the ovs_dump_ifpacts command:
(gdb) help ovs_dump_ofpacts
Dump all actions in an ofpacts set
Usage: ovs_dump_ofpacts <struct ofpact *> <ofpacts_len>
<struct ofpact *> : Pointer to set of ofpact structures.
<ofpacts_len> : Total length of the set.
Example dumping all actions when in the clone_xlate_actions() function:
(gdb) ovs_dump_ofpacts actions actions_len
(struct ofpact *) 0x561c7be487c8: {type = OFPACT_SET_FIELD, raw = 255 '', len = 24}
(struct ofpact *) 0x561c7be487e0: {type = OFPACT_SET_FIELD, raw = 255 '', len = 24}
(struct ofpact *) 0x561c7be487f8: {type = OFPACT_SET_FIELD, raw = 255 '', len = 24}
(struct ofpact *) 0x561c7be48810: {type = OFPACT_SET_FIELD, raw = 255 '', len = 32}
(struct ofpact *) 0x561c7be48830: {type = OFPACT_SET_FIELD, raw = 255 '', len = 24}
(struct ofpact *) 0x561c7be48848: {type = OFPACT_RESUBMIT, raw = 38 '&', len = 16}
Signed-off-by: Eelco Chaudron <echaudro@redhat.com>
Signed-off-by: William Tu <u9012063@gmail.com>
2020-04-17 14:51:34 +02:00
|
|
|
#
|
|
|
|
# Implements the GDB "ovs_dump_ofpacts" command
|
|
|
|
#
|
|
|
|
class CmdDumpOfpacts(gdb.Command):
|
|
|
|
"""Dump all actions in an ofpacts set
|
utilities: Add another GDB macro for ovs-vswitchd.
This commit adds a basic packet metadata macro to the already existing
macros in ovs_gdb.py, ovs_dump_packets will print out information about
one or more packets. It feeds packets into tcpdump, and the user can
pass in tcpdump options to modify how packets are parsed or even write
out packets to a pcap file.
Example usage:
(gdb) break fast_path_processing
(gdb) commands
ovs_dump_packets packets_
continue
end
(gdb) continue
Thread 1 "ovs-vswitchd" hit Breakpoint 2, fast_path_processing ...
12:01:05.962485 ARP, Ethernet (len 6), IPv4 (len 4), Request who-has
10.1.1.1 tell 10.1.1.2, length 28
Thread 1 "ovs-vswitchd" hit Breakpoint 1, fast_path_processing ...
12:01:05.981214 ARP, Ethernet (len 6), IPv4 (len 4), Reply 10.1.1.1
is-at a6:0f:c3:f0:5f:bd (oui Unknown), length 28
Signed-off-by: Mike Pattrick <mkp@redhat.com>
Acked-by: Eelco Chaudron <echaudro@redhat.com>
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
2021-12-17 09:09:17 -05:00
|
|
|
Usage:
|
|
|
|
ovs_dump_ofpacts <struct ofpact *> <ofpacts_len>
|
Utilities: Add the ovs_dump_ofpacts command to gdb
This adds the ovs_dump_ifpacts command:
(gdb) help ovs_dump_ofpacts
Dump all actions in an ofpacts set
Usage: ovs_dump_ofpacts <struct ofpact *> <ofpacts_len>
<struct ofpact *> : Pointer to set of ofpact structures.
<ofpacts_len> : Total length of the set.
Example dumping all actions when in the clone_xlate_actions() function:
(gdb) ovs_dump_ofpacts actions actions_len
(struct ofpact *) 0x561c7be487c8: {type = OFPACT_SET_FIELD, raw = 255 '', len = 24}
(struct ofpact *) 0x561c7be487e0: {type = OFPACT_SET_FIELD, raw = 255 '', len = 24}
(struct ofpact *) 0x561c7be487f8: {type = OFPACT_SET_FIELD, raw = 255 '', len = 24}
(struct ofpact *) 0x561c7be48810: {type = OFPACT_SET_FIELD, raw = 255 '', len = 32}
(struct ofpact *) 0x561c7be48830: {type = OFPACT_SET_FIELD, raw = 255 '', len = 24}
(struct ofpact *) 0x561c7be48848: {type = OFPACT_RESUBMIT, raw = 38 '&', len = 16}
Signed-off-by: Eelco Chaudron <echaudro@redhat.com>
Signed-off-by: William Tu <u9012063@gmail.com>
2020-04-17 14:51:34 +02:00
|
|
|
|
|
|
|
<struct ofpact *> : Pointer to set of ofpact structures.
|
|
|
|
<ofpacts_len> : Total length of the set.
|
|
|
|
|
|
|
|
Example dumping all actions when in the clone_xlate_actions() function:
|
|
|
|
|
|
|
|
(gdb) ovs_dump_ofpacts actions actions_len
|
utilities: Add another GDB macro for ovs-vswitchd.
This commit adds a basic packet metadata macro to the already existing
macros in ovs_gdb.py, ovs_dump_packets will print out information about
one or more packets. It feeds packets into tcpdump, and the user can
pass in tcpdump options to modify how packets are parsed or even write
out packets to a pcap file.
Example usage:
(gdb) break fast_path_processing
(gdb) commands
ovs_dump_packets packets_
continue
end
(gdb) continue
Thread 1 "ovs-vswitchd" hit Breakpoint 2, fast_path_processing ...
12:01:05.962485 ARP, Ethernet (len 6), IPv4 (len 4), Request who-has
10.1.1.1 tell 10.1.1.2, length 28
Thread 1 "ovs-vswitchd" hit Breakpoint 1, fast_path_processing ...
12:01:05.981214 ARP, Ethernet (len 6), IPv4 (len 4), Reply 10.1.1.1
is-at a6:0f:c3:f0:5f:bd (oui Unknown), length 28
Signed-off-by: Mike Pattrick <mkp@redhat.com>
Acked-by: Eelco Chaudron <echaudro@redhat.com>
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
2021-12-17 09:09:17 -05:00
|
|
|
(struct ofpact *) 0x87c8: {type = OFPACT_SET_FIELD, raw = 255 '', len = 24}
|
|
|
|
(struct ofpact *) 0x87e0: {type = OFPACT_SET_FIELD, raw = 255 '', len = 24}
|
|
|
|
(struct ofpact *) 0x87f8: {type = OFPACT_SET_FIELD, raw = 255 '', len = 24}
|
|
|
|
(struct ofpact *) 0x8810: {type = OFPACT_SET_FIELD, raw = 255 '', len = 32}
|
|
|
|
(struct ofpact *) 0x8830: {type = OFPACT_SET_FIELD, raw = 255 '', len = 24}
|
|
|
|
(struct ofpact *) 0x8848: {type = OFPACT_RESUBMIT, raw = 38 '&', len = 16}
|
Utilities: Add the ovs_dump_ofpacts command to gdb
This adds the ovs_dump_ifpacts command:
(gdb) help ovs_dump_ofpacts
Dump all actions in an ofpacts set
Usage: ovs_dump_ofpacts <struct ofpact *> <ofpacts_len>
<struct ofpact *> : Pointer to set of ofpact structures.
<ofpacts_len> : Total length of the set.
Example dumping all actions when in the clone_xlate_actions() function:
(gdb) ovs_dump_ofpacts actions actions_len
(struct ofpact *) 0x561c7be487c8: {type = OFPACT_SET_FIELD, raw = 255 '', len = 24}
(struct ofpact *) 0x561c7be487e0: {type = OFPACT_SET_FIELD, raw = 255 '', len = 24}
(struct ofpact *) 0x561c7be487f8: {type = OFPACT_SET_FIELD, raw = 255 '', len = 24}
(struct ofpact *) 0x561c7be48810: {type = OFPACT_SET_FIELD, raw = 255 '', len = 32}
(struct ofpact *) 0x561c7be48830: {type = OFPACT_SET_FIELD, raw = 255 '', len = 24}
(struct ofpact *) 0x561c7be48848: {type = OFPACT_RESUBMIT, raw = 38 '&', len = 16}
Signed-off-by: Eelco Chaudron <echaudro@redhat.com>
Signed-off-by: William Tu <u9012063@gmail.com>
2020-04-17 14:51:34 +02:00
|
|
|
"""
|
|
|
|
def __init__(self):
|
|
|
|
super(CmdDumpOfpacts, self).__init__("ovs_dump_ofpacts",
|
|
|
|
gdb.COMMAND_DATA)
|
|
|
|
|
|
|
|
def invoke(self, arg, from_tty):
|
|
|
|
arg_list = gdb.string_to_argv(arg)
|
|
|
|
|
|
|
|
if len(arg_list) != 2:
|
|
|
|
print("usage: ovs_dump_ofpacts <struct ofpact *> <ofpacts_len>")
|
|
|
|
return
|
|
|
|
|
|
|
|
ofpacts = gdb.parse_and_eval(arg_list[0]).cast(
|
|
|
|
gdb.lookup_type('struct ofpact').pointer())
|
|
|
|
|
|
|
|
length = gdb.parse_and_eval(arg_list[1])
|
|
|
|
|
|
|
|
for node in ForEachOFPACTS(ofpacts, length):
|
|
|
|
print("(struct ofpact *) {}: {}".format(node, node.dereference()))
|
|
|
|
|
|
|
|
|
utilities: Add another GDB macro for ovs-vswitchd.
This commit adds a basic packet metadata macro to the already existing
macros in ovs_gdb.py, ovs_dump_packets will print out information about
one or more packets. It feeds packets into tcpdump, and the user can
pass in tcpdump options to modify how packets are parsed or even write
out packets to a pcap file.
Example usage:
(gdb) break fast_path_processing
(gdb) commands
ovs_dump_packets packets_
continue
end
(gdb) continue
Thread 1 "ovs-vswitchd" hit Breakpoint 2, fast_path_processing ...
12:01:05.962485 ARP, Ethernet (len 6), IPv4 (len 4), Request who-has
10.1.1.1 tell 10.1.1.2, length 28
Thread 1 "ovs-vswitchd" hit Breakpoint 1, fast_path_processing ...
12:01:05.981214 ARP, Ethernet (len 6), IPv4 (len 4), Reply 10.1.1.1
is-at a6:0f:c3:f0:5f:bd (oui Unknown), length 28
Signed-off-by: Mike Pattrick <mkp@redhat.com>
Acked-by: Eelco Chaudron <echaudro@redhat.com>
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
2021-12-17 09:09:17 -05:00
|
|
|
#
|
|
|
|
# Implements the GDB "ovs_dump_packets" command
|
|
|
|
#
|
|
|
|
class CmdDumpPackets(gdb.Command):
|
|
|
|
"""Dump metadata about dp_packets
|
|
|
|
Usage:
|
|
|
|
ovs_dump_packets <struct dp_packet_batch|dp_packet> [tcpdump options]
|
|
|
|
|
|
|
|
This command can take either a dp_packet_batch struct and print out
|
|
|
|
metadata about all packets in this batch, or a single dp_packet struct and
|
|
|
|
print out metadata about a single packet.
|
|
|
|
|
|
|
|
Everything after the struct reference is passed into tcpdump. If nothing
|
|
|
|
is passed in as a tcpdump option, the default is "-n".
|
|
|
|
|
|
|
|
(gdb) ovs_dump_packets packets_
|
|
|
|
12:01:05.981214 ARP, Ethernet (len 6), IPv4 (len 4), Reply 10.1.1.1 is-at
|
|
|
|
a6:0f:c3:f0:5f:bd (oui Unknown), length 28
|
|
|
|
"""
|
|
|
|
def __init__(self):
|
|
|
|
super().__init__("ovs_dump_packets", gdb.COMMAND_DATA)
|
|
|
|
|
|
|
|
def invoke(self, arg, from_tty):
|
|
|
|
if Ether is None:
|
|
|
|
print("ERROR: This command requires scapy to be installed.")
|
|
|
|
return
|
|
|
|
|
|
|
|
arg_list = gdb.string_to_argv(arg)
|
|
|
|
if len(arg_list) == 0:
|
|
|
|
print("Usage: ovs_dump_packets <struct dp_packet_batch|"
|
|
|
|
"dp_packet> [tcpdump options]")
|
|
|
|
return
|
|
|
|
|
|
|
|
symb_name = arg_list[0]
|
|
|
|
tcpdump_args = arg_list[1:]
|
|
|
|
|
|
|
|
if not tcpdump_args:
|
|
|
|
# Add a sane default
|
|
|
|
tcpdump_args = ["-n"]
|
|
|
|
|
|
|
|
val = gdb.parse_and_eval(symb_name)
|
|
|
|
while val.type.code == gdb.TYPE_CODE_PTR:
|
|
|
|
val = val.dereference()
|
|
|
|
|
|
|
|
pkt_list = []
|
|
|
|
if str(val.type).startswith("struct dp_packet_batch"):
|
|
|
|
for idx in range(val['count']):
|
|
|
|
pkt_struct = val['packets'][idx].dereference()
|
|
|
|
pkt = self.extract_pkt(pkt_struct)
|
|
|
|
if pkt is None:
|
|
|
|
continue
|
|
|
|
pkt_list.append(pkt)
|
|
|
|
elif str(val.type) == "struct dp_packet":
|
|
|
|
pkt = self.extract_pkt(val)
|
|
|
|
if pkt is None:
|
|
|
|
return
|
|
|
|
pkt_list.append(pkt)
|
|
|
|
else:
|
|
|
|
print("Error, unsupported argument type: {}".format(str(val.type)))
|
|
|
|
return
|
|
|
|
|
2022-04-29 16:03:02 -04:00
|
|
|
stdout = tcpdump(pkt_list, args=tcpdump_args, getfd=True, quiet=True)
|
|
|
|
gdb.write(stdout.read().decode("utf8", "replace"))
|
utilities: Add another GDB macro for ovs-vswitchd.
This commit adds a basic packet metadata macro to the already existing
macros in ovs_gdb.py, ovs_dump_packets will print out information about
one or more packets. It feeds packets into tcpdump, and the user can
pass in tcpdump options to modify how packets are parsed or even write
out packets to a pcap file.
Example usage:
(gdb) break fast_path_processing
(gdb) commands
ovs_dump_packets packets_
continue
end
(gdb) continue
Thread 1 "ovs-vswitchd" hit Breakpoint 2, fast_path_processing ...
12:01:05.962485 ARP, Ethernet (len 6), IPv4 (len 4), Request who-has
10.1.1.1 tell 10.1.1.2, length 28
Thread 1 "ovs-vswitchd" hit Breakpoint 1, fast_path_processing ...
12:01:05.981214 ARP, Ethernet (len 6), IPv4 (len 4), Reply 10.1.1.1
is-at a6:0f:c3:f0:5f:bd (oui Unknown), length 28
Signed-off-by: Mike Pattrick <mkp@redhat.com>
Acked-by: Eelco Chaudron <echaudro@redhat.com>
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
2021-12-17 09:09:17 -05:00
|
|
|
|
|
|
|
def extract_pkt(self, pkt):
|
|
|
|
pkt_fields = pkt.type.keys()
|
|
|
|
if pkt['packet_type'] != 0:
|
|
|
|
return
|
|
|
|
if pkt['l3_ofs'] == 0xFFFF:
|
|
|
|
return
|
|
|
|
|
|
|
|
if "mbuf" in pkt_fields:
|
|
|
|
if pkt['mbuf']['data_off'] == 0xFFFF:
|
|
|
|
return
|
|
|
|
eth_ptr = pkt['mbuf']['buf_addr']
|
|
|
|
eth_off = int(pkt['mbuf']['data_off'])
|
|
|
|
eth_len = int(pkt['mbuf']['pkt_len'])
|
|
|
|
else:
|
|
|
|
if pkt['data_ofs'] == 0xFFFF:
|
|
|
|
return
|
|
|
|
eth_ptr = pkt['base_']
|
|
|
|
eth_off = int(pkt['data_ofs'])
|
|
|
|
eth_len = int(pkt['size_'])
|
|
|
|
|
|
|
|
if eth_ptr == 0 or eth_len < 1:
|
|
|
|
return
|
|
|
|
|
|
|
|
# Extract packet
|
|
|
|
pkt_ptr = eth_ptr.cast(
|
|
|
|
gdb.lookup_type('uint8_t').pointer()
|
|
|
|
)
|
|
|
|
pkt_ptr += eth_off
|
|
|
|
|
|
|
|
pkt_data = []
|
|
|
|
for idx in range(eth_len):
|
|
|
|
pkt_data.append(int(pkt_ptr[idx]))
|
|
|
|
|
|
|
|
pkt_data = struct.pack("{}B".format(eth_len), *pkt_data)
|
|
|
|
|
|
|
|
packet = Ether(pkt_data)
|
|
|
|
packet.len = int(eth_len)
|
|
|
|
|
|
|
|
return packet
|
|
|
|
|
|
|
|
|
utilities: Add some GDB macros for ovs-vswitchd
This commit adds basic GDB macro's for ovs-vswitchd:
- ovs_dump_bridge [ports|wanted]
- ovs_dump_bridge_ports <struct bridge *>
- ovs_dump_dp_netdev [ports]
- ovs_dump_dp_netdev_ports <struct dp_netdev *>
- ovs_dump_netdev
These dump functions show limited info, but you can simply cut/paste
the address and get the full structure info. For example:
(gdb) ovs_dump_netdev
(struct netdev *) 0x555771ed89e0: name = ovs-netdev , auto_classified = false, netdev_class = 0x5557714413c0 <netdev_tap_class>
(struct netdev *) 0x555771fc62a0: name = ovs_pvp_br0 , auto_classified = false, netdev_class = 0x5557714413c0 <netdev_tap_class>
(struct netdev *) 0x555771fc9660: name = vnet0 , auto_classified = true , netdev_class = 0x555771445e00 <netdev_linux_class>
(struct netdev *) 0x555771fc78d0: name = virbr0 , auto_classified = true , netdev_class = 0x555771445e00 <netdev_linux_class>
(struct netdev *) 0x7fbefffb5540: name = dpdk0 , auto_classified = false, netdev_class = 0x5557714419e0 <dpdk_class>
(struct netdev *) 0x555771fc98b0: name = em3 , auto_classified = true , netdev_class = 0x555771445e00 <netdev_linux_class>
(struct netdev *) 0x7fbea0a31c40: name = vhost0 , auto_classified = false, netdev_class = 0x555771442040 <dpdk_vhost_client_class>
(gdb) p *((struct netdev *) 0x7fbefffb5540)
$1 = {name = 0x555771ecef70 "dpdk0", netdev_class = 0x5557714419e0 <dpdk_class>, auto_classified = false, mtu_user_config = true, ref_cnt = 2, change_seq = 12,
reconfigure_seq = 0x555771ecf2e0, last_reconfigure_seq = 110, n_txq = 2, n_rxq = 1, node = 0x555771efafe0, saved_flags_list = {prev = 0x7fbefffb5580, next = 0x7fbefffb5580}}
Signed-off-by: Eelco Chaudron <echaudro@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2018-05-09 13:47:26 +02:00
|
|
|
#
|
|
|
|
# Initialize all GDB commands
|
|
|
|
#
|
|
|
|
CmdDumpBridge()
|
|
|
|
CmdDumpBridgePorts()
|
|
|
|
CmdDumpDpNetdev()
|
2018-05-16 17:37:11 +02:00
|
|
|
CmdDumpDpNetdevPollThreads()
|
utilities: Add some GDB macros for ovs-vswitchd
This commit adds basic GDB macro's for ovs-vswitchd:
- ovs_dump_bridge [ports|wanted]
- ovs_dump_bridge_ports <struct bridge *>
- ovs_dump_dp_netdev [ports]
- ovs_dump_dp_netdev_ports <struct dp_netdev *>
- ovs_dump_netdev
These dump functions show limited info, but you can simply cut/paste
the address and get the full structure info. For example:
(gdb) ovs_dump_netdev
(struct netdev *) 0x555771ed89e0: name = ovs-netdev , auto_classified = false, netdev_class = 0x5557714413c0 <netdev_tap_class>
(struct netdev *) 0x555771fc62a0: name = ovs_pvp_br0 , auto_classified = false, netdev_class = 0x5557714413c0 <netdev_tap_class>
(struct netdev *) 0x555771fc9660: name = vnet0 , auto_classified = true , netdev_class = 0x555771445e00 <netdev_linux_class>
(struct netdev *) 0x555771fc78d0: name = virbr0 , auto_classified = true , netdev_class = 0x555771445e00 <netdev_linux_class>
(struct netdev *) 0x7fbefffb5540: name = dpdk0 , auto_classified = false, netdev_class = 0x5557714419e0 <dpdk_class>
(struct netdev *) 0x555771fc98b0: name = em3 , auto_classified = true , netdev_class = 0x555771445e00 <netdev_linux_class>
(struct netdev *) 0x7fbea0a31c40: name = vhost0 , auto_classified = false, netdev_class = 0x555771442040 <dpdk_vhost_client_class>
(gdb) p *((struct netdev *) 0x7fbefffb5540)
$1 = {name = 0x555771ecef70 "dpdk0", netdev_class = 0x5557714419e0 <dpdk_class>, auto_classified = false, mtu_user_config = true, ref_cnt = 2, change_seq = 12,
reconfigure_seq = 0x555771ecf2e0, last_reconfigure_seq = 110, n_txq = 2, n_rxq = 1, node = 0x555771efafe0, saved_flags_list = {prev = 0x7fbefffb5580, next = 0x7fbefffb5580}}
Signed-off-by: Eelco Chaudron <echaudro@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2018-05-09 13:47:26 +02:00
|
|
|
CmdDumpDpNetdevPorts()
|
2018-05-31 11:13:19 +02:00
|
|
|
CmdDumpDpProvider()
|
utilities: Add some GDB macros for ovs-vswitchd
This commit adds basic GDB macro's for ovs-vswitchd:
- ovs_dump_bridge [ports|wanted]
- ovs_dump_bridge_ports <struct bridge *>
- ovs_dump_dp_netdev [ports]
- ovs_dump_dp_netdev_ports <struct dp_netdev *>
- ovs_dump_netdev
These dump functions show limited info, but you can simply cut/paste
the address and get the full structure info. For example:
(gdb) ovs_dump_netdev
(struct netdev *) 0x555771ed89e0: name = ovs-netdev , auto_classified = false, netdev_class = 0x5557714413c0 <netdev_tap_class>
(struct netdev *) 0x555771fc62a0: name = ovs_pvp_br0 , auto_classified = false, netdev_class = 0x5557714413c0 <netdev_tap_class>
(struct netdev *) 0x555771fc9660: name = vnet0 , auto_classified = true , netdev_class = 0x555771445e00 <netdev_linux_class>
(struct netdev *) 0x555771fc78d0: name = virbr0 , auto_classified = true , netdev_class = 0x555771445e00 <netdev_linux_class>
(struct netdev *) 0x7fbefffb5540: name = dpdk0 , auto_classified = false, netdev_class = 0x5557714419e0 <dpdk_class>
(struct netdev *) 0x555771fc98b0: name = em3 , auto_classified = true , netdev_class = 0x555771445e00 <netdev_linux_class>
(struct netdev *) 0x7fbea0a31c40: name = vhost0 , auto_classified = false, netdev_class = 0x555771442040 <dpdk_vhost_client_class>
(gdb) p *((struct netdev *) 0x7fbefffb5540)
$1 = {name = 0x555771ecef70 "dpdk0", netdev_class = 0x5557714419e0 <dpdk_class>, auto_classified = false, mtu_user_config = true, ref_cnt = 2, change_seq = 12,
reconfigure_seq = 0x555771ecf2e0, last_reconfigure_seq = 110, n_txq = 2, n_rxq = 1, node = 0x555771efafe0, saved_flags_list = {prev = 0x7fbefffb5580, next = 0x7fbefffb5580}}
Signed-off-by: Eelco Chaudron <echaudro@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2018-05-09 13:47:26 +02:00
|
|
|
CmdDumpNetdev()
|
Utilities: Add the simap and netdev_provider dump commands to gdb
This changes add two additional gdb commands:
- ovs_dump_netdev_provider
- ovs_dump_ovs_list <struct simap *>
Here are some examples of their output:
ovs_dump_netdev_provider:
=========================
(gdb) ovs_dump_netdev_provider
(struct netdev_registered_class *) 0x2b2c540: refcnt = {count = 3},
(struct netdev_class *) 0x9555c0 = {type = tap, is_pmd = false, ...},
(struct netdev_registered_class *) 0x2b2c5a0: refcnt = {count = 2},
(struct netdev_class *) 0xc439d8 = {type = vxlan, is_pmd = false, ...},
(struct vport_class *) 0xc439d0 = { dpif_port = vxlan_sys, ... }
(struct netdev_registered_class *) 0x2b2c960: refcnt = {count = 1},
(struct netdev_class *) 0xc442f8 = {type = ip6erspan, is_pmd = false, ...},
(struct vport_class *) 0xc442f0 = { dpif_port = ip6erspan_sys, ... }
(struct netdev_registered_class *) 0x2b2c980: refcnt = {count = 1},
(struct netdev_class *) 0xc44540 = {type = ip6gre, is_pmd = false, ...},
(struct vport_class *) 0xc44538 = { dpif_port = ip6gre_sys, ... }
(struct netdev_registered_class *) 0x2b2ebe0: refcnt = {count = 3},
(struct netdev_class *) 0x95b8c0 = {type = dpdk, is_pmd = true, ...},
ovs_dump_ovs_list:
==================
(gdb) b memory_report
Breakpoint 1 at 0x753190: file lib/memory.c, line 136.
(gdb) set want_report=1
(gdb) c
Continuing.
Breakpoint 1, memory_report (usage=usage@entry=0x7fff0683d920) at lib/memory.c:136
136 {
(gdb) p usage
$20 = (const struct simap *) 0x7fff0683d920
(gdb) p* usage
$21 = {map = {buckets = 0x2b64df0, one = 0x0, mask = 3, n = 4}}
(gdb) p *usage
(gdb) ovs_dump_simap usage
handlers : 40 / 0x28
ports : 6 / 0x6
revalidators: 16 / 0x10
rules : 10 / 0xa
Signed-off-by: Eelco Chaudron <echaudro@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2018-06-01 13:21:31 +02:00
|
|
|
CmdDumpNetdevProvider()
|
Utilities: Add the ovs_dump_ofpacts command to gdb
This adds the ovs_dump_ifpacts command:
(gdb) help ovs_dump_ofpacts
Dump all actions in an ofpacts set
Usage: ovs_dump_ofpacts <struct ofpact *> <ofpacts_len>
<struct ofpact *> : Pointer to set of ofpact structures.
<ofpacts_len> : Total length of the set.
Example dumping all actions when in the clone_xlate_actions() function:
(gdb) ovs_dump_ofpacts actions actions_len
(struct ofpact *) 0x561c7be487c8: {type = OFPACT_SET_FIELD, raw = 255 '', len = 24}
(struct ofpact *) 0x561c7be487e0: {type = OFPACT_SET_FIELD, raw = 255 '', len = 24}
(struct ofpact *) 0x561c7be487f8: {type = OFPACT_SET_FIELD, raw = 255 '', len = 24}
(struct ofpact *) 0x561c7be48810: {type = OFPACT_SET_FIELD, raw = 255 '', len = 32}
(struct ofpact *) 0x561c7be48830: {type = OFPACT_SET_FIELD, raw = 255 '', len = 24}
(struct ofpact *) 0x561c7be48848: {type = OFPACT_RESUBMIT, raw = 38 '&', len = 16}
Signed-off-by: Eelco Chaudron <echaudro@redhat.com>
Signed-off-by: William Tu <u9012063@gmail.com>
2020-04-17 14:51:34 +02:00
|
|
|
CmdDumpOfpacts()
|
2018-05-16 17:37:11 +02:00
|
|
|
CmdDumpOvsList()
|
utilities: Add another GDB macro for ovs-vswitchd.
This commit adds a basic packet metadata macro to the already existing
macros in ovs_gdb.py, ovs_dump_packets will print out information about
one or more packets. It feeds packets into tcpdump, and the user can
pass in tcpdump options to modify how packets are parsed or even write
out packets to a pcap file.
Example usage:
(gdb) break fast_path_processing
(gdb) commands
ovs_dump_packets packets_
continue
end
(gdb) continue
Thread 1 "ovs-vswitchd" hit Breakpoint 2, fast_path_processing ...
12:01:05.962485 ARP, Ethernet (len 6), IPv4 (len 4), Request who-has
10.1.1.1 tell 10.1.1.2, length 28
Thread 1 "ovs-vswitchd" hit Breakpoint 1, fast_path_processing ...
12:01:05.981214 ARP, Ethernet (len 6), IPv4 (len 4), Reply 10.1.1.1
is-at a6:0f:c3:f0:5f:bd (oui Unknown), length 28
Signed-off-by: Mike Pattrick <mkp@redhat.com>
Acked-by: Eelco Chaudron <echaudro@redhat.com>
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
2021-12-17 09:09:17 -05:00
|
|
|
CmdDumpPackets()
|
Utilities: Add the simap and netdev_provider dump commands to gdb
This changes add two additional gdb commands:
- ovs_dump_netdev_provider
- ovs_dump_ovs_list <struct simap *>
Here are some examples of their output:
ovs_dump_netdev_provider:
=========================
(gdb) ovs_dump_netdev_provider
(struct netdev_registered_class *) 0x2b2c540: refcnt = {count = 3},
(struct netdev_class *) 0x9555c0 = {type = tap, is_pmd = false, ...},
(struct netdev_registered_class *) 0x2b2c5a0: refcnt = {count = 2},
(struct netdev_class *) 0xc439d8 = {type = vxlan, is_pmd = false, ...},
(struct vport_class *) 0xc439d0 = { dpif_port = vxlan_sys, ... }
(struct netdev_registered_class *) 0x2b2c960: refcnt = {count = 1},
(struct netdev_class *) 0xc442f8 = {type = ip6erspan, is_pmd = false, ...},
(struct vport_class *) 0xc442f0 = { dpif_port = ip6erspan_sys, ... }
(struct netdev_registered_class *) 0x2b2c980: refcnt = {count = 1},
(struct netdev_class *) 0xc44540 = {type = ip6gre, is_pmd = false, ...},
(struct vport_class *) 0xc44538 = { dpif_port = ip6gre_sys, ... }
(struct netdev_registered_class *) 0x2b2ebe0: refcnt = {count = 3},
(struct netdev_class *) 0x95b8c0 = {type = dpdk, is_pmd = true, ...},
ovs_dump_ovs_list:
==================
(gdb) b memory_report
Breakpoint 1 at 0x753190: file lib/memory.c, line 136.
(gdb) set want_report=1
(gdb) c
Continuing.
Breakpoint 1, memory_report (usage=usage@entry=0x7fff0683d920) at lib/memory.c:136
136 {
(gdb) p usage
$20 = (const struct simap *) 0x7fff0683d920
(gdb) p* usage
$21 = {map = {buckets = 0x2b64df0, one = 0x0, mask = 3, n = 4}}
(gdb) p *usage
(gdb) ovs_dump_simap usage
handlers : 40 / 0x28
ports : 6 / 0x6
revalidators: 16 / 0x10
rules : 10 / 0xa
Signed-off-by: Eelco Chaudron <echaudro@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2018-06-01 13:21:31 +02:00
|
|
|
CmdDumpSimap()
|
2018-11-22 16:18:14 +01:00
|
|
|
CmdDumpSmap()
|
utilities: Add upcall related commands to the GDB script
This commit adds ovs_dump_udpif_keys and ovs_show_upcall commands to the GDB script.
Here are some examples of the output:
(gdb) ovs_show_upcall
netdev@ovs-netdev:
flows : (current 0) (avg 0) (max 0) (limit 10000)
dump duration : 1ms
ufid enabled : true
39: (keys 0)
42: (keys 0)
41: (keys 0)
43: (keys 0)
44: (keys 0)
45: (keys 0)
system@ovs-system:
flows : (current 4000) (avg 4031) (max 4064) (limit 139000)
dump duration : 4ms
ufid enabled : true
99: (keys 676)
102: (keys 665)
101: (keys 656)
103: (keys 648)
104: (keys 642)
105: (keys 713)
(gdb) ovs_dump_udpif_keys
(struct udpif *) 0x1ebb830: name = netdev@ovs-netdev, total keys = 2
(struct udpif *) 0x20c6f00: name = system@ovs-system, total keys = 0
(gdb) ovs_dump_udpif_keys 0x1ebb830
(struct umap *) 0x1ef9328:
(struct udpif_key *) 0x7f36e0004e40: key_len = 132, mask_len = 144
ufid = 3e529416-83bf-bab4-5c6e-421127a9143a
hash = 0x3d96b11d, pmd_id = 1
state = UKEY_OPERATIONAL
n_packets = 2, n_bytes = 68
used = 1397047436, tcp_flags = 0x0000
(struct umap *) 0x1efb740:
(struct udpif_key *) 0x7f36dc004c20: key_len = 132, mask_len = 144
ufid = ee98d69f-8298-04dd-844a-4d2abee9f773
hash = 0x2e8077c2, pmd_id = 15
state = UKEY_OPERATIONAL
n_packets = 0, n_bytes = 0
used = 0, tcp_flags = 0x0000
(gdb) ovs_dump_udpif_keys 0x1ebb830 short
(struct umap *) 0x1ef9328:
(struct udpif_key *) 0x7f36e0004e40:
(struct umap *) 0x1efb740:
(struct udpif_key *) 0x7f36dc004c20:
Signed-off-by: Eelco Chaudron <echaudro@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2018-07-02 14:00:10 +02:00
|
|
|
CmdDumpUdpifKeys()
|
2018-06-20 11:04:03 +02:00
|
|
|
CmdShowFDB()
|
utilities: Add upcall related commands to the GDB script
This commit adds ovs_dump_udpif_keys and ovs_show_upcall commands to the GDB script.
Here are some examples of the output:
(gdb) ovs_show_upcall
netdev@ovs-netdev:
flows : (current 0) (avg 0) (max 0) (limit 10000)
dump duration : 1ms
ufid enabled : true
39: (keys 0)
42: (keys 0)
41: (keys 0)
43: (keys 0)
44: (keys 0)
45: (keys 0)
system@ovs-system:
flows : (current 4000) (avg 4031) (max 4064) (limit 139000)
dump duration : 4ms
ufid enabled : true
99: (keys 676)
102: (keys 665)
101: (keys 656)
103: (keys 648)
104: (keys 642)
105: (keys 713)
(gdb) ovs_dump_udpif_keys
(struct udpif *) 0x1ebb830: name = netdev@ovs-netdev, total keys = 2
(struct udpif *) 0x20c6f00: name = system@ovs-system, total keys = 0
(gdb) ovs_dump_udpif_keys 0x1ebb830
(struct umap *) 0x1ef9328:
(struct udpif_key *) 0x7f36e0004e40: key_len = 132, mask_len = 144
ufid = 3e529416-83bf-bab4-5c6e-421127a9143a
hash = 0x3d96b11d, pmd_id = 1
state = UKEY_OPERATIONAL
n_packets = 2, n_bytes = 68
used = 1397047436, tcp_flags = 0x0000
(struct umap *) 0x1efb740:
(struct udpif_key *) 0x7f36dc004c20: key_len = 132, mask_len = 144
ufid = ee98d69f-8298-04dd-844a-4d2abee9f773
hash = 0x2e8077c2, pmd_id = 15
state = UKEY_OPERATIONAL
n_packets = 0, n_bytes = 0
used = 0, tcp_flags = 0x0000
(gdb) ovs_dump_udpif_keys 0x1ebb830 short
(struct umap *) 0x1ef9328:
(struct udpif_key *) 0x7f36e0004e40:
(struct umap *) 0x1efb740:
(struct udpif_key *) 0x7f36dc004c20:
Signed-off-by: Eelco Chaudron <echaudro@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2018-07-02 14:00:10 +02:00
|
|
|
CmdShowUpcall()
|