Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 20 Nov 2023 07:36:18 -0800
From:      Chuck Tuffli <chuck@freebsd.org>
To:        Yuri <yuri@aetern.org>
Cc:        Warner Losh <imp@freebsd.org>, src-committers@freebsd.org,  dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org
Subject:   Re: git: 34a6ad848fbf - main - nvme: Don't use version to listen for events for ns and fw changes
Message-ID:  <CAKAYmMJJfTTHUJrKLKmhWE2p4Y-Cm4Rz1pFzfnZPh-%2BEGGHbsw@mail.gmail.com>
In-Reply-To: <71162369-66f6-4f08-9ba7-e87236151fee@aetern.org>
References:  <202311180432.3AI4W3YM029176@gitrepo.freebsd.org> <71162369-66f6-4f08-9ba7-e87236151fee@aetern.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, Nov 17, 2023 at 8:53=E2=80=AFPM Yuri <yuri@aetern.org> wrote:
>
> Warner Losh wrote:
> > The branch main has been updated by imp:
> >
> > URL: https://cgit.FreeBSD.org/src/commit/?id=3D34a6ad848fbf471773a430a7=
e457bf49816e756e
> >
> > commit 34a6ad848fbf471773a430a7e457bf49816e756e
> > Author:     Warner Losh <imp@FreeBSD.org>
> > AuthorDate: 2023-11-18 04:24:00 +0000
> > Commit:     Warner Losh <imp@FreeBSD.org>
> > CommitDate: 2023-11-18 04:25:57 +0000
> >
> >     nvme: Don't use version to listen for events for ns and fw changes
...
> >       if (ctrlr->cdata.ver >=3D NVME_REV(1, 2))
>
> It seems to be under version check still? Or am I misreading the commit
> message?
>
> > -             ctrlr->async_event_config |=3D NVME_ASYNC_EVENT_NS_ATTRIB=
UTE |
> > -                 NVME_ASYNC_EVENT_FW_ACTIVATE;
> > +             ctrlr->async_event_config |=3D
> > +                 ctrlr->cdata.oaes & (NVME_ASYNC_EVENT_NS_ATTRIBUTE |
> > +                     NVME_ASYNC_EVENT_FW_ACTIVATE);

I think this logic is correct as the Namespace and Firmware events
didn't exist prior to version 1.2. The significant change here
(irrespective of the commit message wording) is masking these events
if the device doesn't support them. That is, their respective bit in
OAES (aka Optional Async Events Supported) will be zero if not
supported and then won't be added to the async_event_config.

Perhaps the intent was "Don't _only_ use the version to listen for
events, but also check they are supported".
My $.02

--chuck



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAKAYmMJJfTTHUJrKLKmhWE2p4Y-Cm4Rz1pFzfnZPh-%2BEGGHbsw>