Re: iblinkinfo for Python

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Benjamin,

I have written some simple parser for output of certain IB commands:
https://gitlab.com/domke/ParseInfiniband

Maybe it will help you, since it includes iblinkinfo and is in py3.

Best,
 Jens

On 1/5/22 19:32, Benjamin Drung wrote:
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?




[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux