From: Simon Horman <horms@kernel.org>
To: Shinas Rasheed <srasheed@marvell.com>
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
hgani@marvell.com, vimleshk@marvell.com, egallen@redhat.com,
mschmidt@redhat.com, pabeni@redhat.com, kuba@kernel.org,
davem@davemloft.net, wizhao@redhat.com, kheib@redhat.com,
konguyen@redhat.com, Veerasenareddy Burru <vburru@marvell.com>,
Sathesh Edara <sedara@marvell.com>,
Eric Dumazet <edumazet@google.com>
Subject: Re: [PATCH net-next v2 1/4] octeon_ep: add PF-VF mailbox communication
Date: Sun, 10 Dec 2023 11:37:32 +0000 [thread overview]
Message-ID: <20231210113732.GF5817@kernel.org> (raw)
In-Reply-To: <20231209081450.2613561-2-srasheed@marvell.com>
On Sat, Dec 09, 2023 at 12:14:47AM -0800, Shinas Rasheed wrote:
> Implement mailbox communication between PF and VFs.
> PF-VF mailbox is used for all control commands from VF to PF and
> asynchronous notification messages from PF to VF.
>
> Signed-off-by: Shinas Rasheed <srasheed@marvell.com>
...
> diff --git a/drivers/net/ethernet/marvell/octeon_ep/octep_main.c b/drivers/net/ethernet/marvell/octeon_ep/octep_main.c
...
> @@ -1315,6 +1335,7 @@ static void octep_device_cleanup(struct octep_device *oct)
> oct->mbox[i] = NULL;
> }
>
> + octep_delete_pfvf_mbox(oct);
> octep_ctrl_net_uninit(oct);
> cancel_delayed_work_sync(&oct->hb_task);
>
> @@ -1411,6 +1432,13 @@ static int octep_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
> goto err_octep_config;
> }
>
> + err = octep_setup_pfvf_mbox(octep_dev);
> + if (err) {
> + dev_err(&pdev->dev, " pfvf mailbox setup failed\n");
> + octep_ctrl_net_uninit(octep_dev);
> + return err;
Hi Shinas,
This seems inconsistent with other error handling in this function, I
suspect it is leaking resources. And even if it does not, it's likely to
lead to such problems as this function is updated in future. Please
consider consistently handling error unwinding using goto labels in this
function.
I think that means either making sure that octep_delete_pfvf_mbox() can
handle the case whereby octep_setup_pfvf_mbox() fails. Or including) the
steps taken by octep_device_cleanup() in the unwind ladder provided by goto
labels (which could be a separate patch, and I suspect to be the best
approach). But I could well be wrong.
> + }
> +
> octep_ctrl_net_get_info(octep_dev, OCTEP_CTRL_NET_INVALID_VFID,
> &octep_dev->conf->fw_info);
> dev_info(&octep_dev->pdev->dev, "Heartbeat interval %u msecs Heartbeat miss count %u\n",
...
next prev parent reply other threads:[~2023-12-10 11:37 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-09 8:14 [PATCH net-next v2 0/4] add PF-VF mailbox support Shinas Rasheed
2023-12-09 8:14 ` [PATCH net-next v2 1/4] octeon_ep: add PF-VF mailbox communication Shinas Rasheed
2023-12-10 11:37 ` Simon Horman [this message]
2023-12-11 6:32 ` [EXT] " Shinas Rasheed
2023-12-09 8:14 ` [PATCH net-next v2 2/4] octeon_ep: PF-VF mailbox version support Shinas Rasheed
2023-12-09 8:14 ` [PATCH net-next v2 3/4] octeon_ep: control net framework to support VF offloads Shinas Rasheed
2023-12-09 8:14 ` [PATCH net-next v2 4/4] octeon_ep: support firmware notifications for VFs Shinas Rasheed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20231210113732.GF5817@kernel.org \
--to=horms@kernel.org \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=egallen@redhat.com \
--cc=hgani@marvell.com \
--cc=kheib@redhat.com \
--cc=konguyen@redhat.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mschmidt@redhat.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=sedara@marvell.com \
--cc=srasheed@marvell.com \
--cc=vburru@marvell.com \
--cc=vimleshk@marvell.com \
--cc=wizhao@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).