• Chaitanya Kulkarni's avatar
    nvmet: make ctrl-id configurable · 94a39d61
    Chaitanya Kulkarni authored
    This patch adds a new target subsys attribute which allows user to
    optionally specify target controller IDs which then used in the
    nvmet_execute_identify_ctrl() to fill up the nvme_id_ctrl structure.
    
    For example, when using a cluster setup with two nodes, with a dual
    ported NVMe drive and exporting the drive from both the nodes,
    The connection to the host fails due to the same controller ID and
    results in the following error message:-
    
    "nvme nvmeX: Duplicate cntlid XXX with nvmeX, rejecting"
    
    With this patch now user can partition the controller IDs for each
    subsystem by setting up the cntlid_min and cntlid_max. These values
    will be used at the time of the controller ID creation. By partitioning
    the ctrl-ids for each subsystem results in the unique ctrl-id space
    which avoids the collision.
    
    When new attribute is not specified target will fall back to original
    cntlid calculation method.
    Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
    Signed-off-by: default avatarChaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
    Signed-off-by: default avatarKeith Busch <kbusch@kernel.org>
    94a39d61
core.c 35.8 KB