Displaying 20 results from an estimated 272 matches for "cpu_to_le16".
2014 Sep 21
2
[PATCH RFC] virtio-pci: share config interrupt between virtio devices
...endor ID,
> in spite of the fact the virtio spec always required this explicitly.
I think I may be a bit confused here, but AFAIK we do set subsystem vendor
ID properly for our virtio-pci devices?
vpci->pci_hdr = (struct pci_device_header) {
.vendor_id = cpu_to_le16(PCI_VENDOR_ID_REDHAT_QUMRANET),
.device_id = cpu_to_le16(device_id),
[...]
.subsys_vendor_id = cpu_to_le16(PCI_SUBSYSTEM_VENDOR_ID_REDHAT_QUMRANET),
Thanks,
Sasha
2014 Sep 21
2
[PATCH RFC] virtio-pci: share config interrupt between virtio devices
...endor ID,
> in spite of the fact the virtio spec always required this explicitly.
I think I may be a bit confused here, but AFAIK we do set subsystem vendor
ID properly for our virtio-pci devices?
vpci->pci_hdr = (struct pci_device_header) {
.vendor_id = cpu_to_le16(PCI_VENDOR_ID_REDHAT_QUMRANET),
.device_id = cpu_to_le16(device_id),
[...]
.subsys_vendor_id = cpu_to_le16(PCI_SUBSYSTEM_VENDOR_ID_REDHAT_QUMRANET),
Thanks,
Sasha
2009 Feb 16
3
[PATCH 0/2] ocfs2: two fixes for xattr -v2
Hi,
I have fixed the problems in version 1 patches. These two patches based
on the latest main line kernel.
Thanks,
tiger
> For EAs data structure in inode/block are little different from them in
> bucket. These two patches try to make them same for the most part.
>
> The first patch set xh_free_start and xh_name_value_len when EAs in
> inode/block. xh_free_start is useful to
2014 Sep 21
1
[PATCH RFC] virtio-pci: share config interrupt between virtio devices
...>> >
>> > I think I may be a bit confused here, but AFAIK we do set subsystem vendor
>> > ID properly for our virtio-pci devices?
>> >
>> > vpci->pci_hdr = (struct pci_device_header) {
>> > .vendor_id = cpu_to_le16(PCI_VENDOR_ID_REDHAT_QUMRANET),
>> > .device_id = cpu_to_le16(device_id),
>> > [...]
>> > .subsys_vendor_id = cpu_to_le16(PCI_SUBSYSTEM_VENDOR_ID_REDHAT_QUMRANET),
>> >
>> >
>> > Thanks,
>...
2014 Sep 21
1
[PATCH RFC] virtio-pci: share config interrupt between virtio devices
...>> >
>> > I think I may be a bit confused here, but AFAIK we do set subsystem vendor
>> > ID properly for our virtio-pci devices?
>> >
>> > vpci->pci_hdr = (struct pci_device_header) {
>> > .vendor_id = cpu_to_le16(PCI_VENDOR_ID_REDHAT_QUMRANET),
>> > .device_id = cpu_to_le16(device_id),
>> > [...]
>> > .subsys_vendor_id = cpu_to_le16(PCI_SUBSYSTEM_VENDOR_ID_REDHAT_QUMRANET),
>> >
>> >
>> > Thanks,
>...
2009 Mar 18
2
[RFC] metadata alloc fix in machines which has PAGE_SIZE > CLUSTER_SIZE
Hi Mark/Joel,
I meet with some meta allocation bugs when I implement reflink these
days. And after some investigation, I think we should have the same
problem when we have PAGE_SIZE > CLUSTER_SIZE. So I create a scenario
today in one ppc box and try. the box panic as I expected. ;)
The scenario is that: Create a file with the disk layout like this(with
bs=512, and cs=4K).
debugfs: stat
2023 Mar 02
1
[PATCH vhost v1 06/12] virtio_ring: packed: separate DMA codes
...struct vring_virtqueue *vq,
for (n = 0; n < out_sgs + in_sgs; n++) {
for (sg = sgs[n]; sg; sg = sg_next(sg)) {
- addr = vring_map_one_sg(vq, sg, n < out_sgs ?
- DMA_TO_DEVICE : DMA_FROM_DEVICE);
- if (vring_mapping_error(vq, addr))
- goto unmap_release;
-
desc[i].flags = cpu_to_le16(n < out_sgs ?
0 : VRING_DESC_F_WRITE);
- desc[i].addr = cpu_to_le64(addr);
+ desc[i].addr = cpu_to_le64(sg->dma_address);
desc[i].len = cpu_to_le32(sg->length);
i++;
}
@@ -1380,7 +1375,7 @@ static int virtqueue_add_indirect_packed(struct vring_virtqueue *vq,
total...
2014 Sep 21
0
[PATCH RFC] virtio-pci: share config interrupt between virtio devices
...fact the virtio spec always required this explicitly.
>
> I think I may be a bit confused here, but AFAIK we do set subsystem vendor
> ID properly for our virtio-pci devices?
>
> vpci->pci_hdr = (struct pci_device_header) {
> .vendor_id = cpu_to_le16(PCI_VENDOR_ID_REDHAT_QUMRANET),
> .device_id = cpu_to_le16(device_id),
> [...]
> .subsys_vendor_id = cpu_to_le16(PCI_SUBSYSTEM_VENDOR_ID_REDHAT_QUMRANET),
>
>
> Thanks,
> Sasha
Yes but the spec says:
The Subsystem Vendor...
2023 Mar 22
1
[PATCH vhost v4 02/11] virtio_ring: packed: separate dma codes
...M;
+
curr = id;
c = 0;
for (n = 0; n < out_sgs + in_sgs; n++) {
for (sg = sgs[n]; sg; sg = sg_next(sg)) {
- dma_addr_t addr = vring_map_one_sg(vq, sg, n < out_sgs ?
- DMA_TO_DEVICE : DMA_FROM_DEVICE);
- if (vring_mapping_error(vq, addr))
- goto unmap_release;
-
flags = cpu_to_le16(vq->packed.avail_used_flags |
(++c == total_sg ? 0 : VRING_DESC_F_NEXT) |
(n < out_sgs ? 0 : VRING_DESC_F_WRITE));
@@ -1496,12 +1493,12 @@ static inline int virtqueue_add_packed(struct virtqueue *_vq,
else
desc[i].flags = flags;
- desc[i].addr = cpu_to_le64(addr...
2009 Feb 11
2
[PATCH 0/2] ocfs2: two fixes for xattr
Hi,
For EAs data structure in inode/block are little different from them in
bucket. These two patches try to make them same for the most part.
The first patch set xh_free_start and xh_name_value_len when EAs in
inode/block. xh_free_start is useful to keep the minimum offset of the
xattr name/value. But xh_name_value_len is not very useful because we
don't have "hole" when EAs in
2023 May 17
2
[PATCH vhost v9 01/12] virtio_ring: put mapping error check in vring_map_one_sg
...sg_next(sg)) {
- addr = vring_map_one_sg(vq, sg, n < out_sgs ?
- DMA_TO_DEVICE : DMA_FROM_DEVICE);
- if (vring_mapping_error(vq, addr))
+ if (vring_map_one_sg(vq, sg, n < out_sgs ?
+ DMA_TO_DEVICE : DMA_FROM_DEVICE, &addr))
goto unmap_release;
desc[i].flags = cpu_to_le16(n < out_sgs ?
@@ -1426,9 +1432,10 @@ static inline int virtqueue_add_packed(struct virtqueue *_vq,
c = 0;
for (n = 0; n < out_sgs + in_sgs; n++) {
for (sg = sgs[n]; sg; sg = sg_next(sg)) {
- dma_addr_t addr = vring_map_one_sg(vq, sg, n < out_sgs ?
- DMA_TO_DEVICE : DMA_FROM_DE...
2016 Aug 24
2
[PATCH 2/3] qemu: Implement virtio-pstore device
...v(rarg->ioc, sg, sg_num, &err);
> + if (len < 0) {
> + if (errno == EAGAIN) {
> + len = 0;
> + }
> + ret = -1;
> + } else {
> + info->len = cpu_to_le32(len);
> + ret = 0;
> + }
> +
> + res.cmd = cpu_to_le16(VIRTIO_PSTORE_CMD_READ);
> + res.type = cpu_to_le16(VIRTIO_PSTORE_TYPE_UNKNOWN);
> + res.ret = cpu_to_le32(ret);
> +
> + /* now copy res and fileinfo */
> + iov_from_buf(elem->in_sg, elem->in_num, 0, &res, sizeof(res));
> + iov_from_buf(elem->in_sg, el...
2016 Aug 24
2
[PATCH 2/3] qemu: Implement virtio-pstore device
...v(rarg->ioc, sg, sg_num, &err);
> + if (len < 0) {
> + if (errno == EAGAIN) {
> + len = 0;
> + }
> + ret = -1;
> + } else {
> + info->len = cpu_to_le32(len);
> + ret = 0;
> + }
> +
> + res.cmd = cpu_to_le16(VIRTIO_PSTORE_CMD_READ);
> + res.type = cpu_to_le16(VIRTIO_PSTORE_TYPE_UNKNOWN);
> + res.ret = cpu_to_le32(ret);
> +
> + /* now copy res and fileinfo */
> + iov_from_buf(elem->in_sg, elem->in_num, 0, &res, sizeof(res));
> + iov_from_buf(elem->in_sg, el...
2018 Nov 21
1
[PATCH net-next v3 00/13] virtio: support packed ring
...d;
dma_addr_t addr;
+ int c = 0;
head = vq->packed.next_avail_idx;
desc = alloc_indirect_packed(total_sg, gfp);
@@ -1001,8 +1002,9 @@ static int virtqueue_add_indirect_packed(struct vring_virtqueue *vq,
if (vring_mapping_error(vq, addr))
goto unmap_release;
- desc[i].flags = cpu_to_le16(n < out_sgs ?
- 0 : VRING_DESC_F_WRITE);
+ desc[i].flags = cpu_to_le16((n < out_sgs ?
+ 0 : VRING_DESC_F_WRITE) |
+ (++c == total_sg ? 0 : VRING_DESC_F_NEXT));
desc[i].addr = cpu_to_le64(addr);
desc[i].len = cpu_to_le32(sg->length);
i++;
--
2.14.1
>
>...
2018 Dec 07
0
[RFC 3/3] virtio_ring: use new vring flags
...len),
- (flags & VRING_DESC_F_WRITE) ?
+ (flags & BIT(VRING_PACKED_DESC_F_WRITE)) ?
DMA_FROM_DEVICE : DMA_TO_DEVICE);
}
}
@@ -1002,7 +1015,7 @@ static int virtqueue_add_indirect_packed(struct vring_virtqueue *vq,
goto unmap_release;
desc[i].flags = cpu_to_le16(n < out_sgs ?
- 0 : VRING_DESC_F_WRITE);
+ 0 : BIT(VRING_PACKED_DESC_F_WRITE));
desc[i].addr = cpu_to_le64(addr);
desc[i].len = cpu_to_le32(sg->length);
i++;
@@ -1025,8 +1038,9 @@ static int virtqueue_add_indirect_packed(struct vring_virtqueue *vq,
vq->packed.desc_e...
2015 Apr 14
2
[PATCH] virtio_balloon: drop virtio_balloon_stat_modern
Looks like we are better off sticking with the misaligned stat struct,
to reduce the amount of virtio 1 specific code in balloon. So let's do
it.
Add a detailed comment to reduce the chance people copy this bad example.
This also fixes a bug on BE architectures: tag should use
cpu_to_le16, not cpu_to_le32.
Acked-by: Cornelia Huck <cornelia.huck at de.ibm.com>
Signed-off-by: Michael S. Tsirkin <mst at redhat.com>
---
Just reposting so it's easier to apply.
Feel free to squash into previous patch if you think it's
neater.
include/uapi/linux/virtio_balloon.h | 3...
2015 Apr 14
2
[PATCH] virtio_balloon: drop virtio_balloon_stat_modern
Looks like we are better off sticking with the misaligned stat struct,
to reduce the amount of virtio 1 specific code in balloon. So let's do
it.
Add a detailed comment to reduce the chance people copy this bad example.
This also fixes a bug on BE architectures: tag should use
cpu_to_le16, not cpu_to_le32.
Acked-by: Cornelia Huck <cornelia.huck at de.ibm.com>
Signed-off-by: Michael S. Tsirkin <mst at redhat.com>
---
Just reposting so it's easier to apply.
Feel free to squash into previous patch if you think it's
neater.
include/uapi/linux/virtio_balloon.h | 3...
2014 Sep 18
3
[PATCH RFC] virtio-pci: share config interrupt between virtio devices
On Monday 01 September 2014 09:37:30, Michael S. Tsirkin wrote:
> Why do we need INT#x?
> How about setting IRQF_SHARED for the config interrupt
> while using MSI-X? You'd have to read ISR to check that the
> interrupt was intended for your device.
The virtio 0.9.5 spec says that ISR is "unused" when in MSI-X mode. I
don't think that you can depend on the device to
2014 Sep 18
3
[PATCH RFC] virtio-pci: share config interrupt between virtio devices
On Monday 01 September 2014 09:37:30, Michael S. Tsirkin wrote:
> Why do we need INT#x?
> How about setting IRQF_SHARED for the config interrupt
> while using MSI-X? You'd have to read ISR to check that the
> interrupt was intended for your device.
The virtio 0.9.5 spec says that ISR is "unused" when in MSI-X mode. I
don't think that you can depend on the device to
2015 Mar 19
5
[PATCH 1/1] Add virtio-input driver.
...u16 type, u16 code, s32 value)
> +{
> + struct virtio_input_event *stsbuf;
> + struct scatterlist sg[1];
> +
> + stsbuf = kzalloc(sizeof(*stsbuf), GFP_ATOMIC);
> + if (!stsbuf)
> + return -ENOMEM;
> +
> + stsbuf->type = cpu_to_le16(type);
> + stsbuf->code = cpu_to_le16(code);
> + stsbuf->value = cpu_to_le32(value);
> + sg_init_one(sg, stsbuf, sizeof(*stsbuf));
> + virtqueue_add_outbuf(vi->sts, sg, 1, stsbuf, GFP_ATOMIC);
> + virtqueue_kick(vi->sts);
GFP_ATOMIC, eww. B...