All of lore.kernel.org
 help / color / mirror / Atom feed
From: hch@infradead.org (Christoph Hellwig)
Subject: [PATCH] nvme: avoid cqe corruption when update at the same time as read
Date: Thu, 10 Mar 2016 06:36:50 -0800	[thread overview]
Message-ID: <20160310143650.GA8689@infradead.org> (raw)
In-Reply-To: <881149974.3314758.1457608128188.JavaMail.zimbra@kalray.eu>

On Thu, Mar 10, 2016@12:08:48PM +0100, Marta Rybczynska wrote:
> Looks like a good refactoring to me. However, it seems to me that in
> nvme_cqe_valid we should be checking for phase, not for head.

Yeah, this doesn't work as-is.  I still think that non-obvious
check should be split out into something.  Maybe just:

static inline bool nvme_cqe_valid(struct nvme_queue *nvmeq, u16 head, u16 phase)
{
	return (le16_to_cpu(nvmeq->cqes[head].status) & 1) == phase;
}

  reply	other threads:[~2016-03-10 14:36 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1963234885.1121305.1457109031908.JavaMail.zimbra@kalray.eu>
2016-03-05  7:23 ` [PATCH] nvme: avoid cqe corruption when update at the same time as read Marta Rybczynska
2016-03-09 17:08   ` Christoph Hellwig
2016-03-10  8:31     ` Johannes Thumshirn
2016-03-10 11:08     ` Marta Rybczynska
2016-03-10 14:36       ` Christoph Hellwig [this message]
2016-03-10 15:07         ` Marta Rybczynska
2016-03-15  8:24           ` Christoph Hellwig
2016-03-10 15:07         ` Keith Busch

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=20160310143650.GA8689@infradead.org \
    --to=hch@infradead.org \
    /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 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.