From: Jerin Jacob <jerinjacobk@gmail.com>
To: Tomasz Duszynski <tduszynski@marvell.com>
Cc: dev@dpdk.org, Jakub Palider <jpalider@marvell.com>,
Anatoly Burakov <anatoly.burakov@intel.com>,
jerinj@marvell.com, thomas@monjalon.net
Subject: Re: [PATCH] raw/cnxk_bphy: support multi-process mode
Date: Wed, 4 Oct 2023 23:17:39 +0530 [thread overview]
Message-ID: <CALBAE1PEm5BKHUaQfy8s9_3ho-nFG6WCaVp0F9c+xzfBPKUcxg@mail.gmail.com> (raw)
In-Reply-To: <20231003204110.3344703-1-tduszynski@marvell.com>
On Wed, Oct 4, 2023 at 5:16 AM Tomasz Duszynski <tduszynski@marvell.com> wrote:
>
> Add support for sharing BPHY PMD across multiple running processes.
> In scenarios where resources need to be shared across processes
> user-space need to ensure serialization.
>
> Signed-off-by: Tomasz Duszynski <tduszynski@marvell.com>
> Reviewed-by: Jerin Jacob Kollanukkaran <jerinj@marvell.com>
> Tested-by: Jerin Jacob Kollanukkaran <jerinj@marvell.com>
Updated the git commit as follows and applied to
dpdk-next-net-mrvl/for-next-net. Thanks
Author: Tomasz Duszynski <tduszynski@marvell.com>
Date: Tue Oct 3 22:41:09 2023 +0200
raw/cnxk_bphy: support multi-process mode
Add support for multi process mode in BPHY PMD.
Signed-off-by: Tomasz Duszynski <tduszynski@marvell.com>
> ---
> doc/guides/rawdevs/cnxk_bphy.rst | 8 ++++++++
> drivers/raw/cnxk_bphy/cnxk_bphy.c | 16 ++++++++++------
> 2 files changed, 18 insertions(+), 6 deletions(-)
>
> diff --git a/doc/guides/rawdevs/cnxk_bphy.rst b/doc/guides/rawdevs/cnxk_bphy.rst
> index 2490912534..b544b543a3 100644
> --- a/doc/guides/rawdevs/cnxk_bphy.rst
> +++ b/doc/guides/rawdevs/cnxk_bphy.rst
> @@ -19,6 +19,14 @@ The BPHY CGX/RPM implements following features in the rawdev API:
> - Access to BPHY CGX/RPM via a set of predefined messages
> - Access to BPHY memory
> - Custom interrupt handlers
> +- Multiprocess aware
> +
> +Limitations
> +-----------
> +
> +In multiprocess mode user-space application must ensure no resources
> +sharing takes place. Otherwise, user-space application should ensure
> +synchronization.
>
> Device Setup
> ------------
> diff --git a/drivers/raw/cnxk_bphy/cnxk_bphy.c b/drivers/raw/cnxk_bphy/cnxk_bphy.c
> index d42cca649c..15dbc4c1a6 100644
> --- a/drivers/raw/cnxk_bphy/cnxk_bphy.c
> +++ b/drivers/raw/cnxk_bphy/cnxk_bphy.c
> @@ -359,10 +359,12 @@ bphy_rawdev_probe(struct rte_pci_driver *pci_drv,
> bphy_dev->mem.res2 = pci_dev->mem_resource[2];
> bphy_dev->bphy.pci_dev = pci_dev;
>
> - ret = roc_bphy_dev_init(&bphy_dev->bphy);
> - if (ret) {
> - rte_rawdev_pmd_release(bphy_rawdev);
> - return ret;
> + if (rte_eal_process_type() == RTE_PROC_PRIMARY) {
> + ret = roc_bphy_dev_init(&bphy_dev->bphy);
> + if (ret) {
> + rte_rawdev_pmd_release(bphy_rawdev);
> + return ret;
> + }
> }
>
> return 0;
> @@ -390,8 +392,10 @@ bphy_rawdev_remove(struct rte_pci_device *pci_dev)
> return -EINVAL;
> }
>
> - bphy_dev = (struct bphy_device *)rawdev->dev_private;
> - roc_bphy_dev_fini(&bphy_dev->bphy);
> + if (rte_eal_process_type() == RTE_PROC_PRIMARY) {
> + bphy_dev = (struct bphy_device *)rawdev->dev_private;
> + roc_bphy_dev_fini(&bphy_dev->bphy);
> + }
>
> return rte_rawdev_pmd_release(rawdev);
> }
> --
> 2.34.1
>
prev parent reply other threads:[~2023-10-04 17:48 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-03 20:41 Tomasz Duszynski
2023-10-04 17:47 ` Jerin Jacob [this message]
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=CALBAE1PEm5BKHUaQfy8s9_3ho-nFG6WCaVp0F9c+xzfBPKUcxg@mail.gmail.com \
--to=jerinjacobk@gmail.com \
--cc=anatoly.burakov@intel.com \
--cc=dev@dpdk.org \
--cc=jerinj@marvell.com \
--cc=jpalider@marvell.com \
--cc=tduszynski@marvell.com \
--cc=thomas@monjalon.net \
/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).