On Thu, Mar 14, 2019 at 05:36:28AM -0700, Shahaf Shuler wrote: > Hi Koh, > > Thursday, March 7, 2019 9:33 AM, Yongseok Koh: > > Subject: [PATCH 3/4] net/mlx5: rework PMD global data init > > > > There's more need to have PMD global data structure. It should be > > initialized > > once per a process regardless of how many PMD instances are probed. > > mlx5_init_once() is called during probing and make sure all the init > > functions > > are called once per a process. The existing shared memory gets more > > extensively used for this purpose. As there could be multiple secondary > > processes, a static storage (local to process) is also added. > > It is hard to understand from the commit log what was missing on the old > design.
Okay, will add more comments. > > As the reserved virtual address for UAR remap is a PMD global resource, this > > doesn't need to be stored in the device priv structure, but in the PMD > > global > > data. > > I thought we agreed to drop those and have different VA for each process. > If so, is the extra work on the UAR here is needed? My plan was to do that in a separate patch for performance regression. Let me know if you want it to be done in this patchset. > > Signed-off-by: Yongseok Koh <[email protected]> > > --- > > drivers/net/mlx5/mlx5.c | 250 ++++++++++++++++++++++++++++++++-- > > ---------- > > drivers/net/mlx5/mlx5.h | 19 +++- > > drivers/net/mlx5/mlx5_mp.c | 19 +++- > > drivers/net/mlx5/mlx5_txq.c | 7 +- > > 4 files changed, 217 insertions(+), 78 deletions(-) > > > > diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c index > > 6ed2418106..ea8fd55ee6 100644 > > --- a/drivers/net/mlx5/mlx5.c > > +++ b/drivers/net/mlx5/mlx5.c > > @@ -128,16 +128,26 @@ struct mlx5_shared_data *mlx5_shared_data; > > /* Spinlock for mlx5_shared_data allocation. */ static rte_spinlock_t > > mlx5_shared_data_lock = RTE_SPINLOCK_INITIALIZER; > > > > +/* Process local data for secondary processes. */ static struct > > +mlx5_local_data mlx5_local_data; > > Why not storing this context as part of ethdev-> process_private instead of > declaring it static? Because it is not per-device data but per-PMD data. Will also have to rebase my patchsets when I send out v2. Thanks, Yongseok

