mbox series

[0/3] eal: rte_ctrl_thread_create API replacement

Message ID 1670271868-11364-1-git-send-email-roretzla@linux.microsoft.com (mailing list archive)
Headers
Series eal: rte_ctrl_thread_create API replacement |

Message

Tyler Retzlaff Dec. 5, 2022, 8:24 p.m. UTC
  Remove rte_ctrl_thread_create API which exposes pthread_t and provide
new rte_control_thread_create API based on EALs rte_thread_t.

To limit compatibility regression risk and ease of removal of the
existing rte_ctrl_thread_create in the future duplicate most of the
existing implementation. The duplication will be removed when
rte_ctrl_thread_create is finally duplicated/removed.

The unit test for rte_ctrl_thread_create has been duplicated to exercise
both the old and the new API during transition, as with the API the
duplicate test will be removed when the rte_ctrl_thread_create API is
removed.

Tyler Retzlaff (3):
  eal: add rte control thread create API
  test: add rte control thread create API test
  eal: deprecate pthread control thread create API

 app/test/test_lcores.c               | 44 +++++++++++++++++
 doc/guides/rel_notes/deprecation.rst |  4 ++
 lib/eal/common/eal_common_thread.c   | 93 ++++++++++++++++++++++++++++++++----
 lib/eal/include/rte_thread.h         | 29 +++++++++++
 lib/eal/version.map                  |  3 ++
 5 files changed, 165 insertions(+), 8 deletions(-)
  

Comments

Morten Brørup Dec. 5, 2022, 8:34 p.m. UTC | #1
> From: Tyler Retzlaff [mailto:roretzla@linux.microsoft.com]
> Sent: Monday, 5 December 2022 21.24
> 
> Remove rte_ctrl_thread_create API which exposes pthread_t and provide
> new rte_control_thread_create API based on EALs rte_thread_t.
> 
> To limit compatibility regression risk and ease of removal of the
> existing rte_ctrl_thread_create in the future duplicate most of the
> existing implementation. The duplication will be removed when
> rte_ctrl_thread_create is finally duplicated/removed.
> 
> The unit test for rte_ctrl_thread_create has been duplicated to
> exercise
> both the old and the new API during transition, as with the API the
> duplicate test will be removed when the rte_ctrl_thread_create API is
> removed.
> 
> Tyler Retzlaff (3):
>   eal: add rte control thread create API
>   test: add rte control thread create API test
>   eal: deprecate pthread control thread create API
> 
>  app/test/test_lcores.c               | 44 +++++++++++++++++
>  doc/guides/rel_notes/deprecation.rst |  4 ++
>  lib/eal/common/eal_common_thread.c   | 93
> ++++++++++++++++++++++++++++++++----
>  lib/eal/include/rte_thread.h         | 29 +++++++++++
>  lib/eal/version.map                  |  3 ++
>  5 files changed, 165 insertions(+), 8 deletions(-)
> 
> --
> 1.8.3.1
> 

Series-Acked-by: Morten Brørup <mb@smartsharesystems.com>
  
Tyler Retzlaff Jan. 31, 2023, 8:30 p.m. UTC | #2
Announce deprecation of rte_ctrl_thread_create API which is the final
remaining stable API exposing pthread_t.

Provide an equivalent replacement API rte_control_thread_create that
uses the new rte_thread_t type.

Provide a unit test for the new rte_control_thread_create API.

Add missing doxygen index for thread / rte_thread.h.

Notice!

To limit compatibility regression risk and ease removal of the
existing rte_ctrl_thread_create in the future duplicate most of the
existing implementation rather than try to have it accommodate both
public API contracts.

The duplication, the union introduced to support it along with remaining
internal pthread_xxx calls will be removed when rte_ctrl_thread_create is
finally removed.

The old unit test for rte_ctrl_thread_create is kept in place to guarantee
correct behavior while deprecated and will be removed when
rte_ctrl_thread_create is finally removed.

Series-acked-by: Morten Brørup <mb@smartsharesystems.com>
Reviewed-by: Mattias Rönnblom <mattias.ronnblom@ericsson.com>

v5:
  * rebase series now that rte_thread_set_name has been merged,
    remove now unnecessary casts.
  * combine patch adding rte_control_thread_create and patch
    adding unit test into patch 1.
  * reword deprecation notice to indicate which release we
    intend to mark rte_ctrl_thread_create deprecated and which
    release we intend to remove the same.
  * adjust deprecation notice commit subject based on previous
    deprecation notice series feedback.
  * add (mostly unrelated) patch to series to add thread / rte_thread.h
    to doxygen index (an oversight missed from previous series).

v4:
  * fix missing whitespace in deprecation notice text
  * remove comment in rte_control_thread_create implementation
    referring to sched_yield as requested by community feedback
  * add missing parameter name to function pointer declaration

