Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 299527
b: refs/heads/master
c: ca8f4fb
h: refs/heads/master
i:
  299525: 9df0bef
  299523: 62d1d08
  299519: 2f3aa68
v: v3
  • Loading branch information
Michael S. Tsirkin authored and David S. Miller committed Apr 13, 2012
1 parent 616725a commit 9d0b35f
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 9a5d2bd99e0dfe9a31b3c160073ac445ba3d773f
refs/heads/master: ca8f4fb21d08747013cce9cf1840aa5bfc31f2d8
2 changes: 1 addition & 1 deletion trunk/drivers/vhost/net.c
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ static void handle_tx(struct vhost_net *net)

vq->heads[vq->upend_idx].len = len;
ubuf->callback = vhost_zerocopy_callback;
ubuf->arg = vq->ubufs;
ubuf->ctx = vq->ubufs;
ubuf->desc = vq->upend_idx;
msg.msg_control = ubuf;
msg.msg_controllen = sizeof(ubuf);
Expand Down
5 changes: 2 additions & 3 deletions trunk/drivers/vhost/vhost.c
Original file line number Diff line number Diff line change
Expand Up @@ -1598,10 +1598,9 @@ void vhost_ubuf_put_and_wait(struct vhost_ubuf_ref *ubufs)
kfree(ubufs);
}

void vhost_zerocopy_callback(void *arg)
void vhost_zerocopy_callback(struct ubuf_info *ubuf)
{
struct ubuf_info *ubuf = arg;
struct vhost_ubuf_ref *ubufs = ubuf->arg;
struct vhost_ubuf_ref *ubufs = ubuf->ctx;
struct vhost_virtqueue *vq = ubufs->vq;

/* set len = 1 to mark this desc buffers done DMA */
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/vhost/vhost.h
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ bool vhost_enable_notify(struct vhost_dev *, struct vhost_virtqueue *);

int vhost_log_write(struct vhost_virtqueue *vq, struct vhost_log *log,
unsigned int log_num, u64 len);
void vhost_zerocopy_callback(void *arg);
void vhost_zerocopy_callback(struct ubuf_info *);
int vhost_zerocopy_signal_used(struct vhost_virtqueue *vq);

#define vq_err(vq, fmt, ...) do { \
Expand Down
7 changes: 4 additions & 3 deletions trunk/include/linux/skbuff.h
Original file line number Diff line number Diff line change
Expand Up @@ -238,11 +238,12 @@ enum {
/*
* The callback notifies userspace to release buffers when skb DMA is done in
* lower device, the skb last reference should be 0 when calling this.
* The desc is used to track userspace buffer index.
* The ctx field is used to track device context.
* The desc field is used to track userspace buffer index.
*/
struct ubuf_info {
void (*callback)(void *);
void *arg;
void (*callback)(struct ubuf_info *);
void *ctx;
unsigned long desc;
};

Expand Down

0 comments on commit 9d0b35f

Please sign in to comment.