search for: virtio_net_s_link_up

Displaying 20 results from an estimated 179 matches for "virtio_net_s_link_up".

2012 Mar 13
1
[V4 PATCH] virtio-net: send gratuitous packet when needed
...rtio_has_feature(vi->vdev, VIRTIO_NET_F_GUEST_ANNOUNCE)) + cancel_work_sync(&vi->announce); napi_disable(&vi->napi); return 0; @@ -962,11 +974,23 @@ static void virtnet_update_status(struct virtnet_info *vi) return; /* Ignore unknown (future) status bits */ - v &= VIRTIO_NET_S_LINK_UP; + v &= VIRTIO_NET_S_LINK_UP | VIRTIO_NET_S_ANNOUNCE; if (vi->status == v) return; + if (v & VIRTIO_NET_S_ANNOUNCE) { + v &= ~VIRTIO_NET_S_ANNOUNCE; + vi->vdev->config->set(vi->vdev, + offsetof(struct virtio_net_config, + status), +...
2012 Mar 13
1
[V4 PATCH] virtio-net: send gratuitous packet when needed
...rtio_has_feature(vi->vdev, VIRTIO_NET_F_GUEST_ANNOUNCE)) + cancel_work_sync(&vi->announce); napi_disable(&vi->napi); return 0; @@ -962,11 +974,23 @@ static void virtnet_update_status(struct virtnet_info *vi) return; /* Ignore unknown (future) status bits */ - v &= VIRTIO_NET_S_LINK_UP; + v &= VIRTIO_NET_S_LINK_UP | VIRTIO_NET_S_ANNOUNCE; if (vi->status == v) return; + if (v & VIRTIO_NET_S_ANNOUNCE) { + v &= ~VIRTIO_NET_S_ANNOUNCE; + vi->vdev->config->set(vi->vdev, + offsetof(struct virtio_net_config, + status), +...
2012 Mar 28
2
[V6 PATCH] virtio-net: send gratuitous packets when needed
...ble napi! */ cancel_delayed_work_sync(&vi->refill); + cancel_work_sync(&vi->announce); napi_disable(&vi->napi); return 0; @@ -962,11 +983,17 @@ static void virtnet_update_status(struct virtnet_info *vi) return; /* Ignore unknown (future) status bits */ - v &= VIRTIO_NET_S_LINK_UP; + v &= VIRTIO_NET_S_LINK_UP | VIRTIO_NET_S_ANNOUNCE; if (vi->status == v) return; + if (v & VIRTIO_NET_S_ANNOUNCE) { + v &= ~VIRTIO_NET_S_ANNOUNCE; + if (v & VIRTIO_NET_S_LINK_UP) + schedule_work(&vi->announce); + } + vi->status = v; if (vi->statu...
2012 Mar 28
2
[V6 PATCH] virtio-net: send gratuitous packets when needed
...ble napi! */ cancel_delayed_work_sync(&vi->refill); + cancel_work_sync(&vi->announce); napi_disable(&vi->napi); return 0; @@ -962,11 +983,17 @@ static void virtnet_update_status(struct virtnet_info *vi) return; /* Ignore unknown (future) status bits */ - v &= VIRTIO_NET_S_LINK_UP; + v &= VIRTIO_NET_S_LINK_UP | VIRTIO_NET_S_ANNOUNCE; if (vi->status == v) return; + if (v & VIRTIO_NET_S_ANNOUNCE) { + v &= ~VIRTIO_NET_S_ANNOUNCE; + if (v & VIRTIO_NET_S_LINK_UP) + schedule_work(&vi->announce); + } + vi->status = v; if (vi->statu...
2020 Jul 15
2
[PATCH RFC don't apply] vdpa_sim: endian-ness for config space
...le_endian(vdpasim), val); +} + static struct vdpasim *vdpasim_dev; static struct vdpasim *vdpa_to_sim(struct vdpa_device *vdpa) @@ -332,8 +350,8 @@ static struct vdpasim *vdpasim_create(void) goto err_iommu; config = &vdpasim->config; - config->mtu = 1500; - config->status = VIRTIO_NET_S_LINK_UP; + config->mtu = cpu_to_vdpasim16(vdpasim, 1500); + config->status = cpu_to_vdpasim16(vdpasim, VIRTIO_NET_S_LINK_UP); eth_random_addr(config->mac); vringh_set_iotlb(&vdpasim->vqs[0].vring, vdpasim->iommu); -- MST
2020 Jul 15
2
[PATCH RFC don't apply] vdpa_sim: endian-ness for config space
...le_endian(vdpasim), val); +} + static struct vdpasim *vdpasim_dev; static struct vdpasim *vdpa_to_sim(struct vdpa_device *vdpa) @@ -332,8 +350,8 @@ static struct vdpasim *vdpasim_create(void) goto err_iommu; config = &vdpasim->config; - config->mtu = 1500; - config->status = VIRTIO_NET_S_LINK_UP; + config->mtu = cpu_to_vdpasim16(vdpasim, 1500); + config->status = cpu_to_vdpasim16(vdpasim, VIRTIO_NET_S_LINK_UP); eth_random_addr(config->mac); vringh_set_iotlb(&vdpasim->vqs[0].vring, vdpasim->iommu); -- MST
2012 Mar 16
1
[V5 PATCH] virtio-net: send gratuitous packets when needed
...ble napi! */ cancel_delayed_work_sync(&vi->refill); + cancel_work_sync(&vi->announce); napi_disable(&vi->napi); return 0; @@ -962,11 +973,22 @@ static void virtnet_update_status(struct virtnet_info *vi) return; /* Ignore unknown (future) status bits */ - v &= VIRTIO_NET_S_LINK_UP; + v &= VIRTIO_NET_S_LINK_UP | VIRTIO_NET_S_ANNOUNCE; if (vi->status == v) return; + if (v & VIRTIO_NET_S_ANNOUNCE) { + v &= ~VIRTIO_NET_S_ANNOUNCE; + vi->vdev->config->set(vi->vdev, + offsetof(struct virtio_net_config, + status), +...
2012 Mar 16
1
[V5 PATCH] virtio-net: send gratuitous packets when needed
...ble napi! */ cancel_delayed_work_sync(&vi->refill); + cancel_work_sync(&vi->announce); napi_disable(&vi->napi); return 0; @@ -962,11 +973,22 @@ static void virtnet_update_status(struct virtnet_info *vi) return; /* Ignore unknown (future) status bits */ - v &= VIRTIO_NET_S_LINK_UP; + v &= VIRTIO_NET_S_LINK_UP | VIRTIO_NET_S_ANNOUNCE; if (vi->status == v) return; + if (v & VIRTIO_NET_S_ANNOUNCE) { + v &= ~VIRTIO_NET_S_ANNOUNCE; + vi->vdev->config->set(vi->vdev, + offsetof(struct virtio_net_config, + status), +...
2012 Mar 16
1
[PATCH] virtio-spec: split virtio-net device status filed into ro and rw byte
...(though is only valid if VIRTIO_NET_F_MAC is set), and the status field only exists if VIRTIO_NET_F_STATUS is set. + +\change_inserted 2090695081 1331907586 + The low byte of status field is read-only, guest write to this byte would + be ignored. + Currently only one bit is defined for this byte: VIRTIO_NET_S_LINK_UP. + The high byte of status field is read-writable. + Currently only one bit is defined for this byte: VIRTIO_NET_S_ANNOUNCE. + +\change_deleted 2090695081 1331907489 Two bits are currently defined for the status field: VIRTIO_NET_S_LINK_UP and VIRTIO_NET_S_ANNOUNCE. + +\change_unchanged \be...
2012 Mar 16
1
[PATCH] virtio-spec: split virtio-net device status filed into ro and rw byte
...(though is only valid if VIRTIO_NET_F_MAC is set), and the status field only exists if VIRTIO_NET_F_STATUS is set. + +\change_inserted 2090695081 1331907586 + The low byte of status field is read-only, guest write to this byte would + be ignored. + Currently only one bit is defined for this byte: VIRTIO_NET_S_LINK_UP. + The high byte of status field is read-writable. + Currently only one bit is defined for this byte: VIRTIO_NET_S_ANNOUNCE. + +\change_deleted 2090695081 1331907489 Two bits are currently defined for the status field: VIRTIO_NET_S_LINK_UP and VIRTIO_NET_S_ANNOUNCE. + +\change_unchanged \be...
2020 Aug 05
3
[PATCH v2 22/24] vdpa_sim: fix endian-ness of config space
...*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 = 1500; > - config->status = VIRTIO_NET_S_LINK_UP; > - eth_random_addr(config->mac); > + eth_random_addr(vdpasim->config.mac); > > vringh_set_iotlb(&vdpasim->vqs[0].vring, vdpasim->iommu); > vringh_set_iotlb(&vdpasim->vqs[1].vring, vdpasim->iommu); > @@ -448,6 +462,7 @@ static u64 vdpasim_get_fe...
2020 Aug 05
3
[PATCH v2 22/24] vdpa_sim: fix endian-ness of config space
...*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 = 1500; > - config->status = VIRTIO_NET_S_LINK_UP; > - eth_random_addr(config->mac); > + eth_random_addr(vdpasim->config.mac); > > vringh_set_iotlb(&vdpasim->vqs[0].vring, vdpasim->iommu); > vringh_set_iotlb(&vdpasim->vqs[1].vring, vdpasim->iommu); > @@ -448,6 +462,7 @@ static u64 vdpasim_get_fe...
2023 Mar 27
0
[PATCH] vdpa/mlx5: Avoid losing link state updates
...void update_link_state(struct mlx5_vdpa_dev *mvdev) > +{ > + struct mlx5_vdpa_net *ndev = to_mlx5_vdpa_ndev(mvdev); > + bool up; > + > + up = get_link_state(mvdev); > + spin_lock(&ndev->status_lock); > + if (up) > + ndev->config.status |= cpu_to_mlx5vdpa16(mvdev, VIRTIO_NET_S_LINK_UP); > + else > + ndev->config.status &= cpu_to_mlx5vdpa16(mvdev, ~VIRTIO_NET_S_LINK_UP); > + spin_unlock(&ndev->status_lock); > +} > + > static int mlx5_vdpa_set_driver_features(struct vdpa_device *vdev, u64 features) > { > struct mlx5_vdpa_dev *mvdev = to_m...
2020 Jul 16
1
[PATCH RFC don't apply] vdpa_sim: endian-ness for config space
...sim_dev; > > static struct vdpasim *vdpa_to_sim(struct vdpa_device *vdpa) > > @@ -332,8 +350,8 @@ static struct vdpasim *vdpasim_create(void) > > goto err_iommu; > > config = &vdpasim->config; > > - config->mtu = 1500; > > - config->status = VIRTIO_NET_S_LINK_UP; > > + config->mtu = cpu_to_vdpasim16(vdpasim, 1500); > > + config->status = cpu_to_vdpasim16(vdpasim, VIRTIO_NET_S_LINK_UP); > > eth_random_addr(config->mac); > > vringh_set_iotlb(&vdpasim->vqs[0].vring, vdpasim->iommu);
2015 Aug 17
0
[PATCH v2 1/2] virtio-net: rephrase devconf fields description
...guration fields are currently defined. The \field{mac} address field > -always exists (though is only valid if VIRTIO_NET_F_MAC is set), and > -\field{status} only exists if VIRTIO_NET_F_STATUS is set. Two > -read-only bits (for the driver) are currently defined for the status field: > -VIRTIO_NET_S_LINK_UP and VIRTIO_NET_S_ANNOUNCE. > + > +The following configuration fields are currently defined: > > \begin{lstlisting} > #define VIRTIO_NET_S_LINK_UP 1 > #define VIRTIO_NET_S_ANNOUNCE 2 > \end{lstlisting} > > -The following driver-read-only field, \field{max_vi...
2012 Apr 12
2
[net-next V7 PATCH] virtio-net: send gratuitous packets when needed
...v, VIRTIO_NET_F_STATUS, offsetof(struct virtio_net_config, status), &v) < 0) - return; + goto done; + + if (v & VIRTIO_NET_S_ANNOUNCE) { + netif_notify_peers(vi->dev); + virtnet_ack_link_announce(vi); + } /* Ignore unknown (future) status bits */ v &= VIRTIO_NET_S_LINK_UP; if (vi->status == v) - return; + goto done; vi->status = v; @@ -976,13 +1006,15 @@ static void virtnet_update_status(struct virtnet_info *vi) netif_carrier_off(vi->dev); netif_stop_queue(vi->dev); } +done: + mutex_unlock(&vi->config_lock); } static void v...
2012 Apr 12
2
[net-next V7 PATCH] virtio-net: send gratuitous packets when needed
...v, VIRTIO_NET_F_STATUS, offsetof(struct virtio_net_config, status), &v) < 0) - return; + goto done; + + if (v & VIRTIO_NET_S_ANNOUNCE) { + netif_notify_peers(vi->dev); + virtnet_ack_link_announce(vi); + } /* Ignore unknown (future) status bits */ v &= VIRTIO_NET_S_LINK_UP; if (vi->status == v) - return; + goto done; vi->status = v; @@ -976,13 +1006,15 @@ static void virtnet_update_status(struct virtnet_info *vi) netif_carrier_off(vi->dev); netif_stop_queue(vi->dev); } +done: + mutex_unlock(&vi->config_lock); } static void v...
2015 Aug 16
1
[PATCH v2 1/2] virtio-net: rephrase devconf fields description
...iver-read-only configuration fields are currently defined. The \field{mac} address field -always exists (though is only valid if VIRTIO_NET_F_MAC is set), and -\field{status} only exists if VIRTIO_NET_F_STATUS is set. Two -read-only bits (for the driver) are currently defined for the status field: -VIRTIO_NET_S_LINK_UP and VIRTIO_NET_S_ANNOUNCE. + +The following configuration fields are currently defined: \begin{lstlisting} #define VIRTIO_NET_S_LINK_UP 1 #define VIRTIO_NET_S_ANNOUNCE 2 \end{lstlisting} -The following driver-read-only field, \field{max_virtqueue_pairs} only exists if -VIRTIO_NET_F_M...
2018 Jan 04
3
[PATCH net-next v3 1/3] virtio_net: propagate linkspeed/duplex settings from the hypervisor
...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 this from virtnet_probe. > > I propose moving this chunk to a function and calli...
2018 Jan 04
3
[PATCH net-next v3 1/3] virtio_net: propagate linkspeed/duplex settings from the hypervisor
...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 this from virtnet_probe. > > I propose moving this chunk to a function and calli...