[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] FreeBSD netfront.c / problem



At Thu, 09 Mar 2006 16:36:13 +0100,
Simon Kagstrom wrote:
>  48   for (i = 0, m_new = sc->xn_rx_batch; m_new; 
>  49        i++, sc->xn_rx_batchlen--, m_new = next) {
>  50 
>               [...]
>  70           rx_pfn_array[i] = vtomach(mtod(m_new,vm_offset_t)) >> 
> PAGE_SHIFT;
> 
> The above call fails gives -1 (i.e., an invalid virtual -> machine
> translation) time since some mbufs are placed on the same page.
> 
>  71           
>  72           /* Remove this page from pseudo phys map before passing back to 
> Xen. */
>  73           xen_phys_machine[((unsigned long)m_new->m_ext.ext_args >> 
> PAGE_SHIFT)] 
>  74           = INVALID_P2M_ENTRY;
> 
> ... because this invalidates that mapping. I therefore get every
> [...]
> second entry in rx_pfn_array set to -1.
> Questions: I don't know FreeBSD very well, but does FreeBSD always
> place the mbufs on separate pages? How could the above code otherwise
> work?

I think I found the problem myself, in sys/i386-xen/conf/XENCONF,
MCLSHIFT is defined to 12, which means that each mbuf cluster will be
4KB large. I had it at 11, which should explain why every second
rx_pfn_array was reset.

So, then I'm curious: was this the reason for setting MCLSHIFT to 12
in FreeBSD?

// Simon


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.