sonic-net / DASH

Disaggregated APIs for SONiC Hosts
Apache License 2.0
80 stars 89 forks source link

[sai-gen] Deprecate the name annotations in favor of SaiTable #479

Closed r12f closed 8 months ago

r12f commented 8 months ago

This PR has 2 updates:

  1. Deprecate the @name annotations in favor of @SaiTable.
  2. Add api_order attribute in @SaiTable annotation to help us enforce the order of the generated APIs.

The second change is a must have, otherwise for any API set that contains multiple type of entries (generated from multiple tables), the order could be changed between changes and break the ABI compatibility as the screenshot shows below:

Snipaste_2023-12-12_12-24-41

The doc is also updated to capture the use of this new attribute.

For generated content updates:

  1. No updates on SAI header files:

    r12f@r12f-dl380:~/data/code/sonic/DASH/dash-pipeline
    $ diff SAI/SAI/experimental/ ~/data/code/sonic/DASH-exp/dash-pipeline/SAI/SAI/experimental/
    r12f@r12f-dl380:~/data/code/sonic/DASH/dash-pipeline
  2. For libsai, table id will be updated as previous change.

    r12f@r12f-dl380:~/data/code/sonic/DASH/dash-pipeline
    $ diff SAI/SAI/experimental/ ~/data/code/sonic/DASH-exp/dash-pipeline/SAI/SAI/experimental/
    r12f@r12f-dl380:~/data/code/sonic/DASH/dash-pipeline
    $ diff SAI/lib/ ~/data/code/sonic/DASH-exp/dash-pipeline/SAI/lib/
    diff SAI/lib/saidashacl.cpp /home/r12f/data/code/sonic/DASH-exp/dash-pipeline/SAI/lib/saidashacl.cpp
    31c31
    <     tableId = 50200087;
    ---
    >     tableId = 45323240;
    diff SAI/lib/saidashdirectionlookup.cpp /home/r12f/data/code/sonic/DASH-exp/dash-pipeline/SAI/lib/saidashdirectionlookup.cpp
    19c19
    <     pi_p4_id_t tableId = 45670434;
    ---
    >     pi_p4_id_t tableId = 38960243;
    110c110
    <     pi_p4_id_t tableId = 45670434;
    ---
    >     pi_p4_id_t tableId = 38960243;
    diff SAI/lib/saidasheni.cpp /home/r12f/data/code/sonic/DASH-exp/dash-pipeline/SAI/lib/saidasheni.cpp
    19c19
    <     pi_p4_id_t tableId = 46804748;
    ---
    >     pi_p4_id_t tableId = 38612462;
    118c118
    <     pi_p4_id_t tableId = 46804748;
    ---
    >     pi_p4_id_t tableId = 38612462;
    212c212
    <     tableId = 45859274;
    ---
    >     tableId = 47336097;
    diff SAI/lib/saidashinboundrouting.cpp /home/r12f/data/code/sonic/DASH-exp/dash-pipeline/SAI/lib/saidashinboundrouting.cpp
    19c19
    <     pi_p4_id_t tableId = 38920290;
    ---
    >     pi_p4_id_t tableId = 42758350;
    152c152
    <     pi_p4_id_t tableId = 38920290;
    ---
    >     pi_p4_id_t tableId = 42758350;
    diff SAI/lib/saidashmeter.cpp /home/r12f/data/code/sonic/DASH-exp/dash-pipeline/SAI/lib/saidashmeter.cpp
    31c31
    <     tableId = 38547152;
    ---
    >     tableId = 49926129;
    244c244
    <     tableId = 39168708;
    ---
    >     tableId = 48776568;
    425c425
    <     tableId = 34535910;
    ---
    >     tableId = 47787652;
    diff SAI/lib/saidashoutboundcatopa.cpp /home/r12f/data/code/sonic/DASH-exp/dash-pipeline/SAI/lib/saidashoutboundcatopa.cpp
    19c19
    <     pi_p4_id_t tableId = 39175949;
    ---
    >     pi_p4_id_t tableId = 48860231;
    219c219
    <     pi_p4_id_t tableId = 39175949;
    ---
    >     pi_p4_id_t tableId = 48860231;
    diff SAI/lib/saidashoutboundrouting.cpp /home/r12f/data/code/sonic/DASH-exp/dash-pipeline/SAI/lib/saidashoutboundrouting.cpp
    19c19
    <     pi_p4_id_t tableId = 44067785;
    ---
    >     pi_p4_id_t tableId = 42788937;
    308c308
    <     pi_p4_id_t tableId = 44067785;
    ---
    >     pi_p4_id_t tableId = 42788937;
    diff SAI/lib/saidashpavalidation.cpp /home/r12f/data/code/sonic/DASH-exp/dash-pipeline/SAI/lib/saidashpavalidation.cpp
    19c19
    <     pi_p4_id_t tableId = 35526612;
    ---
    >     pi_p4_id_t tableId = 48948181;
    118c118
    <     pi_p4_id_t tableId = 35526612;
    ---
    >     pi_p4_id_t tableId = 48948181;
    diff SAI/lib/saidashvip.cpp /home/r12f/data/code/sonic/DASH-exp/dash-pipeline/SAI/lib/saidashvip.cpp
    19c19
    <     pi_p4_id_t tableId = 45245089;
    ---
    >     pi_p4_id_t tableId = 38937816;
    110c110
    <     pi_p4_id_t tableId = 45245089;
    ---
    >     pi_p4_id_t tableId = 38937816;
    diff SAI/lib/saidashvnet.cpp /home/r12f/data/code/sonic/DASH-exp/dash-pipeline/SAI/lib/saidashvnet.cpp
    31c31
    <     tableId = 34815711;
    ---
    >     tableId = 34579306;
    diff SAI/lib/sairoute.cpp /home/r12f/data/code/sonic/DASH-exp/dash-pipeline/SAI/lib/sairoute.cpp
    19c19
    <     pi_p4_id_t tableId = 49279256;
    ---
    >     pi_p4_id_t tableId = 36513740;
    124c124
    <     pi_p4_id_t tableId = 49279256;
    ---
    >     pi_p4_id_t tableId = 36513740;
