Skip to contentSkip to conversation

Questions about the FreeBSD network subsystem

DISCUSSION Roger Pau Monné 1 participant 1 message Sep 8, 2015

lore
Share & tools
lore
#0 lore raw

Hello,

I'm not very familiar with FreeBSD network subsystem and I'm trying to import a new version of xen-netfront from Linux to FreeBSD. So far so good, most stuff is pretty similar and I think I've _mostly_ figured it out by myself. I have however a couple of questions regarding the network subsystem.

I'm planning to use if_transmit/if_qflush instead of if_start. AFAICT I have to create my own queue inside of the driver in order to queue packets if the shared ring is full. What's the prefer way to do this? I see there are functions to create a mbuf queue (mbufq) or a ifnet based queue (drbr_* family of functions). I expect using drbr is TRTTD, but I would like to get some confirmation before proceeding.

Also, the Xen PV network protocol allows signalling packets that contain valid data or blank checksums. It allows specifying the following flags:

- NET{RX/TR}F_data_validated: packet data has been validated against
protocol checksum.
- NET{RX/TX}F_csum_blank: protocol checksum field is blank in the
packet (hardware offload)?.
- No flag: checksum present and valid.

How do this options translate to the csum_flags present in mbufs on FreeBSD?

Thanks, Roger.