[P4-dev] control-plane API generation

hemant at mnkcg.com hemant at mnkcg.com
Wed Sep 12 16:01:04 EDT 2018


Hi Omer,

 

Thanks much for the clarification.  Also, congratulations on the backend SAI API generation work!

 

Best,

 

Hemant

 

From: P4-dev <p4-dev-bounces at lists.p4.org> On Behalf Of Omer Shabtai
Sent: Wednesday, September 12, 2018 3:55 PM
To: Calin Cascaval <cascaval at barefootnetworks.com>; Mihai Budiu <mbudiu at vmware.com>; p4-dev at lists.p4.org
Subject: Re: [P4-dev] control-plane API generation

 

Hi Hemant,

Regarding the June 18 P4 to SAI demo, We have shown how SAI (fixed API) can be extended via P4, as a hybrid-programmable approach.

Currently the SAI API extensions (flexSAI) headers are auto generated at the backend layer.

SAI is indeed ASIC independent, but the SAI community is aiming for a specific target architecture to be supported by all vendors with a well-defined pipeline, known as SAI behavioral model, and can be found here: 

https://github.com/opencomputeproject/SAI/tree/master/doc/behavioral%20model

flexSAI output will be generated by compiling against the SAI p4 target, so having the flexSAI API implemented at the backend layer seemed like a good option.

For more details, please refer to https://github.com/opencomputeproject/SAI/tree/master/flexsai/p4

I hope this will clarify the flexSAI API implementation. 

 

Thanks,

Omer Shabtai

Mellanox

 

 

From: P4-dev <p4-dev-bounces at lists.p4.org <mailto:p4-dev-bounces at lists.p4.org> > On Behalf Of Calin Cascaval via P4-dev
Sent: Tuesday, September 11, 2018 8:42 AM
To: Mihai Budiu <mbudiu at vmware.com <mailto:mbudiu at vmware.com> >
Cc: p4-dev <p4-dev at lists.p4.org <mailto:p4-dev at lists.p4.org> >
Subject: Re: [P4-dev] control-plane API generation

 

Forking the compiler is not ideal since it will be hard to get back contributions from other developers. I would rather make an effort to agree on where these APIs should be generated in a uniform manner across all backends. As Antonin explained, the current point has been agreed upon after quite a bit of discussion and I haven't yet seen an instance where the point needs to be moved.


--

Thanks, Calin

 

On Sep 10, 2018, at 22:31, Mihai Budiu <mbudiu at vmware.com <mailto:mbudiu at vmware.com> > wrote:

 

The compiler is open-source and nothing prevents you from forking it and moving the API generation to another place. Of course, then you will have to keep the fork updated, which is not easy long term. It is a good idea to have the API match the program that the user wrote, and not a transformed version of that program. If the API matches a modified program then you have to write down the rules by which the program is modified so people will know how to implement the API. It is much simpler to have no special rules whatsoever.

 

Mihai

 

From: P4-dev < <mailto:p4-dev-bounces at lists.p4.org> p4-dev-bounces at lists.p4.org> On Behalf Of  <mailto:hemant at mnkcg.com> hemant at mnkcg.com
Sent: Monday, September 10, 2018 7:55 AM
To: 'Antonin Bas' < <mailto:antonin at barefootnetworks.com> antonin at barefootnetworks.com>
Cc: 'p4-dev' < <mailto:p4-dev at lists.p4.org> p4-dev at lists.p4.org>
Subject: Re: [P4-dev] control-plane API generation

 

Got it.  At the June 2018 P4 Workshop, in the Mellanox P4 to SAI demo, I asked where is the SAI API generated from in p4c?  I thought I heard, “by the midend”.   Since SAI is also independent of any asic, SAI API generation should also be invoked after the frontend.  Maybe, someone from Mellanox can confirm since I don’t see details in their slide nor the abstract.  I would like to what, if SAI API generation is done after the frontend processing, before any midend processing is run?

 

Thanks,

 

Hemant

 

