> Im not an expert on the ral driver, but openbsd drivers practically
 > never map device registers into memory. The value of flags will be
 > written to hardware later.

Unless I'm misunderstanding the driver, the TX ring is in system
memory -- in other words the device will read the descriptors from
RAM, any time after they are written.  There is an MMIO register to
kick the chip and ask it to start processing the TX ring, but I think
a sequence like the following is completely possible:

    CPU                        DEVICE

    set VALID in TX desc 1
    setup rest of TX desc 1
    kick TX engine
                               fetch TX desc 1
                                 VALID, so execute
    set VALID in TX desc 2
                               finish TX desc 1
                               fetch TX desc 2
                                 VALID, so execute
    setup rest of TX desc 2
                               urk, we just executed a bogus descriptor.

 - R.

Reply via email to