After recently digging into the nodemap code, I'm trying to figure out how to configure nodemaps with IPv6 addresses.
My understanding of IPv6 is superficial, so it isn't clear to me how a HPC cluster of nodes would be addressed? In some documentation, the interface identifier is randomly assigned (formerly based on the Ethernet MAC address), so no "NID range" is possible, and the nodemap might need thousands of individual records to describe the nodes, yuck. It also seems possible that the interface identifier part of the IPv6 address would be sequentially assigned to the client nodes, which would map will to the existing nodemap functionality.
For IPv4 addresses, nodemap stores the nrr_start_nid and nrr_end_nid range in a 32-byte struct nodemap_range_rec using the NODEMAP_RANGE_IDX keys. The nodemap index contains only 32-byte records, so it would be possible to store one, but not two, 20-byte IPv6 NIDs in a single record.
To distinguish IPv6 NIDs in the nodemap config index, a new NODEMAP_RANGE6_IDX with nodemap_range6_rec records could be used:
struct nodemap_range6_rec {
__u64 nr6_count;
struct nr6_start_nid;
__u32 nr6_padding;
};
Since the nodemap range does not need to have a different nud_size, nid_type, nid_num or IPv6 subnet, it would be possible to store the 20-byte struct lnet_nid plus a _u64 count of NIDs that are in this range. The _u64 nr6_count corresponds to the interface identifier part of the IPv6 address, so is large enough to contain all NIDs in a given subnet, if necessary.
This works for inclusive ranges (ie. nodes X-Y belong to a nodemap), but not very good to specify exclusive ranges (ie. "all other NIDs belong to this nodemap"). Any thoughts?
Got https://review.whamcloud.com/c/fs/lustre-release/+/53135 fully working for IPv6 and IPv4. Its ready for review. Once this lands we can put lustre into a feature freeze.