DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Medvedkin, Vladimir" <vladimir.medvedkin@intel.com>
To: Stephen Hemminger <stephen@networkplumber.org>
Cc: <dev@dpdk.org>, <rjarry@redhat.com>, <ruifeng.wang@arm.com>,
	<honnappa.nagarahalli@arm.com>, <david.marchand@redhat.com>
Subject: Re: [PATCH v2 1/2] fib: implement RCU rule reclamation
Date: Thu, 10 Oct 2024 12:21:05 +0100	[thread overview]
Message-ID: <86a9b3b8-bf6c-4518-960b-bbbabd53ab16@intel.com> (raw)
In-Reply-To: <20241008112802.48bdd858@hermes.local>

Hi Stephen,

Thanks for the review, I'll address your comments in v3


On 08/10/2024 19:28, Stephen Hemminger wrote:
> On Tue,  8 Oct 2024 17:55:23 +0000
> Vladimir Medvedkin <vladimir.medvedkin@intel.com> wrote:
>> +	if ((tbl8_idx == -ENOSPC) && dp->dq != NULL) {
> Better to either drop the parenthesis here, or put it on both conditions.
>
>> +		/* If there are no tbl8 groups try to reclaim one. */
>> +		if (rte_rcu_qsbr_dq_reclaim(dp->dq, 1,
>> +				NULL, NULL, NULL) == 0)
>> +			tbl8_idx = tbl8_get_idx(dp);
>> +	}
> Could add unlikely() to this expression.
>
> 	/* If there are no tbl8 groups try to reclaim one. */
> 	if (unlikely(tbl8_idx == -ENOSPC && dp->dq &&
> 		     !rte_rcu_qsbr_dq_reclaim(dp->dq, 1, NULL, NULL, NULL)))
> 	    tbl8_idx = tbl8_get_idx(dp);
>
>
>> +static void
>> +__rcu_qsbr_free_resource(void *p, void *data, unsigned int n)
>> +{
>> +	struct dir24_8_tbl *dp = p;
>> +	uint64_t tbl8_idx = *(uint64_t *)data;
>> +	RTE_SET_USED(n);
>> +
>> +	tbl8_cleanup_and_free(dp, tbl8_idx);
>> +}
> My preference (not a requirement) is to use __rte_unused attribute
> instead of RTE_SET_USED
>
>> +	if (dp->v == NULL)
>> +		tbl8_cleanup_and_free(dp, tbl8_idx);
>> +	else if (dp->rcu_mode == RTE_FIB_QSBR_MODE_SYNC) {
>> +		rte_rcu_qsbr_synchronize(dp->v,
>> +			RTE_QSBR_THRID_INVALID);
>> +		tbl8_cleanup_and_free(dp, tbl8_idx);
>> +	} else { /* RTE_FIB_QSBR_MODE_DQ */
>> +		if (rte_rcu_qsbr_dq_enqueue(dp->dq,
>> +				(void *)&tbl8_idx))
> Minor nit: cast to void * is not necessary in C (only in C++).
> And can fit on one line; max line length now for DPDK is 100 characters.
>
> Overall, looks good.
>
> Acked-by: Stephen Hemminger <stephen@networkplumber.org>

-- 
Regards,
Vladimir


  reply	other threads:[~2024-10-10 11:21 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-06 17:09 [PATCH] " Vladimir Medvedkin
2024-09-27 22:12 ` Robin Jarry
2024-09-27 23:52   ` David Marchand
2024-10-04 12:03     ` Vladimir Medvedkin
2024-10-08 17:55 ` [PATCH v2 1/2] " Vladimir Medvedkin
2024-10-08 17:55   ` [PATCH v2 2/2] test/fib: add RCU functional tests Vladimir Medvedkin
2024-10-08 18:18   ` [PATCH v2 1/2] fib: implement RCU rule reclamation Stephen Hemminger
2024-10-09 19:12     ` Doug Foster
2024-10-08 18:28   ` Stephen Hemminger
2024-10-10 11:21     ` Medvedkin, Vladimir [this message]
2024-10-10 11:27   ` [PATCH v3 " Vladimir Medvedkin
2024-10-10 11:27     ` [PATCH v3 2/2] test/fib: add RCU functional tests Vladimir Medvedkin
2024-10-11  9:10     ` [PATCH v3 1/2] fib: implement RCU rule reclamation David Marchand
2024-10-14 16:58     ` David Marchand
2024-10-14 17:10     ` David Marchand

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=86a9b3b8-bf6c-4518-960b-bbbabd53ab16@intel.com \
    --to=vladimir.medvedkin@intel.com \
    --cc=david.marchand@redhat.com \
    --cc=dev@dpdk.org \
    --cc=honnappa.nagarahalli@arm.com \
    --cc=rjarry@redhat.com \
    --cc=ruifeng.wang@arm.com \
    --cc=stephen@networkplumber.org \
    /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).