On Wed, May 16, 2018 at 07:50:16PM +0800, Jason Wang wrote:
On 2018å05æ16æ 16:37, Tiwei Bie wrote:[...]
I'm also not sure.. But fortunately, it should be quite easystruct vring_virtqueue {I'm not sure idr is fit for the performance critical case here. Need to
@@ -116,6 +117,9 @@ struct vring_virtqueue {
/* Last written value to driver->flags in
* guest byte order. */
u16 event_flags_shadow;
+
+ /* ID allocation. */
+ struct idr buffer_id;
measure its performance impact, especially if we have few unused slots.
to replace it with something else without changing other code.
If it will really hurt the performance, I'll change it.
[...]};
};
Above code doesn't depend on the information in the descriptor+static void detach_buf_packed(struct vring_virtqueue *vq, unsigned int head,As mentioned in previous discussion, this probably won't work for the case
+ unsigned int id, void **ctx)
+{
+ struct vring_packed_desc *desc;
+ unsigned int i, j;
+
+ /* Clear data ptr. */
+ vq->desc_state[id].data = NULL;
+
+ i = head;
+
+ for (j = 0; j < vq->desc_state[id].num; j++) {
+ desc = &vq->vring_packed.desc[i];
+ vring_unmap_one_packed(vq, desc);
of out of order completion since it depends on the information in the
descriptor ring. We probably need to extend ctx to record such information.
ring. The vq->desc_state[] is the extended ctx.
Best regards,
Tiwei Bie