From: Martin Wilck <mwilck@suse.com>
To: Christophe Varoqui <christophe.varoqui@opensvc.com>
Cc: dm-devel@redhat.com, Martin Wilck <mwilck@suse.com>
Subject: [PATCH v2 00/23] "Foreign" NVMe support for multipath-tools
Date: Tue, 6 Mar 2018 00:14:44 +0100 [thread overview]
Message-ID: <20180305231507.10386-1-mwilck@suse.com> (raw)
Hello Christophe,
This patch series adds limited support for "foreign" multipath devices
to multipath and multipathd, and implements the respective API for
"native" NVMe multipath devices. The implementation is done using
a shared library approach similar to checkers, so other non-dm multipath
implementations could hook into this API easily.
"Limited support" means here that multipath and multipathd are able
to print information about "foreign" multipath maps with the commands
"multipath -l[l]", "multipathd show topology", "multipathd show maps", and
"multipathd show paths", and that multipathd checks the devices in the
checker loop and prints log messages if something interesting is detected.
No support for other functionality such real health monitoring or
administration is currently planned, although it might be be doable
by extending the code from this patch set.
Sample output from multipathd with this patch set:
multipathd show topology
sys0:NQN:subsysname (uuid.96926ba3-b207-437c-902c-4a4df6538c3f) [nvme] nvme0n1 NVMe,Linux,4.15.0-r
size=2097152 features='n/a' hwhandler='n/a' wp=rw
`-+- policy='n/a' prio=n/a status=n/a
|- 0:1:1 nvme0c1n1 0:0 n/a n/a live
|- 0:2:1 nvme0c2n1 0:0 n/a n/a live
|- 0:3:1 nvme0c3n1 0:0 n/a n/a live
`- 0:4:1 nvme0c4n1 0:0 n/a n/a live
The first part of the set (01-09) consists only of cleanup patches, improving the
usage of "const" qualifiers in the part of the code I've been working with.
(I'm routinely trying to do at least some cleanup work when I look more deeply
into parts of the code). These patches don't change functionality. 10 and
11 are two minor helpers for the patches that follow.
Patch 12 and 15 represent the actual new APIs. Patch 13, 14 change the
libmultipath printing code to work with the strongly simplified "generic"
multipath API from patch 12. This allows to provide foreign library code
without replicating the complex data structures libmultipath is using
internally, and yet use libmultipath's native printing code for displaying
map and path properties.
Patch 15 defines the actual API for "foreign" libraries. It is built on
top of the "generic" API which defines the data structures with which objects
like multipath maps and paths are described.
Patch 17 and 21 provide the implementation of NVMe native multipath
support using these APIs. Patch 18 - 20 contain the necessary changes
to multipath and multipathd to call into the new APIs.
(Note the numbering has changed from v1, as patch 18 has been split off
patch 20).
Patch 22 makes multipathd update path group priorities also when not strictly
necessary. This was added because patch 05 removed code that updated the
pg prios in the printing code path.
Patch 23 fixes multipathd's signal blocking logic, a response to the discussion
that came up on the first submission of this patch set.
The patch set is based on the previous multipath-tools patches I
sent to dm-devel:
- "[PATCH v2 00/20] Various multipath-tools fixes" ff.
- "[PATCH 0/7] multipath-tools: uevent processing fixes and unit tests" ff.
(7/7 replaced by "[PATCH v2] multipathd: ignore uevents for non-mpath
devices")
- "[PATCH 1/3] multipath.rules: handle NVME devices" ff.
- "[PATCH] libmultipath: increase path product_id/rev field size for NVMe"
To try and reduce confusion, the full series is available here:
https://github.com/openSUSE/multipath-tools/tree/upstream-queue
Reviews and comments are of course welcome.
Changes v1 -> v2:
- 12/23: added '#include "dm-generic.h"' to print.h (Ben Marzinski)
- 12/23: added "%d %s" formats in generic_style() to print device and product info
in topology printout by default
- 13/23: removed double "%d %s" format (Ben Marzinski)
- 15/23: added locking to the foreign implementation to avoid use of deallocated
data structures in foreign libraries (because of Ben's comment on 17/20)
- 15/23: avoid "name" pointer (Ben Marzinski)
- 15/23: simplify prototype of free_foreign()
- 15/23: use scandir() rather than glob() for scanning foreign libraries
- 17/23: avoid superfluous udev references (Ben Marzinski)
- 17/23: add commend about locking in cleanup() (Ben Marzinski)
- 17/23: substitute __attribute__ ((fallthrough)) by comment (Ben Marzinski)
- 18/23 is new (it has been split off former 20/23 because of Ben's comment on
19/23); numbering has changed from here (18 becomes 19, 19->20, 20->21).
- 20/23: don't call foreign libraries in ev_add_path(), as foreign paths are never
added to pathvec anyway
- 21/23: nvme: use scandir() rather than glob() for looking for path devices
(Ben Marzinski)
- 22/23: new, because of Ben's comment on patch 5
- 23/23: new, result of discussion about signal blocking
(Patches not mentioned are identical to the first series, except 19/23 they have
Reviewed-by: tags by Ben).
Martin Wilck (23):
multipath(d)/Makefile: add explicit dependency on libraries
libmultipath: remove unused "stdout helpers"
libmultipath: get rid of selector "hack" in print.c
libmultipath: parser: use call-by-value for "snprint" methods
libmultipath: don't update path groups when printing
libmultipath/print: use "const" where appropriate
libmultipath: use "const" in devmapper code
libmultipath: fix compiler warnings for -Wcast-qual
multipath-tools: Makefile.inc: use -Werror=cast-qual
libmultipath: add vector_free_const()
libmultipath: add vector_convert()
libmultipath: "generic multipath" interface
libmultipath: print: convert API to generic data type
libmultipath: print: use generic API for get_x_layout()
libmultipath: API for foreign multipath handling
libmultipath/print: add "%G - foreign" wildcard
libmultipath/foreign: nvme foreign library
libmultipath: pathinfo: call into foreign library
multipath: use foreign API
multipathd: use foreign API
libmultipath: foreign/nvme: implement path display
multipathd: update path group prio in check_path
multipathd: fix signal blocking logic
Makefile | 1 +
Makefile.inc | 1 +
kpartx/devmapper.c | 3 +-
libmpathcmd/mpath_cmd.c | 2 +-
libmultipath/Makefile | 2 +-
libmultipath/checkers/rbd.c | 4 +-
libmultipath/configure.c | 1 +
libmultipath/configure.h | 1 -
libmultipath/devmapper.c | 35 +-
libmultipath/devmapper.h | 16 +-
libmultipath/dict.c | 206 ++++++------
libmultipath/discovery.c | 22 +-
libmultipath/discovery.h | 6 +-
libmultipath/dm-generic.c | 70 ++++
libmultipath/dm-generic.h | 41 +++
libmultipath/dmparser.c | 2 +-
libmultipath/foreign.c | 602 +++++++++++++++++++++++++++++++++
libmultipath/foreign.h | 322 ++++++++++++++++++
libmultipath/foreign/Makefile | 30 ++
libmultipath/foreign/nvme.c | 761 ++++++++++++++++++++++++++++++++++++++++++
libmultipath/generic.c | 39 +++
libmultipath/generic.h | 136 ++++++++
libmultipath/io_err_stat.c | 17 +-
libmultipath/list.h | 6 +-
libmultipath/memory.h | 8 +-
libmultipath/parser.c | 9 +-
libmultipath/parser.h | 12 +-
libmultipath/pgpolicies.c | 11 +-
libmultipath/print.c | 395 +++++++++++++---------
libmultipath/print.h | 82 +++--
libmultipath/structs.c | 16 +-
libmultipath/structs.h | 9 +-
libmultipath/uevent.c | 6 +-
libmultipath/util.c | 6 +-
libmultipath/vector.h | 30 ++
multipath/Makefile | 2 +-
multipath/main.c | 14 +
multipathd/Makefile | 2 +-
multipathd/cli_handlers.c | 40 ++-
multipathd/main.c | 59 +++-
multipathd/uxlsnr.c | 10 +-
41 files changed, 2656 insertions(+), 381 deletions(-)
create mode 100644 libmultipath/dm-generic.c
create mode 100644 libmultipath/dm-generic.h
create mode 100644 libmultipath/foreign.c
create mode 100644 libmultipath/foreign.h
create mode 100644 libmultipath/foreign/Makefile
create mode 100644 libmultipath/foreign/nvme.c
create mode 100644 libmultipath/generic.c
create mode 100644 libmultipath/generic.h
--
2.16.1
next reply other threads:[~2018-03-05 23:14 UTC|newest]
Thread overview: 59+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-05 23:14 Martin Wilck [this message]
2018-03-05 23:14 ` [PATCH v2 01/23] multipath(d)/Makefile: add explicit dependency on libraries Martin Wilck
2018-03-06 7:04 ` Hannes Reinecke
2018-03-05 23:14 ` [PATCH v2 02/23] libmultipath: remove unused "stdout helpers" Martin Wilck
2018-03-06 7:04 ` Hannes Reinecke
2018-03-05 23:14 ` [PATCH v2 03/23] libmultipath: get rid of selector "hack" in print.c Martin Wilck
2018-03-06 7:05 ` Hannes Reinecke
2018-03-05 23:14 ` [PATCH v2 04/23] libmultipath: parser: use call-by-value for "snprint" methods Martin Wilck
2018-03-06 7:05 ` Hannes Reinecke
2018-03-15 14:25 ` Bart Van Assche
2018-03-05 23:14 ` [PATCH v2 05/23] libmultipath: don't update path groups when printing Martin Wilck
2018-03-06 7:06 ` Hannes Reinecke
2018-03-05 23:14 ` [PATCH v2 06/23] libmultipath/print: use "const" where appropriate Martin Wilck
2018-03-06 7:07 ` Hannes Reinecke
2018-03-05 23:14 ` [PATCH v2 07/23] libmultipath: use "const" in devmapper code Martin Wilck
2018-03-06 7:07 ` Hannes Reinecke
2018-03-05 23:14 ` [PATCH v2 09/23] multipath-tools: Makefile.inc: use -Werror=cast-qual Martin Wilck
2018-03-06 7:08 ` Hannes Reinecke
2018-03-05 23:14 ` [PATCH v2 10/23] libmultipath: add vector_free_const() Martin Wilck
2018-03-06 1:01 ` Bart Van Assche
2018-03-06 7:08 ` Hannes Reinecke
2018-03-05 23:14 ` [PATCH v2 11/23] libmultipath: add vector_convert() Martin Wilck
2018-03-06 7:10 ` Hannes Reinecke
2018-03-05 23:14 ` [PATCH v2 12/23] libmultipath: "generic multipath" interface Martin Wilck
2018-03-06 7:10 ` Hannes Reinecke
2018-03-07 19:01 ` Benjamin Marzinski
2018-03-05 23:14 ` [PATCH v2 13/23] libmultipath: print: convert API to generic data type Martin Wilck
2018-03-06 7:11 ` Hannes Reinecke
2018-03-07 19:02 ` Benjamin Marzinski
2018-03-05 23:14 ` [PATCH v2 14/23] libmultipath: print: use generic API for get_x_layout() Martin Wilck
2018-03-06 7:12 ` Hannes Reinecke
2018-03-05 23:14 ` [PATCH v2 15/23] libmultipath: API for foreign multipath handling Martin Wilck
2018-03-06 7:12 ` Hannes Reinecke
2018-03-07 19:08 ` Benjamin Marzinski
2018-03-05 23:15 ` [PATCH v2 16/23] libmultipath/print: add "%G - foreign" wildcard Martin Wilck
2018-03-06 7:13 ` Hannes Reinecke
2018-03-05 23:15 ` [PATCH v2 17/23] libmultipath/foreign: nvme foreign library Martin Wilck
2018-03-06 7:13 ` Hannes Reinecke
2018-03-07 19:09 ` Benjamin Marzinski
2018-03-05 23:15 ` [PATCH v2 18/23] libmultipath: pathinfo: call into " Martin Wilck
2018-03-06 7:14 ` Hannes Reinecke
2018-03-07 19:10 ` Benjamin Marzinski
2018-03-05 23:15 ` [PATCH v2 19/23] multipath: use foreign API Martin Wilck
2018-03-06 7:14 ` Hannes Reinecke
2018-03-07 19:11 ` Benjamin Marzinski
2018-03-05 23:15 ` [PATCH v2 20/23] multipathd: " Martin Wilck
2018-03-06 7:15 ` Hannes Reinecke
2018-03-07 19:25 ` Benjamin Marzinski
2018-03-05 23:15 ` [PATCH v2 21/23] libmultipath: foreign/nvme: implement path display Martin Wilck
2018-03-06 7:15 ` Hannes Reinecke
2018-03-07 19:27 ` Benjamin Marzinski
2018-03-05 23:15 ` [PATCH v2 22/23] multipathd: update path group prio in check_path Martin Wilck
2018-03-06 7:16 ` Hannes Reinecke
2018-03-07 20:01 ` Benjamin Marzinski
2018-03-05 23:15 ` [PATCH v2 23/23] multipathd: fix signal blocking logic Martin Wilck
2018-03-06 7:16 ` Hannes Reinecke
2018-03-06 8:55 ` Martin Wilck
2018-03-07 20:24 ` Benjamin Marzinski
[not found] ` <20180305231507.10386-9-mwilck@suse.com>
2018-03-06 7:08 ` [PATCH v2 08/23] libmultipath: fix compiler warnings for -Wcast-qual Hannes Reinecke
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=20180305231507.10386-1-mwilck@suse.com \
--to=mwilck@suse.com \
--cc=christophe.varoqui@opensvc.com \
--cc=dm-devel@redhat.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