-
Notifications
You must be signed in to change notification settings - Fork 78
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 text to support sending cloned packet to multicast group #665
Changes from 3 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -675,16 +675,17 @@ follow. | |
if (ostd.clone) { | ||
if (ostd.clone_session_id value is supported) { | ||
cos = class_of_service configured for ostd.clone_session_id in PRE | ||
ep = egress_port configured for ostd.clone_session_id in PRE | ||
egress_port = egress_port in the set of pairs of egress_port and instance configured for ostd.clone_session_id in PRE | ||
instance = instance in the set of pairs of egress_port and instance configured for ostd.clone_session_id in PRE | ||
trunc = truncate configured for ostd.clone_session in PRE | ||
plen = packet_length_bytes configured for ostd.clone_session in PRE | ||
if (cos value is not supported) { | ||
cos = 0; | ||
// Recommmended to log error about unsupported cos value. | ||
} | ||
if (platform_port_valid(ep)) { | ||
create a clone of the packet and send it to the packet | ||
buffer with the egress_port ep and | ||
create one or more clones of the packet and send it to the packet | ||
buffer with the egress_port, instance and | ||
class_of_service cos, after which it will start | ||
egress processing. It will contain at most the | ||
first plen bytes of the packet as received at the | ||
|
@@ -761,7 +762,7 @@ the number of distinct class of service values that a PSA device | |
supports. | ||
|
||
|
||
### Multicast replication | ||
### Multicast replication {#sec-multicast} | ||
|
||
The control plane may configure each `multicast_group` in the PRE to | ||
create the desired copies of packets sent to that group. Each group | ||
|
@@ -896,8 +897,9 @@ packet contents and metadata when a packet begins egress processing. | |
+--------------+-------------+---------------+--------------+-----+ | ||
| `packet_path` | Same value as received by EgressParser above. |||| | ||
+--------------+-------------+---------------+--------------+-----+ | ||
| `instance` | From PacketReplicationEngine configuration for NM packets. |||| | ||
| | 0 for all other kinds of packets. |||| | ||
| `instance` | 0 | from PRE | 0 for cloned packets that are not multicast replicated. || | ||
| | | configuration | from PRE configuration of multicast group || | ||
| | | of multicast group | for cloned packets that are multicast replicated || | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not sure I follow the text in the CI2E column. Maybe prepend a 'value from PRE configuration ...' |
||
+--------------+-------------+---------------+--------------+-----+ | ||
| `egress_timestamp` | Time that packet began processing in EgressParser. Filled in |||| | ||
| | independently for each copy of a multicast-replicated packet. |||| | ||
|
@@ -1018,9 +1020,9 @@ the contents of several metadata fields in the struct | |
if (ostd.clone) { | ||
if (ostd.clone_session_id value is supported) { | ||
cos = class_of_service configured for ostd.clone_session_id in PRE | ||
ep = egress_port configured for ostd.clone_session_id in PRE | ||
trunc = truncate configured for ostd.clone_session in PRE | ||
plen = packet_length_bytes configured for ostd.clone_session in PRE | ||
(egress_port, instance) = set of egress_port and instance pairs configured for ostd.clone_session_id in PRE | ||
trunc = truncate configured for ostd.clone_session_id in PRE | ||
plen = packet_length_bytes configured for ostd.clone_session_id in PRE | ||
if (cos value is not supported) { | ||
cos = 0; | ||
// Recommmended to log error about unsupported cos | ||
|
@@ -1149,17 +1151,25 @@ values that should be associated with packets cloned using that | |
session. | ||
|
||
``` | ||
PortId_t egress_port; | ||
/// Each clone session may configure one or more pairs of (egress_port, instance). | ||
PortId_t egress_port; /// egress_port in a pair of (egress_port, instance) | ||
EgressInstance_t instance; /// instance in a pair of (egress_port, instance) | ||
|
||
/// Each clone session may configure at most one of each following values. | ||
ClassOfService_t class_of_service; | ||
bool truncate; | ||
PacketLength_t packet_length_bytes; /// only used if truncate is true | ||
``` | ||
|
||
The `egress_port` may be any port that can be used for normal unicast | ||
packets, i.e. any normal port, `PSA_PORT_CPU`, or `PSA_PORT_RECIRCULATE`. For | ||
the latter two values, the cloned packet will be sent to the CPU, or | ||
recirculated at the end of egress processing, as a normal unicast | ||
packet would at the end of egress processing. | ||
packets, i.e. any normal port, `PSA_PORT_CPU`, or | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Have we not defined 'normal port' before? If not, maybe we should, and then we can use it throughout. |
||
`PSA_PORT_RECIRCULATE`. For the latter two values, the cloned packet | ||
will be sent to the CPU, or recirculated at the end of egress | ||
processing, as a normal unicast packet would at the end of egress | ||
processing. | ||
|
||
The `instance` is configured by the control plane in PRE to identify | ||
different copies of the multicasted packet. | ||
|
||
Truncation of cloned packets is supported as an optimization to | ||
reduce the bandwidth required to send the beginning of packets. This | ||
|
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 pseudo code, would it be too outside P4 to write:
(egress_port, instance) = egress_port and instance in the set of configured sessions for ostd.clone_session_id in PRE
?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.
hmm, just as you did in line 1023 :)