search for: config_work

Displaying 20 results from an estimated 243 matches for "config_work".

2017 Jan 16
2
[PATCH v2] virtio_console: fix a crash in config_work_handler
Using control_work instead of config_work as the 3rd argument to container_of results in an invalid portdev pointer. Indeed, the work structure is initialized as below: INIT_WORK(&portdev->config_work, &config_work_handler); It leads to a crash when portdev->vdev is dereferenced later. This bug is triggered when the gue...
2017 Jan 16
2
[PATCH v2] virtio_console: fix a crash in config_work_handler
Using control_work instead of config_work as the 3rd argument to container_of results in an invalid portdev pointer. Indeed, the work structure is initialized as below: INIT_WORK(&portdev->config_work, &config_work_handler); It leads to a crash when portdev->vdev is dereferenced later. This bug is triggered when the gue...
2012 Apr 12
2
[net-next V7 PATCH] virtio-net: send gratuitous packets when needed
...ble_rx_bufs; + /* enable config space updates */ + bool config_enable; + /* Active statistics */ struct virtnet_stats __percpu *stats; /* Work struct for refilling if we run low on memory. */ struct delayed_work refill; + /* Work struct for config space updates */ + struct work_struct config_work; + + /* Lock for config space updates */ + struct mutex config_lock; + /* Chain pages by the private ptr. */ struct page *pages; @@ -781,6 +790,16 @@ static bool virtnet_send_command(struct virtnet_info *vi, u8 class, u8 cmd, return status == VIRTIO_NET_OK; } +static void virtnet_ack_lin...
2012 Apr 12
2
[net-next V7 PATCH] virtio-net: send gratuitous packets when needed
...ble_rx_bufs; + /* enable config space updates */ + bool config_enable; + /* Active statistics */ struct virtnet_stats __percpu *stats; /* Work struct for refilling if we run low on memory. */ struct delayed_work refill; + /* Work struct for config space updates */ + struct work_struct config_work; + + /* Lock for config space updates */ + struct mutex config_lock; + /* Chain pages by the private ptr. */ struct page *pages; @@ -781,6 +790,16 @@ static bool virtnet_send_command(struct virtnet_info *vi, u8 class, u8 cmd, return status == VIRTIO_NET_OK; } +static void virtnet_ack_lin...
2014 Oct 06
1
[PATCH 08/16] virtio_net: drop config_enable
...> > /* Prevent config work handler from accessing the device. */ Same comment as for the equivalent comment in the virtio-blk code. > - mutex_lock(&vi->config_lock); > - vi->config_enable = false; > - mutex_unlock(&vi->config_lock); > + flush_work(&vi->config_work); > > unregister_netdev(vi->dev); > > remove_vq_common(vi); > > - flush_work(&vi->config_work); > - > free_percpu(vi->stats); > free_netdev(vi->dev); > } > @@ -1899,9 +1888,7 @@ static int virtnet_freeze(struct virtio_device *vdev) >...
2014 Oct 06
1
[PATCH 08/16] virtio_net: drop config_enable
...> > /* Prevent config work handler from accessing the device. */ Same comment as for the equivalent comment in the virtio-blk code. > - mutex_lock(&vi->config_lock); > - vi->config_enable = false; > - mutex_unlock(&vi->config_lock); > + flush_work(&vi->config_work); > > unregister_netdev(vi->dev); > > remove_vq_common(vi); > > - flush_work(&vi->config_work); > - > free_percpu(vi->stats); > free_netdev(vi->dev); > } > @@ -1899,9 +1888,7 @@ static int virtnet_freeze(struct virtio_device *vdev) >...
2011 Dec 07
2
[PATCH RFC] virtio_blk: fix config handler race
...t;linux/hdreg.h> #include <linux/module.h> +#include <linux/mutex.h> #include <linux/virtio.h> #include <linux/virtio_blk.h> #include <linux/scatterlist.h> @@ -36,6 +37,12 @@ struct virtio_blk /* Process context for config space updates */ struct work_struct config_work; + /* Lock for config space updates */ + struct mutex config_lock; + + /* enable config space updates */ + bool config_enable; + /* What host tells us, plus 2 for header & tailer. */ unsigned int sg_elems; @@ -318,6 +325,10 @@ static void virtblk_config_changed_work(struct work_struct *...
2011 Dec 07
2
[PATCH RFC] virtio_blk: fix config handler race
...t;linux/hdreg.h> #include <linux/module.h> +#include <linux/mutex.h> #include <linux/virtio.h> #include <linux/virtio_blk.h> #include <linux/scatterlist.h> @@ -36,6 +37,12 @@ struct virtio_blk /* Process context for config space updates */ struct work_struct config_work; + /* Lock for config space updates */ + struct mutex config_lock; + + /* enable config space updates */ + bool config_enable; + /* What host tells us, plus 2 for header & tailer. */ unsigned int sg_elems; @@ -318,6 +325,10 @@ static void virtblk_config_changed_work(struct work_struct *...
2014 Oct 05
0
[PATCH 08/16] virtio_net: drop config_enable
...virtio_cread_feature(vi->vdev, VIRTIO_NET_F_STATUS, struct virtio_net_config, status, &v) < 0) goto done; @@ -1758,7 +1752,6 @@ static int virtnet_probe(struct virtio_device *vdev) } mutex_init(&vi->config_lock); - vi->config_enable = true; INIT_WORK(&vi->config_work, virtnet_config_changed_work); /* If we can receive ANY GSO packets, we must allocate large ones. */ @@ -1876,16 +1869,12 @@ static void virtnet_remove(struct virtio_device *vdev) unregister_hotcpu_notifier(&vi->nb); /* Prevent config work handler from accessing the device. */ - mu...
2014 Oct 06
0
[PATCH v2 07/15] virtio_net: drop config_enable
...virtio_cread_feature(vi->vdev, VIRTIO_NET_F_STATUS, struct virtio_net_config, status, &v) < 0) goto done; @@ -1758,7 +1752,6 @@ static int virtnet_probe(struct virtio_device *vdev) } mutex_init(&vi->config_lock); - vi->config_enable = true; INIT_WORK(&vi->config_work, virtnet_config_changed_work); /* If we can receive ANY GSO packets, we must allocate large ones. */ @@ -1875,17 +1868,13 @@ static void virtnet_remove(struct virtio_device *vdev) unregister_hotcpu_notifier(&vi->nb); - /* Prevent config work handler from accessing the device. */ -...
2015 Feb 28
2
[PATCH] virtio_console: avoid config access from irq
...diff --git a/drivers/char/virtio_console.c b/drivers/char/virtio_console.c index def736d..72d7028 100644 --- a/drivers/char/virtio_console.c +++ b/drivers/char/virtio_console.c @@ -142,6 +142,7 @@ struct ports_device { * notification */ struct work_struct control_work; + struct work_struct config_work; struct list_head ports; @@ -1837,10 +1838,21 @@ static void config_intr(struct virtio_device *vdev) portdev = vdev->priv; + if (!use_multiport(portdev)) + schedule_work(&portdev->config_work); +} + +static void config_work_handler(struct work_struct *work) +{ + struct ports_...
2015 Feb 28
2
[PATCH] virtio_console: avoid config access from irq
...diff --git a/drivers/char/virtio_console.c b/drivers/char/virtio_console.c index def736d..72d7028 100644 --- a/drivers/char/virtio_console.c +++ b/drivers/char/virtio_console.c @@ -142,6 +142,7 @@ struct ports_device { * notification */ struct work_struct control_work; + struct work_struct config_work; struct list_head ports; @@ -1837,10 +1838,21 @@ static void config_intr(struct virtio_device *vdev) portdev = vdev->priv; + if (!use_multiport(portdev)) + schedule_work(&portdev->config_work); +} + +static void config_work_handler(struct work_struct *work) +{ + struct ports_...
2023 May 24
1
[PATCH V3 net-next 1/2] virtio-net: convert rx mode setting to use workqueue
...ons(+), 3 deletions(-) diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c index 56ca1d270304..5d2f1da4eaa0 100644 --- a/drivers/net/virtio_net.c +++ b/drivers/net/virtio_net.c @@ -265,6 +265,12 @@ struct virtnet_info { /* Work struct for config space updates */ struct work_struct config_work; + /* Work struct for config rx mode */ + struct work_struct rx_mode_work; + + /* Is rx mode work enabled? */ + bool rx_mode_work_enabled; + /* Does the affinity hint is set for virtqueues? */ bool affinity_hint_set; @@ -388,6 +394,20 @@ static void disable_delayed_refill(struct virtnet_inf...
2015 Jun 24
2
[RFC] virtio_net: Adding tx_timeout function.
..., 68 insertions(+), 1 deletion(-) diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c index 63c7810..75ac45c 100644 --- a/drivers/net/virtio_net.c +++ b/drivers/net/virtio_net.c @@ -135,6 +135,9 @@ struct virtnet_info { /* Work struct for config space updates */ struct work_struct config_work; + /* Work struct for resetting the virtio-net driver. */ + struct work_struct reset_task; + /* Does the affinity hint is set for virtqueues? */ bool affinity_hint_set; @@ -1394,6 +1397,18 @@ static int virtnet_change_mtu(struct net_device *dev, int new_mtu) return 0; } +static void vi...
2015 Jun 24
2
[RFC] virtio_net: Adding tx_timeout function.
..., 68 insertions(+), 1 deletion(-) diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c index 63c7810..75ac45c 100644 --- a/drivers/net/virtio_net.c +++ b/drivers/net/virtio_net.c @@ -135,6 +135,9 @@ struct virtnet_info { /* Work struct for config space updates */ struct work_struct config_work; + /* Work struct for resetting the virtio-net driver. */ + struct work_struct reset_task; + /* Does the affinity hint is set for virtqueues? */ bool affinity_hint_set; @@ -1394,6 +1397,18 @@ static int virtnet_change_mtu(struct net_device *dev, int new_mtu) return 0; } +static void vi...
2015 Jun 25
3
[RFC] virtio_net: Adding tx_timeout function.
...et.c b/drivers/net/virtio_net.c > > index 63c7810..75ac45c 100644 > > --- a/drivers/net/virtio_net.c > > +++ b/drivers/net/virtio_net.c > > @@ -135,6 +135,9 @@ struct virtnet_info { > > /* Work struct for config space updates */ > > struct work_struct config_work; > > > > + /* Work struct for resetting the virtio-net driver. */ > > + struct work_struct reset_task; > > + > > /* Does the affinity hint is set for virtqueues? */ > > bool affinity_hint_set; > > > > @@ -1394,6 +1397,18 @@ static...
2015 Jun 25
3
[RFC] virtio_net: Adding tx_timeout function.
...et.c b/drivers/net/virtio_net.c > > index 63c7810..75ac45c 100644 > > --- a/drivers/net/virtio_net.c > > +++ b/drivers/net/virtio_net.c > > @@ -135,6 +135,9 @@ struct virtnet_info { > > /* Work struct for config space updates */ > > struct work_struct config_work; > > > > + /* Work struct for resetting the virtio-net driver. */ > > + struct work_struct reset_task; > > + > > /* Does the affinity hint is set for virtqueues? */ > > bool affinity_hint_set; > > > > @@ -1394,6 +1397,18 @@ static...
2014 Oct 05
0
[PATCH 06/16] virtio_blk: drop config_enable
...k(vblk->disk); kobject_uevent_env(&disk_to_dev(vblk->disk)->kobj, KOBJ_CHANGE, envp); -done: + mutex_unlock(&vblk->config_lock); } @@ -609,7 +604,6 @@ static int virtblk_probe(struct virtio_device *vdev) mutex_init(&vblk->config_lock); INIT_WORK(&vblk->config_work, virtblk_config_changed_work); - vblk->config_enable = true; err = init_vq(vblk); if (err) @@ -772,9 +766,7 @@ static void virtblk_remove(struct virtio_device *vdev) int refc; /* Prevent config work handler from accessing the device. */ - mutex_lock(&vblk->config_lock); - vblk...
2014 Oct 06
0
[PATCH v2 05/15] virtio_blk: drop config_enable
...k(vblk->disk); kobject_uevent_env(&disk_to_dev(vblk->disk)->kobj, KOBJ_CHANGE, envp); -done: + mutex_unlock(&vblk->config_lock); } @@ -609,7 +604,6 @@ static int virtblk_probe(struct virtio_device *vdev) mutex_init(&vblk->config_lock); INIT_WORK(&vblk->config_work, virtblk_config_changed_work); - vblk->config_enable = true; err = init_vq(vblk); if (err) @@ -771,10 +765,8 @@ static void virtblk_remove(struct virtio_device *vdev) int index = vblk->index; int refc; - /* Prevent config work handler from accessing the device. */ - mutex_lock(&am...
2023 Apr 17
2
[PATCH net-next V2 1/2] virtio-net: convert rx mode setting to use workqueue
....2e56bbf86894 100644 > > > > --- a/drivers/net/virtio_net.c > > > > +++ b/drivers/net/virtio_net.c > > > > @@ -265,6 +265,12 @@ struct virtnet_info { > > > > /* Work struct for config space updates */ > > > > struct work_struct config_work; > > > > > > > > + /* Work struct for config rx mode */ > > > > + struct work_struct rx_mode_work; > > > > + > > > > + /* Is rx mode work enabled? */ > > > > + bool rx_mode_work_enabled; > > > > + &g...