[PATCH rfc 0/1] Fix missing AENs when discovery controllers are disconnected

Sagi Grimberg sagi at grimberg.me
Wed Sep 14 03:29:20 PDT 2022


> I was thinking this rather than the new option... The bit would only be 
> set *after* the first successful link-side connect, thus the initial 
> nvme_start_ctrl would not send the reconnect event. Every reconnect 
> thereafter would.
> 
> -- james
> 
> 
> diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
> index 2429b11eb9a8..43c8b6590164 100644
> --- a/drivers/nvme/host/core.c
> +++ b/drivers/nvme/host/core.c
> @@ -4814,6 +4814,10 @@ void nvme_start_ctrl(struct nvme_ctrl *ctrl)
> 
>       nvme_enable_aen(ctrl);
> 
> +    if (nvme_discovery_ctrl(ctrl) &&
> +        test_bit(NVME_CTRL_FABRIC_CONNECTED, &ctrl->flags))
> +        nvme_change_uevent(ctrl, "NVME_EVENT=rediscover");
> +
>       if (ctrl->queue_count > 1) {
>           nvme_queue_scan(ctrl);
>           nvme_start_queues(ctrl);
> diff --git a/drivers/nvme/host/fc.c b/drivers/nvme/host/fc.c
> index 127abaf9ba5d..ff1dd8f999b0 100644
> --- a/drivers/nvme/host/fc.c
> +++ b/drivers/nvme/host/fc.c
> @@ -2947,6 +2947,7 @@ nvme_fc_create_io_queues(struct nvme_fc_ctrl *ctrl)
>           goto out_delete_hw_queues;
> 
>       ctrl->ioq_live = true;
> +    set_bit(NVME_CTRL_FABRIC_CONNECTED, &ctrl->ctrl.flags);

Isn't this set before calling nvme_start_ctrl()?

But this is orthogonal to the user argument, is there a specific
reason to why not add an explicit argument requesting that?
Because every userspace that will setup a persistent discovery
controller will need this event?



More information about the Linux-nvme mailing list