DPDK patches and discussions
 help / color / mirror / Atom feed
From: Chaoyong He <chaoyong.he@corigine.com>
To: Ferruh Yigit <ferruh.yigit@amd.com>, "dev@dpdk.org" <dev@dpdk.org>
Cc: oss-drivers <oss-drivers@corigine.com>
Subject: RE: [PATCH 0/8] refactor logic to support secondary process
Date: Tue, 21 May 2024 02:17:09 +0000	[thread overview]
Message-ID: <SJ0PR13MB554503BCCB2332FFEDB7A7149EEA2@SJ0PR13MB5545.namprd13.prod.outlook.com> (raw)
In-Reply-To: <4c98caa6-7887-47bc-a41f-7cfb862e391f@amd.com>

> On 4/19/2024 6:23 AM, Chaoyong He wrote:
> > Refactor data structure and related logic to make the secondary
> > process can work as expect.
> >
> 
> Hi Chaoyong,
> 
> Patchset looks good, but I have a question related to the motivation of moving
> so many structs to process private data?
> 
> Normally ethdev is process private, and ethdev->data is shared. Primary
> configures the device and secondary learns shared data and uses it for
> datapath.
> There are cases, like file descriptors for same file can be different for different
> process and process private structure is used.
> 
> In below patches, device private data level structs seems moved to the process
> private structure, is the intention both primary process and secondary process
> do the control path and configuration?
> If so, just a reminder that this is not intended usage of the multi-process
> support and many control APIs are not designed as thread-safe.
> 
> Would you mind describing a little more about your use case that requires
> below process private data changes?

The main motivation of these changes is to solve the problems when customers using the 
secondary process (they use primary process for monitor and secondary process for rx/tx/configuration ...).

The NFP card support different firmware applications, this means we need read message from firmware to 
decide to run which logic.

And with single-pf firmware (this means one PCI BDF address for multi physical ports), we also need 
read message (how many ports totally) from firmware before attach to the primary process.

All this relates with CPP and symbol table, and they are different for primary process and secondary process.
If still put them in the process shared section (ethdev->data), the assignment logic in secondary process will overwrite it 
and cause the primary process crash.

So we move them into the process private section (ethdev->process_private).

> 
> 
> > ---
> > v2:
> > * Solve the build problem.
> > ---
> >
> > Chaoyong He (8):
> >   net/nfp: fix resource leak of secondary process
> >   net/nfp: fix configuration BAR problem
> >   net/nfp: adjust the data field of Rx/Tx queue
> >   net/nfp: add the process private structure
> >   net/nfp: move device info data field
> >   net/nfp: unify CPP acquire method
> >   net/nfp: remove ethernet device data field
> >   net/nfp: unify port create and destroy interface
> >
> >  drivers/net/nfp/flower/nfp_flower.c           | 127 ++++----
> >  drivers/net/nfp/flower/nfp_flower.h           |  11 +-
> >  drivers/net/nfp/flower/nfp_flower_cmsg.c      |   5 +-
> >  drivers/net/nfp/flower/nfp_flower_cmsg.h      |   3 +-
> >  drivers/net/nfp/flower/nfp_flower_ctrl.c      |   8 +-
> >  drivers/net/nfp/flower/nfp_flower_flow.c      |  16 +-
> >  .../net/nfp/flower/nfp_flower_representor.c   | 151 ++++++----
> >  .../net/nfp/flower/nfp_flower_representor.h   |   4 +-
> >  drivers/net/nfp/flower/nfp_flower_service.c   |  32 +-
> >  drivers/net/nfp/flower/nfp_flower_service.h   |  10 +-
> >  drivers/net/nfp/nfd3/nfp_nfd3_dp.c            |   5 +-
> >  drivers/net/nfp/nfdk/nfp_nfdk_dp.c            |   5 +-
> >  drivers/net/nfp/nfp_ethdev.c                  | 274 ++++++++++--------
> >  drivers/net/nfp/nfp_ethdev_vf.c               |  18 +-
> >  drivers/net/nfp/nfp_net_common.c              | 116 ++++----
> >  drivers/net/nfp/nfp_net_common.h              |  30 +-
> >  drivers/net/nfp/nfp_net_flow.c                |  20 +-
> >  drivers/net/nfp/nfp_rxtx.c                    |   9 +-
> >  drivers/net/nfp/nfp_rxtx.h                    |  69 ++---
> >  drivers/net/nfp/nfpcore/nfp6000_pcie.c        |  34 +--
> >  20 files changed, 524 insertions(+), 423 deletions(-)
> >


  reply	other threads:[~2024-05-21  2:17 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-19  3:12 Chaoyong He
2024-04-19  3:12 ` [PATCH 1/8] net/nfp: fix resource leak of " Chaoyong He
2024-04-19  3:12 ` [PATCH 2/8] net/nfp: fix configuration BAR problem Chaoyong He
2024-04-19  3:12 ` [PATCH 3/8] net/nfp: adjust the data field of Rx/Tx queue Chaoyong He
2024-04-19  3:12 ` [PATCH 4/8] net/nfp: add the process private structure Chaoyong He
2024-04-19  3:12 ` [PATCH 5/8] net/nfp: move device info data field Chaoyong He
2024-04-19  3:12 ` [PATCH 6/8] net/nfp: unify CPP acquire method Chaoyong He
2024-04-19  3:12 ` [PATCH 7/8] net/nfp: remove ethernet device data field Chaoyong He
2024-04-19  3:12 ` [PATCH 8/8] net/nfp: unify port create and destroy interface Chaoyong He
2024-04-19  5:23 ` [PATCH 0/8] refactor logic to support secondary process Chaoyong He
2024-04-19  5:23   ` [PATCH v2 1/8] net/nfp: fix resource leak of " Chaoyong He
2024-04-19  5:23   ` [PATCH v2 2/8] net/nfp: fix configuration BAR problem Chaoyong He
2024-04-19  5:23   ` [PATCH v2 3/8] net/nfp: adjust the data field of Rx/Tx queue Chaoyong He
2024-04-19  5:23   ` [PATCH v2 4/8] net/nfp: add the process private structure Chaoyong He
2024-04-19  5:23   ` [PATCH v2 5/8] net/nfp: move device info data field Chaoyong He
2024-04-19  5:23   ` [PATCH v2 6/8] net/nfp: unify CPP acquire method Chaoyong He
2024-04-19  5:23   ` [PATCH v2 7/8] net/nfp: remove ethernet device data field Chaoyong He
2024-04-19  5:23   ` [PATCH v2 8/8] net/nfp: unify port create and destroy interface Chaoyong He
2024-05-20 22:19   ` [PATCH 0/8] refactor logic to support secondary process Ferruh Yigit
2024-05-21  2:17     ` Chaoyong He [this message]
2024-05-21 11:09       ` Ferruh Yigit
2024-05-21 11:24         ` Chaoyong He
2024-05-21 12:54           ` Ferruh Yigit
2024-05-21 15:08   ` Ferruh Yigit

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=SJ0PR13MB554503BCCB2332FFEDB7A7149EEA2@SJ0PR13MB5545.namprd13.prod.outlook.com \
    --to=chaoyong.he@corigine.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@amd.com \
    --cc=oss-drivers@corigine.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).