# lspci | grep Mel
10000:01:00.0 Ethernet controller: Mellanox Technologies MT27800 Family [ConnectX-5]
# mstconfig q
-E- Failed to open the device
# mstconfig -d 10000:01:00.0 q
-E- Failed to open the device
Quick check of the code shows that the domain is only stored in a 16-bit value, which it can be larger than. I would suggest expand the fields to 32 bit at least.