* SetPageForeign in netback
@ 2008-06-15 16:04 Zang Hongyong
2008-06-18 10:52 ` Grzegorz Miłoś
0 siblings, 1 reply; 5+ messages in thread
From: Zang Hongyong @ 2008-06-15 16:04 UTC (permalink / raw)
To: xen-devel
hi,
in netback init mmap_pages,
SetPageForeign(page, netif_page_release);
that is, page->index = netif_page_release
while netif_page_release is a function.
so what's the meaning of SetPageForeign?
And when the function netif_page_release() will be called?
thanks in advance.
Zang Hongyong
zanghongyong@ncic.ac.cn
2008-06-15
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: SetPageForeign in netback
2008-06-15 16:04 Zang Hongyong
@ 2008-06-18 10:52 ` Grzegorz Miłoś
0 siblings, 0 replies; 5+ messages in thread
From: Grzegorz Miłoś @ 2008-06-18 10:52 UTC (permalink / raw)
To: Zang Hongyong; +Cc: xen-devel
> hi,
> in netback init mmap_pages,
> SetPageForeign(page, netif_page_release);
> that is, page->index = netif_page_release
> while netif_page_release is a function.
netif_page_release is a function, and therefore:
page->index = netif_page_release
will store netif_page_release function pointer in 'index'
> so what's the meaning of SetPageForeign?
Setting a page foreign means that the page is owned by another domain,
and that some care needs to be taken when freeing it.
> And when the function netif_page_release() will be called?
Whenever PageForeignDestructor is called (as it calls the destructor
function stored in the 'index' field).
PageForeignDestructor is called from:
__free_pages_ok
and
free_hot_cold_page
Hope this helps.
Cheers
Gr(z)egor(z)
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: SetPageForeign in netback
2008-06-19 0:40 Re: " Zang Hongyong
@ 2008-06-19 7:22 ` Keir Fraser
0 siblings, 0 replies; 5+ messages in thread
From: Keir Fraser @ 2008-06-19 7:22 UTC (permalink / raw)
To: Zang Hongyong, gm281; +Cc: xen-devel
The aim is to achieve batching and scheduling of work (to some extent) on
both the transmit and receive paths. So no vif gets starved, and larger
batches of packets are handled more efficiently.
-- Keir
On 19/6/08 01:40, "Zang Hongyong" <zanghongyong@ncic.ac.cn> wrote:
> Thanks again!
> Another question about netback.
> tasklet is used in both tx and rx. Lets take a look at rx, Before tasklet,
> packets of all vnifs must be queued together, and in tasklet packet will be
> dequeued, and handled to its proper netfront of domU.
> 1)why not handle packet directly without the overall queue and tasklet stuff?
> 2)Is the overall queue and tasklet stuff fair to all vnifs? For example, when
> vif1.0 rx, the netback driver put its packet to overall queue and do tasklet,
> while in tasklet, packets belonging to other vif maybe handled.
> I've noticed when tx, netfront handle packet directly to its proper
> Ring,Request stuff.
>
>
>
> ======= 2008-06-19 00:37:40 您在来信中写道:=======
>
>>> Many thanks!
>>> And that is, when tx, after the data page is sent by native Nic driver in
>>> dom0, the data page will be freed, then netif_page_release() called which
>>> indicates netback to unmap the page offered by domU, and moves on its tx
>>> response.
>>>
>>> Is that so?
>>
>> Correct.
>>
>>> If so, how about a bad NIC driver which doen't call free_page() after
>>> sending data out of machine ?
>>
>> Well, it could happen if there was a memory leak in the driver. This
>> would also be present in non-xenified linux. We are hoping for
>> bug-free device drivers.
>>
>>
>>> and Why mmap_pages is allocated by
>>> alloc_empty_pages_and_pagevec(MAX_PENDING_REQS)?
>>> can mmap_pages be allocated by alloc_vm_area() and vmalloc_to_page() ??
>>
>> alloc_empty_pages_and_pagevec() balloons machine memory frames away
>> from Dom0, you are therefore left with pseudo-physical page that's not
>> backed by real memory. You want that, because you'll substitute DomU's
>> memory frame in it's place. I don't think alloc_vm_area does that. It
>> would only allocate virtually continuous range of memory.
>>
>> Cheers
>> Gr(z)egor(z)
>>
>>>
>>> Forgive my silly questions above please.
>>>
>>>
>>> ======= 2008-06-18 18:52:27 您在来信中写道:=======
>>>
>>>>> hi,
>>>>> in netback init mmap_pages,
>>>>> SetPageForeign(page, netif_page_release);
>>>>> that is, page->index = netif_page_release
>>>>> while netif_page_release is a function.
>>>>
>>>> netif_page_release is a function, and therefore:
>>>> page->index = netif_page_release
>>>> will store netif_page_release function pointer in 'index'
>>>>
>>>>> so what's the meaning of SetPageForeign?
>>>>
>>>> Setting a page foreign means that the page is owned by another domain,
>>>> and that some care needs to be taken when freeing it.
>>>>
>>>>> And when the function netif_page_release() will be called?
>>>>
>>>> Whenever PageForeignDestructor is called (as it calls the destructor
>>>> function stored in the 'index' field).
>>>> PageForeignDestructor is called from:
>>>> __free_pages_ok
>>>> and
>>>> free_hot_cold_page
>>>>
>>>> Hope this helps.
>>>>
>>>> Cheers
>>>> Gr(z)egor(z)
>>>>
>>>> _______________________________________________
>>>> Xen-devel mailing list
>>>> Xen-devel@lists.xensource.com
>>>> http://lists.xensource.com/xen-devel
>>>>
>>>>
>>>
>>> = = = = = = = = = = = = = = = = = = = =
>>> Zang Hongyong
>>> zanghongyong@ncic.ac.cn
>>> 2008-06-18
>>>
>>>
>>> _______________________________________________
>>> Xen-devel mailing list
>>> Xen-devel@lists.xensource.com
>>> http://lists.xensource.com/xen-devel
>>>
>>>
>> _______________________________________________
>> Xen-devel mailing list
>> Xen-devel@lists.xensource.com
>> http://lists.xensource.com/xen-devel
>>
>
> = = = = = = = = = = = = = = = = = = = =
> Zang Hongyong
> zanghongyong@ncic.ac.cn
> 2008-06-19
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xensource.com
> http://lists.xensource.com/xen-devel
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Re: Re: Re: Re: SetPageForeign in netback
@ 2008-06-25 0:50 Zang Hongyong
2008-06-27 15:59 ` Neil Turton
0 siblings, 1 reply; 5+ messages in thread
From: Zang Hongyong @ 2008-06-25 0:50 UTC (permalink / raw)
To: gm281; +Cc: xen-devel
[-- Attachment #1: Type: text/plain, Size: 1634 bytes --]
Thanks a lot.
I noticed that the plug-in accelerator is available in Xen3.2 Source code. The accelerator is used for direct IO network devices such as Infiniband and Solarflare 10G Nic.
Can it be used for the PCIE IOV devices?
and is there any referece implementation of PCIE IOV Nics now?
======= 2008-06-24 14:41:49 您在来信中写道:=======
>>>The reason why you have to copy is to make sure that you pull the skb
>>>into a fresh page (which doesn't have any other pieces of data in it).
>>>It's only then that you can flip it to DomU.
>>>It used to be the case that the backend was more efficient in the
>>>rx-flip mode. Some/most skbs copies were avoided by keeping a close
>>>eye on the skb allocation. Since rx-flip is now only/mostly kept for
>>>backward compatibility (rx-copy is the default) the code was
>>>simplified.
>>
>> You mean in previous Xen release, rx-flip is more efficient than today's release. And keeping rx-flip in Xen Source Code tree today is only for compatibility. So no need to do more optimizing for it.
>> Is my understanding right?
>>
>
>I don't know if much performance was lost (the code got simplified, at
>the expense of potentially more skb copies, but I don't know of any
>experimental tests to benchmark what the effect was exactly), but
>aside from that, your understanding is correct.
>
>Cheers
>Gr(z)egor(z)
>
>_______________________________________________
>Xen-devel mailing list
>Xen-devel@lists.xensource.com
>http://lists.xensource.com/xen-devel
>
>
= = = = = = = = = = = = = = = = = = = =
Zang Hongyong
zanghongyong@ncic.ac.cn
2008-06-25
[-- Attachment #2: Type: text/plain, Size: 138 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: SetPageForeign in netback
2008-06-25 0:50 Re: Re: Re: Re: SetPageForeign in netback Zang Hongyong
@ 2008-06-27 15:59 ` Neil Turton
0 siblings, 0 replies; 5+ messages in thread
From: Neil Turton @ 2008-06-27 15:59 UTC (permalink / raw)
To: Zang Hongyong; +Cc: xen-devel, gm281
Hi Zang,
You wrote:
> I noticed that the plug-in accelerator is available in Xen3.2 Source code. The
> accelerator is used for direct IO network devices such as Infiniband and
> Solarflare 10G Nic.
> Can it be used for the PCIE IOV devices?
> and is there any referece implementation of PCIE IOV Nics now?
The accelerator plug-in framework is designed to be general-purpose, so
it should work fine with IOV devices. It requires a plug-in driver to
be written for both netfront and netback. Between them, these drivers
will need to ensure that BAR pages are mapped into the guest, IOMMU page
tables are setup and interrupts passed to the guest. These jobs are
outside the scope of the accelerator framework which is just concerned
with handing over traffic from netfront/netback.
I don't know of a reference implementation of an IOV NIC - just the
Solarflare one, but the PCI passthrough code should help you with
mapping interrupts and pages. Which NIC are you wanting to use?
Cheers, Neil.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2008-06-27 15:59 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-06-25 0:50 Re: Re: Re: Re: SetPageForeign in netback Zang Hongyong
2008-06-27 15:59 ` Neil Turton
-- strict thread matches above, loose matches on Subject: below --
2008-06-19 0:40 Re: " Zang Hongyong
2008-06-19 7:22 ` Keir Fraser
2008-06-15 16:04 Zang Hongyong
2008-06-18 10:52 ` Grzegorz Miłoś
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.