From a4fe16a426097eee263cb3ef831dcea468b1ca26 Mon Sep 17 00:00:00 2001 From: Wen Liang Date: Fri, 2 Sep 2022 13:44:30 -0400 Subject: [PATCH] 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 cb5606cf1c7a ('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] https://github.com/alaahl/rdma/blob/0c9fb6ca7bcb4f24a6134e68338a88a84c4ab56c/rdma.ifup-ib#L75 --- src/core/settings/plugins/ifcfg-rh/nms-ifcfg-rh-reader.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/core/settings/plugins/ifcfg-rh/nms-ifcfg-rh-reader.c b/src/core/settings/plugins/ifcfg-rh/nms-ifcfg-rh-reader.c index 46df18b77..67c3228b7 100644 --- a/src/core/settings/plugins/ifcfg-rh/nms-ifcfg-rh-reader.c +++ b/src/core/settings/plugins/ifcfg-rh/nms-ifcfg-rh-reader.c @@ -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) {