Re: [ovs-dev] [PATCH v2] bfd: Improve state change log message.

2024-03-08 Thread Ilya Maximets
On 3/8/24 11:22, Eelco Chaudron wrote:
> 
> 
> On 5 Mar 2024, at 21:37, Timothy Redaelli wrote:
> 
>> A log message like this one:
>>
>> 2024-01-09T06:45:17.201Z|00071|bfd(handler2)|INFO|ovn-0af536-0: BFD state
>> change: down->up "Neighbor Signaled Session Down"->"Neighbor Signaled Session
>> Down".
>>
>> can be hard to read since '->' usually represents a status change, but
>> in this case the diagnostic code stays constant. Update the log message to
>> avoid such ambiguity. The log message for the above event become:
>>
>> 2024-01-09T06:45:16.211Z|00026|bfd(handler3)|INFO|ovn-0af536-0: BFD state
>> change: (bfd.SessionState: down, bfd.LocalDiag: "Neighbor Signaled Session
>> Down") -> (bfd.SessionState: up, bfd.LocalDiag: "Neighbor Signaled Session
>> Down")
>>
>> Reported-by: Alex Stupnikov 
>> Reported-at: https://bugzilla.redhat.com/2258496
>> Signed-off-by: Timothy Redaelli 
> 
> Thanks for following up, the change looks good to me!
> 
> Acked-by: Eelco Chaudron 
> 

Thanks, Timothy and Eelco!

Applied and backported down to 2.17 as previously discussed.

Best regards, Ilya Maximets.
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


Re: [ovs-dev] [PATCH v2] bfd: Improve state change log message.

2024-03-08 Thread Eelco Chaudron



On 5 Mar 2024, at 21:37, Timothy Redaelli wrote:

> A log message like this one:
>
> 2024-01-09T06:45:17.201Z|00071|bfd(handler2)|INFO|ovn-0af536-0: BFD state
> change: down->up "Neighbor Signaled Session Down"->"Neighbor Signaled Session
> Down".
>
> can be hard to read since '->' usually represents a status change, but
> in this case the diagnostic code stays constant. Update the log message to
> avoid such ambiguity. The log message for the above event become:
>
> 2024-01-09T06:45:16.211Z|00026|bfd(handler3)|INFO|ovn-0af536-0: BFD state
> change: (bfd.SessionState: down, bfd.LocalDiag: "Neighbor Signaled Session
> Down") -> (bfd.SessionState: up, bfd.LocalDiag: "Neighbor Signaled Session
> Down")
>
> Reported-by: Alex Stupnikov 
> Reported-at: https://bugzilla.redhat.com/2258496
> Signed-off-by: Timothy Redaelli 

Thanks for following up, the change looks good to me!

Acked-by: Eelco Chaudron 

___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


[ovs-dev] [PATCH v2] bfd: Improve state change log message.

2024-03-05 Thread Timothy Redaelli
A log message like this one:

2024-01-09T06:45:17.201Z|00071|bfd(handler2)|INFO|ovn-0af536-0: BFD state
change: down->up "Neighbor Signaled Session Down"->"Neighbor Signaled Session
Down".

can be hard to read since '->' usually represents a status change, but
in this case the diagnostic code stays constant. Update the log message to
avoid such ambiguity. The log message for the above event become:

2024-01-09T06:45:16.211Z|00026|bfd(handler3)|INFO|ovn-0af536-0: BFD state
change: (bfd.SessionState: down, bfd.LocalDiag: "Neighbor Signaled Session
Down") -> (bfd.SessionState: up, bfd.LocalDiag: "Neighbor Signaled Session
Down")

Reported-by: Alex Stupnikov 
Reported-at: https://bugzilla.redhat.com/2258496
Signed-off-by: Timothy Redaelli 
---

v1 -> v2:
Restructured the message format as suggested by Ilya Maximets and Eelco
Chaudron to avoid ambiguity

---
 lib/bfd.c | 7 ---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/lib/bfd.c b/lib/bfd.c
index 9af258917..b8149e789 100644
--- a/lib/bfd.c
+++ b/lib/bfd.c
@@ -1130,10 +1130,11 @@ bfd_set_state(struct bfd *bfd, enum state state, enum 
diag diag)
 if (!VLOG_DROP_INFO()) {
 struct ds ds = DS_EMPTY_INITIALIZER;
 
-ds_put_format(, "%s: BFD state change: %s->%s"
-  " \"%s\"->\"%s\".\n",
+ds_put_format(, "%s: BFD state change: (bfd.SessionState: %s,"
+  " bfd.LocalDiag: \"%s\") -> (bfd.SessionState: %s,"
+  " bfd.LocalDiag: \"%s\")\n",
   bfd->name, bfd_state_str(bfd->state),
-  bfd_state_str(state), bfd_diag_str(bfd->diag),
+  bfd_diag_str(bfd->diag), bfd_state_str(state),
   bfd_diag_str(diag));
 bfd_put_details(, bfd);
 VLOG_INFO("%s", ds_cstr());
-- 
2.43.2

___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev