What Is a PDU

· 219 words · 1 minute read

以前在 Ceph 上跑虚拟机的时候,偶尔看到 libvirt 报错:

qemu unexpectedly closed the monitor: sending req data... pdu length 134, total length 142
the received hdr shows the err 0, the pdu length 198
...

当时不知道这个 pdu 是啥意思。搜了一圈 libvirt, Qemu, Ceph,kernel 的源代码,也没找到类似上面报错的地方。最近看 linux SCSI 层代码的时候,碰到一个 blk_mq_rq_to_pdu() … 眼睛一亮。

StackOverflow 上找到了 What is a PDU答案

PDU is not Linux-specific. It’s a Protocol Data Unit. From Wikipedia

In telecommunications, a protocol data unit (PDU) is a single unit of information transmitted among peer entities of a computer network. A PDU is composed of protocol-specific control information and user data. In the layered architectures of communication protocol stacks, each layer implements protocols tailored to the specific type or mode of data exchange.

So in device drivers, this is a generic term for whatever units of data are managed by the specific device or protocol.

comments powered by Disqus