All of lore.kernel.org
 help / color / mirror / Atom feed
From: Benjamin Drung <benjamin.drung@ionos.com>
To: linux-rdma@vger.kernel.org
Subject: iblinkinfo for Python
Date: Wed, 05 Jan 2022 11:32:40 +0100	[thread overview]
Message-ID: <44396b05adcf8a414a9f4d6a843fce16670a83c1.camel@ionos.com> (raw)

Hi,

we have an in-house Shell script that uses iblinkinfo to check if the
InfiniBand cabling is correct. This information can be derived from the
node names that can be seen for the HCA port. I want to improve that
check and rewrite it in Python, but I failed to find an easy and robust
way to retrieve the node names for a HCA port:

1) Call "iblinkinfo --line" and parse the output. Parsing the output
could probably be done with a complex regular expression. This solution
is too ugly IMO.

2) Extend iblinkinfo to provide a JSON output. Then let the Python
script call "iblinkinfo --json" and simply use json.load for parsing.
This solution requires some C coding and probably a good json library
should be used to avoid generating bogus JSON.

3) Use https://github.com/jgunthorpe/python-rdma but this library has
not been touched for five years and needs porting to Python 3. So that
is probably a lot of work as well.

4) Use pyverbs provided by rdma-core, but I found neither a single API
call to query similar data to iblinkinfo, nor an example for that use
case.

What should I do?

-- 
Benjamin Drung

Senior DevOps Engineer and Debian & Ubuntu Developer
Compute Platform Operations Cloud

IONOS SE | Revaler Str. 30 | 10245 Berlin | Deutschland
E-Mail: benjamin.drung@ionos.com | Web: www.ionos.de

Hauptsitz Montabaur, Amtsgericht Montabaur, HRB 24498

Vorstand: Hüseyin Dogan, Dr. Martin Endreß, Claudia Frese, Henning
Kettler, Arthur Mai, Britta Schmidt, Achim Weiß
Aufsichtsratsvorsitzender: Markus Kadelke


Member of United Internet


             reply	other threads:[~2022-01-05 10:32 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-05 10:32 Benjamin Drung [this message]
2022-01-05 11:52 ` iblinkinfo for Python Leon Romanovsky
2022-01-05 12:05   ` Benjamin Drung
2022-01-06 14:39     ` Leon Romanovsky
2022-01-11 12:28 ` Jens Domke

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=44396b05adcf8a414a9f4d6a843fce16670a83c1.camel@ionos.com \
    --to=benjamin.drung@ionos.com \
    --cc=linux-rdma@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.