public inbox for linux-nvme@lists.infradead.org
 help / color / mirror / Atom feed
From: keith.busch@intel.com (Keith Busch)
Subject: Two M.2 NVMe drives with same NQN, one gets removed
Date: Tue, 27 Nov 2018 08:01:02 -0700	[thread overview]
Message-ID: <20181127150102.GA6181@localhost.localdomain> (raw)
In-Reply-To: <20181127102554.GA16387@dingwall.me.uk>

On Tue, Nov 27, 2018@02:25:54AM -0800, James Dingwall wrote:
> Hi,
> On Mon, Nov 26, 2018@11:54:27PM -0800, Christoph Hellwig wrote:
> > On Mon, Nov 26, 2018@08:31:11AM -0700, Keith Busch wrote:
> > > According to the resolution discussion here:
> > > 
> > >   https://downloadcenter.intel.com/download/28320/Known-Issue-Intel-SSD-760p-Pro-7600p-Series-SubNQN-Conflict-on-Linux
> > > 
> > >   "
> > >   If you purchased your Intel? SSD from an OEM, your firmware version may
> > >   have a different naming. Contact your local OEM representative for
> > >   latest firmware revisions.
> > >   "
> > > 
> > > Sounds like Lenovo will need to merge the Intel update into their
> > > specific firmware if they haven't already done so.
> > 
> > OEMs are notoriously bad in picking up firmware fixes.  If the problems
> > with this drive persist we should probably add a quick that ignores the
> > drive provided NQN and build up one from based on the legacy
> > model/serial number algorithm instead.
> 
> Would something like this be the way to go if an appropriate entry is
> created in the nvme_id_table in pci.c?  The example subnqn shown in
> http://lists.infradead.org/pipermail/linux-nvme/2018-November/021154.html
> looks like the fallback entry so I suppose the firmware fix has been to
> just blank the relevant field.  (Should 2014.08.org be 2014-08.org
> in core.c when generating the fake name?)
> 
> Thanks,
> James

Looks correct, and just needs the nvme_id_table updated as you
mentioned. I also recommend skipping the NVME_VS(1, 2, 1) check if the
quirk is set so we're not warning users.


> diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
> index 559d567693b8..d4ace74237d9 100644
> --- a/drivers/nvme/host/core.c
> +++ b/drivers/nvme/host/core.c
> @@ -2076,10 +2076,12 @@ static void nvme_init_subnqn(struct nvme_subsystem *subsys, struct nvme_ctrl *ct
>  	size_t nqnlen;
>  	int off;
>  
> -	nqnlen = strnlen(id->subnqn, NVMF_NQN_SIZE);
> -	if (nqnlen > 0 && nqnlen < NVMF_NQN_SIZE) {
> -		strlcpy(subsys->subnqn, id->subnqn, NVMF_NQN_SIZE);
> -		return;
> +	if(!(ctrl->quirks & NVME_QUIRK_IGNORE_DEV_SUBNQN)) {
> +		nqnlen = strnlen(id->subnqn, NVMF_NQN_SIZE);
> +		if (nqnlen > 0 && nqnlen < NVMF_NQN_SIZE) {
> +			strlcpy(subsys->subnqn, id->subnqn, NVMF_NQN_SIZE);
> +			return;
> +		}
>  	}
>  
>  	if (ctrl->vs >= NVME_VS(1, 2, 1))
> diff --git a/drivers/nvme/host/nvme.h b/drivers/nvme/host/nvme.h
> index cee79cb388af..a07155c05328 100644
> --- a/drivers/nvme/host/nvme.h
> +++ b/drivers/nvme/host/nvme.h
> @@ -90,6 +90,11 @@ enum nvme_quirks {
>  	 * Set MEDIUM priority on SQ creation
>  	 */
>  	NVME_QUIRK_MEDIUM_PRIO_SQ		= (1 << 7),
> +
> +	/*
> +	 * Ignore device provided subnqn.
> +	 */
> +	NVME_QUIRK_IGNORE_DEV_SUBNQN		= (1 << 8),
>  };
>  
>  /*

  reply	other threads:[~2018-11-27 15:01 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-26 13:38 Two M.2 NVMe drives with same NQN, one gets removed James Dingwall
2018-11-26 15:31 ` Keith Busch
2018-11-27  7:54   ` Christoph Hellwig
2018-11-27 10:25     ` James Dingwall
2018-11-27 15:01       ` Keith Busch [this message]
2018-11-30 11:50         ` James Dingwall
  -- strict thread matches above, loose matches on Subject: below --
2018-11-17  0:17 John Van Bockel
2018-11-17  1:33 ` Keith Busch
2018-11-18 19:08   ` John Van Bockel
     [not found]   ` <CAGmwwfc=g+4h12qMBvRVJoE66Z70kzzfkabjyxLC=d7LZp627A@mail.gmail.com>
2018-11-19 17:00     ` Keith Busch
2018-11-21 21:19       ` John Van Bockel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181127150102.GA6181@localhost.localdomain \
    --to=keith.busch@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox