On 2014/8/21 5:21, Michael S. Tsirkin wrote:
> On Wed, Aug 20, 2014 at 12:18:33PM +0200, Michael S. Tsirkin wrote:
>>> Because of vhost_net_set_vq_index, VM can be start successfully.
>>> But, after about 80 times of migration under my environment, virtual nic 
>>> became unreachable again.
>>> When I use jprobe to notify tap, the virtual nic becomes reachable again. 
>>> This shows that interrupts missing causes
>>> the problem.
>>
>> Could you please clarify what do you mean by "notify tap" here?
>> Thanks!
>  
> Or just post your jprobe script.
> 
Ok, thanks, this is the key function.
static int cont =1;
static int virtnet_poll_jprobe(struct napi_struct *napi, int budget)
{
        struct receive_queue *rq =
                container_of(napi, struct receive_queue, napi);
        struct virtnet_info *vi = rq->vq->vdev->priv;
        struct send_queue *sq;
        struct vring_virtqueue *vq;
        int i;

        if (cont == 1) {
                for (i = 0; i < curr_queue_pairs; i++) {
                        sq = &vi->sq[i];
                        vq = to_vvq(sq->vq);
                       vq->notify(sq->vq);
                }
                cont = 0;
        }
        jprobe_return();
        return 0;
}
When the problem occurs, one queue pair(each nic has two queue pairs) is 
active, so virtual nic can still receive skbs.
And, only one queue pair misses a interrupt.
To run the jprobe, some definition of function and structure should be copied 
to jprobe.c.

-- 
Best Wishes!
Zhang Jie


Reply via email to