On 12/11/24 12:13, Eelco Chaudron wrote:
> 
> 
> On 9 Dec 2024, at 21:21, Ilya Maximets wrote:
> 
>> If prefixes are set for the flow table, ovs-vswitchd will print them
>> out to the log whenever something changes in the database.  Since
>> normally prefixes will be set for every OpenFlow table, it will print
>> 255 log messages per iteration.  This is very annoying in dynamic
>> environments like Kubernetes, where database changes can happen
>> frequently, obscuring and erasing useful logs on log rotation.
>>
>> These log messages are not very important.  The information can be
>> looked up in the database and normally the values will not actually
>> change after initial setup.  Move the log to debug level.
>>
>> While at it, rate limit the warnings about misconfigured prefixes,
>> as they may be too much as well.  And make the print out a little
>> nicer by only printing once if multiple adjacent tables have the
>> same prefixes configured.  In most cases that will reduce the amount
>> of logs from 255 lines to 1 per iteration with debug logging enabled.
>> We're also now logging the default values as well, since it's under
>> debug and will not actually add that many log lines with the new
>> collapsed format.  This makes debug logs more accurate/useful.
>>
>> An additional improvement might be to not print if nothing actually
>> changed, but that will require either per-table per-bridge tracking
>> of previous values or changing parts of the ofproto API to tell the
>> bridge layer if something changed or not.  Doesn't seem necessary
>> at the moment.
>>
>> Fixes: 13751fd88c4b ("Classifier: Track address prefixes.")
>> Signed-off-by: Ilya Maximets <[email protected]>
> 
> Do not like the additional log outside the loop with “if (prev_prefixes) {“,
> but I see not other clean(er) solution. The rest looks good to me.

Yeah, I'm not a huge fan either.  I guess, it doesn't look right because
the function itself is a little too long.  We may try and refactor it
somehow as a follow up.

> 
> Acked-by: Eelco Chaudron <[email protected]>
> 

Thanks!  Applied and backported down to 2.17.  It's not a critical fix,
but I was backporting the CI change down to 2.17 anyways, so took this
one along.

Best regards, Ilya Maximets.
_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to