Linux-NVME Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: hch@lst.de (Christoph Hellwig)
Subject: [PATCH 09/10] nvmet: support configuring ANA groups
Date: Thu, 7 Jun 2018 14:02:02 +0200	[thread overview]
Message-ID: <20180607120202.GB11716@lst.de> (raw)
In-Reply-To: <20180607100901.5d7e92ab@pentland.suse.de>

On Thu, Jun 07, 2018@10:09:01AM +0200, Hannes Reinecke wrote:
> > +	configfs_add_default_group(&port->ana_groups_group,
> > &port->group); +
> > +	port->ana_group1.port = port;
> > +	port->ana_group1.grpid = 1;
> 
> NVMET_DEFAULT_ANA_GRPID ?

Yes.

> 
> And maybe rename 'ana_group1' to 'ana_default_group' ?

Ok.

> 
> > +	config_group_init_type_name(&port->ana_group1.group,
> > +			"1", &nvmet_ana_group_type);
> 
> snprintf(grpname, "%d", NVMET_DEFAULT_ANA_GRPID); ?

That'll require a buffer allocation.  But I guess the __stringify
should work here.

> > +void nvmet_send_ana_event(struct nvmet_subsys *subsys)
> > +{
> > +	struct nvmet_ctrl *ctrl;
> > +
> > +	mutex_lock(&subsys->lock);
> > +	list_for_each_entry(ctrl, &subsys->ctrls, subsys_entry) {
> > +		if (nvmet_aen_disabled(ctrl,
> > NVME_AEN_CFG_ANA_CHANGE))
> > +			continue;
> > +		nvmet_add_async_event(ctrl, NVME_AER_TYPE_NOTICE,
> > +				NVME_AER_NOTICE_ANA, NVME_LOG_ANA);
> > +	}
> > +	mutex_unlock(&subsys->lock);
> > +}
> > +
> 
> Isn't this sending too many AENs?
> We're changing the ANA state per _port_, which is linked to individual
> controllers.
> But controllers which are _not_ on that port won't be affected by the
> ANA change, so in theory we shouldn't send ANA AENs for not-affected
> controllers.
> 
> Can't we just add a pointer to the port in the nvmet_ctrl structure and
> filter according to the affected ports?

Yes, we should probably filter out only controllers that are on this
port.  I'll take a look at how to best do that.

  reply	other threads:[~2018-06-07 12:02 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-06 14:33 draft ANA support v3 Christoph Hellwig
2018-06-06 14:33 ` [PATCH 01/10] nvme.h: add support for the log specific field Christoph Hellwig
2018-06-07  7:27   ` Johannes Thumshirn
2018-06-07  7:58   ` Hannes Reinecke
2018-06-07 12:34   ` Sagi Grimberg
2018-06-06 14:33 ` [PATCH 02/10] nvme.h: add ANA definitions Christoph Hellwig
2018-06-07  7:59   ` Hannes Reinecke
2018-06-07  8:30   ` Johannes Thumshirn
2018-06-07 12:35   ` Sagi Grimberg
2018-06-06 14:33 ` [PATCH 03/10] nvme: simplify the API for getting log pages Christoph Hellwig
2018-06-07  7:39   ` Johannes Thumshirn
2018-06-07  7:59   ` Hannes Reinecke
2018-06-07 12:35   ` Sagi Grimberg
2018-06-06 14:33 ` [PATCH 04/10] nvme: remove nvme_req_needs_failover Christoph Hellwig
2018-06-07  7:40   ` Johannes Thumshirn
2018-06-07  8:01   ` Hannes Reinecke
2018-06-07 11:57     ` Christoph Hellwig
2018-06-07 12:36   ` Sagi Grimberg
2018-06-06 14:33 ` [PATCH 05/10] nvme: add ANA support Christoph Hellwig
2018-06-07  8:01   ` Hannes Reinecke
2018-06-07 12:49   ` Sagi Grimberg
2018-06-07 13:05     ` Christoph Hellwig
2018-06-07 13:55       ` Christoph Hellwig
2018-06-06 14:33 ` [PATCH 06/10] nvme: don't set gendisks live that don't have an I/O capable path Christoph Hellwig
2018-06-06 14:33 ` [PATCH 07/10] nvmet: track and limit the number of namespaces per subsystem Christoph Hellwig
2018-06-07  7:54   ` Johannes Thumshirn
2018-06-07  8:02   ` Hannes Reinecke
2018-06-06 14:33 ` [PATCH 08/10] nvmet: add minimal ANA support Christoph Hellwig
2018-06-07  8:03   ` Hannes Reinecke
2018-06-07 12:52   ` Sagi Grimberg
2018-06-06 14:33 ` [PATCH 09/10] nvmet: support configuring ANA groups Christoph Hellwig
2018-06-07  8:09   ` Hannes Reinecke
2018-06-07 12:02     ` Christoph Hellwig [this message]
2018-06-07 12:58   ` Sagi Grimberg
2018-06-07 13:08     ` Christoph Hellwig
2018-06-06 14:33 ` [PATCH 10/10] host fold Christoph Hellwig
2018-06-06 14:46   ` Christoph Hellwig
2018-06-06 15:18     ` Hannes Reinecke
2018-06-07 12:34 ` draft ANA support v3 Sagi Grimberg
2018-06-07 13:06   ` Christoph Hellwig

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=20180607120202.GB11716@lst.de \
    --to=hch@lst.de \
    /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