From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id CDC0DA0548; Fri, 2 Apr 2021 18:34:27 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 884CC141111; Fri, 2 Apr 2021 18:34:27 +0200 (CEST) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by mails.dpdk.org (Postfix) with ESMTP id C182A14110C for ; Fri, 2 Apr 2021 18:34:26 +0200 (CEST) IronPort-SDR: fk6DgDamATOMDKG3xnh963kkZiVE2gosbS9vrGWX4PUzOwVcfLCYnD/EzkWECeAAxYrIGz5/qT ugngcwVJ49PQ== X-IronPort-AV: E=McAfee;i="6000,8403,9942"; a="180027118" X-IronPort-AV: E=Sophos;i="5.81,300,1610438400"; d="scan'208";a="180027118" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Apr 2021 09:34:25 -0700 IronPort-SDR: LASgvp9zVdcC85B35x04DGLLv3UeTCqn6LZvuZBdNZT3Au27C/Qc58DkIGr0VLjtAxac8CY7Wl 5HzHwBt7SRcw== X-IronPort-AV: E=Sophos;i="5.81,300,1610438400"; d="scan'208";a="419724453" Received: from aburakov-mobl.ger.corp.intel.com (HELO [10.213.214.195]) ([10.213.214.195]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Apr 2021 09:34:23 -0700 To: Conor Walsh , jerinj@marvell.com, stephen@networkplumber.org, bernard.iremonger@intel.com, konstantin.ananyev@intel.com, vladimir.medvedkin@intel.com Cc: dev@dpdk.org References: <20210315113439.1045223-1-conor.walsh@intel.com> <20210402105252.1145821-1-conor.walsh@intel.com> <20210402105252.1145821-4-conor.walsh@intel.com> From: "Burakov, Anatoly" Message-ID: <466e2090-1d96-5da7-2c93-9809bbddbb0f@intel.com> Date: Fri, 2 Apr 2021 17:34:20 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.9.0 MIME-Version: 1.0 In-Reply-To: <20210402105252.1145821-4-conor.walsh@intel.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH v6 3/5] examples/l3fwd: add FIB infrastructure X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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 > Acked-by: Konstantin Ananyev > Acked-by: Vladimir Medvedkin > Acked-by: Anatoly Burako > --- 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