netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next v2 0/3] openvswitch: allow specifying ifindex of new interfaces
@ 2022-08-19 15:30 Andrey Zhadchenko
  2022-08-19 15:30 ` [PATCH net-next v2 1/3] " Andrey Zhadchenko
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Andrey Zhadchenko @ 2022-08-19 15:30 UTC (permalink / raw)
  To: netdev
  Cc: dev, pshelar, davem, edumazet, kuba, pabeni, ptikhomirov,
	alexander.mikhalitsyn, avagin, brauner, mark.d.gray, i.maximets,
	aconole

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 does not allow to
specify ifindex. Most of the time we can just create an interface via
generic netlink requests and plug it into ovs but datapaths (generally any
OVS_VPORT_TYPE_INTERNAL) can only be created via openvswitch requests which
do not support selecting ifindex.

This patch allows to do so.
For new datapaths I decided to use dp_infindex in header as infindex
because it control ifindex for other requests too.
For internal vports I reused OVS_VPORT_ATTR_IFINDEX.

The only concern I have is that previously dp_ifindex was not used for
OVS_DP_VMD_NEW requests and some software may not set it to zero. However
we have been running this patch at Virtuozzo for 2 years and have not
encountered this problem. Not sure if it is worth to add new
ovs_datapath_attr instead.

v2:
Added two more patches.

Add OVS_DP_ATTR_PER_CPU_PIDS to dumps as suggested by Ilya Maximets.
Without it we won't be able to checkpoint/restore new openvswitch
configurations which use OVS_DP_F_DISPATCH_UPCALL_PER_CPU flag.

Found and fixed memory leak on datapath creation error path.

Andrey Zhadchenko (3):
  openvswitch: allow specifying ifindex of new interfaces
  openvswitch: fix memory leak at failed datapath creation
  openvswitch: add OVS_DP_ATTR_PER_CPU_PIDS to get requests

 include/uapi/linux/openvswitch.h     |   4 +
 net/openvswitch/datapath.c           | 107 ++++++++++++++++++---------
 net/openvswitch/vport-internal_dev.c |   1 +
 net/openvswitch/vport.h              |   2 +
 4 files changed, 77 insertions(+), 37 deletions(-)

-- 
2.31.1


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2022-08-23 20:02 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-08-19 15:30 [PATCH net-next v2 0/3] openvswitch: allow specifying ifindex of new interfaces Andrey Zhadchenko
2022-08-19 15:30 ` [PATCH net-next v2 1/3] " Andrey Zhadchenko
2022-08-22  8:06   ` Christian Brauner
2022-08-23  1:37   ` Jakub Kicinski
2022-08-23 13:50     ` Andrey Zhadchenko
2022-08-23 19:15       ` Jakub Kicinski
2022-08-19 15:30 ` [PATCH net-next v2 2/3] openvswitch: fix memory leak at failed datapath creation Andrey Zhadchenko
2022-08-22 12:53   ` Aaron Conole
2022-08-23  1:38     ` Jakub Kicinski
2022-08-19 15:30 ` [PATCH net-next v2 3/3] openvswitch: add OVS_DP_ATTR_PER_CPU_PIDS to get requests Andrey Zhadchenko
2022-08-23  1:41   ` Jakub Kicinski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).