【正文】
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 packetbuffer in kernelspace Splitting our packetbuffer 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 Two physical packetbuffers prise one logical packet that gets transmitted! Transmitting a ?splitpacket? NIC hardware Devicedriver module Applicationprogram Userspace Kernelspace packetdata buffer packetheader buffer DMA DMA The 82573L controller ‘merges’ the contents of these