DPDK patches and discussions
 help / color / mirror / Atom feed
From: Michael Baum <michaelba@nvidia.com>
To: Ferruh Yigit <ferruh.yigit@intel.com>, "dev@dpdk.org" <dev@dpdk.org>
Cc: Xiaoyun Li <xiaoyun.li@intel.com>,
	Aman Singh <aman.deep.singh@intel.com>,
	 Yuying Zhang <yuying.zhang@intel.com>,
	Matan Azrad <matan@nvidia.com>
Subject: RE: [PATCH 1/2] app/testpmd: add test for remote PD and CTX
Date: Mon, 7 Mar 2022 16:07:47 +0000	[thread overview]
Message-ID: <DM5PR12MB4661C8AA4BAAC339A9FE3728CC089@DM5PR12MB4661.namprd12.prod.outlook.com> (raw)
In-Reply-To: <6d96be71-a21f-5413-36b8-e9771bf6fe9f@intel.com>


On 3/3/2022 2:57 PM, Ferruh Yigit wrote: 
> On 3/1/2022 8:26 PM, Michael Baum wrote:
> > Add mlx5 internal option in testpmd run-time function "port attach" to
> > add another parameter named "mlx5_socket" for attaching port and add 2
> > devargs before.
> >
> > The arguments are "cmd_fd" and "pd_handle" using to import device
> > created out of PMD. Testpmd application import it using IPC, and
> > updates the devargs list before attaching.
> >
> > The syntax is:
> >
> >    testpmd > port attach (identifier) mlx5_socket=(path)
> >
> > Where "path" is the IPC socket path agreed on the remote process.
> >
> > Signed-off-by: Michael Baum <michaelba@nvidia.com>
> > Acked-by: Matan Azrad <matan@nvidia.com>
> 
> <...>
> 
> > diff --git a/app/test-pmd/meson.build b/app/test-pmd/meson.build index
> > 43130c8856..c4fd379e67 100644
> > --- a/app/test-pmd/meson.build
> > +++ b/app/test-pmd/meson.build
> > @@ -73,3 +73,6 @@ endif
> >   if dpdk_conf.has('RTE_NET_DPAA')
> >       deps += ['bus_dpaa', 'mempool_dpaa', 'net_dpaa']
> >   endif
> > +if dpdk_conf.has('RTE_NET_MLX5')
> > +    deps += 'net_mlx5'
> > +endif
> 
> Is this patch introduce any build time dependency to mlx5 driver? If not this
> chunk should go to next patch, which uses mlx5 PMD specific API.

OK

> 
> <...>
> 
> > diff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst
> > b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
> > index 1083c6d538..d6490947c4 100644
> > --- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst
> > +++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
> > @@ -2127,6 +2127,46 @@ the mode and slave parameters must be given.
> >      Done
> >
> >
> > +port attach with mlx5 socket path
> > +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> > +
> > +MLX5 internal option to attach a port specified by pci address or
> > +virtual device args and add extra devargs to it, which is imported from external process::
> > +
> > +   testpmd> port attach (identifier) mlx5_socket=(path)
> > +
> > +where:
> > +
> > +* ``identifier``: pci address or virtual device args.
> > +* ``path``: socket path to import arguments agreed by the external process.
> > +
> > +The mlx5 PMD enables to import CTX and PD created outside the PMD.
> > +It gets as devargs the device's ``cmd_fd`` and ``pd_handle``, then
> > +using those arguments to import objects.
> > +See :ref:`mlx5 driver options <mlx5_common_driver_options>` for more information.
> > +
> > +When ``cmd_fd`` and ``pd_handle`` arguments are coming from another
> > +process, the FD must be dup'd before being passed.
> > +In this function, testpmd initializes IPC socket to get FD using SCM_RIGHTS.
> > +It gets the external process socket path, then import the ``cmd_fd``
> > +and ``pd_handle`` arguments and add them to devargs list.
> > +After updating this, it calls the regular ``port attach`` function
> > +with extended idevtifier.
> > +
> > +For example, to attach a port whose pci address is ``0000:0a:00.0``
> > +and its socket path is ``/var/run/import_ipc_socket``.
> > +
> > +.. code-block:: console
> > +
> > +   testpmd> port attach 0000:0a:00.0 mlx5_socket=/var/run/import_ipc_socket
> > +   Attaching a new port...
> > +   testpmd: MLX5 socket path is /var/run/import_ipc_socket
> > +   testpmd: Attach port with extra devargs 0000:0a:00.0,cmd_fd=40,pd_handle=1
> > +   EAL: Probe PCI driver: mlx5_pci (15b3:101d) device: 0000:03:00.0 (socket 0)
> > +   Port 0 is attached. Now total ports is 1
> > +   Done
> > +
> 
> 
> Hi Michael,
> 
> This is too much mlx5 specific addition, and I don't think it is good to extend
> testpmd with PMD specific code.
> If we enable it, sure there will be other vendors willing to do the same,
> making testpmd even messier.

Hi Ferruh,

It is mlx5 PMD specific API, which enables to import device from remote process.
This extension is the way to test this API, you can see a lot of PMD specific APIs along testpmd files. 

If one day, other vendors want to import devargs from remote process, they will remove the mlx5 build time dependency and use it.

> 
> I don't know what those ``cmd_fd`` and ``pd_handle`` (that read from
> provided socket), but can they be read from some other script and feed to
> testpmd, like a python wrapper etc...

  reply	other threads:[~2022-03-07 16:07 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-01 20:26 [PATCH 0/2] app/testpmd: external RxQ tests Michael Baum
2022-03-01 20:26 ` [PATCH 1/2] app/testpmd: add test for remote PD and CTX Michael Baum
2022-03-03 12:57   ` Ferruh Yigit
2022-03-07 16:07     ` Michael Baum [this message]
2022-03-08  9:40       ` Thomas Monjalon
2022-03-01 20:26 ` [PATCH 2/2] app/testpmd: add test for external RxQ Michael Baum
2022-03-03 13:02   ` Ferruh Yigit
2022-03-07 15:51     ` Michael Baum
2022-06-16 17:10 ` [PATCH v2 0/2] mlx5/testpmd: external RxQ tests Michael Baum
2022-06-16 17:10   ` [PATCH v2 1/2] app/testpmd: add test for remote PD and CTX Michael Baum
2022-06-16 17:10   ` [PATCH v2 2/2] app/testpmd: add test for external RxQ Michael Baum
2022-06-21  9:27   ` [PATCH v2 0/2] mlx5/testpmd: external RxQ tests Raslan Darawsheh
2022-06-28 14:58   ` [PATCH v3 0/2] net/mlx5: " Michael Baum
2022-06-28 14:58     ` [PATCH v3 1/2] net/mlx5: add test for remote PD and CTX Michael Baum
2022-06-28 14:58     ` [PATCH v3 2/2] net/mlx5: add test for external Rx queue Michael Baum
2022-06-29  9:06     ` [PATCH v3 0/2] net/mlx5: external RxQ tests Raslan Darawsheh

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=DM5PR12MB4661C8AA4BAAC339A9FE3728CC089@DM5PR12MB4661.namprd12.prod.outlook.com \
    --to=michaelba@nvidia.com \
    --cc=aman.deep.singh@intel.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    --cc=matan@nvidia.com \
    --cc=xiaoyun.li@intel.com \
    --cc=yuying.zhang@intel.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).