[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAOkoqZmbuiHYfkzgqFzc1asdk4s1stoLT2zHQ6PCn_8GK_qb5g@mail.gmail.com>
Date: Tue, 4 Jan 2022 20:28:26 -0800
From: Dimitris Michailidis <d.michailidis@...gible.com>
To: Jakub Kicinski <kuba@...nel.org>
Cc: davem@...emloft.net, netdev@...r.kernel.org,
Andrew Lunn <andrew@...n.ch>
Subject: Re: [PATCH net-next v4 2/8] net/fungible: Add service module for
Fungible drivers
On Tue, Jan 4, 2022 at 5:47 PM Jakub Kicinski <kuba@...nel.org> wrote:
>
> On Mon, 3 Jan 2022 22:46:51 -0800 Dimitris Michailidis wrote:
> > Fungible cards have a number of different PCI functions and thus
> > different drivers, all of which use a common method to initialize and
> > interact with the device. This commit adds a library module that
> > collects these common mechanisms. They mainly deal with device
> > initialization, setting up and destroying queues, and operating an admin
> > queue. A subset of the FW interface is also included here.
> >
> > Signed-off-by: Dimitris Michailidis <dmichail@...gible.com>
>
> > +/* Destroy a funq's component queues on the device. */
> > +int fun_destroy_queue(struct fun_queue *funq)
> > +{
> > + struct fun_dev *fdev = funq->fdev;
> > + int rc1, rc2 = 0, rc3;
> > +
> > + rc1 = fun_destroy_sq(fdev, funq->sqid);
> > + if (funq->rq_depth)
> > + rc2 = fun_destroy_sq(fdev, funq->rqid);
> > + rc3 = fun_destroy_cq(fdev, funq->cqid);
> > +
> > + fun_free_irq(funq);
> > +
> > + if (rc1)
> > + return rc1;
> > + return rc2 ? rc2 : rc3;
>
> What's the caller going to do with that error code?
> Destroy functions are best kept void.
>
> Actually I don't see any callers of this function at all.
> Please make sure to remove all dead code.
Removed.
> > +}
> > +
> > +void fun_free_irq(struct fun_queue *funq)
> > +{
> > + if (funq->irq_handler) {
> > + unsigned int vector = funq_irq(funq);
> > +
> > + synchronize_irq(vector);
>
> free_irq() will synchronize, why is this needed?
Removed.
> > + free_irq(vector, funq->irq_data);
> > + funq->irq_handler = NULL;
> > + funq->irq_data = NULL;
> > + }
> > +}
Powered by blists - more mailing lists