DPDK patches and discussions
 help / color / mirror / Atom feed
From: Ankur Dwivedi <adwivedi@marvell.com>
To: Jerin Jacob <jerinjacobk@gmail.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>,
	Jerin Jacob Kollanukkaran <jerinj@marvell.com>,
	Nithin Kumar Dabilpuram <ndabilpuram@marvell.com>,
	Kiran Kumar Kokkilagadda <kirankumark@marvell.com>,
	Sunil Kumar Kori <skori@marvell.com>,
	Satha Koteswara Rao Kottidi <skoteshwar@marvell.com>,
	Thomas Monjalon <thomas@monjalon.net>
Subject: RE: [EXT] Re: [PATCH v2 1/2] common/cnxk: add support to get aged flows
Date: Thu, 28 Sep 2023 13:49:34 +0000	[thread overview]
Message-ID: <PH0PR18MB5003F577BF0768285363D58FDDC1A@PH0PR18MB5003.namprd18.prod.outlook.com> (raw)
In-Reply-To: <CALBAE1P3xy9X7n29Hri4Ptkc7MGeG41aAc=0boiqTk=96G8dtQ@mail.gmail.com>



>
>
>Ankur, following changes in upstream changed the thread APIs. I have
>adapted to this change in [1]. Please review ASAP - It is blocking rc1 PR.

I have reviewed the changes. The changes are fine.

