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 19890A04A9; Tue, 8 Feb 2022 04:04:25 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id CB6504014E; Tue, 8 Feb 2022 04:04:24 +0100 (CET) Received: from mail-pf1-f178.google.com (mail-pf1-f178.google.com [209.85.210.178]) by mails.dpdk.org (Postfix) with ESMTP id 7F32240141 for ; Tue, 8 Feb 2022 04:04:23 +0100 (CET) Received: by mail-pf1-f178.google.com with SMTP id d187so16437863pfa.10 for ; Mon, 07 Feb 2022 19:04:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20210112.gappssmtp.com; s=20210112; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=rVLjwzR2cVJaog+NfSEsomX5YYKp6yFQIAGZ0Dluk+8=; b=QOac9qtY5SCTIRx7OZr+QRLvRvXjmPQ/OIq0FdQMV4h6kpJCFj7WalRh2UNrq/IuVf SQS3ikLYieSo33pCzvodlWi111qtlan1vs6lTawrHBXCyUOL3AIbtr0ALSvBafRrmHij EnWO6DJF3aHr/wvQBpsrgWkKazPt6r3Adm2paOJ9GRi2eaKVZoooFbMJmVM/Pwhav96a lBdv98hUOEFomiZLrgdVdOL8vizVEvuyssDB0TdvCTaCz7Jqmz8XAf7LgQkGN9rp9BF6 kaxonydrjKXHhnSPIz6ac2jtuiaKz3UZnu7zwrgirIPERa2BZtYaZbPlUH0gfTpv8KNh 9BJQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=rVLjwzR2cVJaog+NfSEsomX5YYKp6yFQIAGZ0Dluk+8=; b=HtpCCX8qf5btR1r6h0YsutCioMuRJEcoqa20GPku6mzpx+lbmjPSy76ZlSOOjvwOrr h3IHJs6Jg1vjB8eCXVI6tspUoa2U6HU0SbrNXKuF5ihD8JPoqu4/13HDbQfa8AulYQVp QMeXNdiFFEJXmY8iG0Y8eDNt8ELMb+GIpKfmGzFdbXkMEqXSB+wj46GBs9vAI5dc1J6f ryKPMOtWS2Jxc7Um6BaZgBT6RpqmBxRWlDUt2tuxRmQuMeaALKhr899T+UlLEOE+Pdo0 rXzOhmYSTr2sVas7YVMAFqj8iuhZJS2LzHLcNjML5iSv/+Qlri5NiJvy9jK5mreitnXw N3gQ== X-Gm-Message-State: AOAM53341SwWhTrWVVP6Z5aqTQk/8rTOGrxtMOvYsMH0gYZQtDIgz0dK Zefc5NyT00rDgz2+DcOI72USVA== X-Google-Smtp-Source: ABdhPJxO1hmtQHbSuNE7VgwdRjraMgnBKzsLAAtbFtBfUgO1jjY+AJiEL0agZI5g+9j90n7TRjsysQ== X-Received: by 2002:a05:6a00:10c1:: with SMTP id d1mr2368286pfu.79.1644289462368; Mon, 07 Feb 2022 19:04:22 -0800 (PST) Received: from hermes.local (204-195-112-199.wavecable.com. [204.195.112.199]) by smtp.gmail.com with ESMTPSA id ip4sm715343pjb.8.2022.02.07.19.04.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Feb 2022 19:04:21 -0800 (PST) Date: Mon, 7 Feb 2022 19:04:19 -0800 From: Stephen Hemminger To: "Ananyev, Konstantin" Cc: "Morrissey, Sean" , "dev@dpdk.org" Subject: Re: [PATCH v5 0/2] Add config file support for l3fwd Message-ID: <20220207190419.2a1ca44b@hermes.local> In-Reply-To: References: <20220126124459.2469838-1-sean.morrissey@intel.com> <20220204195905.449192-1-sean.morrissey@intel.com> <20220204142636.6250f05c@hermes.local> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit 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 On Sun, 6 Feb 2022 15:16:22 +0000 "Ananyev, Konstantin" wrote: > > > This patchset introduces config file support for l3fwd > > > and its lookup methods LPM, FIB, and EM, similar to > > > that of l3fwd-acl. This allows for route rules to be > > > defined in configuration files and edited there instead > > > of in each of the lookup methods hardcoded route tables. > > > > > > V4: > > > * Fix nondeterministic bug of segfault on termination of > > > sample app. > > > V5: > > > * Reintroduce hardcoded tables as to not break dts and > > > allow for hardcoded tables to be used if no config > > > files presented. > > > > > > Sean Morrissey (2): > > > examples/l3fwd: add config file support for LPM/FIB > > > examples/l3fwd: add config file support for EM > > > > > > doc/guides/sample_app_ug/l3_forward.rst | 89 +++-- > > > examples/l3fwd/em_default_v4.cfg | 17 + > > > examples/l3fwd/em_default_v6.cfg | 17 + > > > examples/l3fwd/l3fwd.h | 41 +++ > > > examples/l3fwd/l3fwd_em.c | 471 +++++++++++++++++------- > > > examples/l3fwd/l3fwd_fib.c | 50 +-- > > > examples/l3fwd/l3fwd_lpm.c | 315 +++++++++++++++- > > > examples/l3fwd/l3fwd_route.h | 41 +++ > > > examples/l3fwd/lpm_default_v4.cfg | 17 + > > > examples/l3fwd/lpm_default_v6.cfg | 17 + > > > examples/l3fwd/main.c | 68 +++- > > > 11 files changed, 949 insertions(+), 194 deletions(-) > > > create mode 100644 examples/l3fwd/em_default_v4.cfg > > > create mode 100644 examples/l3fwd/em_default_v6.cfg > > > create mode 100644 examples/l3fwd/lpm_default_v4.cfg > > > create mode 100644 examples/l3fwd/lpm_default_v6.cfg > > > > > > > Why not use the DPDK cfgfile library and format? > > It is model after standard INI format. > > It is probably some sort of misunderstanding: > This patch doesn't add configuration file for some l3fwd run-time parameters > (number of ports/queues, queue/cpu mappings, etc.). > It allows user to specify he's own routing table instead of hard-coded ones. > For routing table .ini file format is not really suitable. > Instead we follow format similar to what is used in other DPDK apps > (l3fwd-acl, ipsec-secgw, test-acl, test-fib, test-sad, etc.) for these purposes: > list of route entries, each entry occupies exactly one line. > As an example: > /examples/l3fwd/lpm_default_v4.cfg > #Copy of hard-coded IPv4 FWD table for L3FWD LPM > R198.18.0.0/24 0 > R198.18.1.0/24 1 > R198.18.2.0/24 2 > R198.18.3.0/24 3 > .... > I suppose it is self-explanatory, intuitive and close enough > to what user used for with unix-like route config tools. > Konstantin I was think either, use existing cfgfile and a a section of LPM so that it could be an example and also have some generic code for handling prefix entries. Or have a generic library for reading LPM entries. L3fwd is supposed to be as small as possible (it no longer is), and the real work should be done by libraries to make it easier to build other applications.