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

saiapi.j2 change causes for "create and set" flag to be changed #439

Closed
vincent-xs opened this issue Sep 14, 2023 · 1 comment
Closed

saiapi.j2 change causes for "create and set" flag to be changed #439

vincent-xs opened this issue Sep 14, 2023 · 1 comment
Assignees

Comments

@vincent-xs
Copy link
Contributor

vincent-xs commented Sep 14, 2023

@vijasrin

part of this commit
Author: Vijay Srinivasan
Revision: add355e
Date: 2023-06-21 12:44:23
Comment: Adding support for metering (#365)

modified
1/ saiapi.j2 logic for mandatory variables (affecting all vendor LIBSAI)
this is mostly this check:
{% for key in table['keys'] %}
{% if key.isattribute != 'false' %} <<<<<<<<<<<<<<<< is this check stating: this parameter is not part of any lookup key, so no need to make it mandatory ? (this would be the case for the VNI we get from VNET, that VNI being only used as packet data on outbound).

/**
 * @brief {{ key.match_type | capitalize | replace('Lpm', 'LPM') }} matched key {{ key.sai_key_name }}
 *
 * @type {{ key.type }}
 * @flags MANDATORY_ON_CREATE | CREATE_ONLY

{% if key.type == 'sai_uint16_t' %}

2/ commented out in BMV2 the expected/match param logic (just BMV2 sai)

any reason for this?

@vijasrin
Copy link
Collaborator

vijasrin commented Sep 20, 2023

@vincent-xs

  1. The key.isattribute was meant to be used in cases where the table keys also needed to be part of the attribute enums. Looks like this is deprecated and not being used anymote. The removal of the if condition generates the same output.

  2. Ref: libsai bmv2 not respecting optional nature of attributes #370 optional attributes should not be required, which was causing an assert in bmv2 sai. Hence this check was commented out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants