Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extension Range for SAI Hash #1939

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions inc/saiswitch.h
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The enums are uint32 values, and it is unlikely that the custom hash algorithms or going to be tens of thousands more than standard hash algorithms.

So, we should make this 0x10000000 instead of 0x100 like every other custom range start.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 <#1939 (comment)> : > @@ -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 <#1939 (comment)>, 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.

Agree with Jai. We need to support custom ranges for such enums.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 <#1939 (comment)> : > @@ -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 <#1939 (comment)>, 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.

Agree with Jai. We need to support custom ranges for such enums.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i updated check that custom ranges needs to start from 0x1000000


/** End of custom range base */
SAI_HASH_ALGORITHM_CUSTOM_RANGE_END
} sai_hash_algorithm_t;

/**
Expand Down
Loading