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

Allow for CREATE_ONLY attributes in non objects #1616

Merged
merged 1 commit into from
Oct 13, 2022

Conversation

marian-pritsak
Copy link
Contributor

Primarily desired for action selectors to make
the dependent attributes that are object mandatory

Signed-off-by: Marian Pritsak marianp@mellanox.com

Primarily desired for action selectors to make
the dependent attributes that are object mandatory

Signed-off-by: Marian Pritsak <marianp@mellanox.com>
@marian-pritsak
Copy link
Contributor Author

The example is as follows:

We have a route entry with an action selector:

    /**
     * @brief Packet action
     *
     * @type sai_packet_action_t
     * @flags CREATE_AND_SET
     * @default SAI_PACKET_ACTION_FORWARD
     */
    SAI_ROUTE_ENTRY_ATTR_PACKET_ACTION = SAI_ROUTE_ENTRY_ATTR_START,

And another attribute that is an object:

    /**
     * @brief Next hop or next hop group id for the packet, or a router interface
     * in case of the directly reachable route or the CPU port in case of IP2ME route
     *
     * The next hop id is only effective when the packet action is one of the
     * following: FORWARD, COPY, LOG, TRANSIT.
     *
   ...
     *
     * When it is SAI_NULL_OBJECT_ID, then the packet will be dropped.
     *
     * @type sai_object_id_t
     * @flags CREATE_AND_SET
     * @objects SAI_OBJECT_TYPE_NEXT_HOP, SAI_OBJECT_TYPE_NEXT_HOP_GROUP, SAI_OBJECT_TYPE_ROUTER_INTERFACE, SAI_OBJECT_TYPE_PORT
     * @allownull true
     * @default SAI_NULL_OBJECT_ID
     */
    SAI_ROUTE_ENTRY_ATTR_NEXT_HOP_ID,

The next hop ID only makes sense if the action is not DROP. If the action is FORWARD, and next hop ID is NULL, it is just another way of saying action == DROP.

There may be action selectors other than sai_packet_action_t that don't allow for drop and object attributes like next hop ID cannot be NULL, which the metadata checker does not allow for today.

@rlhui rlhui merged commit cbe8033 into opencomputeproject:master Oct 13, 2022
@rlhui rlhui mentioned this pull request Mar 13, 2023
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

Successfully merging this pull request may close these issues.

3 participants