[dpdk-dev] [PATCH v6 3/5] examples/l3fwd: add FIB infrastructure
Burakov, Anatoly
anatoly.burakov at intel.com
Fri Apr 2 18:34:20 CEST 2021
On 02-Apr-21 11:52 AM, Conor Walsh wrote:
> The purpose of this commit is to add the necessary function calls
> and supporting infrastructure to allow the Forwarding Information Base
> (FIB) library to be integrated into the l3fwd sample app.
> Instead of adding an individual flag for FIB, a new flag '--lookup' has
> been added that allows the user to select their desired lookup method.
> The flags '-E' and '-L' have been retained for backwards compatibility.
>
> Signed-off-by: Conor Walsh <conor.walsh at intel.com>
> Acked-by: Konstantin Ananyev <konstantin.ananyev at intel.com>
> Acked-by: Vladimir Medvedkin <vladimir.medvedkin at intel.com>
> Acked-by: Anatoly Burako <anatoly.burakov at intel.com>
> ---
Burakov*
> break;
>
> case 'L':
> - l3fwd_lpm_on = 1;
> + if (lookup_mode != L3FWD_LOOKUP_DEFAULT) {
> + fprintf(stderr, "Only one lookup mode is allowed at a time!\n");
> + return -1;
> + }
> + lookup_mode = L3FWD_LOOKUP_LPM;
> break;
>
> /* long options */
> @@ -680,18 +726,24 @@ parse_args(int argc, char **argv)
> eth_rx_q = 1;
> break;
>
> + case CMD_LINE_OPT_LOOKUP_NUM:
> + if (lookup_mode != L3FWD_LOOKUP_DEFAULT) {
> + fprintf(stderr, "Only one lookup mode is allowed at a time!\n");
> + return -1;
> + }
> + ret = parse_lookup(optarg);
> + if (ret) {
> + fprintf(stderr, "Invalid lookup option! Accepted options: em, lpm, fib\n");
Nitpicking, but i would have preferred having this log in the
parse_lookup(), because if we add one more lookup method, you'd only
have to modify one function (together with the log message), rather than
two. However, this works too :)
--
Thanks,
Anatoly
More information about the dev
mailing list