changelog shortlog graph tags branches changeset files revisions annotate raw help

Mercurial > core / lisp/ffi/uring/cq.lisp

changeset 698: 96958d3eb5b0
parent: 013741871f49
author: Richard Westhaver <ellis@rwest.io>
date: Fri, 04 Oct 2024 22:04:59 -0400
permissions: -rw-r--r--
description: fixes
1 ;;; uring/cq.lisp --- Completion Queue
2 
3 ;;
4 
5 ;;; Code:
6 (in-package :uring)
7 
8 (defstruct completion-queue-offsets
9  (head 0 :type fixnum)
10  (tail 0 :type fixnum)
11  (ring-mask 0 :type fixnum)
12  (ring-entries 0 :type fixnum)
13  (overflow 0 :type fixnum)
14  (cqes 0 :type fixnum)
15  (flags 0 :type fixnum)
16  ;; resv1
17  (user-addr 0 :type fixnum))
18 
19 ;; (defmethod build ((self completion-queue-offsets) &key &allow-other-keys)
20 ;; (with-slots (head tail ring-mask ring-entries overflow cqes flags user-addr) self
21 ;; (with-io-cqring-offsets res
22 ;; ((head head) (tail tail) (ring-mask ring-mask) (ring-entries ring-entries)
23 ;; (overflow overflow) (cqes cqes) (flags flags) (user-addr user-addr))
24 ;; res)))
25 
26 (defstruct completion-queue
27  (head 0 :type fixnum)
28  (tail 0 :type fixnum)
29  (queue (make-alien io-uring-cq) :type (alien io-uring-cq*))) ;; io-uring-cq*
30 
31 ;; (define-alien-type io-uring-cqe* (* (struct io-uring-cqe)))
32 
33 ;; 16-byte CQE
34 (defstruct completion-queue-entry
35  (user-data 0 :type fixnum)
36  (res 0 :type fixnum)
37  (flags 0 :type fixnum))
38 
39 ;; (defmethod build ((self completion-queue-entry) &key &allow-other-keys)
40 ;; (with-slots (user-data res flags) self
41 ;; (with-io-uring-cqe ret
42 ;; ((user-data user-data) (res res) (flags flags))
43 ;; ret)))
44 
45 ;; (defmethod build ((self completion-queue-entry) &key &allow-other-keys)
46 ;; (build (make-completion-queue-entry-32 :entry self))
47 ;; (with-slots (user-data res flags) self
48 ;; (with-io-uring-cqe ret
49 ;; ((user-data user-data) (res res) (flags flags))
50 ;; ret)))
51 
52 ;; 32-byte CQE
53 (defstruct completion-queue-entry-32
54  (entry (make-completion-queue-entry) :type completion-queue-entry))
55  ;; big-cqe = 16 bytes of padding u64*2
56 
57 ;; (defmethod build ((self completion-queue-entry-32) &key &allow-other-keys)
58 ;; (with-slots (entry) self
59 ;; (with-slots (user-data res flags) entry
60 ;; (with-alien ((big-cqe (array unsigned-long 2)))
61 ;; ;; TODO this may need to change to align with new version of WITH-IO-URING-SQE
62 ;; (with-io-uring-cqe ret
63 ;; ((user-data user-data) (res res) (flags flags) (big-cqe big-cqe))
64 ;; ret)))))
65 
66 ;; sync, fill, pop
67 ;; check-overflow
68 ;; eventfd support?