Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 9 Jul 2000 20:51:24 -0700
From:      Alfred Perlstein <bright@wintelcom.net>
To:        net@freebsd.org
Cc:        dg@freebsd.org, wollman@freebsd.org
Subject:   argh! Re: weird things with M_EXT and large packets
Message-ID:  <20000709205124.A25571@fw.wintelcom.net>
In-Reply-To: <20000709140441.T25571@fw.wintelcom.net>; from bright@wintelcom.net on Sun, Jul 09, 2000 at 02:04:41PM -0700
References:  <20000709140441.T25571@fw.wintelcom.net>

next in thread | previous in thread | raw e-mail | index | archive | help
* Alfred Perlstein <bright@wintelcom.net> [000709 14:04] wrote:
> I have some code here sending a mbuf via:
> 
> error = (*so->so_proto->pr_usrreqs->pru_send)(so, 0, m, 0, 0, p);
> 
> m is setup like so:
> 
>     m->m_ext.ext_free = kblob_mbuf_free;
>     m->m_ext.ext_ref = kblob_mbuf_ref;
>     m->m_ext.ext_buf = (void *)kb;
>     m->m_ext.ext_size = kb->kb_len;
>     m->m_data = (char *) kb->kb_data + uap->offset;
>     m->m_flags |= M_EXT;
>     m->m_pkthdr.len = m->m_len = uap->nbytes;
> 
> uap->nbytes is 59499.
> 
> It looks like the packet is being broken up or referenced to be sent,
> but at a certain point it hangs.

I'm 99.99% sure what's going on is that since I'm using normal kernel
malloc for these external clusters what's happening is that the device
driver is failing to notice that the data contained crosses a page
boundry and isn't breaking the data up properly.  Since the memory is
fragmented it's passing garbage over the wire that doesn't match the
checksum (hence the resending of the data)

Doing a transfer over localhost works fine.

If use contigmalloc to allocate the buffers then it works, I would really
rather not use contigmalloc because frankly it scares me.

Is there a specific reason the network drivers (or at least fxp)
don't seem to check page boundries so that discontig kmem can be
passed to the drivers in large chunks?  I'd rather not have to
allocate size/PAGE_SIZE mbuf headers for each send.

This may only fxp doing this incorrectly, or I may be just be
totally off, does this all make sense?

thanks,
-Alfred


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-net" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20000709205124.A25571>