xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Dongli Zhang <dongli.zhang@oracle.com>
To: shishir tiwari <sumit.tiwari1943@gmail.com>, xen-devel@lists.xen.org
Cc: Wei Liu <wei.liu2@citrix.com>
Subject: Re: Paravitrualization drivers query
Date: Fri, 21 Jul 2017 15:34:41 +0800	[thread overview]
Message-ID: <5155e963-83c5-0be5-6e33-ff8996668fbe@oracle.com> (raw)
In-Reply-To: <CANS8LXU_LjX9rm6xN6gBm9Um-N5SvRwx0KLEsToENd5n8EdC9g@mail.gmail.com>



On 07/21/2017 03:12 PM, shishir tiwari wrote:
> 
>     > Hi
>     >
>     > I am trying understand Xen Pv drivers and i writing my own pv fronend and
>     > backend driver.
>     >
>     > 1. For driver internal communication how do i create/write node in backend
>     > driver and how to read in fronted drivers.
>     > 2.how do i create one shared page in backend driver to write/read data in
>     > frontend driver.
>     >
> 
>     >Depending on where your driver lives >(kernel or userspace), the APIs are
>     >going to be different.
> 
> 
> My driver will be in kernel space. I want to create some Node and shared page or
> queue. So I can transfer data for domu to dom0. 

Hi Shishir

I suggest you read about drivers/net/xen-netfront.c and
drivers/net/xen-netback/* in linux kernel.

You would rely on xenbus/xenstore to read/write node in frontend or backend and
the corresponding APIs are xenbus_write, xenbus_printf, xenbus_read, etc.

To create shared page between frontend and backend, you create use grant tale
mechanism. Generally, each grant table reference is used to indicate one shared
memory page. The frontend allocates a page to share and bind this page to a
grant table reference. This reference is then passed to backend via xenstore or
ring buffer. Backend maps the shared page with this reference via APIs like
gnttab_map_refs().

I suggest you read about the book "Definitive Guide to Xen Hypervisor" and read
about linux paravirtual driver code.

Dongli Zhang

> 
> 
>     > I gone-through kernel code and but its tittle bit confusing to me.
> 
>     >>Which bits do you find confusing?
> 
> 
> I am not able to understand who first create Node and shared memory by xen or
> domO or may be by frontend drivers
> 
> 
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> https://lists.xen.org/xen-devel
> 

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

  reply	other threads:[~2017-07-21  7:34 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CANS8LXW26tg3LAy2G0pJWiTtNGGsFn4tkfezSo5NvQZGgaUGsQ@mail.gmail.com>
2017-07-20 14:59 ` Paravitrualization drivers query shishir tiwari
2017-07-20 16:50   ` Wei Liu
     [not found]     ` <CANS8LXV9Tu9YciUr0M9EOzY53ha9QFtwW4SDcrQ5mKmPNYm=0A@mail.gmail.com>
     [not found]       ` <CANS8LXVU_M7ezMuP5VmYgWo5e6GLBNedoR-u2TSHQdkQE8thhQ@mail.gmail.com>
2017-07-21  7:12         ` shishir tiwari
2017-07-21  7:34           ` Dongli Zhang [this message]
2017-07-21  8:22           ` Wei 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=5155e963-83c5-0be5-6e33-ff8996668fbe@oracle.com \
    --to=dongli.zhang@oracle.com \
    --cc=sumit.tiwari1943@gmail.com \
    --cc=wei.liu2@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).