diff --git a/kernel-boot/rdma_rename.c b/kernel-boot/rdma_rename.c index 42392c760..24207dcf0 100644 --- a/kernel-boot/rdma_rename.c +++ b/kernel-boot/rdma_rename.c @@ -57,6 +57,7 @@ struct data { uint64_t node_guid; char *name; int idx; + int name_assign_type; }; static bool debug_mode; @@ -555,6 +556,11 @@ static int get_nldata_cb(struct nl_msg *msg, void *data) d->idx = nla_get_u32(tb[RDMA_NLDEV_ATTR_DEV_INDEX]); d->node_guid = nla_get_u64(tb[RDMA_NLDEV_ATTR_NODE_GUID]); + + if (tb[RDMA_NLDEV_ATTR_NAME_ASSIGN_TYPE]) + d->name_assign_type = + nla_get_u8(tb[RDMA_NLDEV_ATTR_NAME_ASSIGN_TYPE]); + return NL_STOP; } @@ -639,6 +645,13 @@ int main(int argc, char **argv) goto out; } + if (d.name_assign_type == RDMA_NAME_ASSIGN_TYPE_USER) { + pr_dbg("%s: Leave user-assigned names, do nothing\n", d.curr); + /* Do nothing */ + ret = 0; + goto out; + } + if (d.idx == -1 || !d.prefix) { pr_err("%s: Failed to get current device name and index\n", d.curr);