File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -82,6 +82,7 @@ module Make(C: S.CONFIGURATION with type 'a io = 'a Lwt.t) = struct
82
82
rx_client : (RX.Response .t ,int ) Lwt_ring.Front .t ;
83
83
rx_map : (int , Gnt .gntref * Io_page .t ) Hashtbl .t ;
84
84
rx_gnt : Gnt .gntref ;
85
+ mutable rx_id : Cstruct .uint16 ;
85
86
86
87
evtchn : Eventchn .t ;
87
88
features : Features .t ;
@@ -145,7 +146,7 @@ module Make(C: S.CONFIGURATION with type 'a io = 'a Lwt.t) = struct
145
146
(* Register callback activation *)
146
147
let backend = backend_conf.S. backend in
147
148
return { vif_id; backend_id; tx_client; tx_gnt; tx_mutex; tx_pool;
148
- rx_gnt; rx_fring; rx_client; rx_map; stats;
149
+ rx_gnt; rx_fring; rx_client; rx_map; rx_id = 0 ; stats;
149
150
evtchn; mac; backend; features;
150
151
}
151
152
@@ -163,7 +164,12 @@ module Make(C: S.CONFIGURATION with type 'a io = 'a Lwt.t) = struct
163
164
let pages = Io_page. pages num in
164
165
List. iter
165
166
(fun (gref , page ) ->
166
- let id = gref mod (1 lsl 16 ) in
167
+ let rec next () =
168
+ let id = nf.rx_id in
169
+ nf.rx_id < - (succ nf.rx_id) mod (1 lsl 16 ) ;
170
+ if Hashtbl. mem nf.rx_map id then next () else id
171
+ in
172
+ let id = next () in
167
173
Gnt.Gntshr. grant_access ~domid: nf.backend_id ~writable: true gref page;
168
174
Hashtbl. add nf.rx_map id (gref, page);
169
175
let slot_id = Ring.Rpc.Front. next_req_id nf.rx_fring in
You can’t perform that action at this time.
0 commit comments