SAI icon indicating copy to clipboard operation
SAI copied to clipboard

Extension Range for SAI Hash

Open JaiOCP opened this issue 1 year ago • 9 comments

Added extension range for sai_hash_algorithm_t

JaiOCP avatar Dec 13 '23 22:12 JaiOCP

Hi Kamil,

We need to add vendor specific hash algorithms either because they are confidential or proprietary.

But you are right, currently the tool chain allows it but if we add extensions then start throwing errors. There is another place such custom range is added and will have same problem https://github.com/JaiOCP/SAI/blob/85e106e8661d49403bf4f368913e44437d10a644/inc/saisrv6.h#L106 https://github.com/JaiOCP/SAI/blob/85e106e8661d49403bf4f368913e44437d10a644/inc/saisrv6.h#L54

Please help how this can be done.

Regards, -Jai

On Thu, Jan 11, 2024 at 12:07 PM Kamil Cudnik @.***> wrote:

@.**** commented on this pull request.

In inc/saiswitch.h https://github.com/opencomputeproject/SAI/pull/1939#discussion_r1449341650 :

@@ -208,6 +208,11 @@ typedef enum _sai_hash_algorithm_t /** Combination of CRC and XOR based hash algorithm */ SAI_HASH_ALGORITHM_CRC_XOR = 6,

  • /** Custom range base value */
  • SAI_HASH_ALGORITHM_CUSTOM_RANGE_START = 0x00000100,

why you need to have custom range here? this is not an atteibute, current logic will not allow such range at enums

— Reply to this email directly, view it on GitHub https://github.com/opencomputeproject/SAI/pull/1939#discussion_r1449341650, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKCSHLPQZ7D7HZLRTMMONIDYOBA65AVCNFSM6AAAAABAT4NRPSVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMYTQMJWGUZDOMBVGE . You are receiving this because you authored the thread.Message ID: @.***>

-- This electronic communication and the information and any files transmitted with it, or attached to it, are confidential and are intended solely for the use of the individual or entity to whom it is addressed and may contain information that is confidential, legally privileged, protected by privacy laws, or otherwise restricted from disclosure to anyone else. If you are not the intended recipient or the person responsible for delivering the e-mail to the intended recipient, you are hereby notified that any use, copying, distributing, dissemination, forwarding, printing, or copying of this e-mail is strictly prohibited. If you received this e-mail in error, please return the e-mail to the sender, delete it from your computer, and destroy any printed copy of it.

JaiOCP avatar Jan 11 '24 20:01 JaiOCP

Will work on this to support in parser then you can add

kcudnik avatar Jan 12 '24 07:01 kcudnik

i just check that locally, and actually current validator allows such entries, and since this is enum extension not attribute extension, then this enum is not actually checked, we have custom ranges in enum in this commit: eaf281214712873c869f8ff8f454b31a636c60a1, but they are pure workaround, and will be removed once workaround will be met, this should normally not be a apractice to add custom ranges to non attr enums, question here whether we should use extension start value as 0x100 or 0x10000000, i would suggest to use 0x10000000, since in some enums we have "ranges" which are in value slike 0x1000..0x1fff, 0x2000..0x2fff and so one, so everything that is outside possible valid extensions, should be allowed, and vendor specific extenstions should be in 0x10000000,

i will add a check for that in the future to follow this rule

kcudnik avatar Jan 12 '24 08:01 kcudnik

i made check for that https://github.com/opencomputeproject/SAI/pull/1945, but we need to fix pipeline first on github to pass all runchecks

kcudnik avatar Jan 12 '24 08:01 kcudnik

/azp run

kcudnik avatar Jan 16 '24 11:01 kcudnik

Azure Pipelines successfully started running 1 pipeline(s).

azure-pipelines[bot] avatar Jan 16 '24 11:01 azure-pipelines[bot]

/azp run

kcudnik avatar Jan 16 '24 12:01 kcudnik

Azure Pipelines successfully started running 1 pipeline(s).

azure-pipelines[bot] avatar Jan 16 '24 12:01 azure-pipelines[bot]

Would it also make sense to standardize an attribute value for an implementation-defined 'strong' hash algo ?

j-bos avatar Apr 17 '24 17:04 j-bos