【正文】
。 } Transmit operation application program user databuffer runtime library write() Linux OS kernel nic devicedriver my_write() file subsystem hardware packet buffer copy_from_user() DMA user space kernel space We want to eliminate this copyingoperation Our driver?s packetlayout packetbuffer in kernelspace destnaddress sourceaddress TYPE/ LENGTH count data data data – baseaddress (64bits) status Packet length special CSS 16 bytes cmd CSO Format for Legacy TransmitDescriptor Can zerocopy be transparent? ? We would like to implement the zerocopy concept in out ?? character driver in such a manner that no changes would be required to an ?application? program?s code ? We will show how to do this for ?outgoing? packets (., by modifying ?my_write()?), but achieving zerocopy with ?ining? packets would be a lot more plicated! TX Descriptor?s CMD byte I D E V L E 0 0 R S I C I F C S E O P CommandByte Format EOP = EndOfPacket (1=yes, 0=no) RS = Report Status (1=yes, 0=no) VLE = VLANtag Enable Key question: What will the NIC do if we don’t set the EOPbit in a TX Descriptor? Splitting our packetlayout packetbuffer in kernelspace destnaddress sourceaddress TYPE/ LENGTH count data data data – baseaddress (64bits) status Packet Length (=HDR) special CSS cmd EOP=0 CSO Format for Legacy TransmitDescriptor Pair baseaddress (64bits) status Packet Length (=LEN) special CSS cmd EOP=1 CSO HDR LEN packetbuffer in userspace