r12f commented 8 months ago

Ok, the PR is ready for review.

@chrispsommers , with this all tables are off the @name annotation. @jafingerhut and @fruffy, this change should help solving the issue #347 . (@KrisNey-MSFT as FYI as well)

KrisNey-MSFT commented 8 months ago

[like] Kristina Moore reacted to your message:


From: Riff @.> Sent: Tuesday, December 12, 2023 9:02:52 PM To: sonic-net/DASH @.> Cc: Kristina Moore @.>; Mention @.> Subject: Re: [sonic-net/DASH] [sai-gen] Deprecate the name annotations in favor of SaiTable (PR #479)

Ok, the PR is ready for review.

@chrispsommershttps://github.com/chrispsommers , with this all tables are off the @name annotation. @jafingerhuthttps://github.com/jafingerhut and @fruffyhttps://github.com/fruffy, this change should help solving the issue #347https://github.com/sonic-net/DASH/issues/347 . @.***https://github.com/KrisNey-MSFT as FYI as well)

— Reply to this email directly, view it on GitHubhttps://github.com/sonic-net/DASH/pull/479#issuecomment-1852806884, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AFJSI6EIS2YHY3N4SVHRC4DYJDA7ZAVCNFSM6AAAAABASC2II6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNJSHAYDMOBYGQ. You are receiving this because you were mentioned.Message ID: @.***>

r12f commented 8 months ago

Since #480 is approved, which contains all changes in this PR. For keeping the changes clean, I am going to merge this PR first, rebase #480 , then merge #480 afterwards.