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

Unify SAI_HOSTIF_USER_DEFINED_TRAP_TYPE_CUSTOM_RANGE_BASE value #2114

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

kcudnik
Copy link
Collaborator

@kcudnik kcudnik commented Nov 22, 2024

To match all other custom range bases starting from 0x1000000.

All other _CUSTOM_RANGE_BASE enums are indexed at 0x1000000, lets's move this one to the same base to have all vendor custom enums at the same base across entire SAI

To match all other custom range bases starting from 0x1000000
@kcudnik
Copy link
Collaborator Author

kcudnik commented Nov 22, 2024

Unfortunately this is enum breaking change, fortunately sonic is not using this attribute, and in vendor case, if they have any custom traps, it's easy to workaround it in internal headers:

#define SAI_HOSTIF_USER_DEFINED_TRAP_TYPE_CUSTOM_RANGE_BASE_OLD (0x1000)

if (trapid >= SAI_HOSTIF_USER_DEFINED_TRAP_TYPE_CUSTOM_RANGE_BASE_OLD &&
    trapid <  SAI_HOSTIF_USER_DEFINED_TRAP_TYPE_CUSTOM_RANGE_BASE)
{
    trapid = trapid - SAI_HOSTIF_USER_DEFINED_TRAP_TYPE_CUSTOM_RANGE_BASE_OLD +
                      SAI_HOSTIF_USER_DEFINED_TRAP_TYPE_CUSTOM_RANGE_BASE;
}

if this will help, we can introduce depreciated enum in SAI with previous values for convenience

@kcudnik
Copy link
Collaborator Author

kcudnik commented Nov 22, 2024

FYI @JaiOCP @tushar-ty @marian-pritsak @itaibaz please join discussion if you have any comments

@tjchadaga tjchadaga added the reviewed PR is discussed in SAI Meeting label Dec 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking-change reviewed PR is discussed in SAI Meeting
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants