[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.DEB.2.10.1710251618520.574@sstabellini-ThinkPad-X260>
Date: Wed, 25 Oct 2017 16:22:41 -0700 (PDT)
From: Stefano Stabellini <sstabellini@...nel.org>
To: Boris Ostrovsky <boris.ostrovsky@...cle.com>
cc: Stefano Stabellini <sstabellini@...nel.org>,
xen-devel@...ts.xen.org, linux-kernel@...r.kernel.org,
jgross@...e.com, Stefano Stabellini <stefano@...reto.com>
Subject: Re: [PATCH v6 02/13] xen/pvcalls: implement frontend disconnect
On Wed, 25 Oct 2017, Boris Ostrovsky wrote:
> On 10/24/2017 01:33 PM, Stefano Stabellini wrote:
> > +static void pvcalls_front_free_map(struct pvcalls_bedata *bedata,
> > + struct sock_mapping *map, bool locked)
> > +{
> > +}
> > +
> > static const struct xenbus_device_id pvcalls_front_ids[] = {
> > { "pvcalls" },
> > { "" }
> > @@ -27,6 +66,32 @@
> >
> > static int pvcalls_front_remove(struct xenbus_device *dev)
> > {
> > + struct pvcalls_bedata *bedata;
> > + struct sock_mapping *map = NULL, *n;
>
> Your last comment made me look again at sock_mapping definition. And
> then I noticed that it is not defined until patch 4 ;-(
I moved the definition of struct sock_mapping to this patch. Then, I
tested the build patch by patch. I also had to move a few #includes from
patch #5 to #4, but everything builds fine now.
> > +
> > + bedata = dev_get_drvdata(&pvcalls_front_dev->dev);
> > + dev_set_drvdata(&dev->dev, NULL);
> > + pvcalls_front_dev = NULL;
> > + if (bedata->irq >= 0)
> > + unbind_from_irqhandler(bedata->irq, dev);
> > +
> > + smp_mb();
> > + while (atomic_read(&pvcalls_refcount) > 0)
> > + cpu_relax();
> > + list_for_each_entry_safe(map, n, &bedata->socket_mappings, list) {
> > + if (map->active_socket) {
> > + /* No need to lock, refcount is 0 */
> > + pvcalls_front_free_map(bedata, map, true);
> > + } else {
> > + list_del(&map->list);
> > + kfree(map);
> > + }
> > + }
> > + if (bedata->ref >= 0)
> > + gnttab_end_foreign_access(bedata->ref, 0, 0);
> > + kfree(bedata->ring.sring);
> > + kfree(bedata);
> > + xenbus_switch_state(dev, XenbusStateClosed);
> > return 0;
> > }
> >
>
Powered by blists - more mailing lists