From: Antonin Bas < <mailto:antonin at barefootnetworks.com> antonin at barefootnetworks.com> 
Sent: Monday, September 10, 2018 10:09 AM
To:  <mailto:hemant at mnkcg.com> hemant at mnkcg.com
Cc: p4-dev < <mailto:p4-dev at lists.p4.org> p4-dev at lists.p4.org>
Subject: Re: [P4-dev] control-plane API generation

 

This is a hard rule as far as I'm concerned. We actually worked hard to ensure that API generation happens right after the frontend and does not depend on the backend (or the midend passes that this backend chooses to use). The generated P4Info message should be exactly the same independently of which backend you are using.

What we can do though is invoke midend passes independently of the backend in the P4Info generation code ( <https://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fp4lang%2Fp4c%2Fblob%2Fmaster%2Fcontrol-plane%2Fp4RuntimeSerializer.cpp%23L1328&data=02%7C01%7Comers%40mellanox.com%7C060624c4bfc9438037b108d617a9612f%7Ca652971c7d2e4d9ba6a4d149256f461b%7C0%7C0%7C636722413593875904&sdata=0ARGBgkG%2FxEFV1BDLlQ7YGsRQixfll9rDhF3Nn6QtX0%3D&reserved=0> https://github.com/p4lang/p4c/blob/master/control-plane/p4RuntimeSerializer.cpp#L1328). I believe that usually it is best avoided: you want the P4Info message / the runtime APIs to match exactly the contents of the P4 program.

 

On Wed, Sep 5, 2018 at 1:33 PM, < <mailto:hemant at mnkcg.com> hemant at mnkcg.com> wrote:

In the bmv2 backend, I see that P4Runtime/control-plane API generation is called in p4c/backends/bmv2/simple_switch/main.cpp after frontend.run().   Is this a hard rule or can one move the API generation, for example, to be after midend.process()?   

 

Thanks in advance.

 

Hemant

 

MNK Consulting

 <https://emea01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fmnkcg.com%2F&data=02%7C01%7Comers%40mellanox.com%7C060624c4bfc9438037b108d617a9612f%7Ca652971c7d2e4d9ba6a4d149256f461b%7C0%7C0%7C636722413593875904&sdata=CrmrIbDwCNaJR2t1FMIihfVBNy%2BtA3YrAJoKSs9cL1Y%3D&reserved=0> http://mnkcg.com

 


_______________________________________________
P4-dev mailing list
 <mailto:P4-dev at lists.p4.org> P4-dev at lists.p4.org
 <https://emea01.safelinks.protection.outlook.com/?url=http%3A%2F%2Flists.p4.org%2Fmailman%2Flistinfo%2Fp4-dev_lists.p4.org&data=02%7C01%7Comers%40mellanox.com%7C060624c4bfc9438037b108d617a9612f%7Ca652971c7d2e4d9ba6a4d149256f461b%7C0%7C0%7C636722413593875904&sdata=zyYR%2FnIc7Pu7U%2Bmm7RcHn0J3JrzPUofy1lXJiUASLPk%3D&reserved=0> http://lists.p4.org/mailman/listinfo/p4-dev_lists.p4.org





 

-- 

Antonin

_______________________________________________
P4-dev mailing list
 <mailto:P4-dev at lists.p4.org> P4-dev at lists.p4.org
 <https://emea01.safelinks.protection.outlook.com/?url=http%3A%2F%2Flists.p4.org%2Fmailman%2Flistinfo%2Fp4-dev_lists.p4.org&data=02%7C01%7Comers%40mellanox.com%7C060624c4bfc9438037b108d617a9612f%7Ca652971c7d2e4d9ba6a4d149256f461b%7C0%7C0%7C636722413593875904&sdata=zyYR%2FnIc7Pu7U%2Bmm7RcHn0J3JrzPUofy1lXJiUASLPk%3D&reserved=0> http://lists.p4.org/mailman/listinfo/p4-dev_lists.p4.org

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.p4.org/pipermail/p4-dev_lists.p4.org/attachments/20180912/e7cb7ca4/attachment.html>


More information about the P4-dev mailing list