search for: num_in

Displaying 20 results from an estimated 113 matches for "num_in".

2016 Nov 28
1
[PATCH v3] crypto: add virtio-crypto driver
...>>> > > + unsigned int tmp; >>> > > + struct virtio_crypto *vcrypto = ctx->vcrypto; >>> > > + int op = encrypt ? VIRTIO_CRYPTO_OP_ENCRYPT : VIRTIO_CRYPTO_OP_DECRYPT; >>> > > + int err; >>> > > + unsigned int num_out = 0, num_in = 0; >>> > > + >>> > > + /* >>> > > + * Avoid to do DMA from the stack, switch to using >>> > > + * dynamically-allocated for the key >>> > > + */ >>> > > + uint8_t *cipher_key = kmalloc(keylen, GFP_ATOMIC)...
2016 Nov 28
1
[PATCH v3] crypto: add virtio-crypto driver
...>>> > > + unsigned int tmp; >>> > > + struct virtio_crypto *vcrypto = ctx->vcrypto; >>> > > + int op = encrypt ? VIRTIO_CRYPTO_OP_ENCRYPT : VIRTIO_CRYPTO_OP_DECRYPT; >>> > > + int err; >>> > > + unsigned int num_out = 0, num_in = 0; >>> > > + >>> > > + /* >>> > > + * Avoid to do DMA from the stack, switch to using >>> > > + * dynamically-allocated for the key >>> > > + */ >>> > > + uint8_t *cipher_key = kmalloc(keylen, GFP_ATOMIC)...
2008 Apr 05
11
[PATCH RFC 1/5] vringfd syscall
...p); + return fd; + +free_vr: + kfree(vr); +put_filp: + put_filp(filp); +put_fd: + put_unused_fd(fd); +out: + return err; +} + +/* Returns an error, or 0 (no buffers), or an id for vring_used_buffer() */ +int vring_get_buffer(struct vring_info *vr, + struct iovec *in_iov, + unsigned int *num_in, unsigned long *in_len, + struct iovec *out_iov, + unsigned int *num_out, unsigned long *out_len) +{ + unsigned int i, in = 0, out = 0; + unsigned long dummy; + u16 head; + struct vring_desc d; + + if (unlikely(get_user(head, &vr->ring.avail->idx) != 0)) + return -EFAULT; + +...
2008 Apr 05
11
[PATCH RFC 1/5] vringfd syscall
...p); + return fd; + +free_vr: + kfree(vr); +put_filp: + put_filp(filp); +put_fd: + put_unused_fd(fd); +out: + return err; +} + +/* Returns an error, or 0 (no buffers), or an id for vring_used_buffer() */ +int vring_get_buffer(struct vring_info *vr, + struct iovec *in_iov, + unsigned int *num_in, unsigned long *in_len, + struct iovec *out_iov, + unsigned int *num_out, unsigned long *out_len) +{ + unsigned int i, in = 0, out = 0; + unsigned long dummy; + u16 head; + struct vring_desc d; + + if (unlikely(get_user(head, &vr->ring.avail->idx) != 0)) + return -EFAULT; + +...
2019 Dec 12
4
[PATCH] virtio-blk: remove VIRTIO_BLK_F_SCSI support
...dr with additional status - * information. - */ -#ifdef CONFIG_VIRTIO_BLK_SCSI -static int virtblk_add_req_scsi(struct virtqueue *vq, struct virtblk_req *vbr, - struct scatterlist *data_sg, bool have_data) -{ - struct scatterlist hdr, status, cmd, sense, inhdr, *sgs[6]; - unsigned int num_out = 0, num_in = 0; - - sg_init_one(&hdr, &vbr->out_hdr, sizeof(vbr->out_hdr)); - sgs[num_out++] = &hdr; - sg_init_one(&cmd, vbr->sreq.cmd, vbr->sreq.cmd_len); - sgs[num_out++] = &cmd; - - if (have_data) { - if (vbr->out_hdr.type & cpu_to_virtio32(vq->vdev, VIRTIO_BLK_T_...
2019 Sep 18
0
[PATCH v6] virtio-fs: add virtiofs filesystem
...tched one forget request.\n", > + __func__); > + } > +} > + > +/* Allocate and copy args into req->argbuf */ > +static int copy_args_to_argbuf(struct fuse_req *req) > +{ > + struct fuse_args *args = req->args; > + unsigned int offset = 0; > + unsigned int num_in; > + unsigned int num_out; > + unsigned int len; > + unsigned int i; > + > + num_in = args->in_numargs - args->in_pages; > + num_out = args->out_numargs - args->out_pages; > + len = fuse_len_args(num_in, (struct fuse_arg *) args->in_args) + > + fuse_len_...
2016 Nov 30
3
[PATCH v4 1/1] crypto: add virtio-crypto driver
...en, > + int encrypt) > +{ > + struct scatterlist outhdr, key_sg, inhdr, *sgs[3]; > + unsigned int tmp; > + struct virtio_crypto *vcrypto = ctx->vcrypto; > + int op = encrypt ? VIRTIO_CRYPTO_OP_ENCRYPT : VIRTIO_CRYPTO_OP_DECRYPT; > + int err; > + unsigned int num_out = 0, num_in = 0; > + > + /* > + * Avoid to do DMA from the stack, switch to using > + * dynamically-allocated for the key > + */ > + uint8_t *cipher_key = kmalloc(keylen, GFP_ATOMIC); > + > + if (!cipher_key) > + return -ENOMEM; > + > + memcpy(cipher_key, key, keylen); Are...
2016 Nov 30
3
[PATCH v4 1/1] crypto: add virtio-crypto driver
...en, > + int encrypt) > +{ > + struct scatterlist outhdr, key_sg, inhdr, *sgs[3]; > + unsigned int tmp; > + struct virtio_crypto *vcrypto = ctx->vcrypto; > + int op = encrypt ? VIRTIO_CRYPTO_OP_ENCRYPT : VIRTIO_CRYPTO_OP_DECRYPT; > + int err; > + unsigned int num_out = 0, num_in = 0; > + > + /* > + * Avoid to do DMA from the stack, switch to using > + * dynamically-allocated for the key > + */ > + uint8_t *cipher_key = kmalloc(keylen, GFP_ATOMIC); > + > + if (!cipher_key) > + return -ENOMEM; > + > + memcpy(cipher_key, key, keylen); Are...
2020 Sep 11
0
[virtio-dev] Re: clarifying the handling of responses for virtio-rpmb
...y some patches to the > virtio RPMB driver: > > * Change the device id from 0xFFFF to 28 > > * (Add some debug facilities. Needed to see the frames. Got first no > request frames on the device side, nothing.) > > * Fix descriptor directions. For the outgoing frames num_in was > incremented instead of num_out. > > The frames in the for-loop may be outgoing or intended for incoming > data. Decided on the RPMB_F_WRITE flag what to do with those frames: > > for (i = 0; i < ncmds; i++) { > ... > > if (cmds[i].flags &...
2016 Dec 01
1
[PATCH v4 1/1] crypto: add virtio-crypto driver
...uthdr, key_sg, inhdr, *sgs[3]; > > > + unsigned int tmp; > > > + struct virtio_crypto *vcrypto = ctx->vcrypto; > > > + int op = encrypt ? VIRTIO_CRYPTO_OP_ENCRYPT : > > VIRTIO_CRYPTO_OP_DECRYPT; > > > + int err; > > > + unsigned int num_out = 0, num_in = 0; > > > + > > > + /* > > > + * Avoid to do DMA from the stack, switch to using > > > + * dynamically-allocated for the key > > > + */ > > > + uint8_t *cipher_key = kmalloc(keylen, GFP_ATOMIC); > > > + > > > + if (!cipher_...
2016 Dec 01
1
[PATCH v4 1/1] crypto: add virtio-crypto driver
...uthdr, key_sg, inhdr, *sgs[3]; > > > + unsigned int tmp; > > > + struct virtio_crypto *vcrypto = ctx->vcrypto; > > > + int op = encrypt ? VIRTIO_CRYPTO_OP_ENCRYPT : > > VIRTIO_CRYPTO_OP_DECRYPT; > > > + int err; > > > + unsigned int num_out = 0, num_in = 0; > > > + > > > + /* > > > + * Avoid to do DMA from the stack, switch to using > > > + * dynamically-allocated for the key > > > + */ > > > + uint8_t *cipher_key = kmalloc(keylen, GFP_ATOMIC); > > > + > > > + if (!cipher_...
2016 Nov 14
3
[PATCH] crypto: add virtio-crypto driver
...uthdr, key_sg, inhdr, *sgs[3]; + unsigned int tmp; + struct virtio_crypto_session_input input; + struct virtio_crypto_op_ctrl_req ctrl; + struct virtio_crypto *vcrypto = ctx->vcrypto; + int op = encrypt ? VIRTIO_CRYPTO_OP_ENCRYPT : VIRTIO_CRYPTO_OP_DECRYPT; + int err; + unsigned int num_out = 0, num_in = 0; + + memset(&ctrl, 0, sizeof(ctrl)); + memset(&input, 0, sizeof(input)); + /* Pad ctrl header */ + ctrl.header.opcode = cpu_to_le32(VIRTIO_CRYPTO_CIPHER_CREATE_SESSION); + ctrl.header.algo = cpu_to_le32((uint32_t)alg); + /* Set the default dataqueue id to 0 */ + ctrl.header.queue_id = 0...
2016 Nov 14
3
[PATCH] crypto: add virtio-crypto driver
...uthdr, key_sg, inhdr, *sgs[3]; + unsigned int tmp; + struct virtio_crypto_session_input input; + struct virtio_crypto_op_ctrl_req ctrl; + struct virtio_crypto *vcrypto = ctx->vcrypto; + int op = encrypt ? VIRTIO_CRYPTO_OP_ENCRYPT : VIRTIO_CRYPTO_OP_DECRYPT; + int err; + unsigned int num_out = 0, num_in = 0; + + memset(&ctrl, 0, sizeof(ctrl)); + memset(&input, 0, sizeof(input)); + /* Pad ctrl header */ + ctrl.header.opcode = cpu_to_le32(VIRTIO_CRYPTO_CIPHER_CREATE_SESSION); + ctrl.header.algo = cpu_to_le32((uint32_t)alg); + /* Set the default dataqueue id to 0 */ + ctrl.header.queue_id = 0...
2016 Nov 28
5
[PATCH v3] crypto: add virtio-crypto driver
...en, > + int encrypt) > +{ > + struct scatterlist outhdr, key_sg, inhdr, *sgs[3]; > + unsigned int tmp; > + struct virtio_crypto *vcrypto = ctx->vcrypto; > + int op = encrypt ? VIRTIO_CRYPTO_OP_ENCRYPT : VIRTIO_CRYPTO_OP_DECRYPT; > + int err; > + unsigned int num_out = 0, num_in = 0; > + > + /* > + * Avoid to do DMA from the stack, switch to using > + * dynamically-allocated for the key > + */ > + uint8_t *cipher_key = kmalloc(keylen, GFP_ATOMIC); > + > + if (!cipher_key) > + return -ENOMEM; > + > + memcpy(cipher_key, key, keylen); >...
2016 Nov 28
5
[PATCH v3] crypto: add virtio-crypto driver
...en, > + int encrypt) > +{ > + struct scatterlist outhdr, key_sg, inhdr, *sgs[3]; > + unsigned int tmp; > + struct virtio_crypto *vcrypto = ctx->vcrypto; > + int op = encrypt ? VIRTIO_CRYPTO_OP_ENCRYPT : VIRTIO_CRYPTO_OP_DECRYPT; > + int err; > + unsigned int num_out = 0, num_in = 0; > + > + /* > + * Avoid to do DMA from the stack, switch to using > + * dynamically-allocated for the key > + */ > + uint8_t *cipher_key = kmalloc(keylen, GFP_ATOMIC); > + > + if (!cipher_key) > + return -ENOMEM; > + > + memcpy(cipher_key, key, keylen); >...
2016 Nov 27
2
[PATCH v2 2/2] crypto: add virtio-crypto driver
...en, > + int encrypt) > +{ > + struct scatterlist outhdr, key_sg, inhdr, *sgs[3]; > + unsigned int tmp; > + struct virtio_crypto *vcrypto = ctx->vcrypto; > + int op = encrypt ? VIRTIO_CRYPTO_OP_ENCRYPT : VIRTIO_CRYPTO_OP_DECRYPT; > + int err; > + unsigned int num_out = 0, num_in = 0; > + > + /* > + * Avoid to do DMA from the stack, switch to using > + * dynamically-allocated for the key > + */ > + uint8_t *cipher_key = kmalloc(keylen, GFP_ATOMIC); Is all crypto using GFP_ATOMIC like this? Is there code that recovers if this fails? > + > + if (...
2016 Nov 27
2
[PATCH v2 2/2] crypto: add virtio-crypto driver
...en, > + int encrypt) > +{ > + struct scatterlist outhdr, key_sg, inhdr, *sgs[3]; > + unsigned int tmp; > + struct virtio_crypto *vcrypto = ctx->vcrypto; > + int op = encrypt ? VIRTIO_CRYPTO_OP_ENCRYPT : VIRTIO_CRYPTO_OP_DECRYPT; > + int err; > + unsigned int num_out = 0, num_in = 0; > + > + /* > + * Avoid to do DMA from the stack, switch to using > + * dynamically-allocated for the key > + */ > + uint8_t *cipher_key = kmalloc(keylen, GFP_ATOMIC); Is all crypto using GFP_ATOMIC like this? Is there code that recovers if this fails? > + > + if (...
2017 Jul 05
3
[PATCH v2] virtio-blk: add DISCARD support to virtio-blk driver
...-git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c index 0297ad7..8f0c614 100644 --- a/drivers/block/virtio_blk.c +++ b/drivers/block/virtio_blk.c @@ -172,10 +172,52 @@ static int virtblk_add_req(struct virtqueue *vq, struct virtblk_req *vbr, return virtqueue_add_sgs(vq, sgs, num_out, num_in, vbr, GFP_ATOMIC); } +static inline int virtblk_setup_discard(struct request *req) +{ + unsigned short segments = blk_rq_nr_discard_segments(req), n = 0; + u32 block_size = queue_logical_block_size(req->q); + struct virtio_blk_discard *range; + struct bio *bio; + + if (block_size < 512 ||...
2017 Jul 05
3
[PATCH v2] virtio-blk: add DISCARD support to virtio-blk driver
...-git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c index 0297ad7..8f0c614 100644 --- a/drivers/block/virtio_blk.c +++ b/drivers/block/virtio_blk.c @@ -172,10 +172,52 @@ static int virtblk_add_req(struct virtqueue *vq, struct virtblk_req *vbr, return virtqueue_add_sgs(vq, sgs, num_out, num_in, vbr, GFP_ATOMIC); } +static inline int virtblk_setup_discard(struct request *req) +{ + unsigned short segments = blk_rq_nr_discard_segments(req), n = 0; + u32 block_size = queue_logical_block_size(req->q); + struct virtio_blk_discard *range; + struct bio *bio; + + if (block_size < 512 ||...
2016 Nov 28
0
[virtio-dev] Re: [PATCH v2 2/2] crypto: add virtio-crypto driver
...t; > + struct scatterlist outhdr, key_sg, inhdr, *sgs[3]; > > + unsigned int tmp; > > + struct virtio_crypto *vcrypto = ctx->vcrypto; > > + int op = encrypt ? VIRTIO_CRYPTO_OP_ENCRYPT : > VIRTIO_CRYPTO_OP_DECRYPT; > > + int err; > > + unsigned int num_out = 0, num_in = 0; > > + > > + /* > > + * Avoid to do DMA from the stack, switch to using > > + * dynamically-allocated for the key > > + */ > > + uint8_t *cipher_key = kmalloc(keylen, GFP_ATOMIC); > > Is all crypto using GFP_ATOMIC like this? > Is there code that...