From: Vladimir Medvedkin <vladimir.medvedkin@intel.com>
To: dev@dpdk.org
Cc: rjarry@redhat.com, stable@dpdk.org
Subject: [PATCH 2/2] fib6: fix tbl8 allocation check logic
Date: Tue, 14 Oct 2025 18:17:55 +0000 [thread overview]
Message-ID: <20251014181755.114300-2-vladimir.medvedkin@intel.com> (raw)
In-Reply-To: <20251014181755.114300-1-vladimir.medvedkin@intel.com>
Currently if there were 'n' preallocated tbl8 entries only 'n - 1' were
able to be used. Fix the logic allowing to use all preallocated tbl8
entries.
Fixes: c3e12e0f0354 ("fib: add dataplane algorithm for IPv6")
Cc: stable@dpdk.org
Signed-off-by: Vladimir Medvedkin <vladimir.medvedkin@intel.com>
---
lib/fib/trie.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/lib/fib/trie.c b/lib/fib/trie.c
index 5a9978b4ca..6427920c58 100644
--- a/lib/fib/trie.c
+++ b/lib/fib/trie.c
@@ -576,8 +576,7 @@ trie_modify(struct rte_fib6 *fib, const struct rte_ipv6_addr *ip,
return 0;
}
- if ((depth > 24) && (dp->rsvd_tbl8s >=
- dp->number_tbl8s - depth_diff))
+ if ((depth > 24) && (dp->rsvd_tbl8s + depth_diff > dp->number_tbl8s))
return -ENOSPC;
node = rte_rib6_insert(rib, &ip_masked, depth);
--
2.43.0
prev parent reply other threads:[~2025-10-14 18:18 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-14 18:17 [PATCH 1/2] fib6: fix memory leak on delete operation Vladimir Medvedkin
2025-10-14 18:17 ` Vladimir Medvedkin [this message]
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=20251014181755.114300-2-vladimir.medvedkin@intel.com \
--to=vladimir.medvedkin@intel.com \
--cc=dev@dpdk.org \
--cc=rjarry@redhat.com \
--cc=stable@dpdk.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).