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

Sending Network Packets with Mirage/kFreeBSD



Hello there,

For your information, I have just updated the Mirage/kFreeBSD repository
at GitHub that now implements support for sending packets:

https://github.com/pgj/mirage-kfreebsd/commit/a51477bb5e1c60fd34efbf211d153a46093ec4ba

The current binding technically maps Mirage IO pages or list of IO pages
to FreeBSD mbuf(9) buffers while it avoids copying their contents.  As a
side-product, it introduces reference counting on the mbuf(9) values, so
they are shared between the NIC driver sending the packets and the OCaml
run-time system.  The trick is to create EXTREF type mbuf(9)s so I can
refer to external memory locations via m_data and help the reference counting
via m_ext.ext_free.

I also added two simple tests, like an ARP probe and sending ICMP echo
requests to check the functionality.  The code for these come from mirage-net
package that I also added in this commit (with some minor changes, but it
builds):

https://github.com/pgj/mirage-kfreebsd/commit/0ff5b2cd7ab0975e3f2ee1bd89f8e5dbf028b102

They seem to be working, however I am not quite happy the current memory
management, as each time I unload the modules, I see many leaked allocations.
I checked the code and the IO pages are released by the GC, but something
else is still stuck in the memory.  Do you have any ideas how to track down
these?



 


Rackspace

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