[ovs-dev] [PATCH net-next v3 2/2] openvswitch: add OVS_DP_ATTR_PER_CPU_PIDS to get requests

2022-08-24 Thread Andrey Zhadchenko via dev
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 --- v3: Greatly reduce patch size by allocating message big enough to fit reply in all cases. Now

[ovs-dev] [PATCH net-next v3 0/2] openvswitch: allow specifying ifindex of new interfaces

2022-08-24 Thread Andrey Zhadchenko via dev
Hi! CRIU currently do not support checkpoint/restore of OVS configurations, but there was several requests for it. For example, https://github.com/lxc/lxc/issues/2909 The main problem is ifindexes of newly created interfaces. We realy need to preserve them after restore. Current openvswitch API d

[ovs-dev] [PATCH net-next v3 1/2] openvswitch: allow specifying ifindex of new interfaces

2022-08-24 Thread Andrey Zhadchenko via dev
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

[ovs-dev] [PATCH net v2] openvswitch: fix memory leak at failed datapath creation

2022-08-24 Thread Andrey Zhadchenko via dev
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

[ovs-dev] [PATCH net] openvswitch: fix memory leak at failed datapath creation

2022-08-23 Thread Andrey Zhadchenko via dev
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

Re: [ovs-dev] [PATCH net-next v2 1/3] openvswitch: allow specifying ifindex of new interfaces

2022-08-23 Thread Andrey Zhadchenko via dev
Thanks for the review! On 8/23/22 04:37, Jakub Kicinski wrote: On Fri, 19 Aug 2022 18:30:42 +0300 Andrey Zhadchenko wrote: 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 config

[ovs-dev] [PATCH net-next v2 1/3] openvswitch: allow specifying ifindex of new interfaces

2022-08-19 Thread Andrey Zhadchenko via dev
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. Use ovs_header->dp_ifindex during OVS_DP_CMD_NEW as desired ifindex. Use OVS_VPORT_ATTR_IFINDEX during OVS_VPORT_CMD_

[ovs-dev] [PATCH net-next v2 2/3] openvswitch: fix memory leak at failed datapath creation

2022-08-19 Thread Andrey Zhadchenko via dev
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

[ovs-dev] [PATCH net-next v2 3/3] openvswitch: add OVS_DP_ATTR_PER_CPU_PIDS to get requests

2022-08-19 Thread Andrey Zhadchenko via dev
CRIU needs OVS_DP_ATTR_PER_CPU_PIDS to checkpoint/restore newest openvswitch versions. Add pids to generic datapath reply. Adjust reply allocation to reserve memory for pids and move it under ovs_lock() to ensure than number of pids is unchanged while we adding them to nlmsg. Signed-off-by: Andrey

[ovs-dev] [PATCH net-next v2 0/3] openvswitch: allow specifying ifindex of new interfaces

2022-08-19 Thread Andrey Zhadchenko via dev
Hi! CRIU currently do not support checkpoint/restore of OVS configurations, but there was several requests for it. For example, https://github.com/lxc/lxc/issues/2909 The main problem is ifindexes of newly created interfaces. We realy need to preserve them after restore. Current openvswitch API d

Re: [ovs-dev] [PATCH net-next 0/1] openvswitch: allow specifying ifindex of new interfaces

2022-08-18 Thread Andrey Zhadchenko via dev
On 8/18/22 14:06, Ilya Maximets wrote: On 8/18/22 01:11, Andrey Zhadchenko wrote: On 8/18/22 01:15, Ilya Maximets wrote: On 8/17/22 22:35, Andrey Zhadchenko wrote: On 8/17/22 21:19, Ilya Maximets wrote: On 8/17/22 14:49, Andrey Zhadchenko via dev wrote: Hi! CRIU currently do not

Re: [ovs-dev] [PATCH net-next 0/1] openvswitch: allow specifying ifindex of new interfaces

2022-08-17 Thread Andrey Zhadchenko via dev
On 8/18/22 01:15, Ilya Maximets wrote: On 8/17/22 22:35, Andrey Zhadchenko wrote: On 8/17/22 21:19, Ilya Maximets wrote: On 8/17/22 14:49, Andrey Zhadchenko via dev wrote: Hi! CRIU currently do not support checkpoint/restore of OVS configurations, but there was several requests for it

Re: [ovs-dev] [PATCH net-next 0/1] openvswitch: allow specifying ifindex of new interfaces

2022-08-17 Thread Andrey Zhadchenko via dev
On 8/17/22 21:19, Ilya Maximets wrote: On 8/17/22 14:49, Andrey Zhadchenko via dev wrote: Hi! CRIU currently do not support checkpoint/restore of OVS configurations, but there was several requests for it. For example, https://github.com/lxc/lxc/issues/2909 The main problem is ifindexes of

[ovs-dev] [PATCH net-next 1/1] openvswitch: allow specifying ifindex of new interfaces

2022-08-17 Thread Andrey Zhadchenko via dev
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. Use ovs_header->dp_ifindex during OVS_DP_CMD_NEW as desired ifindex. Use OVS_VPORT_ATTR_IFINDEX during OVS_VPORT_CMD_

[ovs-dev] [PATCH net-next 0/1] openvswitch: allow specifying ifindex of new interfaces

2022-08-17 Thread Andrey Zhadchenko via dev
Hi! CRIU currently do not support checkpoint/restore of OVS configurations, but there was several requests for it. For example, https://github.com/lxc/lxc/issues/2909 The main problem is ifindexes of newly created interfaces. We realy need to preserve them after restore. Current openvswitch API d