infiniband: avoid normalizing the p-key when reading from ifcfg

When writing the p-key setting to the ifcfg file and reading the
setting back, the value has to be consistent. This is not limited to
p-key only, any setting value during the ifcfg write and read also has
to be consistent.

This was probably added in commit cb5606cf1c ('ifcfg-rh:
add support for Infiniband partitions') as this is also what
ifup-ib does ([1]). For NetworkManager profiles however, the
p-key is also valid without the high bit set, so the ifcfg-rh
reader must honor that.

[1] 0c9fb6ca7b/rdma.ifup-ib (L75)
This commit is contained in:
Wen Liang 2022-09-02 13:44:30 -04:00
parent 72144946c9
commit a4fe16a426

View file

@ -5383,7 +5383,6 @@ parse_infiniband_p_key(shvarFile *ifcfg, int *out_p_key, char **out_parent, GErr
PARSE_WARNING("invalid InfiniBand PKEY_ID '%s'", pkey_id);
goto done;
}
id = (id | 0x8000);
ifname = g_strdup_printf("%s.%04x", physdev, (unsigned) id);
if (strcmp(device, ifname) != 0) {