Skip to Content.
Sympa Menu

rare-users - Re: [RARE-users] [freertr] p4lang interpreter where pls?

Subject: RARE user and assistance email list

List archive

Re: [RARE-users] [freertr] p4lang interpreter where pls?


Chronological Thread 
  • From: "Gurevich, Vladimir" <>
  • To: mc36 <>, "" <>
  • Cc: "" <>, "" <>
  • Subject: Re: [RARE-users] [freertr] p4lang interpreter where pls?
  • Date: Mon, 5 Jun 2023 09:42:03 +0000
  • Accept-language: en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=xWCAdEKFp6q10JQlP9WCuJgLb0UPx5I65jBSQTYw+IQ=; b=e8FpiBmhQm3zI1UbHn6Irmx+8rwMlECAABlI9EPriDhsGBhTnjwJ/qbszNI864miSi+obKCGTbpUpvHNNB+0dYdGKbnPfukBfdZA+7Qo6Yn8Kwa5rePWaZcEDTQ2tRfXXLTNrff3Px9BcM1gm/D3RxPPjgCcL1Wlm2ENeb0mBH5jMpWKZSLDklcbjK8B2WZmBhErMynwVJnlrREr+aDFRTZYpvOapg1w58URoAthdNPz3UIW8FygRalwImlv7HSx7HaEtg8Wxo2x5bVMcTCObxIunfyfGRrmQWvZelvAZL2SRE2bBAfsUvYvAONEmuQ+Nqfm1/WR6mYShNb2fQtrlw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SZblhZM2p/4ySXWjtxvBWasdMIS6IygpV9ZuEdQvgpN7J2j4PWDBXyBV8+qZRPllnl1yOzHQ3ufUDQFuDZ2YY+kpbi0rUH0sXYkZPb+RmRyUDgxgz+4vqUlqViuM1vh3qjEIqDfMOKSa4gi7/HaWp77MQ8mtZHeBmffPPIQSdTXetaH3xXU1+d0BGFWlp4QL+cMqb3oPtHBU8hW5zmaNPB3Po5mrr+sL/GfedPhw0FzznDeTNP7OPamEmB8St6B71/CPyez0NJt2PZK2TXMjCafvkCOghQ9SVzdclyccUihNwSx0sI11j+OOfdG5ZdoQPw9HAwW/3j7SUQ2dL4zBOA==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com;

Hello Csaba,

 

All the compilers for all SW targets are extremely fast. I am not quite sure what would you achieve by using an interpreter.

 

Thanks,

Vladimir Gurevich

Principal Engineer,  Switch & Fabric Group (XFG)
Director, 
Intel® Connectivity Education Hub

 

Email:        

Cell:         +1 (408) 833-4505

 

 

From: mc36 <>
Date: Monday, June 5, 2023 at 2:22 AM
To: <>, Gurevich, Vladimir <>
Cc: <>, <>
Subject: Re: [freertr] p4lang interpreter where pls?

hmmm.... sooo my idea is the following in a quick example:



     apply {
         if (ig_md.mpls0_valid == 1) {
             tbl_mpls_fib.apply();
             if ((ig_md.mpls_op_type == 1) && (ig_md.mpls1_valid == 1)) {
                 tbl_mpls_fib_decap.apply();
             }
         }
     }
}

seems easily implemented in an _interpreter_ (not a compiler like you do mostly)

then one can realtime experiment with p4lang.... i've done this b4 for tcl(sh):

https://github.com/rare-freertr/freeRtr/blob/master/src/net/freertr/user/userScript.java

this one is here to make rare/freertr a bit more cisco-alike:

https://www.cisco.com/c/en/us/td/docs/ios-xml/ios/ios_tcl/command/ios-tcl-cr-book/ios-tcl-cr-c1.html


but i even written a virtual machine to be compatible with an other stuff:

https://github.com/rare-freertr/freeRtr/blob/master/src/net/freertr/user/userVM.java

it's only 1500 loc and imho turing-complete if you know that stuff.... :)

ps: i've just registered to the forum, but first i wanted to know if you're

against a very incomplete p4 _interpreter_ , not a compiler or anything....

thx,

cs








On 6/5/23 11:06, Gurevich, Vladimir wrote:
> Hello Csaba,
>
> First of all, there can be no such thing as a    P4_16 interpreter        at the very minimum you need to add the name of the architecture there. For example, BMv2 support P4_16/v1model
> and to a certain extent P4_16/PSA.
>
> Secondarily, I do not quite understand what is that you are trying to achieve and what are you requirements. So, it is not clear to me what is that you do not like on BMv3, for
> example. Note also, that P4_DPDK can also be considered a P4_16/PSA(-subset) emulator, as are other targets, like P4_EBPF, etc.
>
> Last, but not least, you might find it useful to as this kind of questions at
https://forum.p4.org <https://forum.p4.org>
>
> Best,
>
> *Vladimir Gurevich*
>
> Principal Engineer, Switch & Fabric Group (XFG) <
http://intel.com/programmable-networking>
> Director, Intel   Connectivity Education Hub <
http://intel.com/connectivity-education>
>
> Email: <
>
>
> Cell: +1 (408) 833-4505 <tel:+14088334505>
>
> *A close up of a sign Description automatically generated* <
http://intel.com/>
>
> *From: *mc36 <>
> *Date: *Sunday, June 4, 2023 at 10:46 PM
> *To: *Gurevich, Vladimir <>, <>
> *Cc: * <>, <>
> *Subject: *p4lang interpreter where pls?
>
> hihi vlad,
>
> so the question as in $subj$ do you know a very simple p4-16 _interpreter_ in .c or in .java hanging around??
>
> not a full one but a very simple like 100-200 l.o.c max... the use case is to test/develop the rare/freertr
>
> emulated (bmv2) target more easily/quicky??? if nothing exists, then whats your opinion, would it be hard
>
> for me to write one aaand would it worth the effort??? :)
>
> sorely it'll be a way too incomplete etc, just to run the
https://github.com/rare-freertr/RARE-bmv2 <https://github.com/rare-freertr/RARE-bmv2>
>
> which uses just a very small subset of p4-16.... i was thinking to write the emulator for the .json
>
> files but mehhh, i find the .p4 files more fun tbh.... :)
>
> thanks,
>
> cs
>
> _._,_._,_
> ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
> Groups.io Links:
>
> You receive all messages sent to this group.
>
> View/Reply Online (#1333) <
https://groups.io/g/freertr/message/1333> | Reply To Group
> <
> | Reply To Sender
> <
> | Mute This Topic <https://groups.io/mt/99334960/6006518> | New Topic
> <
https://groups.io/g/freertr/post>
> Your Subscription <
https://groups.io/g/freertr/editsub/6006518> | Contact Group Owner <> | Unsubscribe <https://groups.io/g/freertr/unsub> []
>
> _._,_._,_

PNG image




Archive powered by MHonArc 2.6.24.

Top of Page