[dpdk-dev] [PATCH v6 3/5] examples/l3fwd: add FIB infrastructure

Walsh, Conor conor.walsh at intel.com
Tue Apr 6 13:05:17 CEST 2021


<snip>

> > Acked-by: Anatoly Burako <anatoly.burakov at intel.com>
> > ---
> 
> Burakov*

Sorry about that!

> 
> >   			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 :)

I will push a v7 with this change.
Thanks again,
Conor.

> 
> --
> Thanks,
> Anatoly


More information about the dev mailing list