[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220104174732.276286f0@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com>
Date: Tue, 4 Jan 2022 17:47:32 -0800
From: Jakub Kicinski <kuba@...nel.org>
To: Dimitris Michailidis <d.michailidis@...gible.com>
Cc: davem@...emloft.net, netdev@...r.kernel.org, andrew@...n.ch
Subject: Re: [PATCH net-next v4 2/8] net/fungible: Add service module for
Fungible drivers
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.
> +}
> +
> +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?
> + free_irq(vector, funq->irq_data);
> + funq->irq_handler = NULL;
> + funq->irq_data = NULL;
> + }
> +}
Powered by blists - more mailing lists