Displaying 15 results from an estimated 15 matches for "device_fd".
Did you mean:
device_add
2006 Jun 01
2
Finding the right interface on FreeBSD
...--
Ga?l Roualland -+- gael.roualland@oleane.net
-------------- next part --------------
diff -ru tinc-1.0.4/src/bsd/device.c tinc-1.0.4.gr/src/bsd/device.c
--- tinc-1.0.4/src/bsd/device.c Wed May 4 18:57:55 2005
+++ tinc-1.0.4.gr/src/bsd/device.c Wed May 17 22:47:27 2006
@@ -38,6 +38,10 @@
int device_fd = -1;
char *device;
+
+static char device_buf[256];
+#define DEVICE_TRIES_MAX 255
+
char *iface;
char *device_info;
static int device_total_in = 0;
@@ -60,8 +64,31 @@
iface = rindex(device, '/') ? rindex(device, '/') + 1 : device;
if((device_fd = open(device, O_RDWR | O_N...
2019 Sep 17
7
[RFC v4 0/3] vhost: introduce mdev based hardware backend
This RFC is to demonstrate below ideas,
a) Build vhost-mdev on top of the same abstraction defined in
the virtio-mdev series [1];
b) Introduce /dev/vhost-mdev to do vhost ioctls and support
setting mdev device as backend;
Now the userspace API looks like this:
- Userspace generates a compatible mdev device;
- Userspace opens this mdev device with VFIO API (including
doing IOMMU
2019 Sep 17
7
[RFC v4 0/3] vhost: introduce mdev based hardware backend
This RFC is to demonstrate below ideas,
a) Build vhost-mdev on top of the same abstraction defined in
the virtio-mdev series [1];
b) Introduce /dev/vhost-mdev to do vhost ioctls and support
setting mdev device as backend;
Now the userspace API looks like this:
- Userspace generates a compatible mdev device;
- Userspace opens this mdev device with VFIO API (including
doing IOMMU
2018 Apr 02
2
[RFC] vhost: introduce mdev based hardware vhost backend
...uests in above structure.
Each message will be written to or read from this
region at offset 0:
int vhost_vfio_write(struct vhost_dev *dev, struct vhost_vfio_op *op)
{
int count = VHOST_VFIO_OP_HDR_SIZE + op->size;
struct vhost_vfio *vfio = dev->opaque;
int ret;
ret = pwrite64(vfio->device_fd, op, count, vfio->bar0_offset);
if (ret != count)
return -1;
return 0;
}
int vhost_vfio_read(struct vhost_dev *dev, struct vhost_vfio_op *op)
{
int count = VHOST_VFIO_OP_HDR_SIZE + op->size;
struct vhost_vfio *vfio = dev->opaque;
uint64_t request = op->request;
int ret;
ret...
2018 Apr 02
2
[RFC] vhost: introduce mdev based hardware vhost backend
...uests in above structure.
Each message will be written to or read from this
region at offset 0:
int vhost_vfio_write(struct vhost_dev *dev, struct vhost_vfio_op *op)
{
int count = VHOST_VFIO_OP_HDR_SIZE + op->size;
struct vhost_vfio *vfio = dev->opaque;
int ret;
ret = pwrite64(vfio->device_fd, op, count, vfio->bar0_offset);
if (ret != count)
return -1;
return 0;
}
int vhost_vfio_read(struct vhost_dev *dev, struct vhost_vfio_op *op)
{
int count = VHOST_VFIO_OP_HDR_SIZE + op->size;
struct vhost_vfio *vfio = dev->opaque;
uint64_t request = op->request;
int ret;
ret...
2018 Apr 10
4
[RFC] vhost: introduce mdev based hardware vhost backend
...ion at offset 0:
> >
> > int vhost_vfio_write(struct vhost_dev *dev, struct vhost_vfio_op *op)
> > {
> > int count = VHOST_VFIO_OP_HDR_SIZE + op->size;
> > struct vhost_vfio *vfio = dev->opaque;
> > int ret;
> >
> > ret = pwrite64(vfio->device_fd, op, count, vfio->bar0_offset);
> > if (ret != count)
> > return -1;
> >
> > return 0;
> > }
> >
> > int vhost_vfio_read(struct vhost_dev *dev, struct vhost_vfio_op *op)
> > {
> > int count = VHOST_VFIO_OP_HDR_SIZE + op->size;
>...
2018 Apr 10
4
[RFC] vhost: introduce mdev based hardware vhost backend
...ion at offset 0:
> >
> > int vhost_vfio_write(struct vhost_dev *dev, struct vhost_vfio_op *op)
> > {
> > int count = VHOST_VFIO_OP_HDR_SIZE + op->size;
> > struct vhost_vfio *vfio = dev->opaque;
> > int ret;
> >
> > ret = pwrite64(vfio->device_fd, op, count, vfio->bar0_offset);
> > if (ret != count)
> > return -1;
> >
> > return 0;
> > }
> >
> > int vhost_vfio_read(struct vhost_dev *dev, struct vhost_vfio_op *op)
> > {
> > int count = VHOST_VFIO_OP_HDR_SIZE + op->size;
>...
2019 Jul 03
0
[RFC v2] vhost: introduce mdev based hardware vhost backend
...e will be written to or read from this region at offset 0:
>
> int vhost_vfio_write(struct vhost_dev *dev, struct vhost_vfio_op *op)
> {
> int count = VHOST_VFIO_OP_HDR_SIZE + op->size;
> struct vhost_vfio *vfio = dev->opaque;
> int ret;
>
> ret = pwrite64(vfio->device_fd, op, count, vfio->config_offset);
> if (ret != count)
> return -1;
>
> return 0;
> }
>
> int vhost_vfio_read(struct vhost_dev *dev, struct vhost_vfio_op *op)
> {
> int count = VHOST_VFIO_OP_HDR_SIZE + op->size;
> struct vhost_vfio *vfio = dev->opaque;
&g...
2019 Jul 03
4
[RFC v2] vhost: introduce mdev based hardware vhost backend
...uests in above structure.
Each message will be written to or read from this region at offset 0:
int vhost_vfio_write(struct vhost_dev *dev, struct vhost_vfio_op *op)
{
int count = VHOST_VFIO_OP_HDR_SIZE + op->size;
struct vhost_vfio *vfio = dev->opaque;
int ret;
ret = pwrite64(vfio->device_fd, op, count, vfio->config_offset);
if (ret != count)
return -1;
return 0;
}
int vhost_vfio_read(struct vhost_dev *dev, struct vhost_vfio_op *op)
{
int count = VHOST_VFIO_OP_HDR_SIZE + op->size;
struct vhost_vfio *vfio = dev->opaque;
uint64_t request = op->request;
int ret;
re...
2019 Jul 03
4
[RFC v2] vhost: introduce mdev based hardware vhost backend
...uests in above structure.
Each message will be written to or read from this region at offset 0:
int vhost_vfio_write(struct vhost_dev *dev, struct vhost_vfio_op *op)
{
int count = VHOST_VFIO_OP_HDR_SIZE + op->size;
struct vhost_vfio *vfio = dev->opaque;
int ret;
ret = pwrite64(vfio->device_fd, op, count, vfio->config_offset);
if (ret != count)
return -1;
return 0;
}
int vhost_vfio_read(struct vhost_dev *dev, struct vhost_vfio_op *op)
{
int count = VHOST_VFIO_OP_HDR_SIZE + op->size;
struct vhost_vfio *vfio = dev->opaque;
uint64_t request = op->request;
int ret;
re...
2019 Sep 17
0
[RFC v4 3/3] vhost: introduce mdev based hardware backend
...nd))) {
+ r = -EFAULT;
+ goto err;
+ }
+
+ file = fget(backend.group_fd);
+ if (!file) {
+ r = -EBADF;
+ goto err;
+ }
+
+ group = vfio_group_get_external_user(file);
+ fput(file);
+ if (IS_ERR(group)) {
+ r = PTR_ERR(group);
+ goto err;
+ }
+
+ device = vfio_device_get_from_fd(group, backend.device_fd);
+ if (!IS_ERR(device)) {
+ r = PTR_ERR(device);
+ goto err_put_group;
+ }
+
+ if (!vfio_device_ops_match(device, &vfio_mdev_dev_ops)) {
+ r = -EINVAL;
+ goto err_put_device;
+ }
+
+ mdev = vfio_device_data(m->vfio_device);
+
+ magic = virtio_mdev_readl(mdev, VIRTIO_MDEV_MAGIC_VALUE);
+...
2023 Feb 22
0
[PATCH v2 07/13] vdpa: add vdpa net migration state notifier
...gt;vhost_vdpa.dev;
> if (dev->vq_index + dev->nvqs == dev->vq_index_end) {
> g_clear_pointer(&s->vhost_vdpa.iova_tree, vhost_iova_tree_delete);
> @@ -741,6 +816,7 @@ static NetClientState *net_vhost_vdpa_init(NetClientState *peer,
> s->vhost_vdpa.device_fd = vdpa_device_fd;
> s->vhost_vdpa.index = queue_pair_index;
> s->always_svq = svq;
> + s->migration_state.notify = vdpa_net_migration_state_notifier;
> s->vhost_vdpa.shadow_vqs_enabled = svq;
> s->vhost_vdpa.iova_range = iova_range;
>...
2018 Apr 10
0
[RFC] vhost: introduce mdev based hardware vhost backend
...l be written to or read from this
> region at offset 0:
>
> int vhost_vfio_write(struct vhost_dev *dev, struct vhost_vfio_op *op)
> {
> int count = VHOST_VFIO_OP_HDR_SIZE + op->size;
> struct vhost_vfio *vfio = dev->opaque;
> int ret;
>
> ret = pwrite64(vfio->device_fd, op, count, vfio->bar0_offset);
> if (ret != count)
> return -1;
>
> return 0;
> }
>
> int vhost_vfio_read(struct vhost_dev *dev, struct vhost_vfio_op *op)
> {
> int count = VHOST_VFIO_OP_HDR_SIZE + op->size;
> struct vhost_vfio *vfio = dev->opaque;
>...
2019 Sep 17
1
[RFC v4 3/3] vhost: introduce mdev based hardware backend
...group_fd);
> + if (!file) {
> + r = -EBADF;
> + goto err;
> + }
> +
> + group = vfio_group_get_external_user(file);
> + fput(file);
> + if (IS_ERR(group)) {
> + r = PTR_ERR(group);
> + goto err;
> + }
> +
> + device = vfio_device_get_from_fd(group, backend.device_fd);
> + if (!IS_ERR(device)) {
> + r = PTR_ERR(device);
> + goto err_put_group;
> + }
> +
> + if (!vfio_device_ops_match(device, &vfio_mdev_dev_ops)) {
> + r = -EINVAL;
> + goto err_put_device;
> + }
It looks to me that we can avoid to expose vfio_mdev_dev_ops her...
2007 May 21
0
cups, firefox + acrobat (getting strange output)
.../May/2007:13:27:58 -0300] Discarding unused printer-state-changed event...
D [18/May/2007:13:27:58 -0300] [Job 21957] Connected to
192.168.1.55:9100 (IPv4)...
D [18/May/2007:13:27:58 -0300] Discarding unused job-progress event...
D [18/May/2007:13:27:58 -0300] [Job 21957] backendRunLoop(print_fd=4,
device_fd=5, use_bc=1)
D [18/May/2007:13:27:58 -0300] [Job 21957] Read 8192 bytes of print data...
D [18/May/2007:13:27:58 -0300] [Job 21957] Wrote 8192 bytes of print data...
D [18/May/2007:13:27:58 -0300] [Job 21957] Read 8192 bytes of print data...
D [18/May/2007:13:27:58 -0300] cupsdAcceptClient: 9 from...