search for: virtio_cread32

Displaying 20 results from an estimated 46 matches for "virtio_cread32".

Did you mean: virtio_cread
2020 Aug 05
1
[PATCH v3 38/38] virtio_net: use LE accessors for speed/duplex
...ivers/net/virtio_net.c index ba38765dc490..0934b1ec5320 100644 --- a/drivers/net/virtio_net.c +++ b/drivers/net/virtio_net.c @@ -2264,12 +2264,13 @@ static void virtnet_update_settings(struct virtnet_info *vi) if (!virtio_has_feature(vi->vdev, VIRTIO_NET_F_SPEED_DUPLEX)) return; - speed = virtio_cread32(vi->vdev, offsetof(struct virtio_net_config, - speed)); + virtio_cread_le(vi->vdev, struct virtio_net_config, speed, &speed); + if (ethtool_validate_speed(speed)) vi->speed = speed; - duplex = virtio_cread8(vi->vdev, offsetof(struct virtio_net_config, - duplex));...
2018 Jan 04
2
[PATCH net-next v3 1/3] virtio_net: propagate linkspeed/duplex settings from the hypervisor
...0b2d314 100644 --- a/drivers/net/virtio_net.c +++ b/drivers/net/virtio_net.c @@ -2146,6 +2146,22 @@ static void virtnet_config_changed_work(struct work_struct *work) vi->status = v; + if (virtio_has_feature(vi->vdev, VIRTIO_NET_F_SPEED_DUPLEX)) { + u32 speed; + u8 duplex; + + speed = virtio_cread32(vi->vdev, + offsetof(struct virtio_net_config, + speed)); + if (ethtool_validate_speed(speed)) + vi->speed = speed; + duplex = virtio_cread8(vi->vdev, + offsetof(struct virtio_net_config, + duplex)); + if (ethtool_validate_duplex(duplex)) + vi->duple...
2018 Jan 04
3
[PATCH net-next v3 1/3] virtio_net: propagate linkspeed/duplex settings from the hypervisor
...ck). 2) if speed or duplex or speed is set in the qemu command line, then set the VIRTIO_NET_F_SPEED_DUPLEX and have host control the settings of speed/duplex (with ability of guest to over-write if it wanted to). > >> + u32 speed; >> + u8 duplex; >> + >> + speed = virtio_cread32(vi->vdev, >> + offsetof(struct virtio_net_config, >> + speed)); >> + if (ethtool_validate_speed(speed)) >> + vi->speed = speed; >> + duplex = virtio_cread8(vi->vdev, >> + offsetof(struct virtio_net_config, >> + dup...
2018 Jan 04
3
[PATCH net-next v3 1/3] virtio_net: propagate linkspeed/duplex settings from the hypervisor
...ck). 2) if speed or duplex or speed is set in the qemu command line, then set the VIRTIO_NET_F_SPEED_DUPLEX and have host control the settings of speed/duplex (with ability of guest to over-write if it wanted to). > >> + u32 speed; >> + u8 duplex; >> + >> + speed = virtio_cread32(vi->vdev, >> + offsetof(struct virtio_net_config, >> + speed)); >> + if (ethtool_validate_speed(speed)) >> + vi->speed = speed; >> + duplex = virtio_cread8(vi->vdev, >> + offsetof(struct virtio_net_config, >> + dup...
2018 Jan 04
1
[PATCH net-next v3 1/3] virtio_net: propagate linkspeed/duplex settings from the hypervisor
...> @@ -2146,6 +2146,22 @@ static void virtnet_config_changed_work(struct work_struct *work) >> >> vi->status = v; >> >> + if (virtio_has_feature(vi->vdev, VIRTIO_NET_F_SPEED_DUPLEX)) { >> + u32 speed; >> + u8 duplex; >> + >> + speed = virtio_cread32(vi->vdev, >> + offsetof(struct virtio_net_config, >> + speed)); >> + if (ethtool_validate_speed(speed)) >> + vi->speed = speed; >> + duplex = virtio_cread8(vi->vdev, >> + offsetof(struct virtio_net_config, >> + dup...
2018 Jan 04
1
[PATCH net-next v3 1/3] virtio_net: propagate linkspeed/duplex settings from the hypervisor
...> @@ -2146,6 +2146,22 @@ static void virtnet_config_changed_work(struct work_struct *work) >> >> vi->status = v; >> >> + if (virtio_has_feature(vi->vdev, VIRTIO_NET_F_SPEED_DUPLEX)) { >> + u32 speed; >> + u8 duplex; >> + >> + speed = virtio_cread32(vi->vdev, >> + offsetof(struct virtio_net_config, >> + speed)); >> + if (ethtool_validate_speed(speed)) >> + vi->speed = speed; >> + duplex = virtio_cread8(vi->vdev, >> + offsetof(struct virtio_net_config, >> + dup...
2017 Dec 22
6
[PATCH 2/3] qemu: use 64-bit values for feature flags in virtio-net
In prepartion for using some of the high order feature bits, make sure that virtio-net uses 64-bit values everywhere. Signed-off-by: Jason Baron <jbaron at akamai.com> Cc: "Michael S. Tsirkin" <mst at redhat.com> Cc: Jason Wang <jasowang at redhat.com> --- hw/net/virtio-net.c | 54 +++++++++++++++++++++--------------------- include/hw/virtio/virtio-net.h |
2018 Jan 04
5
[PATCH v3 0/3] virtio_net: allow hypervisor to indicate linkspeed and duplex setting
We have found it useful to be able to set the linkspeed and duplex settings from the host-side for virtio_net. This obviates the need for guest changes and settings for these fields, and does not require custom ethtool commands for virtio_net. The ability to set linkspeed and duplex is useful in various cases as described here: 16032be virtio_net: add ethtool support for set and get of settings
2016 Apr 01
0
[patch] virtio: silence uninitialized variable warnings
...tio_device *vdev, unsigned int offset) { - u16 ret; + u16 ret = 0; vdev->config->get(vdev, offset, &ret, sizeof(ret)); return virtio16_to_cpu(vdev, (__force __virtio16)ret); } @@ -363,7 +363,7 @@ static inline void virtio_cwrite16(struct virtio_device *vdev, static inline u32 virtio_cread32(struct virtio_device *vdev, unsigned int offset) { - u32 ret; + u32 ret = 0; vdev->config->get(vdev, offset, &ret, sizeof(ret)); return virtio32_to_cpu(vdev, (__force __virtio32)ret); } @@ -378,7 +378,7 @@ static inline void virtio_cwrite32(struct virtio_device *vdev, static...
2020 Aug 05
0
[PATCH] virtio_net: use LE accessors for speed/duplex
...ivers/net/virtio_net.c index ba38765dc490..0934b1ec5320 100644 --- a/drivers/net/virtio_net.c +++ b/drivers/net/virtio_net.c @@ -2264,12 +2264,13 @@ static void virtnet_update_settings(struct virtnet_info *vi) if (!virtio_has_feature(vi->vdev, VIRTIO_NET_F_SPEED_DUPLEX)) return; - speed = virtio_cread32(vi->vdev, offsetof(struct virtio_net_config, - speed)); + virtio_cread_le(vi->vdev, struct virtio_net_config, speed, &speed); + if (ethtool_validate_speed(speed)) vi->speed = speed; - duplex = virtio_cread8(vi->vdev, offsetof(struct virtio_net_config, - duplex));...
2020 Aug 05
0
[PATCH v3 23/38] virtio_config: cread/write cleanup
...unsigned int offset, u16 val) { + __virtio16 v; + might_sleep(); - val = (__force u16)cpu_to_virtio16(vdev, val); - vdev->config->set(vdev, offset, &val, sizeof(val)); + v = cpu_to_virtio16(vdev, val); + vdev->config->set(vdev, offset, &v, sizeof(v)); } static inline u32 virtio_cread32(struct virtio_device *vdev, unsigned int offset) { - u32 ret; + __virtio32 ret; might_sleep(); vdev->config->get(vdev, offset, &ret, sizeof(ret)); - return virtio32_to_cpu(vdev, (__force __virtio32)ret); + return virtio32_to_cpu(vdev, ret); } static inline void virtio_cwr...
2016 Apr 01
0
[patch] virtio: silence uninitialized variable warnings
...tio_device *vdev, unsigned int offset) { - u16 ret; + u16 ret = 0; vdev->config->get(vdev, offset, &ret, sizeof(ret)); return virtio16_to_cpu(vdev, (__force __virtio16)ret); } @@ -363,7 +363,7 @@ static inline void virtio_cwrite16(struct virtio_device *vdev, static inline u32 virtio_cread32(struct virtio_device *vdev, unsigned int offset) { - u32 ret; + u32 ret = 0; vdev->config->get(vdev, offset, &ret, sizeof(ret)); return virtio32_to_cpu(vdev, (__force __virtio32)ret); } @@ -378,7 +378,7 @@ static inline void virtio_cwrite32(struct virtio_device *vdev, static...
2014 Oct 07
0
[PATCH RFC 05/11] virtio_config: endian conversion for v1.0.
...et; + return virtio_to_cpu_u16(vdev, ret); } static inline void virtio_cwrite16(struct virtio_device *vdev, unsigned int offset, u16 val) { + val = cpu_to_virtio_u16(vdev, val); vdev->config->set(vdev, offset, &val, sizeof(val)); } @@ -236,12 +237,13 @@ static inline u32 virtio_cread32(struct virtio_device *vdev, { u32 ret; vdev->config->get(vdev, offset, &ret, sizeof(ret)); - return ret; + return virtio_to_cpu_u32(vdev, ret); } static inline void virtio_cwrite32(struct virtio_device *vdev, unsigned int offset, u32 val) { + val = cpu_to_virtio_u32(vdev...
2014 Oct 22
0
[PATCH RFC v2 07/16] virtio_config: endian conversion for v1.0
...vdev, (__force __virtio16)ret); } static inline void virtio_cwrite16(struct virtio_device *vdev, unsigned int offset, u16 val) { + val = (__force u16)cpu_to_virtio16(vdev, val); vdev->config->set(vdev, offset, &val, sizeof(val)); } @@ -269,12 +270,13 @@ static inline u32 virtio_cread32(struct virtio_device *vdev, { u32 ret; vdev->config->get(vdev, offset, &ret, sizeof(ret)); - return ret; + return virtio32_to_cpu(vdev, (__force __virtio32)ret); } static inline void virtio_cwrite32(struct virtio_device *vdev, unsigned int offset, u32 val) { + val = (__f...
2014 Oct 22
0
[PATCH RFC v3 07/16] virtio_config: endian conversion for v1.0
...vdev, (__force __virtio16)ret); } static inline void virtio_cwrite16(struct virtio_device *vdev, unsigned int offset, u16 val) { + val = (__force u16)cpu_to_virtio16(vdev, val); vdev->config->set(vdev, offset, &val, sizeof(val)); } @@ -269,12 +270,13 @@ static inline u32 virtio_cread32(struct virtio_device *vdev, { u32 ret; vdev->config->get(vdev, offset, &ret, sizeof(ret)); - return ret; + return virtio32_to_cpu(vdev, (__force __virtio32)ret); } static inline void virtio_cwrite32(struct virtio_device *vdev, unsigned int offset, u32 val) { + val = (__f...
2014 Nov 24
0
[PATCH v3 06/41] virtio_config: endian conversion for v1.0
...vdev, (__force __virtio16)ret); } static inline void virtio_cwrite16(struct virtio_device *vdev, unsigned int offset, u16 val) { + val = (__force u16)cpu_to_virtio16(vdev, val); vdev->config->set(vdev, offset, &val, sizeof(val)); } @@ -285,12 +286,13 @@ static inline u32 virtio_cread32(struct virtio_device *vdev, { u32 ret; vdev->config->get(vdev, offset, &ret, sizeof(ret)); - return ret; + return virtio32_to_cpu(vdev, (__force __virtio32)ret); } static inline void virtio_cwrite32(struct virtio_device *vdev, unsigned int offset, u32 val) { + val = (__f...
2014 Nov 27
0
[PATCH v5 09/45] virtio_config: endian conversion for v1.0
...vdev, (__force __virtio16)ret); } static inline void virtio_cwrite16(struct virtio_device *vdev, unsigned int offset, u16 val) { + val = (__force u16)cpu_to_virtio16(vdev, val); vdev->config->set(vdev, offset, &val, sizeof(val)); } @@ -285,12 +286,13 @@ static inline u32 virtio_cread32(struct virtio_device *vdev, { u32 ret; vdev->config->get(vdev, offset, &ret, sizeof(ret)); - return ret; + return virtio32_to_cpu(vdev, (__force __virtio32)ret); } static inline void virtio_cwrite32(struct virtio_device *vdev, unsigned int offset, u32 val) { + val = (__f...
2014 Nov 27
0
[PATCH v6 10/46] virtio_config: endian conversion for v1.0
...vdev, (__force __virtio16)ret); } static inline void virtio_cwrite16(struct virtio_device *vdev, unsigned int offset, u16 val) { + val = (__force u16)cpu_to_virtio16(vdev, val); vdev->config->set(vdev, offset, &val, sizeof(val)); } @@ -332,12 +333,13 @@ static inline u32 virtio_cread32(struct virtio_device *vdev, { u32 ret; vdev->config->get(vdev, offset, &ret, sizeof(ret)); - return ret; + return virtio32_to_cpu(vdev, (__force __virtio32)ret); } static inline void virtio_cwrite32(struct virtio_device *vdev, unsigned int offset, u32 val) { + val = (__f...
2014 Nov 30
1
[PATCH v7 10/46] virtio_config: endian conversion for v1.0
...vdev, (__force __virtio16)ret); } static inline void virtio_cwrite16(struct virtio_device *vdev, unsigned int offset, u16 val) { + val = (__force u16)cpu_to_virtio16(vdev, val); vdev->config->set(vdev, offset, &val, sizeof(val)); } @@ -332,12 +333,13 @@ static inline u32 virtio_cread32(struct virtio_device *vdev, { u32 ret; vdev->config->get(vdev, offset, &ret, sizeof(ret)); - return ret; + return virtio32_to_cpu(vdev, (__force __virtio32)ret); } static inline void virtio_cwrite32(struct virtio_device *vdev, unsigned int offset, u32 val) { + val = (__f...
2014 Dec 01
0
[PATCH v8 10/50] virtio_config: endian conversion for v1.0
...vdev, (__force __virtio16)ret); } static inline void virtio_cwrite16(struct virtio_device *vdev, unsigned int offset, u16 val) { + val = (__force u16)cpu_to_virtio16(vdev, val); vdev->config->set(vdev, offset, &val, sizeof(val)); } @@ -332,12 +333,13 @@ static inline u32 virtio_cread32(struct virtio_device *vdev, { u32 ret; vdev->config->get(vdev, offset, &ret, sizeof(ret)); - return ret; + return virtio32_to_cpu(vdev, (__force __virtio32)ret); } static inline void virtio_cwrite32(struct virtio_device *vdev, unsigned int offset, u32 val) { + val = (__f...