Module Name: src Committed By: riastradh Date: Sat Feb 25 00:32:49 UTC 2023
Modified Files: src/sys/arch/xen/xen: if_xennet_xenbus.c Log Message: xennet(4): Membar audit. - xennet_tx_complete: Other side owns rsp_prod, giving us responses to tx commands. We own rsp_cons, recording which responess we've processed already. 1. Other side initializes responses before advancing rsp_prod, so we must observe rsp_prod before trying to examine the responses. Hence load from rsp_prod must be followed by xen_rmb. (Can this just use atomic_load_acquire?) 2. As soon as other side observes rsp_event, it may start to overwrite now-unused response slots, so we must finish using the response before advancing rsp_cons. Hence we must issue xen_wmb before store to rsp_event. (Can this just use atomic_store_release?) (Should this use RING_FINAL_CHECK_FOR_RESPONSES?) 3. When loop is done and we set rsp_event, we must ensure the other side has had a chance to see that we want more before we check whether there is more to consume; otherwise the other side might not bother to send us an interrupt. Hence after setting rsp_event, we must issue xen_mb (store-before-load) before re-checking rsp_prod. - xennet_handler (rx): Same deal, except the xen_mb is buried in RING_FINAL_CHECK_FOR_RESPONSES. Unclear why xennet_tx_complete has this open-coded while xennet_handler (rx) uses the macro. XXX pullup-8 (at least the xen_mb part; requires patch) XXX pullup-9 (at least the xen_mb part; requires patch) XXX pullup-10 To generate a diff of this commit: cvs rdiff -u -r1.128 -r1.129 src/sys/arch/xen/xen/if_xennet_xenbus.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.