WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

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

To: xen-devel list <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: Re: [Xen-devel] FreeBSD netfront.c / problem
From: Simon Kagstrom <simon.kagstrom@xxxxxx>
Date: Fri, 10 Mar 2006 11:06:25 +0100
Delivery-date: Fri, 10 Mar 2006 10:08:18 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <877j73636a.wl%simon.kagstrom@xxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <877j73636a.wl%simon.kagstrom@xxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Wanderlust/2.15.2 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.6 (Marutamachi) APEL/10.6 Emacs/21.4 (i386-pc-linux-gnu) MULE/5.0 (SAKAKI)
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

<Prev in Thread] Current Thread [Next in Thread>