-
Notifications
You must be signed in to change notification settings - Fork 475
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
Add packet trimming API #2077
base: master
Are you sure you want to change the base?
Add packet trimming API #2077
Conversation
* @flags CREATE_AND_SET | ||
* @default 0 | ||
*/ | ||
SAI_SWITCH_ATTR_PACKET_TRIMMING_DSCP_VALUE, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should DSCP and QUEUE_INDEX be on a more granular level like on every buffer profile or port?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It can be, but the initial proposal is to have a global setting, which is enough for now.
* @flags CREATE_AND_SET | ||
* @default 0 | ||
*/ | ||
SAI_SWITCH_ATTR_PACKET_TRIMMING_QUEUE_INDEX, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is expected behavior if TRIMMING_QUEUE experiences congestion ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Drop the packet
* @flags CREATE_AND_SET | ||
* @default 0 | ||
*/ | ||
SAI_SWITCH_ATTR_PACKET_TRIMMING_QUEUE_INDEX, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If SAI_SWITCH_ATTR_QOS_DSCP_TO_TC_MAP, SAI_SWITCH_ATTR_QOS_TC_AND_COLOR_TO_DSCP_MAP, SAI_SWITCH_ATTR_PACKET_TRIMMING_DSCP_VALUE and SAI_SWITCH_ATTR_PACKET_TRIMMING_QUEUE_INDEX are all configured and if there are any conflicts between these configuration, what is the expected behavior ?
Different ASICs might want to resolve this in different ways
Can you also add the spec you are referring for this trimming feature ? |
I'm not aware of any RFC or IEEE spec, but there are papers describing this feature, like this one. |
* @flags CREATE_AND_SET | ||
* @default 0 | ||
*/ | ||
SAI_SWITCH_ATTR_PACKET_TRIMMING_QUEUE_INDEX, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typically the domain will be configured with TRIM_DSCP value and its much better to derive to the queue from the DSCP. Current proposal dis-associates the TRIM_DSCP and queue index i.e. one can configure DSCP_TRIM that may be handled by a certain queue in hw and SAI may configure wrong queue index.
Would it better to use qos map profile configured for the switch. We can derive DSCP to Queue mapping based on it.
SAI_SWITCH_ATTR_QOS_DSCP_TO_TC_MAP
and
SAI_SWITCH_ATTR_QOS_DSCP_TO_TC_MAP
Instead of hardcoding the queue index.
doc/SAI-Proposal-Packet-Trimming.md
Outdated
│ │ │ │ │ │ │ │ │ │ │ │ │ ││ | ||
│ │ │ │ │ \ / │ │ │ │ │ │ │ │ ││ | ||
│ │ │ │ │ \ / │ │ │ │ │ │ │ │ ││ | ||
│ Packet │ │ Pipeilne ┼────┼───────\────────► │ │ │ │ │ │ │ ││ Queue |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/Pipeilne/Pipeline/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approving conditionally
- Update the workflow using the TC derived queue and dscp.
- Add TRIM packet/byte stats to queue and to port.
* @flags CREATE_AND_SET | ||
* @default 0 | ||
*/ | ||
SAI_SWITCH_ATTR_PACKET_TRIMMING_QUEUE_INDEX, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@marian-pritsak How does the NOS knows what queue index to program in this case? Capability query will not return a support queue index value. We should let HW decide what queue index it will support for TRIM and make this attribute as READ_ONLY.
Else please provide a workflow that how NOS is supposed to know the queue index
inc/saibuffer.h
Outdated
* Default action. Packet has nowhere to go | ||
* and will be dropped. | ||
*/ | ||
SAI_BUFFER_PROFILE_PACKET_ADMISSION_FAIL_ACTION_DROP = 0x00000000, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
since this is just enum you don't need to explicitly assign any values, you can remove them to make code more clean
* @flags CREATE_AND_SET | ||
* @default 128 | ||
*/ | ||
SAI_SWITCH_ATTR_PACKET_TRIMMING_SIZE, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comments are confusing. One can interpret them as that trimming can be done lesser then configured byte upto maximum size.
We should change it keep it consistent with sample truncation attribute comments
"@brief Truncate size. Truncate sampled packets to this size to reduce traffic bandwidth"
Something like "Trim packet to this size"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, should we add an attribute to specify a min size threshold for packets to qualify for trimming? As an example - a packet can only be trimmed if its size exceeds a min threshold Len1 and if trimmed, it will be trimmed to size Len2, where Len1 >= Len2.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, should we add an attribute to specify a min size threshold for packets to qualify for trimming? As an example - a packet can only be trimmed if its size exceeds a min threshold Len1 and if trimmed, it will be trimmed to size Len2, where Len1 >= Len2.
Ashutosh,
I am not sure about adding a min size. Truncation size is the min and max both. We use similar semantics for Sampling as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed description
* @flags CREATE_AND_SET | ||
* @default 128 | ||
*/ | ||
SAI_SWITCH_ATTR_PACKET_TRIMMING_SIZE, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, should we add an attribute to specify a min size threshold for packets to qualify for trimming? As an example - a packet can only be trimmed if its size exceeds a min threshold Len1 and if trimmed, it will be trimmed to size Len2, where Len1 >= Len2.
Ashutosh,
I am not sure about adding a min size. Truncation size is the min and max both. We use similar semantics for Sampling as well.
* @flags CREATE_AND_SET | ||
* @default 128 | ||
*/ | ||
SAI_SWITCH_ATTR_PACKET_TRIMMING_SIZE, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@marian-pritsak
We need to also clarify that trimming a packet MUST update the IP length and IP checksum.
L4 is not touched i.e. for eg UDP length and checksum is not updated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added this comment to the action description in saibuffer.h
@marian-pritsak - could you please resolve branch conflicts and meta checker issues? |
Hi Tejaswini,
There are comments in this PR that have not been resolved. They are
critical to be addressed.
Regards,
-Jai
…On Mon, Oct 7, 2024 at 3:35 PM Tejaswini Chadaga ***@***.***> wrote:
@marian-pritsak <https://github.com/marian-pritsak> - could you please
resolve branch conflicts and meta checker issues?
—
Reply to this email directly, view it on GitHub
<#2077 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AKCSHLIAY3AKUIRMBJW3CDLZ2MEEVAVCNFSM6AAAAABOO7NB32VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGOJYGA2DEOBSGA>
.
You are receiving this because you commented.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.
|
When a packet is lost, it can be recovered through fast retransmission (e.g., Go-Back-N in RoCE) or by using timeouts. Retransmission triggered by timeouts typically incurs significant latency. Packet trimming aims to facilitate rapid packet loss notification and, consequently, eliminate slow timeout-based retransmissions. | ||
|
||
To help the host recover data more quickly and accurately, we introduce a packet trimming feature, that upon a failed packet admission to a shared buffer, | ||
will trim a packet to a configured size, and try sending it on a different queue to deliver a packet drop notification to an end host. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What will the trimmed packet's headers look like? Will it be the same as the original packet with the exception of the length and DSCP information?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What will the trimmed packet's headers look like? Will it be the same as the original packet with the exception of the length and DSCP information?
Yes, TRIM packets are original packets, trimmed to the specified length and IP length updated
This is part of a UEC Spec and is not yet released. |
@marian-pritsak Can we change general nomenclature of the word TRIMMING. TRIMMING is a function but once the function is achieved, packet is TRIMMED. we can either change the attributes to SAI_SWITCH_ATTR_PACKET_TRIMMING_SIZE -> SAI_SWITCH_ATTR_PACKET_TRIMMING_TRUNCATION_SIZE SAI_SWITCH_ATTR_PACKET_TRIMMING_DSCP_VALUE -> SAI_SWITCH_ATTR_PACKET_TRIMMING_TRIMED_PACKET_DSCP_VALUE SAI_SWITCH_ATTR_PACKET_TRIMMING_QUEUE_INDEX -> What do you think? |
A more simpler option would be to remove the grammar from the names completely and simply use "TRIM". |
I like Tushar's idea to remove grammar entirely. What about you, @JaiOCP ? |
inc/saiswitch.h
Outdated
/** | ||
* @brief Is the new queue index for a trimmed packet mapped from DSCP | ||
* | ||
* @type sai_bool_t |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@marian-pritsak is this a valid type?
Looks like compilation fails with:
ERROR: invalid enum specified 'sai_bool_t' on SAI_SWITCH_ATTR_PACKET_TRIMMING_QUEUE_INDEX_MAPPED_FROM_DSCP
ERROR: sai_bool_t == SAI_SWITCH_ATTR_PACKET_TRIMMING_QUEUE_INDEX_MAPPED_FROM_DSCP not ending on enum name BOOL
Are we missing a declaration?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
type should be bool
inc/saiswitch.h
Outdated
@@ -3048,7 +3048,6 @@ typedef enum _sai_switch_attr_t | |||
*/ | |||
SAI_SWITCH_ATTR_MAX_ICMP_ECHO_SESSION, | |||
|
|||
/** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@marian-pritsak is this a typo?
9eb0885
to
b2cc9b7
Compare
When a packet is lost, it can be recovered through fast retransmission (e.g., Go-Back-N in RoCE) or by using timeouts. Retransmission triggered by timeouts typically incurs significant latency. Packet trimming aims to facilitate rapid packet loss notification and, consequently, eliminate slow timeout-based retransmissions. Signed-off-by: Marian Pritsak <marianp@mellanox.com>
b2cc9b7
to
363bf8f
Compare
When a packet is lost, it can be recovered through fast retransmission (e.g., Go-Back-N in RoCE) or by using timeouts. Retransmission triggered by timeouts typically incurs significant latency. Packet trimming aims to facilitate rapid packet loss notification and, consequently, eliminate slow timeout-based retransmissions.