v3:
  * use {ctrl,control}_start_routine for start_routine field names
  * fix conditional evaluation style p == NULL instead of !p
  * tweak documentation comment for rte_control_thread_create
    - "the EAL threads are then excluded"
    - note RTE_MAX_THREAD_NAME_LEN preprocessor definition
      is the name size (including terminating NUL) limit
  * add missing cast to uintptr_t

v2:
  * correct style error void * (*foo) -> void *(*foo)
  * place retval on lhs of comparison 0 != foo() -> foo() != 0
  * add missing commit description on patch 3/3
  * add cast uintptr_t to pthread_t where appropriate
  * fix doxygen @param names to match parameter names

Tyler Retzlaff (3):
  eal: add rte control thread create API
  doc: add missing index entry for thread
  doc: announce deprecation of thread ctrl create function

 app/test/test_lcores.c               | 41 +++++++++++++++++
 doc/api/doxy-api-index.md            |  1 +
 doc/guides/rel_notes/deprecation.rst |  5 +++
 lib/eal/common/eal_common_thread.c   | 85 ++++++++++++++++++++++++++++++++----
 lib/eal/include/rte_thread.h         | 33 ++++++++++++++
 lib/eal/version.map                  |  1 +
 6 files changed, 158 insertions(+), 8 deletions(-)
  
Tyler Retzlaff Jan. 31, 2023, 8:33 p.m. UTC | #3
top-post

this is a re-submission of v5 of the series due to a mistake i made
in the first submission that caused it not to be correctly submitted
to patchwork.

apologies for the noise.
    
On Tue, Jan 31, 2023 at 12:30:14PM -0800, Tyler Retzlaff wrote:
> Announce deprecation of rte_ctrl_thread_create API which is the final
> remaining stable API exposing pthread_t.
> 
> Provide an equivalent replacement API rte_control_thread_create that
> uses the new rte_thread_t type.
> 
> Provide a unit test for the new rte_control_thread_create API.
> 
> Add missing doxygen index for thread / rte_thread.h.
> 
> Notice!
> 
> To limit compatibility regression risk and ease removal of the
> existing rte_ctrl_thread_create in the future duplicate most of the
> existing implementation rather than try to have it accommodate both
> public API contracts.
> 
> The duplication, the union introduced to support it along with remaining
> internal pthread_xxx calls will be removed when rte_ctrl_thread_create is
> finally removed.
> 
> The old unit test for rte_ctrl_thread_create is kept in place to guarantee
> correct behavior while deprecated and will be removed when
> rte_ctrl_thread_create is finally removed.
> 
> Series-acked-by: Morten Brørup <mb@smartsharesystems.com>
> Reviewed-by: Mattias Rönnblom <mattias.ronnblom@ericsson.com>
> 
> v5:
>   * rebase series now that rte_thread_set_name has been merged,
>     remove now unnecessary casts.
>   * combine patch adding rte_control_thread_create and patch
>     adding unit test into patch 1.
>   * reword deprecation notice to indicate which release we
>     intend to mark rte_ctrl_thread_create deprecated and which
>     release we intend to remove the same.
>   * adjust deprecation notice commit subject based on previous
>     deprecation notice series feedback.
>   * add (mostly unrelated) patch to series to add thread / rte_thread.h
>     to doxygen index (an oversight missed from previous series).
> 
> v4:
>   * fix missing whitespace in deprecation notice text
>   * remove comment in rte_control_thread_create implementation
>     referring to sched_yield as requested by community feedback
>   * add missing parameter name to function pointer declaration
> 
> v3:
>   * use {ctrl,control}_start_routine for start_routine field names
>   * fix conditional evaluation style p == NULL instead of !p
>   * tweak documentation comment for rte_control_thread_create
>     - "the EAL threads are then excluded"
>     - note RTE_MAX_THREAD_NAME_LEN preprocessor definition
>       is the name size (including terminating NUL) limit
>   * add missing cast to uintptr_t
> 
> v2:
>   * correct style error void * (*foo) -> void *(*foo)
>   * place retval on lhs of comparison 0 != foo() -> foo() != 0
>   * add missing commit description on patch 3/3
>   * add cast uintptr_t to pthread_t where appropriate
>   * fix doxygen @param names to match parameter names
> 
> Tyler Retzlaff (3):
>   eal: add rte control thread create API
>   doc: add missing index entry for thread
>   doc: announce deprecation of thread ctrl create function
> 
>  app/test/test_lcores.c               | 41 +++++++++++++++++
>  doc/api/doxy-api-index.md            |  1 +
>  doc/guides/rel_notes/deprecation.rst |  5 +++
>  lib/eal/common/eal_common_thread.c   | 85 ++++++++++++++++++++++++++++++++----
>  lib/eal/include/rte_thread.h         | 33 ++++++++++++++
>  lib/eal/version.map                  |  1 +
>  6 files changed, 158 insertions(+), 8 deletions(-)
> 
> -- 
> 1.8.3.1