diff options
author | Ramu Ramamurthy <ramu.ramamurthy@gmail.com> | 2016-09-01 18:38:58 +0000 |
---|---|---|
committer | Ben Pfaff <blp@ovn.org> | 2016-09-14 16:00:11 -0700 |
commit | 9240e9ab989162b7f0034eaf4c5cce5e60abc420 (patch) | |
tree | 4b1977975c3faa52d90d9eb3d26527ba81329a92 /ovn | |
parent | 57afd0c040f6138e1559b462184a02d33931a52f (diff) | |
download | openvswitch-9240e9ab989162b7f0034eaf4c5cce5e60abc420.tar.gz |
ovn: log dhcp responses for debugging
Add a few messages at INFO to help debug the vif lifecycle.
A logsearch on mac or ip helps debug what happened to the
vif and when. This helps easily correlate logs across CMS and ovn.
Logs appear like this:
2016-09-01T18:15:48Z|00014|binding|INFO|Claiming lport eee1a9af-7513-4540-9385-9e3972bfca05 for this chassis.
2016-09-01T18:15:48Z|00015|binding|INFO|Claiming fa:16:3e:01:c3:4a 10.0.0.7 fd93:b509:aa46:0:f816:3eff:fe01:c34a
2016-09-01T18:15:59Z|00016|pinctrl|INFO|DHCPOFFER fa:16:3e:01:c3:4a 10.0.0.7
2016-09-01T18:15:59Z|00017|pinctrl|INFO|DHCPACK fa:16:3e:01:c3:4a 10.0.0.7
2016-09-01T18:16:22Z|00018|binding|INFO|Releasing lport eee1a9af-7513-4540-9385-9e3972bfca05 from this chassis.
2016-09-01T18:16:22Z|00019|binding|INFO|Releasing fa:16:3e:01:c3:4a 10.0.0.7 fd93:b509:aa46:0:f816:3eff:fe01:c34a
Signed-off-by: Ramu Ramamurthy <ramu.ramamurthy@us.ibm.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
Diffstat (limited to 'ovn')
-rw-r--r-- | ovn/controller/binding.c | 6 | ||||
-rw-r--r-- | ovn/controller/pinctrl.c | 7 |
2 files changed, 13 insertions, 0 deletions
diff --git a/ovn/controller/binding.c b/ovn/controller/binding.c index 0353a7b8e..13c51daac 100644 --- a/ovn/controller/binding.c +++ b/ovn/controller/binding.c @@ -143,6 +143,9 @@ consider_local_datapath(struct controller_ctx *ctx, } else { VLOG_INFO("Claiming lport %s for this chassis.", binding_rec->logical_port); + for (int i = 0; i < binding_rec->n_mac; i++) { + VLOG_INFO("Claiming %s", binding_rec->mac[i]); + } } sbrec_port_binding_set_chassis(binding_rec, chassis_rec); } @@ -179,6 +182,9 @@ consider_local_datapath(struct controller_ctx *ctx, if (ctx->ovnsb_idl_txn) { VLOG_INFO("Releasing lport %s from this chassis.", binding_rec->logical_port); + for (int i = 0; i < binding_rec->n_mac; i++) { + VLOG_INFO("Releasing %s", binding_rec->mac[i]); + } sbrec_port_binding_set_chassis(binding_rec, NULL); sset_find_and_delete(all_lports, binding_rec->logical_port); } diff --git a/ovn/controller/pinctrl.c b/ovn/controller/pinctrl.c index d65e2136b..323faa10c 100644 --- a/ovn/controller/pinctrl.c +++ b/ovn/controller/pinctrl.c @@ -354,6 +354,13 @@ pinctrl_handle_put_dhcp_opts( pin->packet = dp_packet_data(&pkt_out); pin->packet_len = dp_packet_size(&pkt_out); + /* Log the response. */ + static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(20, 40); + const struct eth_header *l2 = dp_packet_l2(&pkt_out); + VLOG_INFO_RL(&rl, "DHCP%s "ETH_ADDR_FMT" "IP_FMT"", + msg_type == DHCP_MSG_OFFER ? "OFFER" : "ACK", + ETH_ADDR_ARGS(l2->eth_src), IP_ARGS(*offer_ip)); + success = 1; exit: if (!ofperr) { |