The check for NULL is not necessary before calling rte_rcu_qsbr_dq_delete. 
Similar to other free routines, an error will not occur when the dq pointer is 
NULL.
However, it will give a debug log statement to indicate an invalid parameter 
and return 0 to indicate success.

-----Original Message-----
From: Stephen Hemminger <step...@networkplumber.org>
Sent: Tuesday, October 8, 2024 1:18 PM
To: Vladimir Medvedkin <vladimir.medved...@intel.com>
Cc: dev@dpdk.org; rja...@redhat.com; Ruifeng Wang <ruifeng.w...@arm.com>; 
Honnappa Nagarahalli <honnappa.nagaraha...@arm.com>; david.march...@redhat.com
Subject: Re: [PATCH v2 1/2] fib: implement RCU rule reclamation

On Tue,  8 Oct 2024 17:55:23 +0000
Vladimir Medvedkin <vladimir.medved...@intel.com> wrote:

> @@ -569,7 +600,60 @@ dir24_8_free(void *p)  {
>       struct dir24_8_tbl *dp = (struct dir24_8_tbl *)p;
>
> +     if (dp->dq != NULL)
> +             rte_rcu_qsbr_dq_delete(dp->dq);
> +

Side note:
rte_rcu_qsbr_dq_delete should be changed to accept NULL as nop.
Like all the other free routines
IMPORTANT NOTICE: The contents of this email and any attachments are 
confidential and may also be privileged. If you are not the intended recipient, 
please notify the sender immediately and do not disclose the contents to any 
other person, use it for any purpose, or store or copy the information in any 
medium. Thank you.

Reply via email to