> Hi Han,
>
> If you investigate the patch you referenced, it's fairly small. It adds
an extra strcmp() call and an extra call to ofproto_port_open_type(). It's
most likely the extra call to ofproto_port_open_type() is causing the extra
CPU usage. Most of the processing done by calling it a second time is
redundant.
>
> Patch one to optimize the behavior would be to factor out the common
parts of ofproto_port_open_type() so that it may be called once. Then call
the parts that differ for each port type. This should be simple. It would
be worth testing again with this patch alone to see how much of an impact
this makes.
>
> Patch two would be to start caching results of ofproto_port_open_type()
locally since the result is not likely to differ between repeated calls.
This would be a bit trickier to make 100% correct because you would need to
be able to reliably detect when your cached value is "dirty". This patch
would be worth pursuing if patch one does not do enough on its own.
>
> Mark!

The ideas looks good. One thing I am still not clear is the trigger of this
problem. I tried repeating same add-port command in a simple sandbox, but
there is no obvious difference whether I revert the patch 8c319e8b7. The
issue is only reproduced in the scale test environment. We might need to
dig deeper into this to understand the root cause. At the same time we will
try the patch you suggested.

Thanks,
Han
_______________________________________________
discuss mailing list
disc...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-discuss

Reply via email to