mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: Rusty Russell <rusty@rustcorp.com.au>
Cc: Christoph Hellwig <hch@lst.de>,
	qemu-devel@nongnu.org, linux-kernel@vger.kernel.org,
	stefanha@gmail.com, kwolf@redhat.com, prerna@linux.vnet.ibm.com,
	aliguori@us.ibm.com
Subject: Re: [PATCH, RFC] virtio_blk: add cache control support
Date: Wed, 16 Mar 2011 15:09:58 +0100	[thread overview]
Message-ID: <20110316140958.GB21877@lst.de> (raw)
In-Reply-To: <87y64fhfjw.fsf@rustcorp.com.au>

On Wed, Mar 16, 2011 at 02:39:39PM +1030, Rusty Russell wrote:
> > +	if (strncmp(buf, "write through", sizeof("write through") - 1) == 0) {
> > +		;
> > +	} else if (strncmp(buf, "write back", sizeof("write back") - 1) == 0) {
> 
>    Is there a reason we're not letting gcc and/or strcmp do the
> optimization work here?

I'm happ to switch strcmp.

> > +	vdev->config->set(vdev, offsetof(struct virtio_blk_config, features),
> > +	                  &features, sizeof(features));
> > +
> > +	vdev->config->get(vdev, offsetof(struct virtio_blk_config, features),
> > +			  &features2, sizeof(features2));
> > +
> > +	if ((features & VIRTIO_BLK_RT_WCE) !=
> > +	    (features2 & VIRTIO_BLK_RT_WCE))
> > +		return -EIO;
> 
>    This seems like a debugging check you left in.  Or do you suspect
> some issues?

No, it's intentional.  config space writes can't return errors, so we need
to check that the value has really changed.  I'll add a comment explaining it.


  reply	other threads:[~2011-03-16 14:10 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20110315141049.GA30627@lst.de>
2011-03-15 14:16 ` Christoph Hellwig
2011-03-16  4:09   ` Rusty Russell
2011-03-16 14:09     ` Christoph Hellwig [this message]
2011-03-17  5:06       ` Rusty Russell
2011-03-17 14:21         ` [Qemu-devel] " Christoph Hellwig
2011-03-24  0:11           ` Rusty Russell
2011-03-24  3:11           ` Anthony Liguori
2011-03-24  3:05         ` Anthony Liguori
2011-03-24  9:54           ` Christian Borntraeger
2011-03-25  5:08             ` Rusty Russell

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=20110316140958.GB21877@lst.de \
    --to=hch@lst.de \
    --cc=aliguori@us.ibm.com \
    --cc=kwolf@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=prerna@linux.vnet.ibm.com \
    --cc=qemu-devel@nongnu.org \
    --cc=rusty@rustcorp.com.au \
    --cc=stefanha@gmail.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

all inboxes | Powered by JetHome®