From: "Walsh, Conor" <conor.walsh@intel.com>
To: "Medvedkin, Vladimir" <vladimir.medvedkin@intel.com>,
"dev@dpdk.org" <dev@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH 1/2] doc: add programmer's guide for the RIB library
Date: Tue, 9 Nov 2021 11:32:42 +0000 [thread overview]
Message-ID: <PH0PR11MB52079E11FF8AB712C25234A1FF929@PH0PR11MB5207.namprd11.prod.outlook.com> (raw)
In-Reply-To: <20211108173727.133124-1-vladimir.medvedkin@intel.com>
> From: dev <dev-bounces@dpdk.org> On Behalf Of Vladimir Medvedkin
> Sent: Monday 8 November 2021 17:37
> To: dev@dpdk.org
> Subject: [dpdk-dev] [PATCH 1/2] doc: add programmer's guide for the RIB
> library
>
> Currently, programmer's guide for the RIB library is missing.
> This commit adds it.
>
> Signed-off-by: Vladimir Medvedkin <vladimir.medvedkin@intel.com>
> ---
> doc/guides/prog_guide/img/rib_internals.svg | 148 +++++++++++++++++
> doc/guides/prog_guide/img/rib_pic.svg | 152 +++++++++++++++++
> doc/guides/prog_guide/index.rst | 1 +
> doc/guides/prog_guide/rib_lib.rst | 172 ++++++++++++++++++++
> 4 files changed, 473 insertions(+)
> create mode 100644 doc/guides/prog_guide/img/rib_internals.svg
> create mode 100644 doc/guides/prog_guide/img/rib_pic.svg
> create mode 100644 doc/guides/prog_guide/rib_lib.rst
>
<snip>
> + RIB prefix independent convergence
> +
> +In case of a next hop failure, we need to replace an active failed next hop
> with a
> +feasible next hop for every corresponding route without waiting for the
> routing daemon
> +recalculation process to complete.
> +To achieve this we can link all existing routes with the same active next hop
> in a linked list,
> +saving the feasible next hop ID and a pointer inside the extension space of
> each ``rte_rib_node``.
> +
> +.. code-block:: c
> +
> + struct my_route_ext {
> + struct rte_rib_node *next;
> + uint64_t feasible_nh;
> + };
> +
> + struct rte_rib_conf conf;
> + conf.ext_sz = sizeof(struct my_route_ext);
> + rib = rte_rib_create("test", 0, &conf);
> + ...
> + /* routing daemon task */
> + struct rte_rib_node *route = rte_rib_insert(rib, RTE_IPV4(192,0,2,0), 24);
> + rte_rib_set_nh(route, active_nh_from_rd);
> + struct my_route_ext *ext = rte_rib_get_ext(route);
> + ext->feasible_nh = feasible_nh_from_rd;
> + list_insert(nh_table[active_nh_from_rd].list_head, route);
> + ...
> + /* dataplane monitoring thread */
> + /* nexthop id fail_nh fails */
^^^^^^^
> + route = NULL;
> + do {
> + route = get_next(nh_table[fail_nh].list_head, route);
> + uint32_t ip;
> + uint8_t depth;
> + rte_rib_get_ip(route, &ip);
> + rte_rib_get_depth(route, &depth);
> + ext = rte_rib_get_ext(route);
> + uint64_t new_nh = ext->feasible_nh;
> + /* do update to the dataplane, for example to the fib */
> + rte_fib_add(fib, ip, depth, new_nh);
> + /* update nexthop if necessary */
^^^^^^^
These two comments are showing as spelling errors on aspell but I think they are ok as this is technically a code comment
and nexthop often appears in the code without a space.
> + rte_rib_set_nh(route, new_nh);
> + } while (route != NULL);
> +
> --
> 2.25.1
Reviewed-by: Conor Walsh <conor.walsh@intel.com>
prev parent reply other threads:[~2021-11-09 11:32 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-08 17:37 Vladimir Medvedkin
2021-11-08 17:37 ` [dpdk-dev] [PATCH 2/2] doc: add programmer's guide for the FIB library Vladimir Medvedkin
2021-11-09 11:32 ` Walsh, Conor
2021-11-26 14:26 ` David Marchand
2021-11-09 11:32 ` Walsh, Conor [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=PH0PR11MB52079E11FF8AB712C25234A1FF929@PH0PR11MB5207.namprd11.prod.outlook.com \
--to=conor.walsh@intel.com \
--cc=dev@dpdk.org \
--cc=vladimir.medvedkin@intel.com \
/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).