search for: ethtool_validate_duplex

Displaying 20 results from an estimated 20 matches for "ethtool_validate_duplex".

2017 Mar 21
0
[PATCH] net: virtio_net: use new api ethtool_{get|set}_link_ksettings
...struct net_device *dev, + const struct ethtool_link_ksettings *cmd) { struct virtnet_info *vi = netdev_priv(dev); u32 speed; - speed = ethtool_cmd_speed(cmd); + speed = cmd->base.speed; /* don't allow custom speed and duplex */ if (!ethtool_validate_speed(speed) || - !ethtool_validate_duplex(cmd->duplex) || + !ethtool_validate_duplex(cmd->base.duplex) || !virtnet_validate_ethtool_cmd(cmd)) return -EINVAL; vi->speed = speed; - vi->duplex = cmd->duplex; + vi->duplex = cmd->base.duplex; return 0; } -static int virtnet_get_settings(struct net_devi...
2017 Mar 21
0
[PATCH] net: virtio_net: use new api ethtool_{get|set}_link_ksettings
...struct net_device *dev, + const struct ethtool_link_ksettings *cmd) { struct virtnet_info *vi = netdev_priv(dev); u32 speed; - speed = ethtool_cmd_speed(cmd); + speed = cmd->base.speed; /* don't allow custom speed and duplex */ if (!ethtool_validate_speed(speed) || - !ethtool_validate_duplex(cmd->duplex) || + !ethtool_validate_duplex(cmd->base.duplex) || !virtnet_validate_ethtool_cmd(cmd)) return -EINVAL; vi->speed = speed; - vi->duplex = cmd->duplex; + vi->duplex = cmd->base.duplex; return 0; } -static int virtnet_get_settings(struct net_devi...
2020 Aug 05
1
[PATCH v3 38/38] virtio_net: use LE accessors for speed/duplex
...gt;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_net_config, duplex, &duplex); + if (ethtool_validate_duplex(duplex)) vi->duplex = duplex; } diff --git a/include/uapi/linux/virtio_net.h b/include/uapi/linux/virtio_net.h index 27d996f29dd1..3f55a4215f11 100644 --- a/include/uapi/linux/virtio_net.h +++ b/include/uapi/linux/virtio_net.h @@ -99,7 +99,7 @@ struct virtio_net_config { * speed, in units...
2017 Mar 21
1
[PATCH 2] net: virtio_net: use new api ethtool_{get|set}_link_ksettings
...struct net_device *dev, + const struct ethtool_link_ksettings *cmd) { struct virtnet_info *vi = netdev_priv(dev); u32 speed; - speed = ethtool_cmd_speed(cmd); + speed = cmd->base.speed; /* don't allow custom speed and duplex */ if (!ethtool_validate_speed(speed) || - !ethtool_validate_duplex(cmd->duplex) || + !ethtool_validate_duplex(cmd->base.duplex) || !virtnet_validate_ethtool_cmd(cmd)) return -EINVAL; vi->speed = speed; - vi->duplex = cmd->duplex; + vi->duplex = cmd->base.duplex; return 0; } -static int virtnet_get_settings(struct net_devi...
2017 Mar 21
1
[PATCH 2] net: virtio_net: use new api ethtool_{get|set}_link_ksettings
...struct net_device *dev, + const struct ethtool_link_ksettings *cmd) { struct virtnet_info *vi = netdev_priv(dev); u32 speed; - speed = ethtool_cmd_speed(cmd); + speed = cmd->base.speed; /* don't allow custom speed and duplex */ if (!ethtool_validate_speed(speed) || - !ethtool_validate_duplex(cmd->duplex) || + !ethtool_validate_duplex(cmd->base.duplex) || !virtnet_validate_ethtool_cmd(cmd)) return -EINVAL; vi->speed = speed; - vi->duplex = cmd->duplex; + vi->duplex = cmd->base.duplex; return 0; } -static int virtnet_get_settings(struct net_devi...
2018 Jan 04
2
[PATCH net-next v3 1/3] virtio_net: propagate linkspeed/duplex settings from the hypervisor
...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_LINK_UP) { netif_carrier_on(vi->dev); netif_tx_wake_all_queues(vi->dev); @@ -2796,7 +2812,8 @@ static struct virtio_device_id id_table[] = { VIRTIO_NET_F_CTRL_RX, VIRTIO_NET_F_CTRL_VLAN, \ VIRTIO_NET_F...
2018 Jan 04
3
[PATCH net-next v3 1/3] virtio_net: propagate linkspeed/duplex settings from the hypervisor
...+ 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_LINK_UP) { >> netif_carrier_on(vi->dev); >> netif_tx_wake_all_queues(vi->dev); > > OK so this handles the case when VIRTIO_NET_F_STATUS is set, > b...
2018 Jan 04
3
[PATCH net-next v3 1/3] virtio_net: propagate linkspeed/duplex settings from the hypervisor
...+ 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_LINK_UP) { >> netif_carrier_on(vi->dev); >> netif_tx_wake_all_queues(vi->dev); > > OK so this handles the case when VIRTIO_NET_F_STATUS is set, > b...
2018 Jan 04
1
[PATCH net-next v3 1/3] virtio_net: propagate linkspeed/duplex settings from the hypervisor
...+ 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_LINK_UP) { >> netif_carrier_on(vi->dev); >> netif_tx_wake_all_queues(vi->dev); >> @@ -2796,7 +2812,8 @@ static struct virtio_device_id id_table[] = { &...
2018 Jan 04
1
[PATCH net-next v3 1/3] virtio_net: propagate linkspeed/duplex settings from the hypervisor
...+ 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_LINK_UP) { >> netif_carrier_on(vi->dev); >> netif_tx_wake_all_queues(vi->dev); >> @@ -2796,7 +2812,8 @@ static struct virtio_device_id id_table[] = { &...
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
2020 Aug 05
0
[PATCH] virtio_net: use LE accessors for speed/duplex
...gt;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_net_config, duplex, &duplex); + if (ethtool_validate_duplex(duplex)) vi->duplex = duplex; } diff --git a/include/uapi/linux/virtio_net.h b/include/uapi/linux/virtio_net.h index 27d996f29dd1..3f55a4215f11 100644 --- a/include/uapi/linux/virtio_net.h +++ b/include/uapi/linux/virtio_net.h @@ -99,7 +99,7 @@ struct virtio_net_config { * speed, in units...
2018 Jan 04
0
[PATCH net-next v3 1/3] virtio_net: propagate linkspeed/duplex settings from the hypervisor
...o_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_LINK_UP) { > netif_carrier_on(vi->dev); > netif_tx_wake_all_queues(vi->dev); > @@ -2796,7 +2812,8 @@ static struct virtio_device_id id_table[] = { > VIRTIO_NET_F_CTRL_RX,...
2018 Jan 04
0
[PATCH net-next v3 1/3] virtio_net: propagate linkspeed/duplex settings from the hypervisor
...o_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_LINK_UP) { > netif_carrier_on(vi->dev); > netif_tx_wake_all_queues(vi->dev); OK so this handles the case when VIRTIO_NET_F_STATUS is set, but when it's clear we need to call...
2018 Jan 05
0
[PATCH net-next v4 1/3] virtio_net: propagate linkspeed/duplex settings from the hypervisor
...t;vdev, VIRTIO_NET_F_SPEED_DUPLEX)) + return; + + 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; +} + static const struct ethtool_ops virtnet_ethtool_ops = { .get_drvinfo = virtnet_get_drvinfo, .get_link = ethtool_op_get_link, @@ -2147,6 +2165,7 @@ static void virtnet_config_changed_work(struct work_struct *work) vi->status = v; if (vi->stat...
2018 Jan 04
0
[PATCH net-next v3 1/3] virtio_net: propagate linkspeed/duplex settings from the hypervisor
...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_LINK_UP) { > >> netif_carrier_on(vi->dev); > >> netif_tx_wake_all_queues(vi->dev); > >> @@ -2796,7 +2812,8 @@ static struc...
2017 Dec 22
1
[PATCH net-next v2 1/3] virtio_net: propagate linkspeed/duplex settings from the hypervisor
...UPLEX)) { + u32 speed; + u8 duplex; + + speed = virtio_cread32(vdev, offsetof(struct virtio_net_config, + speed)); + if (ethtool_validate_speed(speed)) + vi->speed = speed; + duplex = virtio_cread8(vdev, + offsetof(struct virtio_net_config, + duplex)); + if (ethtool_validate_duplex(duplex)) + vi->duplex = duplex; + } err = register_netdev(dev); if (err) { @@ -2746,7 +2760,8 @@ static struct virtio_device_id id_table[] = { VIRTIO_NET_F_CTRL_RX, VIRTIO_NET_F_CTRL_VLAN, \ VIRTIO_NET_F_GUEST_ANNOUNCE, VIRTIO_NET_F_MQ, \ VIRTIO_NET_F_CTRL_MAC_ADDR, \ - VIRTIO_NET_...
2018 Jan 04
0
[PATCH net-next v3 1/3] virtio_net: propagate linkspeed/duplex settings from the hypervisor
...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_LINK_UP) { > >> netif_carrier_on(vi->dev); > >> netif_tx_wake_all_queues(vi->dev); > > > > OK so this handles the case...
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