* [PATCH] nvme: Register for ANA AEN
@ 2018-07-26 10:55 Hannes Reinecke
2018-07-26 10:58 ` Hannes Reinecke
0 siblings, 1 reply; 8+ messages in thread
From: Hannes Reinecke @ 2018-07-26 10:55 UTC (permalink / raw)
We need to register for ANA AENs as we rely on them for our ANA implementation.
Patch is relative to hch nvme-ana tree.
Signed-off-by: Hannes Reinecke <hare at suse.com>
---
drivers/nvme/host/core.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
index 3b96ace1f86d..99910497acdc 100644
--- a/drivers/nvme/host/core.c
+++ b/drivers/nvme/host/core.c
@@ -1042,6 +1042,10 @@ static void nvme_enable_aen(struct nvme_ctrl *ctrl)
u32 supported = ctrl->oaes & NVME_AEN_SUPPORTED, result;
int status;
+#ifdef CONFIG_NVME_MULTIPATH
+ if (ctrl->subsys->cmic & (1 << 3))
+ supported |= NVME_AEN_CFG_ANA_CHANGE;
+#endif
status = nvme_set_features(ctrl, NVME_FEAT_ASYNC_EVENT, supported, NULL,
0, &result);
if (status)
--
2.12.3
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH] nvme: Register for ANA AEN
2018-07-26 10:55 [PATCH] nvme: Register for ANA AEN Hannes Reinecke
@ 2018-07-26 10:58 ` Hannes Reinecke
2018-07-26 11:59 ` Christoph Hellwig
0 siblings, 1 reply; 8+ messages in thread
From: Hannes Reinecke @ 2018-07-26 10:58 UTC (permalink / raw)
On 07/26/2018 12:55 PM, Hannes Reinecke wrote:
> We need to register for ANA AENs as we rely on them for our ANA implementation.
> Patch is relative to hch nvme-ana tree.
>
> Signed-off-by: Hannes Reinecke <hare at suse.com>
> ---
> drivers/nvme/host/core.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
> index 3b96ace1f86d..99910497acdc 100644
> --- a/drivers/nvme/host/core.c
> +++ b/drivers/nvme/host/core.c
> @@ -1042,6 +1042,10 @@ static void nvme_enable_aen(struct nvme_ctrl *ctrl)
> u32 supported = ctrl->oaes & NVME_AEN_SUPPORTED, result;
> int status;
>
> +#ifdef CONFIG_NVME_MULTIPATH
> + if (ctrl->subsys->cmic & (1 << 3))
> + supported |= NVME_AEN_CFG_ANA_CHANGE;
> +#endif
> status = nvme_set_features(ctrl, NVME_FEAT_ASYNC_EVENT, supported, NULL,
> 0, &result);
> if (status)
>
Christoph,
this patch fixes the hang I've seen when running my ANA blktest.
Cheers,
Hannes
--
Dr. Hannes Reinecke Teamlead Storage & Networking
hare at suse.de +49 911 74053 688
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 N?rnberg
GF: F. Imend?rffer, J. Smithard, J. Guild, D. Upmanyu, G. Norton
HRB 21284 (AG N?rnberg)
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH] nvme: Register for ANA AEN
2018-07-26 10:58 ` Hannes Reinecke
@ 2018-07-26 11:59 ` Christoph Hellwig
2018-07-26 12:01 ` Christoph Hellwig
0 siblings, 1 reply; 8+ messages in thread
From: Christoph Hellwig @ 2018-07-26 11:59 UTC (permalink / raw)
On Thu, Jul 26, 2018@12:58:19PM +0200, Hannes Reinecke wrote:
> On 07/26/2018 12:55 PM, Hannes Reinecke wrote:
> > We need to register for ANA AENs as we rely on them for our ANA implementation.
> > Patch is relative to hch nvme-ana tree.
> >
> > Signed-off-by: Hannes Reinecke <hare at suse.com>
> > ---
> > drivers/nvme/host/core.c | 4 ++++
> > 1 file changed, 4 insertions(+)
> >
> > diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
> > index 3b96ace1f86d..99910497acdc 100644
> > --- a/drivers/nvme/host/core.c
> > +++ b/drivers/nvme/host/core.c
> > @@ -1042,6 +1042,10 @@ static void nvme_enable_aen(struct nvme_ctrl *ctrl)
> > u32 supported = ctrl->oaes & NVME_AEN_SUPPORTED, result;
> > int status;
> >
> > +#ifdef CONFIG_NVME_MULTIPATH
> > + if (ctrl->subsys->cmic & (1 << 3))
> > + supported |= NVME_AEN_CFG_ANA_CHANGE;
> > +#endif
> > status = nvme_set_features(ctrl, NVME_FEAT_ASYNC_EVENT, supported, NULL,
> > 0, &result);
> > if (status)
> >
> Christoph,
>
> this patch fixes the hang I've seen when running my ANA blktest.
What target do you run against? With the current 4004a TP
NVME_AEN_CFG_ANA_CHANGE should be set in OAES, which at least the
Linux target always did anyway.
We could work around this bug in the original TP4004, but I'd rather
not accumulate hacks like this.
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH] nvme: Register for ANA AEN
2018-07-26 11:59 ` Christoph Hellwig
@ 2018-07-26 12:01 ` Christoph Hellwig
2018-07-26 12:02 ` Hannes Reinecke
0 siblings, 1 reply; 8+ messages in thread
From: Christoph Hellwig @ 2018-07-26 12:01 UTC (permalink / raw)
On Thu, Jul 26, 2018@01:59:13PM +0200, Christoph Hellwig wrote:
> What target do you run against? With the current 4004a TP
> NVME_AEN_CFG_ANA_CHANGE should be set in OAES, which at least the
> Linux target always did anyway.
Ah, but the patches I sent out are missing this host side fix:
diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
index e482f223f8fd..f6e52ffe6a6d 100644
--- a/drivers/nvme/host/core.c
+++ b/drivers/nvme/host/core.c
@@ -1035,7 +1035,7 @@ int nvme_set_queue_count(struct nvme_ctrl *ctrl, int *count)
EXPORT_SYMBOL_GPL(nvme_set_queue_count);
#define NVME_AEN_SUPPORTED \
- (NVME_AEN_CFG_NS_ATTR | NVME_AEN_CFG_FW_ACT)
+ (NVME_AEN_CFG_NS_ATTR | NVME_AEN_CFG_FW_ACT | NVME_AEN_CFG_ANA_CHANGE)
static void nvme_enable_aen(struct nvme_ctrl *ctrl)
{
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH] nvme: Register for ANA AEN
2018-07-26 12:01 ` Christoph Hellwig
@ 2018-07-26 12:02 ` Hannes Reinecke
2018-07-26 12:07 ` Christoph Hellwig
0 siblings, 1 reply; 8+ messages in thread
From: Hannes Reinecke @ 2018-07-26 12:02 UTC (permalink / raw)
On 07/26/2018 02:01 PM, Christoph Hellwig wrote:
> On Thu, Jul 26, 2018@01:59:13PM +0200, Christoph Hellwig wrote:
>> What target do you run against? With the current 4004a TP
>> NVME_AEN_CFG_ANA_CHANGE should be set in OAES, which at least the
>> Linux target always did anyway.
>
> Ah, but the patches I sent out are missing this host side fix:
>
> diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
> index e482f223f8fd..f6e52ffe6a6d 100644
> --- a/drivers/nvme/host/core.c
> +++ b/drivers/nvme/host/core.c
> @@ -1035,7 +1035,7 @@ int nvme_set_queue_count(struct nvme_ctrl *ctrl, int *count)
> EXPORT_SYMBOL_GPL(nvme_set_queue_count);
>
> #define NVME_AEN_SUPPORTED \
> - (NVME_AEN_CFG_NS_ATTR | NVME_AEN_CFG_FW_ACT)
> + (NVME_AEN_CFG_NS_ATTR | NVME_AEN_CFG_FW_ACT | NVME_AEN_CFG_ANA_CHANGE)
>
> static void nvme_enable_aen(struct nvme_ctrl *ctrl)
> {
>
Ah. Maybe we should fix it up for the final submission...
Cheers,
Hannes
--
Dr. Hannes Reinecke Teamlead Storage & Networking
hare at suse.de +49 911 74053 688
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 N?rnberg
GF: F. Imend?rffer, J. Smithard, J. Guild, D. Upmanyu, G. Norton
HRB 21284 (AG N?rnberg)
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH] nvme: Register for ANA AEN
2018-07-26 12:02 ` Hannes Reinecke
@ 2018-07-26 12:07 ` Christoph Hellwig
2018-07-26 13:37 ` Hannes Reinecke
0 siblings, 1 reply; 8+ messages in thread
From: Christoph Hellwig @ 2018-07-26 12:07 UTC (permalink / raw)
On Thu, Jul 26, 2018@02:02:38PM +0200, Hannes Reinecke wrote:
> On 07/26/2018 02:01 PM, Christoph Hellwig wrote:
> > On Thu, Jul 26, 2018@01:59:13PM +0200, Christoph Hellwig wrote:
> >> What target do you run against? With the current 4004a TP
> >> NVME_AEN_CFG_ANA_CHANGE should be set in OAES, which at least the
> >> Linux target always did anyway.
> >
> > Ah, but the patches I sent out are missing this host side fix:
> >
> > diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
> > index e482f223f8fd..f6e52ffe6a6d 100644
> > --- a/drivers/nvme/host/core.c
> > +++ b/drivers/nvme/host/core.c
> > @@ -1035,7 +1035,7 @@ int nvme_set_queue_count(struct nvme_ctrl *ctrl, int *count)
> > EXPORT_SYMBOL_GPL(nvme_set_queue_count);
> >
> > #define NVME_AEN_SUPPORTED \
> > - (NVME_AEN_CFG_NS_ATTR | NVME_AEN_CFG_FW_ACT)
> > + (NVME_AEN_CFG_NS_ATTR | NVME_AEN_CFG_FW_ACT | NVME_AEN_CFG_ANA_CHANGE)
> >
> > static void nvme_enable_aen(struct nvme_ctrl *ctrl)
> > {
> >
> Ah. Maybe we should fix it up for the final submission...
I'll send out another round later today.
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH] nvme: Register for ANA AEN
2018-07-26 12:07 ` Christoph Hellwig
@ 2018-07-26 13:37 ` Hannes Reinecke
2018-07-26 15:12 ` Christoph Hellwig
0 siblings, 1 reply; 8+ messages in thread
From: Hannes Reinecke @ 2018-07-26 13:37 UTC (permalink / raw)
On 07/26/2018 02:07 PM, Christoph Hellwig wrote:
> On Thu, Jul 26, 2018@02:02:38PM +0200, Hannes Reinecke wrote:
>> On 07/26/2018 02:01 PM, Christoph Hellwig wrote:
>>> On Thu, Jul 26, 2018@01:59:13PM +0200, Christoph Hellwig wrote:
>>>> What target do you run against? With the current 4004a TP
>>>> NVME_AEN_CFG_ANA_CHANGE should be set in OAES, which at least the
>>>> Linux target always did anyway.
>>>
>>> Ah, but the patches I sent out are missing this host side fix:
>>>
>>> diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
>>> index e482f223f8fd..f6e52ffe6a6d 100644
>>> --- a/drivers/nvme/host/core.c
>>> +++ b/drivers/nvme/host/core.c
>>> @@ -1035,7 +1035,7 @@ int nvme_set_queue_count(struct nvme_ctrl *ctrl, int *count)
>>> EXPORT_SYMBOL_GPL(nvme_set_queue_count);
>>>
>>> #define NVME_AEN_SUPPORTED \
>>> - (NVME_AEN_CFG_NS_ATTR | NVME_AEN_CFG_FW_ACT)
>>> + (NVME_AEN_CFG_NS_ATTR | NVME_AEN_CFG_FW_ACT | NVME_AEN_CFG_ANA_CHANGE)
>>>
>>> static void nvme_enable_aen(struct nvme_ctrl *ctrl)
>>> {
>>>
>> Ah. Maybe we should fix it up for the final submission...
>
> I'll send out another round later today.
>
Would it make sense to read back the features after we've tried to
enable them?
It might be that the target doesn't enable ANA AENs (or doesn't support
them), at which point we have to disable ANA on the host as we rely on
ANA AENs for correct operations ...
Cheers,
Hannes
--
Dr. Hannes Reinecke Teamlead Storage & Networking
hare at suse.de +49 911 74053 688
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 N?rnberg
GF: F. Imend?rffer, J. Smithard, J. Guild, D. Upmanyu, G. Norton
HRB 21284 (AG N?rnberg)
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH] nvme: Register for ANA AEN
2018-07-26 13:37 ` Hannes Reinecke
@ 2018-07-26 15:12 ` Christoph Hellwig
0 siblings, 0 replies; 8+ messages in thread
From: Christoph Hellwig @ 2018-07-26 15:12 UTC (permalink / raw)
On Thu, Jul 26, 2018@03:37:48PM +0200, Hannes Reinecke wrote:
> > I'll send out another round later today.
> >
> Would it make sense to read back the features after we've tried to
> enable them?
> It might be that the target doesn't enable ANA AENs (or doesn't support
> them), at which point we have to disable ANA on the host as we rely on
> ANA AENs for correct operations ...
If it doesn't support the AEN it won't be in OAES..
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2018-07-26 15:12 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-07-26 10:55 [PATCH] nvme: Register for ANA AEN Hannes Reinecke
2018-07-26 10:58 ` Hannes Reinecke
2018-07-26 11:59 ` Christoph Hellwig
2018-07-26 12:01 ` Christoph Hellwig
2018-07-26 12:02 ` Hannes Reinecke
2018-07-26 12:07 ` Christoph Hellwig
2018-07-26 13:37 ` Hannes Reinecke
2018-07-26 15:12 ` Christoph Hellwig
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.