From: Andrey Zhadchenko <andrey.zhadchenko@virtuozzo.com>
To: netdev@vger.kernel.org
Cc: dev@openvswitch.org, pshelar@ovn.org, davem@davemloft.net,
edumazet@google.com, kuba@kernel.org, pabeni@redhat.com,
ptikhomirov@virtuozzo.com, alexander.mikhalitsyn@virtuozzo.com,
avagin@google.com, brauner@kernel.org, i.maximets@ovn.org,
aconole@redhat.com
Subject: [PATCH net-next v3 0/2] openvswitch: allow specifying ifindex of new interfaces
Date: Thu, 25 Aug 2022 05:04:48 +0300 [thread overview]
Message-ID: <20220825020450.664147-1-andrey.zhadchenko@virtuozzo.com> (raw)
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.
v3:
Sent memleak fix separately to net.
Improved patches according to the reviews:
- Added new OVS_DP_ATTR_IFINDEX instead of using ovs_header->dp_ifindex
- Pre-allocated bigger reply message for upcall pids
- Some small fixes
Andrey Zhadchenko (2):
openvswitch: allow specifying ifindex of new interfaces
openvswitch: add OVS_DP_ATTR_PER_CPU_PIDS to get requests
include/uapi/linux/openvswitch.h | 3 +++
net/openvswitch/datapath.c | 21 ++++++++++++++++++---
net/openvswitch/vport-internal_dev.c | 1 +
net/openvswitch/vport.h | 2 ++
4 files changed, 24 insertions(+), 3 deletions(-)
--
2.31.1
next reply other threads:[~2022-08-25 2:06 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-25 2:04 Andrey Zhadchenko [this message]
2022-08-25 2:04 ` [PATCH net-next v3 1/2] openvswitch: allow specifying ifindex of new interfaces Andrey Zhadchenko
2022-08-25 2:04 ` [PATCH net-next v3 2/2] openvswitch: add OVS_DP_ATTR_PER_CPU_PIDS to get requests Andrey Zhadchenko
2022-08-26 9:11 ` [PATCH net-next v3 0/2] openvswitch: allow specifying ifindex of new interfaces Christian Brauner
2022-08-27 2:50 ` patchwork-bot+netdevbpf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220825020450.664147-1-andrey.zhadchenko@virtuozzo.com \
--to=andrey.zhadchenko@virtuozzo.com \
--cc=aconole@redhat.com \
--cc=alexander.mikhalitsyn@virtuozzo.com \
--cc=avagin@google.com \
--cc=brauner@kernel.org \
--cc=davem@davemloft.net \
--cc=dev@openvswitch.org \
--cc=edumazet@google.com \
--cc=i.maximets@ovn.org \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=pshelar@ovn.org \
--cc=ptikhomirov@virtuozzo.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox