* [dpdk-dev] [PATCH] lpm: do not return defer queue handle to the user
@ 2020-07-11 7:41 Ruifeng Wang
2020-07-11 13:37 ` David Marchand
0 siblings, 1 reply; 2+ messages in thread
From: Ruifeng Wang @ 2020-07-11 7:41 UTC (permalink / raw)
To: Bruce Richardson, Vladimir Medvedkin
Cc: dev, david.marchand, nd, honnappa.nagarahalli, Ruifeng Wang
There is no need to return defer queue handle in rte_lpm_rcu_qsbr_add API,
since enough flexibility has been provided to configure the defer queue.
Signed-off-by: Ruifeng Wang <ruifeng.wang@arm.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
---
This is a followup patch of LPM RCU reclamation series [1].
[1] http://patches.dpdk.org/cover/73673/
app/test/test_lpm.c | 10 +++++-----
app/test/test_lpm_perf.c | 4 ++--
lib/librte_lpm/rte_lpm.c | 5 +----
lib/librte_lpm/rte_lpm.h | 5 +----
4 files changed, 9 insertions(+), 15 deletions(-)
diff --git a/app/test/test_lpm.c b/app/test/test_lpm.c
index 8330501f0..258b2f67c 100644
--- a/app/test/test_lpm.c
+++ b/app/test/test_lpm.c
@@ -1308,12 +1308,12 @@ test19(void)
rcu_cfg.v = qsv;
/* Invalid QSBR mode */
rcu_cfg.mode = 2;
- status = rte_lpm_rcu_qsbr_add(lpm, &rcu_cfg, NULL);
+ status = rte_lpm_rcu_qsbr_add(lpm, &rcu_cfg);
TEST_LPM_ASSERT(status != 0);
rcu_cfg.mode = RTE_LPM_QSBR_MODE_DQ;
/* Attach RCU QSBR to LPM table */
- status = rte_lpm_rcu_qsbr_add(lpm, &rcu_cfg, NULL);
+ status = rte_lpm_rcu_qsbr_add(lpm, &rcu_cfg);
TEST_LPM_ASSERT(status == 0);
/* Create and attach another RCU QSBR to LPM table */
@@ -1323,7 +1323,7 @@ test19(void)
rcu_cfg.v = qsv2;
rcu_cfg.mode = RTE_LPM_QSBR_MODE_SYNC;
- status = rte_lpm_rcu_qsbr_add(lpm, &rcu_cfg, NULL);
+ status = rte_lpm_rcu_qsbr_add(lpm, &rcu_cfg);
TEST_LPM_ASSERT(status != 0);
rte_lpm_free(lpm);
@@ -1379,7 +1379,7 @@ test20(void)
rcu_cfg.v = qsv;
rcu_cfg.mode = RTE_LPM_QSBR_MODE_DQ;
/* Attach RCU QSBR to LPM table */
- status = rte_lpm_rcu_qsbr_add(lpm, &rcu_cfg, NULL);
+ status = rte_lpm_rcu_qsbr_add(lpm, &rcu_cfg);
TEST_LPM_ASSERT(status == 0);
ip = RTE_IPV4(192, 0, 2, 100);
@@ -1510,7 +1510,7 @@ test21(void)
rcu_cfg.v = g_v;
rcu_cfg.mode = RTE_LPM_QSBR_MODE_SYNC;
/* Attach RCU QSBR to LPM table */
- status = rte_lpm_rcu_qsbr_add(g_lpm, &rcu_cfg, NULL);
+ status = rte_lpm_rcu_qsbr_add(g_lpm, &rcu_cfg);
TEST_LPM_ASSERT(status == 0);
writer_done = 0;
diff --git a/app/test/test_lpm_perf.c b/app/test/test_lpm_perf.c
index dfe186426..58076795e 100644
--- a/app/test/test_lpm_perf.c
+++ b/app/test/test_lpm_perf.c
@@ -521,7 +521,7 @@ test_lpm_rcu_perf_multi_writer(void)
rcu_cfg.v = rv;
/* Assign the RCU variable to LPM */
- if (rte_lpm_rcu_qsbr_add(lpm, &rcu_cfg, NULL) != 0) {
+ if (rte_lpm_rcu_qsbr_add(lpm, &rcu_cfg) != 0) {
printf("RCU variable assignment failed\n");
goto error;
}
@@ -674,7 +674,7 @@ test_lpm_rcu_perf(void)
rcu_cfg.v = rv;
/* Assign the RCU variable to LPM */
- if (rte_lpm_rcu_qsbr_add(lpm, &rcu_cfg, NULL) != 0) {
+ if (rte_lpm_rcu_qsbr_add(lpm, &rcu_cfg) != 0) {
printf("RCU variable assignment failed\n");
goto error;
}
diff --git a/lib/librte_lpm/rte_lpm.c b/lib/librte_lpm/rte_lpm.c
index 126fc5a82..2db9e16a2 100644
--- a/lib/librte_lpm/rte_lpm.c
+++ b/lib/librte_lpm/rte_lpm.c
@@ -288,8 +288,7 @@ __lpm_rcu_qsbr_free_resource(void *p, void *data, unsigned int n)
/* Associate QSBR variable with an LPM object.
*/
int
-rte_lpm_rcu_qsbr_add(struct rte_lpm *lpm, struct rte_lpm_rcu_config *cfg,
- struct rte_rcu_qsbr_dq **dq)
+rte_lpm_rcu_qsbr_add(struct rte_lpm *lpm, struct rte_lpm_rcu_config *cfg)
{
struct rte_rcu_qsbr_dq_parameters params = {0};
char rcu_dq_name[RTE_RCU_QSBR_DQ_NAMESIZE];
@@ -329,8 +328,6 @@ rte_lpm_rcu_qsbr_add(struct rte_lpm *lpm, struct rte_lpm_rcu_config *cfg,
RTE_LOG(ERR, LPM, "LPM defer queue creation failed\n");
return 1;
}
- if (dq != NULL)
- *dq = internal_lpm->dq;
} else {
rte_errno = EINVAL;
return 1;
diff --git a/lib/librte_lpm/rte_lpm.h b/lib/librte_lpm/rte_lpm.h
index a9568fcdd..03da2d37e 100644
--- a/lib/librte_lpm/rte_lpm.h
+++ b/lib/librte_lpm/rte_lpm.h
@@ -218,8 +218,6 @@ rte_lpm_free(struct rte_lpm *lpm);
* the lpm object to add RCU QSBR
* @param cfg
* RCU QSBR configuration
- * @param dq
- * handler of created RCU QSBR defer queue
* @return
* On success - 0
* On error - 1 with error code set in rte_errno.
@@ -229,8 +227,7 @@ rte_lpm_free(struct rte_lpm *lpm);
* - ENOMEM - memory allocation failure
*/
__rte_experimental
-int rte_lpm_rcu_qsbr_add(struct rte_lpm *lpm, struct rte_lpm_rcu_config *cfg,
- struct rte_rcu_qsbr_dq **dq);
+int rte_lpm_rcu_qsbr_add(struct rte_lpm *lpm, struct rte_lpm_rcu_config *cfg);
/**
* Add a rule to the LPM table.
--
2.17.1
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [dpdk-dev] [PATCH] lpm: do not return defer queue handle to the user
2020-07-11 7:41 [dpdk-dev] [PATCH] lpm: do not return defer queue handle to the user Ruifeng Wang
@ 2020-07-11 13:37 ` David Marchand
0 siblings, 0 replies; 2+ messages in thread
From: David Marchand @ 2020-07-11 13:37 UTC (permalink / raw)
To: Ruifeng Wang
Cc: Bruce Richardson, Vladimir Medvedkin, dev, nd, Honnappa Nagarahalli
On Sat, Jul 11, 2020 at 9:42 AM Ruifeng Wang <ruifeng.wang@arm.com> wrote:
>
> There is no need to return defer queue handle in rte_lpm_rcu_qsbr_add API,
> since enough flexibility has been provided to configure the defer queue.
>
> Signed-off-by: Ruifeng Wang <ruifeng.wang@arm.com>
> Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
> ---
> This is a followup patch of LPM RCU reclamation series [1].
> [1] http://patches.dpdk.org/cover/73673/
Applied, thanks Ruifeng.
--
David Marchand
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-07-11 13:37 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-11 7:41 [dpdk-dev] [PATCH] lpm: do not return defer queue handle to the user Ruifeng Wang
2020-07-11 13:37 ` David Marchand
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).