Thanks.
>
>commit 1c1abf1786a6de044bd396da4cc316961e3fd812
>Author: Thomas Monjalon <thomas@monjalon.net>
>Date:   Wed Sep 13 13:28:19 2023 +0200
>
>    lib: convert to internal control threads
>
>    Calls to rte_ctrl_thread_create() are replaced with
>    rte_thread_create_internal_control().
>    Other pthread-related functions are replaced with the rte_thread API.
>    Only pthread_cancel() has no replacement.
>
>    Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
>    Acked-by: Morten Brørup <mb@smartsharesystems.com>
>    Acked-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
>    Acked-by: Konstantin Ananyev <konstantin.v.ananyev@yandex.ru
>
>
>[1]
>
>diff --git a/drivers/common/cnxk/roc_npc.c
>b/drivers/common/cnxk/roc_npc.c index 83c04880f2..94c8e94400 100644
>--- a/drivers/common/cnxk/roc_npc.c
>+++ b/drivers/common/cnxk/roc_npc.c
>@@ -1623,7 +1623,8 @@ roc_npc_flow_destroy(struct roc_npc *roc_npc,
>struct roc_npc_flow *flow)
>  npc_delete_prio_list_entry(npc, flow);
>
>  npc_age_flow_list_entry_delete(roc_npc, flow);
>- if (roc_npc->flow_age.age_flow_refcnt == 0 &&
>roc_npc->flow_age.aged_flows_poll_thread)
>+ if (roc_npc->flow_age.age_flow_refcnt == 0 &&
>+ plt_thread_is_valid(roc_npc->flow_age.aged_flows_poll_thread))
>  npc_aging_ctrl_thread_destroy(roc_npc);
>
> done:
>diff --git a/drivers/common/cnxk/roc_npc.h
>b/drivers/common/cnxk/roc_npc.h index ad1c3b08cc..5a7117eae4 100644
>--- a/drivers/common/cnxk/roc_npc.h
>+++ b/drivers/common/cnxk/roc_npc.h
>@@ -359,7 +359,7 @@ struct roc_npc_flow_age {
>  uint32_t aged_flows_cnt;
>  uint32_t start_id;
>  uint32_t end_id;
>- pthread_t aged_flows_poll_thread;
>+ rte_thread_t aged_flows_poll_thread;
>  struct plt_bitmap *aged_flows;
>  void *age_mem;
>  bool aged_flows_get_thread_exit;
>diff --git a/drivers/common/cnxk/roc_npc_aging.c
>b/drivers/common/cnxk/roc_npc_aging.c
>index 4b845954b4..74543f227b 100644
>--- a/drivers/common/cnxk/roc_npc_aging.c
>+++ b/drivers/common/cnxk/roc_npc_aging.c
>@@ -134,7 +134,7 @@ npc_mcam_get_hit_status(struct npc *npc, uint64_t
>*mcam_ids, uint16_t start_id,
>  return rc;
> }
>
>-void *
>+uint32_t
> npc_aged_flows_get(void *args)
> {
>  uint64_t hit_status[MCAM_ARR_SIZE] = {0}; @@ -182,7 +182,7 @@
>npc_aged_flows_get(void *args)
>  rc = npc_mcam_get_hit_status(npc, mcam_ids, start_id, end_id,
>       hit_status, true);
>  if (rc)
>- return NULL;
>+ return 0;
>
>  plt_seqcount_write_begin(&flow_age->seq_cnt);
>  flow_age->aged_flows_cnt = 0;
>@@ -201,7 +201,7 @@ npc_aged_flows_get(void *args)
>  sleep(flow_age->aging_poll_freq);
>  }
>
>- return NULL;
>+ return 0;
> }
>
> void
>@@ -276,8 +276,8 @@ npc_aging_ctrl_thread_create(struct roc_npc
>*roc_npc,
>
>  if (flow_age->age_flow_refcnt == 0) {
>  flow_age->aged_flows_get_thread_exit = false;
>- if (plt_ctrl_thread_create(&flow_age->aged_flows_poll_thread,
>-    "Aged Flows Get Ctrl Thread", NULL,
>+ if (plt_thread_create_control(&flow_age->aged_flows_poll_thread,
>+    "Aged Flows Get Ctrl Thread",
>     npc_aged_flows_get, roc_npc) != 0) {
>  plt_err("Failed to create thread for age flows");
>  errcode = NPC_ERR_ACTION_NOTSUP;
>@@ -295,7 +295,7 @@ npc_aging_ctrl_thread_destroy(struct roc_npc
>*roc_npc)
>
>  flow_age = &roc_npc->flow_age;
>  flow_age->aged_flows_get_thread_exit = true;
>- pthread_join(flow_age->aged_flows_poll_thread, NULL);
>+ plt_thread_join(flow_age->aged_flows_poll_thread, NULL);
>  npc_aged_flows_bitmap_free(roc_npc);
> }
>
>diff --git a/drivers/common/cnxk/roc_npc_priv.h
>b/drivers/common/cnxk/roc_npc_priv.h
>index 6d6cb64c65..424f8e207a 100644
>--- a/drivers/common/cnxk/roc_npc_priv.h
>+++ b/drivers/common/cnxk/roc_npc_priv.h
>@@ -490,7 +490,7 @@ int npc_mcam_init(struct npc *npc, struct
>roc_npc_flow *flow, int mcam_id);  int npc_mcam_move(struct mbox *mbox,
>uint16_t old_ent, uint16_t new_ent);  void
>npc_age_flow_list_entry_add(struct roc_npc *npc, struct roc_npc_flow
>*flow);  void npc_age_flow_list_entry_delete(struct roc_npc *npc, struct
>roc_npc_flow *flow); -void *npc_aged_flows_get(void *args);
>+uint32_t npc_aged_flows_get(void *args);
> int npc_aged_flows_bitmap_alloc(struct roc_npc *roc_npc);  void
>npc_aged_flows_bitmap_free(struct roc_npc *roc_npc);  int
>npc_aging_ctrl_thread_create(struct roc_npc *roc_npc, diff --git
>a/drivers/common/cnxk/roc_platform.h
>b/drivers/common/cnxk/roc_platform.h
>index ad0d1624a3..1e535a527d 100644
>--- a/drivers/common/cnxk/roc_platform.h
>+++ b/drivers/common/cnxk/roc_platform.h
>@@ -145,6 +145,12 @@
> #define plt_thread_create_control    rte_thread_create_internal_control
> #define plt_thread_join              rte_thread_join
>
>+static inline bool
>+plt_thread_is_valid(rte_thread_t thr)
>+{
>+ return thr.opaque_id ? true : false;
>+}
>+
> #define plt_intr_efd_counter_size_get rte_intr_efd_counter_size_get  #define
>plt_intr_efd_counter_size_set rte_intr_efd_counter_size_set  #define
>plt_intr_vec_list_index_get rte_intr_vec_list_index_get

  reply	other threads:[~2023-09-28 13:49 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-27 11:59 [PATCH v1 0/2] add support for flow aging in CNXK driver Ankur Dwivedi
2023-07-27 11:59 ` [PATCH v1 1/2] common/cnxk: add support to get aged flows Ankur Dwivedi
2023-07-27 11:59 ` [PATCH v1 2/2] net/cnxk: add get flow aged ops Ankur Dwivedi
2023-08-08  8:49 ` [PATCH v2 0/2] add support for flow aging in CNXK driver Ankur Dwivedi
2023-08-08  8:49   ` [PATCH v2 1/2] common/cnxk: add support to get aged flows Ankur Dwivedi
2023-08-14  6:56     ` Jerin Jacob
2023-09-28  8:13       ` Jerin Jacob
2023-09-28 13:49         ` Ankur Dwivedi [this message]
2023-08-08  8:49   ` [PATCH v2 2/2] net/cnxk: add get flow aged ops Ankur Dwivedi

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=PH0PR18MB5003F577BF0768285363D58FDDC1A@PH0PR18MB5003.namprd18.prod.outlook.com \
    --to=adwivedi@marvell.com \
    --cc=dev@dpdk.org \
    --cc=jerinj@marvell.com \
    --cc=jerinjacobk@gmail.com \
    --cc=kirankumark@marvell.com \
    --cc=ndabilpuram@marvell.com \
    --cc=skori@marvell.com \
    --cc=skoteshwar@marvell.com \
    --cc=thomas@monjalon.net \
    /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).