Skip to contentSkip to conversation

weird problem in event channel setup

DISCUSSION Anthony Liguori 2 participants 2 messages Jan 17, 2005 – Jan 18, 2005

lore
Share & tools
lore
#0 lore raw

---- Original message ----

Quoted 9 lines

Date: Mon, 17 Jan 2005 16:57:53 -0500 (EST)
From: Xin Zhao <[email protected]>
Subject: [Xen-devel] weird problem in event channel setup
To: [email protected]

Hi, folks,

I ran into a weird problem when I tried to setup an event channel between dom0 and domU:

Using which ports?

Quoted 3 lines

My code is quite simple: first, a dom0 application create a new channel and bind dom0 and domU with this channel, second, the dom0 send a message over control interface and send a notification via the control channel

to the domU,

Quoted 1 line

then the dom0 application quited.

Where you using the control_msg_t ring queues? If so, what did you base your code on?

Quoted 7 lines

At the domU side, I used a kernel module to listen on the message by calling ctrl_if_register_receiver, when a message is available, the kernel module will print out the message.

When I run the dom0 app for a couple of times in a fast manner, domU will be suspended. But if I run the dom0 application in a slow way (run, wait for a while, run again), domU works fine.

Maybe the queue is filling up and you're not gracefully handling it. Hard to say, would it be possible to post your code somewhere?

Regards,

Anthony Liguori
email: [email protected]

Quoted 5 lines

Anybody knows why? Please give me hand. Thanks.

-X

Quoted 8 lines

-------------------------------------------------------
The SF.Net email is sponsored by: Beat the post-holiday blues Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek. It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/xen-devel

-------------------------------------------------------
The SF.Net email is sponsored by: Beat the post-holiday blues Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek. It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt

#1 lore raw

The pseudo code is like this:

At the Dom0 side:

1. xu_port_new(domid,0,0) // create a new port and connect dom0 and domU(domid)

2. create a new message

    ctrl_msg_t cmsg;
    cmsg.type      = CMSG_SVDIF_FE;
    cmsg.id  = 1;
    cmsg.subtype   = 1;

    channel_msg.local = scp->local_port;
    channel_msg.remote = scp->remote_port;
    memcpy(cmsg.msg,&channel_msg,sizeof(channel_msg));
    cmsg.length    = sizeof(channel_msg);

3. xu_port_write_request() send out the new msg

4. xu_port_notify() send out notification to the DomU, the local port is retrieved with the following codes:

local_port = 0;
remote_port = 1; xc_evtchn_bind_interdomain(self->xc_handle,DOMID_SELF,domid,&local_port, &remote_port);

5. quit.

At the DomU side, we use a simple kernel module, it first register a receiver with ctrl_if_register_receiver(CMSG_SVDIF_FE, ctrl_if_rx); In ctrl_if_rx, we just print out the received msg.

That's it. If the Dom0 app runs in a slow manner, everything seems to be fine. But if the Dom0 app runs very fast, after 2 or 3 rounds, DomU will suspend.

Can someone help me out? I was stuck for quite long time. :( Thanks in advance.

Xin

Quoted 30 lines · Anthony Liguori

---- Original message ----

Quoted 9 lines

Date: Mon, 17 Jan 2005 16:57:53 -0500 (EST)
From: Xin Zhao <[email protected]>
Subject: [Xen-devel] weird problem in event channel setup
To: [email protected]

Hi, folks,

I ran into a weird problem when I tried to setup an event channel between dom0 and domU:

Using which ports?

Quoted 3 lines

My code is quite simple: first, a dom0 application create a new channel and bind dom0 and domU with this channel, second, the dom0 send a message over control interface and send a notification via the control channel

to the domU,

Quoted 1 line

then the dom0 application quited.

Where you using the control_msg_t ring queues? If so, what did you base your code on?

Quoted 7 lines

At the domU side, I used a kernel module to listen on the message by calling ctrl_if_register_receiver, when a message is available, the kernel module will print out the message.

When I run the dom0 app for a couple of times in a fast manner, domU will be suspended. But if I run the dom0 application in a slow way (run, wait for a while, run again), domU works fine.

Quoted 22 lines

Maybe the queue is filling up and you're not gracefully handling it. Hard to say, would it be possible to post your code somewhere?

Regards,

Anthony Liguori
email: [email protected]

Quoted 13 lines

Anybody knows why? Please give me hand. Thanks.

-X

-------------------------------------------------------
The SF.Net email is sponsored by: Beat the post-holiday blues Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek. It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/xen-devel

-------------------------------------------------------
The SF.Net email is sponsored by: Beat the post-holiday blues Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek. It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt