Skip to content

Commit f2acb05

Browse files
ikichavireshk
authored andcommitted
vsock: Set BACKEND_EVENT based on NUM_QUEUES
BACKEND_EVENT value depends on NUM_QUEUES, because it is the next value of NUM_QUEUES, so set it based on NUM_QUEUES Signed-off-by: Jeongik Cha <[email protected]>
1 parent 9f10349 commit f2acb05

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

crates/vsock/src/vhu_vsock.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,12 @@ const TX_QUEUE_EVENT: u16 = 1;
3737
const EVT_QUEUE_EVENT: u16 = 2;
3838

3939
/// Notification coming from the backend.
40-
pub(crate) const BACKEND_EVENT: u16 = 3;
40+
/// Event range [0...num_queues] is reserved for queues and exit event.
41+
/// So NUM_QUEUES + 1 is used.
42+
pub(crate) const BACKEND_EVENT: u16 = (NUM_QUEUES + 1) as u16;
4143

4244
/// Notification coming from the sibling VM.
43-
pub(crate) const SIBLING_VM_EVENT: u16 = 4;
45+
pub(crate) const SIBLING_VM_EVENT: u16 = BACKEND_EVENT + 1;
4446

4547
/// CID of the host
4648
pub(crate) const VSOCK_HOST_CID: u64 = 2;

0 commit comments

Comments
 (0)