26/06/2020 16:43, David Marchand: > On Wed, Jun 24, 2020 at 1:59 PM Ananyev, Konstantin > <konstantin.anan...@intel.com> wrote: > > > > Do you mean - make this new dynamic-lcore API return an error if callied > > > > from secondary process? > > > > > > Yes, and prohibiting from attaching a secondary process if dynamic > > > lcore API has been used in primary. > > > I intend to squash in patch 6: > > > https://github.com/david-marchand/dpdk/commit/e5861ee734bfe2e4dc23d9b919b0db2a32a58aee > > > > But secondary process can attach before lcore_register, so we'll have some > > sort of inconsistency in behaviour. > > If the developer tries to use both features, he gets an ERROR log in > the two init path. > So whatever the order at runtime, we inform the developer (who did not > read/understand the rte_thread_register() documentation) that what he > is doing is unsupported.
I agree. Before this patch, pinning a thread on a random core can trigger some issues. After this patch, register an external thread will take care of logging errors in case of inconsistencies. So the user will know he is doing something not supported by the app. It is an nice improvement. > > If we really want to go ahead with such workaround - It is not a workaround. It is fixing some old issues and making clear what is really impossible. > > probably better to introduce explicit EAL flag ( --single-process or so). > > As Thomas and Bruce suggested, if I understood them properly. No I was thinking to maintain the tri-state information: - secondary is possible - secondary is attached - secondary is forbidden Asking the user to use an option to forbid attaching a secondary process is the same as telling him it is forbidden. The error log is enough in my opinion. > A EAL flag is a stable API from the start, as there is nothing > describing how we can remove one. > So a new EAL flag for an experimental API/feature seems contradictory. > > Going with a new features status API... I think it is beyond this series. > > Thomas seems to suggest an automatic resolution when features conflict > happens.. ? I suggest allowing the maximum and raise an error when usage conflicts. It seems this is what you did in v4. > I'll send the v4, let's discuss it there if you want.