[Devel] [PATCH RH9 2/4] openvswitch: fix memory leak at failed datapath creation

2023-04-25 Thread Andrey Zhadchenko
ovs_dp_cmd_new()->ovs_dp_change()->ovs_dp_set_upcall_portids() allocates array via kmalloc. If for some reason new_vport() fails during ovs_dp_cmd_new() dp->upcall_portids must be freed. Add missing kfree. Kmemleak example: unreferenced object 0x88800c382500 (size 64): comm "dump_state", pid

[Devel] [PATCH RH9 0/4] net/openvswitch: pull ms API

2023-04-25 Thread Andrey Zhadchenko
Revert our patch for openvswitch, apply the ones that got accepted into mainstream: https://lore.kernel.org/all/20220825020450.664147-1-andrey.zhadche...@virtuozzo.com/ Andrey Zhadchenko (4): Revert "net: openvswitch: add capability to specify ifindex of new links" openvswitch: fix memory

[Devel] [PATCH RH9 3/4] openvswitch: allow specifying ifindex of new interfaces

2023-04-25 Thread Andrey Zhadchenko
CRIU is preserving ifindexes of net devices after restoration. However, current Open vSwitch API does not allow to target ifindex, so we cannot correctly restore OVS configuration. Add new OVS_DP_ATTR_IFINDEX for OVS_DP_CMD_NEW and use it as desired ifindex. Use OVS_VPORT_ATTR_IFINDEX during OVS_V

[Devel] [PATCH RH9 4/4] openvswitch: add OVS_DP_ATTR_PER_CPU_PIDS to get requests

2023-04-25 Thread Andrey Zhadchenko
CRIU needs OVS_DP_ATTR_PER_CPU_PIDS to checkpoint/restore newest openvswitch versions. Add pids to generic datapath reply. Limit exported pids amount to nr_cpu_ids. Signed-off-by: Andrey Zhadchenko Acked-by: Christian Brauner (Microsoft) Signed-off-by: Jakub Kicinski (cherry picked from ms com

[Devel] [PATCH RH9 1/4] Revert "net: openvswitch: add capability to specify ifindex of new links"

2023-04-25 Thread Andrey Zhadchenko
This reverts commit 757ebade1eec8c6a3d1a150c8bd6f564c939c058. We should use the version upstream accepted https://jira.vzint.dev/browse/PSBM-105844 Signed-off-by: Andrey Zhadchenko --- net/openvswitch/datapath.c | 16 ++-- net/openvswitch/vport-internal_dev.c | 1 - net/op