diff options
author | Florin Coras <fcoras@cisco.com> | 2021-01-22 15:05:14 -0800 |
---|---|---|
committer | Dave Barach <openvpp@barachs.net> | 2021-01-25 15:34:21 +0000 |
commit | 86f1232ddee5b1751c6ff683892072111d0e2dee (patch) | |
tree | bfa213f887f6c4142531b7585df7b6707a40feb9 /src/svm/fifo_segment.c | |
parent | 15036ad0bc0b41e42d924e6b1cd897cca8f98c3c (diff) |
svm: add custom q implementation for mq
Add separate queue implementation for the message queue as it's custom
tailored for fifo segments as opposed to binary api.
Also move eventfds to the private data structures.
Type: refactor
Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I6df0c824ecd94c7904516373f92a9fffc6b04736
Diffstat (limited to 'src/svm/fifo_segment.c')
-rw-r--r-- | src/svm/fifo_segment.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/svm/fifo_segment.c b/src/svm/fifo_segment.c index d30932448c6..3e9aecb9dc8 100644 --- a/src/svm/fifo_segment.c +++ b/src/svm/fifo_segment.c @@ -1042,7 +1042,7 @@ fifo_segment_msg_q_attach (fifo_segment_t *fs, uword offset, u32 mq_index) mq = vec_elt_at_index (fs->mqs, mq_index); - if (!mq->q) + if (!mq->q.shr) { svm_msg_q_shared_t *smq; smq = (svm_msg_q_shared_t *) ((u8 *) fs->h + offset); @@ -1059,10 +1059,11 @@ fifo_segment_msg_q_offset (fifo_segment_t *fs, u32 mq_index) { svm_msg_q_t *mq = vec_elt_at_index (fs->mqs, mq_index); - if (mq->q == 0) + if (mq->q.shr == 0) return ~0ULL; - return (uword) ((u8 *) mq->q - (u8 *) fs->h) - sizeof (svm_msg_q_shared_t); + return (uword) ((u8 *) mq->q.shr - (u8 *) fs->h) - + sizeof (svm_msg_q_shared_t); } int |