Hi Jon,
I see, thanks. I have to go back to the drawing board. I am developing a P4 to VPP compiler. If VPP has any API to create a table and lookup the table, it would ease compiler development. I am chasing lookup because the lookup result drives subsequent processing in the data plane. For example, a table has two entries (entry1 and entry2). On table lookup, if entry1 is hit, the result of lookup includes action1 which is invoked. An action is a C function. If entry2 is hit, action2 is invoked. An alternative I am thinking is to change VPP code to support P4 better – support explicit table lookup and running user-supplied actions. VPP does run actions but they are pre-defined. https://github.com/FDio/vpp/blob/88caf28354133160d2446e939f1e54adb71cc144/src/vnet/classify/vnet_classify.c#L385 If you see my compiler generated C code, a switch statement is running actions. The table, table key, and actions to run are shows in foo.h https://github.com/hesingh/misc/blob/master/p4-vpp/foo.c#L16 Hemant From: [email protected] <[email protected]> On Behalf Of Jon Loeliger via lists.fd.io Sent: Tuesday, September 29, 2020 9:23 AM To: [email protected] Cc: vpp-dev <[email protected]> Subject: Re: [vpp-dev] table lookup api? On Mon, Sep 28, 2020 at 1:15 PM hemant via lists.fd.io <http://lists.fd.io> <[email protected] <mailto:[email protected]> > wrote: I have created a table in VPP using the vnet_classify_add_del_session() API. What API do I use to lookup this table? Thanks, Hemant There is no API to do a Classifier table lookup. When the table was created via the API, it's table_index was returned in the classify_add_del_table_reply field new_table_index. You should know why you created that table, so stash that new_table_index somewhere in your management data, perhaps in your own (name,table_index) hash table. HTH, jdl
smime.p7s
Description: S/MIME cryptographic signature
-=-=-=-=-=-=-=-=-=-=-=- Links: You receive all messages sent to this group. View/Reply Online (#17585): https://lists.fd.io/g/vpp-dev/message/17585 Mute This Topic: https://lists.fd.io/mt/77180264/21656 Group Owner: [email protected] Unsubscribe: https://lists.fd.io/g/vpp-dev/unsub [[email protected]] -=-=-=-=-=-=-=-=-=-=-=-
