Skip to content

Modification of SAI_PORT_ATTR_CBFC_RECEIVER_NATIVE_TOTAL_CREDITS flags to CREATE_AND_SET - #2368

Open
pullaraogunda wants to merge 3 commits into
opencomputeproject:masterfrom
pullaraogunda:cbfc_rx_native_credits_rw
Open

pullaraogunda wants to merge 3 commits into
opencomputeproject:masterfrom
pullaraogunda:cbfc_rx_native_credits_rw

Conversation

@pullaraogunda

Copy link
Copy Markdown
Contributor

Currently, the SAI_PORT_ATTR_CBFC_RECEIVER_NATIVE_TOTAL_CREDITS attribute is defined as READ_ONLY. Hardware/SDK automatically allocated buffer credits at the receiver port based on default assumptions (e.g., port speed, standard cable length). The user could only query this attribute to retrieve the chip's default allocation.

There is currently no provision in SAI for a user to explicitly configure the receiver credits on the Rx side. While default allocations work for standard setups, administrators may need to override these values based on specific physical topologies, custom cable lengths, or requirements to use only a specific portion of the available credits.

This PR modifies the flag for SAI_PORT_ATTR_CBFC_RECEIVER_NATIVE_TOTAL_CREDITS from READ_ONLY to CREATE_AND_SET.

…EATE_AND_SET

Signed-off-by: pullarao <pullarao.gunda@broadcom.com>
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

@kcudnik

kcudnik commented Oct 20, 2026

Copy link
Copy Markdown
Collaborator

default value will be needed

Signed-off-by: pullarao <pullarao.gunda@broadcom.com>
@pullaraogunda
pullaraogunda force-pushed the cbfc_rx_native_credits_rw branch from cc14865 to b0b1858 Compare October 20, 2026 10:28
Comment thread inc/saiport.h Outdated
* @type sai_uint32_t
* @flags READ_ONLY
* @flags CREATE_AND_SET
* @isvlan false

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

isvlan is not needed as this flag is only used for uint16

Signed-off-by: pullarao <pullarao.gunda@broadcom.com>
@kcudnik

kcudnik commented Oct 20, 2026

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).

@rck-innovium

Copy link
Copy Markdown
Contributor

If we modify the existing SAI_PORT_ATTR_CBFC_RECEIVER_NATIVE_TOTAL_CREDITS to create-and-set with a default value of 0, it breaks the existing use-case of retrieving the chip's allocation (which could be based on the port's ingress buffer pools and buffer profiles). A get on the attribute should return the user-configured values or the default (0) and not the actual allocation by the SDK.

We should let SAI_PORT_ATTR_CBFC_RECEIVER_NATIVE_TOTAL_CREDITS continue to be read-only and treat as the operating value. Additionally introduce a new create-and-set attribute say SAI_PORT_ATTR_CBFC_RECEIVER_NATIVE_TOTAL_CREDITS_OVERRIDE to override the default value.

Is something similar (say SAI_VIRTUAL_CHANNEL_ATTR_CBFC_RECEIVER_NATIVE_CREDIT_LIMIT_OVERRIDE) needed for SAI_VIRTUAL_CHANNEL_ATTR_CBFC_RECEIVER_NATIVE_CREDIT_LIMIT?

@rck-innovium rck-innovium left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We should let SAI_PORT_ATTR_CBFC_RECEIVER_NATIVE_TOTAL_CREDITS continue to be read-only and treat as the operating value. Additionally introduce a new create-and-set attribute say SAI_PORT_ATTR_CBFC_RECEIVER_NATIVE_TOTAL_CREDITS_OVERRIDE to override the default value.

@tjchadaga tjchadaga added the reviewed PR is discussed in SAI Meeting label Oct 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

reviewed PR is discussed in SAI Meeting

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants