On Wed, Apr 30, 2025 at 7:54 AM Ales Musil <amu...@redhat.com> wrote:
> This helps with code complexity to some extent as there were few > places where we would "mimic" vector via regular array with > x2nrealloc() calls. > > It can also help to minimize small sllocations in some cases, > currently when there was array like structure of unknown size list > would be passed around and each struct in that list would be > allocated separately. That could to struct definitions that would > hold a single pointer or other struct + the ovs_list struct. With > vector the inner struct/pointer can be insterted dirrectly into > vector without additional small allocations. The other side of the > approach is cache consistenty, the vector is continous block of > memory which is way more cache freindly during iteration. > > Ales Musil (9): > vec: Add new data type called vector. > utilities: Replace manual x2nrealloc with vector. > northd: Replace manual x2nrealloc with vector. > controller: Replace manual x2nrealloc with vector. > ic: Replace manual x2nrealloc with vector. > lib: Replace manual x2nrealloc with vector. > mac-cache: Use vector instead of list. > controller: Use vector instead of list. > northd: Use vector instead of list. > > controller/binding.c | 74 +++--- > controller/lflow.c | 17 +- > controller/local_data.c | 62 +++-- > controller/local_data.h | 15 +- > controller/mac-cache.c | 191 ++++++-------- > controller/mac-cache.h | 39 +-- > controller/mirror.c | 60 ++--- > controller/ofctrl-seqno.c | 193 +++++++------- > controller/ofctrl-seqno.h | 11 +- > controller/ovn-controller.c | 30 +-- > controller/physical.c | 97 +++---- > controller/pinctrl.c | 27 +- > controller/route-exchange-netlink.c | 33 ++- > controller/route-exchange-netlink.h | 6 +- > controller/route-exchange.c | 10 +- > controller/route.c | 8 +- > controller/statctrl.c | 54 ++-- > controller/test-lflow-cache.c | 27 +- > controller/test-ofctrl-seqno.c | 27 +- > ic/ovn-ic.c | 26 +- > include/ovn/expr.h | 4 +- > lib/actions.c | 115 ++++----- > lib/automake.mk | 2 + > lib/expr.c | 56 ++--- > lib/inc-proc-eng.c | 120 ++++----- > lib/lb.c | 49 ++-- > lib/lb.h | 4 +- > lib/vec.c | 195 +++++++++++++++ > lib/vec.h | 175 +++++++++++++ > northd/en-advertised-route-sync.c | 41 ++- > northd/en-group-ecmp-route.c | 38 ++- > northd/en-group-ecmp-route.h | 4 +- > northd/en-lr-nat.c | 17 +- > northd/en-multicast.c | 47 ++-- > northd/en-multicast.h | 3 +- > northd/lb.c | 7 +- > northd/northd.c | 376 ++++++++++++++-------------- > northd/northd.h | 19 +- > tests/automake.mk | 1 + > tests/ovn.at | 14 ++ > tests/test-ovn.c | 3 +- > tests/test-vector.c | 316 +++++++++++++++++++++++ > utilities/ovn-nbctl.c | 105 +++----- > utilities/ovn-sbctl.c | 52 ++-- > utilities/ovn-trace.c | 23 +- > 45 files changed, 1620 insertions(+), 1173 deletions(-) > create mode 100644 lib/vec.c > create mode 100644 lib/vec.h > create mode 100644 tests/test-vector.c > > -- > 2.49.0 > > Thank you Mark, I went ahead and merged this into main. Regards, Ales _______________________________________________ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev