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

add text to support sending cloned packet to multicast group #665

Merged
merged 4 commits into from
Oct 24, 2018
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 24 additions & 14 deletions p4-16/psa/PSA.mdk
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link
Contributor

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?

Copy link
Contributor

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 :)

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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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 ||
Copy link
Contributor

Choose a reason for hiding this comment

The 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. ||||
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Copy link
Contributor

Choose a reason for hiding this comment

The 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
Expand Down