<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, Apr 30, 2023 at 3:10 AM Thomas Monjalon <<a href="mailto:thomas@monjalon.net">thomas@monjalon.net</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">This thread is an API suggestion, it should be discussed in<br>
the developer mailing list (did the Cc here).<br>
<br>
29/04/2023 16:23, Cliff Burdick:<br>
> > Would rather the flow parser was rewritten as well. Doing open coded<br>
> > parser is much more error prone and hard to extend versus writing the<br>
> > parser in yacc/lex (ie bison/flex).<br>
> <br>
> I agree, and that's kind of why the original suggestion of using testpmd<br>
> came from. Writing a new parser is obviously the better choice and would<br>
> have been great if testpmd started that way, but a significant amount of<br>
> time was invested in that method. Since it works and is tested, it didn't<br>
> seem like a bad request to build off that and bring that code into an rte_<br>
> API. I'd imagine building a proper parser would not just require the parser<br>
> piece, but also making sure all the tests now use that, and also the legacy<br>
> testpmd was converted. It seemed unlikely all of this could be done in a<br>
> reasonable amount of time and a lot of input from many people. Given the<br>
> amount of debugging I (and others) have spent on figuring on why a flow<br>
> spec didn't work properly, this could be a huge timesaver for new projects<br>
> like Tom mentioned.<br>
> <br>
> On Fri, Apr 28, 2023 at 5:04 PM Stephen Hemminger <<br>
> <a href="mailto:stephen@networkplumber.org" target="_blank">stephen@networkplumber.org</a>> wrote:<br>
> <br>
> > On Fri, 28 Apr 2023 12:13:26 -0700<br>
> > Cliff Burdick <<a href="mailto:shaklee3@gmail.com" target="_blank">shaklee3@gmail.com</a>> wrote:<br>
> ><br>
> > > Hi Stephen, it would definitely not be worthwhile to repeat everything<br>
> > > that's already tested with testpmd. I was thinking that given that there<br>
> > > already is a "flow_parse" function that does almost everything needed,<br>
> > > something like that could be exposed. If we think of the testpmd flow<br>
> > > string as a sort of "IR" for string flow specification, that would allow<br>
> > > others to implement higher-level transform of a schema like JSON or YAML<br>
> > > into the testpmd language. Due to the complexity of testpmd and how it's<br>
> > > the source of true for testing flows, I think it's too great of an ask to<br>
> > > have testpmd support a new type of parsing. My only suggestion would be<br>
> > > to take what already exists and expose it in a public API that is included<br>
> > > in a DPDK install.<br>
<br>
So the only things we need are 2 functions, if I understand well:<br>
<br>
int rte_flow_to_text(const struct rte_flow*);<br>
struct rte_flow *rte_flow_from_text(const char *);<br>
<br>
Here I assume the output of rte_flow_from_text() would be a created flow,<br>
meaning it calls rte_flow_create() under the hood.<br>
Is it what you wish?<br>
Or should it fill port ID, attributes, patterns and actions?<br>
<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><br></div>+1 It would be definitely useful to have a generic parser which could re-use the test-pmd parser code as it has already done the heavy lifting. I would be happy to contribute/help to get this going. <br></blockquote>

</blockquote></div></div>