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.wa...@intel.com>
Acked-by: Konstantin Ananyev <konstantin.anan...@intel.com>
Acked-by: Vladimir Medvedkin <vladimir.medved...@intel.com>
Acked-by: Anatoly Burako <anatoly.bura...@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