Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1680725
| From | Juergen Gross <jgross@suse.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH v6 14/18] xen/pvcalls: disconnect and module_exit |
| Date | 2017-07-04 09:40 +0200 |
| Message-ID | <tZqBc-5fa-15@gated-at.bofh.it> (permalink) |
| References | <tZgLv-75o-7@gated-at.bofh.it> <tZgLv-75o-9@gated-at.bofh.it> <tZgVc-7a5-23@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On 03/07/17 23:08, Stefano Stabellini wrote:
> Implement backend_disconnect. Call pvcalls_back_release_active on active
> sockets and pvcalls_back_release_passive on passive sockets.
>
> Implement module_exit by calling backend_disconnect on frontend
> connections.
>
> Signed-off-by: Stefano Stabellini <stefano@aporeto.com>
> CC: boris.ostrovsky@oracle.com
> CC: jgross@suse.com
> ---
> drivers/xen/pvcalls-back.c | 52 ++++++++++++++++++++++++++++++++++++++++++++++
> 1 file changed, 52 insertions(+)
>
> diff --git a/drivers/xen/pvcalls-back.c b/drivers/xen/pvcalls-back.c
> index 9f4247f..71a42fc 100644
> --- a/drivers/xen/pvcalls-back.c
> +++ b/drivers/xen/pvcalls-back.c
> @@ -807,6 +807,42 @@ static int backend_connect(struct xenbus_device *dev)
>
> static int backend_disconnect(struct xenbus_device *dev)
> {
> + struct pvcalls_fedata *fedata;
> + struct sock_mapping *map, *n;
> + struct sockpass_mapping *mappass;
> + struct radix_tree_iter iter;
> + void **slot;
> +
> +
> + fedata = dev_get_drvdata(&dev->dev);
> +
> + down(&fedata->socket_lock);
> + list_for_each_entry_safe(map, n, &fedata->socket_mappings, list) {
> + list_del(&map->list);
> + pvcalls_back_release_active(dev, fedata, map);
> + }
> +
> + radix_tree_for_each_slot(slot, &fedata->socketpass_mappings, &iter, 0) {
> + mappass = radix_tree_deref_slot(slot);
> + if (!mappass)
> + continue;
> + if (radix_tree_exception(mappass)) {
> + if (radix_tree_deref_retry(mappass))
> + slot = radix_tree_iter_retry(&iter);
> + } else {
> + radix_tree_delete(&fedata->socketpass_mappings, mappass->id);
> + pvcalls_back_release_passive(dev, fedata, mappass);
> + }
> + }
> + up(&fedata->socket_lock);
> +
> + xenbus_unmap_ring_vfree(dev, fedata->sring);
> + unbind_from_irqhandler(fedata->irq, dev);
Swap above two lines to avoid irq being handled after releasing
ring?
Juergen
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH v6 00/18] introduce the Xen PV Calls backend Stefano Stabellini <stefano@aporeto.com> - 2017-07-03 23:10 +0200
[PATCH v6 02/18] xen/pvcalls: introduce the pvcalls xenbus backend Stefano Stabellini <sstabellini@kernel.org> - 2017-07-03 23:10 +0200
[PATCH v6 16/18] xen/pvcalls: implement read Stefano Stabellini <sstabellini@kernel.org> - 2017-07-03 23:10 +0200
Re: [PATCH v6 16/18] xen/pvcalls: implement read Juergen Gross <jgross@suse.com> - 2017-07-04 09:40 +0200
[PATCH v6 08/18] xen/pvcalls: implement connect command Stefano Stabellini <sstabellini@kernel.org> - 2017-07-03 23:10 +0200
Re: [PATCH v6 08/18] xen/pvcalls: implement connect command Juergen Gross <jgross@suse.com> - 2017-07-04 09:20 +0200
Re: [PATCH v6 08/18] xen/pvcalls: implement connect command Stefano Stabellini <sstabellini@kernel.org> - 2017-07-05 23:20 +0200
[PATCH v6 07/18] xen/pvcalls: implement socket command Stefano Stabellini <sstabellini@kernel.org> - 2017-07-03 23:10 +0200
[PATCH v6 05/18] xen/pvcalls: connect to a frontend Stefano Stabellini <sstabellini@kernel.org> - 2017-07-03 23:10 +0200
Re: [PATCH v6 05/18] xen/pvcalls: connect to a frontend Juergen Gross <jgross@suse.com> - 2017-07-04 09:00 +0200
Re: [PATCH v6 05/18] xen/pvcalls: connect to a frontend Stefano Stabellini <sstabellini@kernel.org> - 2017-07-05 22:40 +0200
[PATCH v6 13/18] xen/pvcalls: implement release command Stefano Stabellini <sstabellini@kernel.org> - 2017-07-03 23:10 +0200
Re: [PATCH v6 13/18] xen/pvcalls: implement release command Juergen Gross <jgross@suse.com> - 2017-07-04 09:40 +0200
[PATCH v6 06/18] xen/pvcalls: handle commands from the frontend Stefano Stabellini <sstabellini@kernel.org> - 2017-07-03 23:20 +0200
Re: [PATCH v6 06/18] xen/pvcalls: handle commands from the frontend Juergen Gross <jgross@suse.com> - 2017-07-04 09:00 +0200
Re: [PATCH v6 06/18] xen/pvcalls: handle commands from the frontend Stefano Stabellini <sstabellini@kernel.org> - 2017-07-05 22:50 +0200
[PATCH v6 01/18] xen: introduce the pvcalls interface header Stefano Stabellini <sstabellini@kernel.org> - 2017-07-03 23:20 +0200
[PATCH v6 11/18] xen/pvcalls: implement accept command Stefano Stabellini <sstabellini@kernel.org> - 2017-07-03 23:20 +0200
Re: [PATCH v6 11/18] xen/pvcalls: implement accept command Juergen Gross <jgross@suse.com> - 2017-07-04 09:30 +0200
[PATCH v6 09/18] xen/pvcalls: implement bind command Stefano Stabellini <sstabellini@kernel.org> - 2017-07-03 23:20 +0200
Re: [PATCH v6 09/18] xen/pvcalls: implement bind command Juergen Gross <jgross@suse.com> - 2017-07-04 09:30 +0200
Re: [PATCH v6 09/18] xen/pvcalls: implement bind command Stefano Stabellini <sstabellini@kernel.org> - 2017-07-05 23:20 +0200
[PATCH v6 14/18] xen/pvcalls: disconnect and module_exit Stefano Stabellini <sstabellini@kernel.org> - 2017-07-03 23:20 +0200
Re: [PATCH v6 14/18] xen/pvcalls: disconnect and module_exit Juergen Gross <jgross@suse.com> - 2017-07-04 09:40 +0200
Re: [PATCH v6 14/18] xen/pvcalls: disconnect and module_exit Stefano Stabellini <sstabellini@kernel.org> - 2017-07-05 23:30 +0200
[PATCH v6 03/18] xen/pvcalls: initialize the module and register the xenbus backend Stefano Stabellini <sstabellini@kernel.org> - 2017-07-03 23:20 +0200
[PATCH v6 12/18] xen/pvcalls: implement poll command Stefano Stabellini <sstabellini@kernel.org> - 2017-07-03 23:20 +0200
Re: [PATCH v6 12/18] xen/pvcalls: implement poll command Juergen Gross <jgross@suse.com> - 2017-07-04 09:30 +0200
[PATCH v6 10/18] xen/pvcalls: implement listen command Stefano Stabellini <sstabellini@kernel.org> - 2017-07-03 23:20 +0200
[PATCH v6 04/18] xen/pvcalls: xenbus state handling Stefano Stabellini <sstabellini@kernel.org> - 2017-07-03 23:20 +0200
Re: [PATCH v6 04/18] xen/pvcalls: xenbus state handling Juergen Gross <jgross@suse.com> - 2017-07-04 10:10 +0200
Re: [PATCH v6 04/18] xen/pvcalls: xenbus state handling Stefano Stabellini <sstabellini@kernel.org> - 2017-07-05 22:30 +0200
[PATCH v6 15/18] xen/pvcalls: implement the ioworker functions Stefano Stabellini <sstabellini@kernel.org> - 2017-07-03 23:20 +0200
Re: [PATCH v6 15/18] xen/pvcalls: implement the ioworker functions Juergen Gross <jgross@suse.com> - 2017-07-04 09:50 +0200
Re: [PATCH v6 15/18] xen/pvcalls: implement the ioworker functions Stefano Stabellini <sstabellini@kernel.org> - 2017-07-05 23:30 +0200
csiph-web