All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bob Liu <bob.liu@oracle.com>
To: "Roger Pau Monné" <roger.pau@citrix.com>
Cc: xen-devel@lists.xen.org, david.vrabel@citrix.com,
	justing@spectralogic.com, konrad.wilk@oracle.com,
	paul.durrant@citrix.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] driver: xen-blkfront: move talk_to_blkback to the correct place
Date: Fri, 15 May 2015 19:03:07 +0800	[thread overview]
Message-ID: <5555D26B.8040002@oracle.com> (raw)
In-Reply-To: <5555C3DE.7090603@citrix.com>


On 05/15/2015 06:01 PM, Roger Pau Monné wrote:
> El 12/05/15 a les 13.01, Bob Liu ha escrit:
>> The right place for talk_to_blkback() to query backend features and transport
>> parameters is after backend entered XenbusStateInitWait. There is no problem
> 
> talk_to_blkback doesn't gather any backend features, it just publishes
> the features supported by the frontend, which AFAICT can be done at any

1) But talk_tlkback will also allocate and initialize the request ring which
should be done after backend entered XenbusStateInitWait.

Please see the protocol defined in xen/include/public/io/blkif.h:
 *****************************************************************************
 *                                   Startup                                 *
 *****************************************************************************
 *
 * Tool stack creates front and back nodes with state XenbusStateInitialising.
 *
 * Front                                Back
 * =================================    =====================================
 * XenbusStateInitialising              XenbusStateInitialising
 *  o Query virtual device               o Query backend device identification
 *    properties.                          data.
 *  o Setup OS device instance.          o Open and validate backend device.
 *                                       o Publish backend features and
 *                                         transport parameters.
 *                                                      |
 *                                                      |
 *                                                      V
 *                                      XenbusStateInitWait
 *
 * o Query backend features and
 *   transport parameters.
 * o Allocate and initialize the
 *   request ring.


2) Another problem is after 'mutli-page' ring feature get introduced, we have to know the max
ring pages supported by backend in setup_blkring().
If backend haven't enter XenbusStateInitWait, we may not query the right value. E.g.

Frontend                                          Backend

in .probe:
talk_to_blkback()
 > setup_blkring()
  > xenbus_scanf(max_ring_pages)



                                               in .probe:
                                               xenbus_printf(max_ring_pages)
                                               ^^^^ Too late to write the real value
                                               xenbus_switch_state(dev, XenbusStateInitWait)


Thank you reviewing these patches!

Regards,
-Bob

> time provided that it's before switching to state XenbusStateInitWait.
> Blkfront doesn't have to wait for the backend to switch to state
> XenbusStateInitWait before publishing the features supported by the
> frontend, which is what talk_to_blkback does.
> 
> Roger.
> 


  parent reply	other threads:[~2015-05-15 11:03 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-12 11:01 [PATCH 1/2] driver: xen-blkfront: move talk_to_blkback to the correct place Bob Liu
2015-05-12 11:01 ` [PATCH v3 2/2] xen/block: add multi-page ring support Bob Liu
2015-05-15 11:13   ` Roger Pau Monné
2015-05-15 11:13   ` Roger Pau Monné
2015-05-15 12:06     ` Bob Liu
2015-05-15 12:06     ` Bob Liu
2015-05-20  9:34       ` Roger Pau Monné
2015-05-20  9:34       ` Roger Pau Monné
2015-05-12 11:01 ` Bob Liu
2015-05-15 10:01 ` [PATCH 1/2] driver: xen-blkfront: move talk_to_blkback to the correct place Roger Pau Monné
2015-05-15 11:03   ` Bob Liu
2015-05-15 11:03   ` Bob Liu [this message]
2015-05-15 11:14     ` Roger Pau Monné
2015-05-15 11:35       ` Bob Liu
2015-05-15 11:35       ` Bob Liu
2015-05-15 11:57         ` Roger Pau Monné
2015-05-15 11:57         ` Roger Pau Monné
2015-05-15 11:14     ` Roger Pau Monné
2015-05-15 10:01 ` Roger Pau Monné
  -- strict thread matches above, loose matches on Subject: below --
2015-05-12 11:01 Bob Liu

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=5555D26B.8040002@oracle.com \
    --to=bob.liu@oracle.com \
    --cc=david.vrabel@citrix.com \
    --cc=justing@spectralogic.com \
    --cc=konrad.wilk@oracle.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=paul.durrant@citrix.com \
    --cc=roger.pau@citrix.com \
    --cc=xen-devel@lists.xen.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.