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 BDB4D42A16 for ; Fri, 28 Apr 2023 20:09:40 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 35F2640A87; Fri, 28 Apr 2023 20:09:40 +0200 (CEST) Received: from mail-pf1-f173.google.com (mail-pf1-f173.google.com [209.85.210.173]) by mails.dpdk.org (Postfix) with ESMTP id 7112340698 for ; Fri, 28 Apr 2023 20:09:39 +0200 (CEST) Received: by mail-pf1-f173.google.com with SMTP id d2e1a72fcca58-64115eef620so14459348b3a.1 for ; Fri, 28 Apr 2023 11:09:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20221208.gappssmtp.com; s=20221208; t=1682705378; x=1685297378; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=b4LyymWfp2gvY4RzXGAf2vYdghNBLS1AJe6q+Rf4ziQ=; b=a5sYVrS5WiQThiMR082GZdB132Jlmbu31bb5XoZdsYsAD/Ke+bjoNLNuf3eYmebSIK bJJuMlpJ4Kx7PJBeWdHJZ4kV60K5hEPIvIYyuKfeoNmtqFbHASydMoIiGHbsrHLo0yZu h9Z43y0y91aaf/L0gpzdo/PyUg+ClrHWyyvsiABkzxSpCv3zF3wk6vC/ulYbw7PKaPdW ganr98toQQUbB8ZIo9uNh1xhfUKhUGWxPGulWnFtPH83RImbXzYotukS3NcuN/QUfxxr 0FEFU9w/oJ8QhZF8u7E7C4fyxMlTurwZ4HOki1T3CvwwYcyr1S6rIatES6IIyqR8u9sh 1J3g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682705378; x=1685297378; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=b4LyymWfp2gvY4RzXGAf2vYdghNBLS1AJe6q+Rf4ziQ=; b=N1fSg/rxZtDAamN0lwCq74jtSOgUTkUADySXm3rNbEitLG6ibt5bZKYOqpM27+kk0t ADjFYEYEcXl5rOsfawZ1gldpLZc9cmgvMYQLv0QTbs1sRjelJUOyx0ntKOzwilZDEDPD cm5ZFk6NxFz/f0S9x7rNX0tlQIJfkL8aOEope1XKywcvxA3DEzGn5yu3Z4nIk7XIzUse 0T6NUNFbtMAUf3a0PPbxJifaRZECyclZHB/QddpW8eQ4T64LX7xojVyNuhv4uQ6Cd8qv LT9m0qQjEcbnC10w6DroEz66cn2fP5UBSHtVn54MPlYHKvV9XQUpVGjJJaybmsrOPnMu Zdaw== X-Gm-Message-State: AC+VfDzySW03rIQnS5z5/91y0vw3jQk6fr95vcw08ervF7swGwou+DTQ wUEAeTyY7gGFNfEbr17fwQtlaw== X-Google-Smtp-Source: ACHHUZ4NRYJshp/kPsxTT3rALv8bgnsPtaGPFGJmOZVNL9I7phr5t7MZ933LkqmvCO1/JDwX4IbVxA== X-Received: by 2002:a17:90b:1a81:b0:247:78c0:125e with SMTP id ng1-20020a17090b1a8100b0024778c0125emr12716735pjb.15.1682705378316; Fri, 28 Apr 2023 11:09:38 -0700 (PDT) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id e5-20020a17090a630500b002478d21de2bsm1715984pjj.36.2023.04.28.11.09.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 28 Apr 2023 11:09:37 -0700 (PDT) Date: Fri, 28 Apr 2023 11:09:35 -0700 From: Stephen Hemminger To: Tom Barbette Cc: Cliff Burdick , Thomas Monjalon , David Marchand , users , Ori Kam Subject: Re: Generic flow string parser Message-ID: <20230428110935.00311cd8@hermes.local> In-Reply-To: <771fa709-563f-1ec2-a997-084b7709edce@uclouvain.be> References: <1814734.QZUTf85G27@thomas> <771fa709-563f-1ec2-a997-084b7709edce@uclouvain.be> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: users@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK usage discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: users-bounces@dpdk.org On Fri, 28 Apr 2023 17:36:51 +0000 Tom Barbette wrote: > Hi all! >=20 > I totally agree with this. >=20 > In FastClick we link against a copy of the test-pmd source code to call t= he parser externally. We just have to patch a bit some files (see https://g= ithub.com/tbarbette/fastclick/blob/main/userlevel/rte_parse.mk, and used he= re : https://github.com/tbarbette/fastclick/blob/main/lib/flowruleparser.cc= ). It actually worked fairly well until a structure named "template" appear= ed, which is a registered keyword in C++, and prevent compilation now even = under extern "C". This can be patched too but did not find the time yet. >=20 > So a clean solution would be more than nice. It's not only the 12K lines = of codes, it's also the "testpmd syntax" which is known, and appears in a l= ot of examples here and there. >=20 > Given the relatively easy (but hacky) integration we have, a clean librar= y wouldn't probably be very difficult. >=20 >=20 > Tom >=20 > Le 27/04/23 =C3=A0 15:19, Cliff Burdick a =C3=A9crit : > Hi Thomas, testpmd has a 12,000 line parser just for taking in strings an= d converting it to flow rules. This is obviously useful for testing flows, = but it also is an interface for any type of flow imaginable since this is w= here they're tested. >=20 > Now imagine you're developing an application that allows the user to spec= ify custom flows in a config. Your only option is to make your own flow str= ing input (json, etc) and convert that to to the flow spec. This is reinven= ting almost all of what testpmd already does, and it's extremely error-pron= e. I think it would be very useful to have this as an API call rather than = a user constructing each flow by hand so that all these other applications = can benefit and not be worries about bugs during conversions. >=20 >=20 >=20 > On Thu, Apr 27, 2023, 01:37 Thomas Monjalon > wrote: > 26/04/2023 07:47, David Marchand: > > On Wed, Apr 26, 2023 at 6:47=E2=80=AFAM Cliff Burdick > wrote: =20 > > > > > > Does anyone know if a generic parser for flow strings exists anywhere= ? The one inside of testpmd is ideal, but unfortunately it's self-contained= and not distributed as part of a normal DPDK install. This seems like some= thing that is likely reinvented over and over and it would be useful if the= re was a single API to take in strings and generate flows. =20 > > > > I heard this same question in the past, but I don't remember the answer. > > Copying Thomas and Ori who might know. =20 >=20 > I'm not sure how the testpmd code could help another application. > And in general, if your application has a CLI, > you need to integrate the flow commands in a broader context. Exposing the parser for use, would require some renaming of functions, docu= mentation and a test suite. The testing would be the hardest part.