search for: virtio_net_config

Displaying 20 results from an estimated 377 matches for "virtio_net_config".

2020 Aug 05
1
[PATCH v3 38/38] virtio_net: use LE accessors for speed/duplex
...934b1ec5320 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)); + + virtio_cread_le(vi->vdev, struct virtio_...
2017 Dec 22
6
[PATCH 2/3] qemu: use 64-bit values for feature flags in virtio-net
...(container *)0)->field)) typedef struct VirtIOFeature { - uint32_t flags; + uint64_t flags; size_t end; } VirtIOFeature; static VirtIOFeature feature_sizes[] = { - {.flags = 1 << VIRTIO_NET_F_MAC, + {.flags = 1ULL << VIRTIO_NET_F_MAC, .end = endof(struct virtio_net_config, mac)}, - {.flags = 1 << VIRTIO_NET_F_STATUS, + {.flags = 1ULL << VIRTIO_NET_F_STATUS, .end = endof(struct virtio_net_config, status)}, - {.flags = 1 << VIRTIO_NET_F_MQ, + {.flags = 1ULL << VIRTIO_NET_F_MQ, .end = endof(struct virtio_net_config, max_v...
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
2018 Jan 05
5
[PATCH v4 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
2020 Aug 05
0
[PATCH] virtio_net: use LE accessors for speed/duplex
...934b1ec5320 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)); + + virtio_cread_le(vi->vdev, struct virtio_...
2018 Jan 04
2
[PATCH net-next v3 1/3] virtio_net: propagate linkspeed/duplex settings from the hypervisor
...ers/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->duplex = duplex; + } + if (vi->status & VIRTIO_NET_S_LI...
2016 Mar 16
3
[RFC v2 -next 1/2] virtio: Start feature MTU support
...ering */ > #define VIRTIO_NET_F_CTRL_MAC_ADDR 23 /* Set MAC address */ > +#define VIRTIO_NET_F_MTU 25 /* Device supports Default MTU Negotiation */ > > #ifndef VIRTIO_NET_NO_LEGACY > #define VIRTIO_NET_F_GSO 6 /* Host handles pkts w/ any GSO type */ > @@ -73,6 +74,8 @@ struct virtio_net_config { > * Legal values are between 1 and 0x8000 > */ > __u16 max_virtqueue_pairs; > + /* Default maximum transmit unit advice */ > + __u16 mtu; > } __attribute__((packed)); > > /* You can't change user visible headers without breaking ABI. This structure might b...
2016 Mar 16
3
[RFC v2 -next 1/2] virtio: Start feature MTU support
...ering */ > #define VIRTIO_NET_F_CTRL_MAC_ADDR 23 /* Set MAC address */ > +#define VIRTIO_NET_F_MTU 25 /* Device supports Default MTU Negotiation */ > > #ifndef VIRTIO_NET_NO_LEGACY > #define VIRTIO_NET_F_GSO 6 /* Host handles pkts w/ any GSO type */ > @@ -73,6 +74,8 @@ struct virtio_net_config { > * Legal values are between 1 and 0x8000 > */ > __u16 max_virtqueue_pairs; > + /* Default maximum transmit unit advice */ > + __u16 mtu; > } __attribute__((packed)); > > /* You can't change user visible headers without breaking ABI. This structure might b...
2018 Jan 04
3
[PATCH net-next v3 1/3] virtio_net: propagate linkspeed/duplex settings from the hypervisor
...ine, 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, >> + duplex)); >> + if (ethtool_validate_duplex(duplex)) >> +...
2018 Jan 04
3
[PATCH net-next v3 1/3] virtio_net: propagate linkspeed/duplex settings from the hypervisor
...ine, 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, >> + duplex)); >> + if (ethtool_validate_duplex(duplex)) >> +...
2018 Jan 04
1
[PATCH net-next v3 1/3] virtio_net: propagate linkspeed/duplex settings from the hypervisor
...rk(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)) >> +...
2018 Jan 04
1
[PATCH net-next v3 1/3] virtio_net: propagate linkspeed/duplex settings from the hypervisor
...rk(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)) >> +...
2020 Aug 05
3
[PATCH v2 22/24] vdpa_sim: fix endian-ness of config space
...gt; +} > + > static struct vdpasim *vdpasim_dev; > > static struct vdpasim *vdpa_to_sim(struct vdpa_device *vdpa) > @@ -306,7 +324,6 @@ static const struct vdpa_config_ops vdpasim_net_config_ops; > > static struct vdpasim *vdpasim_create(void) > { > - struct virtio_net_config *config; > struct vdpasim *vdpasim; > struct device *dev; > int ret = -ENOMEM; > @@ -331,10 +348,7 @@ static struct vdpasim *vdpasim_create(void) > if (!vdpasim->buffer) > goto err_iommu; > > - config = &vdpasim->config; > - config->mtu = 1...
2020 Aug 05
3
[PATCH v2 22/24] vdpa_sim: fix endian-ness of config space
...gt; +} > + > static struct vdpasim *vdpasim_dev; > > static struct vdpasim *vdpa_to_sim(struct vdpa_device *vdpa) > @@ -306,7 +324,6 @@ static const struct vdpa_config_ops vdpasim_net_config_ops; > > static struct vdpasim *vdpasim_create(void) > { > - struct virtio_net_config *config; > struct vdpasim *vdpasim; > struct device *dev; > int ret = -ENOMEM; > @@ -331,10 +348,7 @@ static struct vdpasim *vdpasim_create(void) > if (!vdpasim->buffer) > goto err_iommu; > > - config = &vdpasim->config; > - config->mtu = 1...
2023 Jan 31
1
[PATCH v2 2/7] vdpa: conditionally read STATUS in config space
...--- a/drivers/vdpa/vdpa.c +++ b/drivers/vdpa/vdpa.c @@ -843,18 +843,25 @@ static int vdpa_dev_net_mac_config_fill(struct sk_buff *msg, u64 features, sizeof(config->mac), config->mac); } +static int vdpa_dev_net_status_config_fill(struct sk_buff *msg, u64 features, + const struct virtio_net_config *config) +{ + u16 val_u16; + + if ((features & BIT_ULL(VIRTIO_NET_F_STATUS)) == 0) + return 0; + + val_u16 = __virtio16_to_cpu(true, config->status); + return nla_put_u16(msg, VDPA_ATTR_DEV_NET_STATUS, val_u16); +} + static int vdpa_dev_net_config_fill(struct vdpa_device *vdev, struct sk_b...
2020 Mar 01
2
[PATCH v3 2/3] virtio-net: Introduce RSS receive steering feature
...< 4) > +#define VIRTIO_NET_RSS_HASH_TYPE_UDPv6 (1 << 5) > +#define VIRTIO_NET_RSS_HASH_TYPE_IP_EX (1 << 6) > +#define VIRTIO_NET_RSS_HASH_TYPE_TCP_EX (1 << 7) > +#define VIRTIO_NET_RSS_HASH_TYPE_UDP_EX (1 << 8) > + > struct virtio_net_config { > /* The config defining mac address (if VIRTIO_NET_F_MAC) */ > __u8 mac[ETH_ALEN]; > @@ -93,6 +105,12 @@ struct virtio_net_config { > * Any other value stands for unknown. > */ > __u8 duplex; > + /* maximum size of RSS key */ > + __u8 rss_max_key_size; > +...
2020 Mar 01
2
[PATCH v3 2/3] virtio-net: Introduce RSS receive steering feature
...< 4) > +#define VIRTIO_NET_RSS_HASH_TYPE_UDPv6 (1 << 5) > +#define VIRTIO_NET_RSS_HASH_TYPE_IP_EX (1 << 6) > +#define VIRTIO_NET_RSS_HASH_TYPE_TCP_EX (1 << 7) > +#define VIRTIO_NET_RSS_HASH_TYPE_UDP_EX (1 << 8) > + > struct virtio_net_config { > /* The config defining mac address (if VIRTIO_NET_F_MAC) */ > __u8 mac[ETH_ALEN]; > @@ -93,6 +105,12 @@ struct virtio_net_config { > * Any other value stands for unknown. > */ > __u8 duplex; > + /* maximum size of RSS key */ > + __u8 rss_max_key_size; > +...
2016 Jun 02
1
[PATCH v2 -next] virtio-net: Add initial MTU advice feature
...b/drivers/net/virtio_net.c @@ -1896,6 +1896,12 @@ static int virtnet_probe(struct virtio_device *vdev) if (virtio_has_feature(vdev, VIRTIO_NET_F_CTRL_VQ)) vi->has_cvq = true; + if (virtio_has_feature(vdev, VIRTIO_NET_F_MTU)) { + dev->mtu = virtio_cread16(vdev, + offsetof(struct virtio_net_config, + mtu)); + } + if (vi->any_header_sg) dev->needed_headroom = vi->hdr_len; @@ -2067,6 +2073,7 @@ static unsigned int features[] = { VIRTIO_NET_F_GUEST_ANNOUNCE, VIRTIO_NET_F_MQ, VIRTIO_NET_F_CTRL_MAC_ADDR, VIRTIO_F_ANY_LAYOUT, + VIRTIO_NET_F_MTU, }; static struct v...
2016 Jun 02
1
[PATCH v2 -next] virtio-net: Add initial MTU advice feature
...b/drivers/net/virtio_net.c @@ -1896,6 +1896,12 @@ static int virtnet_probe(struct virtio_device *vdev) if (virtio_has_feature(vdev, VIRTIO_NET_F_CTRL_VQ)) vi->has_cvq = true; + if (virtio_has_feature(vdev, VIRTIO_NET_F_MTU)) { + dev->mtu = virtio_cread16(vdev, + offsetof(struct virtio_net_config, + mtu)); + } + if (vi->any_header_sg) dev->needed_headroom = vi->hdr_len; @@ -2067,6 +2073,7 @@ static unsigned int features[] = { VIRTIO_NET_F_GUEST_ANNOUNCE, VIRTIO_NET_F_MQ, VIRTIO_NET_F_CTRL_MAC_ADDR, VIRTIO_F_ANY_LAYOUT, + VIRTIO_NET_F_MTU, }; static struct v...
2020 Mar 02
2
[PATCH v3 2/3] virtio-net: Introduce RSS receive steering feature
...v6 (1 << 5) > > > +#define VIRTIO_NET_RSS_HASH_TYPE_IP_EX (1 << 6) > > > +#define VIRTIO_NET_RSS_HASH_TYPE_TCP_EX (1 << 7) > > > +#define VIRTIO_NET_RSS_HASH_TYPE_UDP_EX (1 << 8) > > > + > > > struct virtio_net_config { > > > /* The config defining mac address (if VIRTIO_NET_F_MAC) */ > > > __u8 mac[ETH_ALEN]; > > > @@ -93,6 +105,12 @@ struct virtio_net_config { > > > * Any other value stands for unknown. > > > */ > > > __u8 du...