Skip to content

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
itamar-talmon authored Nov 15, 2022
2 parents ebe95bc + ecb7c74 commit a4d8c86
Show file tree
Hide file tree
Showing 16 changed files with 3,131 additions and 208 deletions.
Binary file modified assets/img/all_partners2_1920x1320.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions contact.html
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@ <h2>Contact</h2>
<div class="mu-contact-area">
<!-- start title -->
<div class="mu-title">
<p>Send questions, bugs, comments and ideas to sonicproject@googlegroups.com</p>
<p>Join the <a href="https://groups.google.com/forum/#!forum/sonicproject"><font color="#0000FF" size="3">mailing list</font></a> </p>
<p>Send questions, bugs, comments and ideas to sonic-dev@lists.sonicfoundation.dev</p>
<p>Join the <a href="https://lists.sonicfoundation.dev/g/sonic-dev"><font color="#0000FF" size="3">mailing list</font></a> </p>
<p>Join the <a href="https://sonicswitch.slack.com"><font color="#0000FF" size="3">Slack discussion group</font></a></p>
<p>Report issues <a href="https://github.com/sonic-net/SONiC/issues"><font color="#0000FF" size="3">here</font></a> and provide the following:</p>
<p> -show version output</p>
Expand Down
785 changes: 785 additions & 0 deletions doc/event-alarm-framework/events-producer.md

Large diffs are not rendered by default.

21 changes: 10 additions & 11 deletions doc/pins/Packet_io.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ There are 2 requirements on the transmit side,
1. Controller needs to be able to send packets out on any of the configured ports, this is generally called the directed transmit.


2. The controller also needs a capability to leverage the ASIC’s forwarding pipeline instead of self determining which port the packet should be sent out. So, a new transmit mode called the ‘submit_to_ingress’ (aka ‘send_to_ingress’) is needed to transmit packets on the ingress pipeline to let the ASIC’s forwarding pipeline select the egress port.
2. The controller also needs a capability to leverage the ASIC’s forwarding pipeline instead of self determining which port the packet should be sent out. So, a new transmit mode called the ‘send_to_ingress’ (aka ‘send_to_ingress’) is needed to transmit packets on the ingress pipeline to let the ASIC’s forwarding pipeline select the egress port.


## Architecture Design
Expand Down Expand Up @@ -140,30 +140,29 @@ The change required for P4Runtime integration is,

There is no major change involved in the directed transmit, P4Runtime will create sockets of the netdev ports during init and do a simple write on the appropriate socket to send packets out on a specific port.

For the “submit_to_ingress” path, the main change is the addition of a new netdev port that enables the injection of packets into the switch forwarding pipeline.
For the “send_to_ingress” path, the main change is the addition of a new netdev port that enables the injection of packets into the switch forwarding pipeline.

![drawing](images/submit_to_ing.png)
![drawing](images/send_to_ing.png)



The netdev port attributes are specified as below in the [copp_cfg.j2](https://github.com/Azure/sonic-buildimage-msft/blob/f6098c8c6d98ecc42e9a66711247aaf2c6fc4759/files/image_config/copp/copp_cfg.j2) file.

The netdev port attributes are specified as below in the config_db.json file or CONFIG DB.

```
"trap.group.send_to_ingress" : {
                    "submit_to_ingress_name" : "send_to_ingress"
},
"SEND_TO_INGRESS_PORT": {
"send_to_ingress": {}
}
```


[Copporch.cpp](https://github.com/sonic-net/sonic-swss/blob/fb06c32b2e25e6057514e9455e997ff7edcb7340/orchagent/copporch.cpp) will parse the above fields and add the netdev port attributes for the CPU port and invoke the SAI hostif create API to create the netdev port for the new submit_to_ingress interface.
PortsOrch.cpp will parse the above fields and add the netdev port attributes for the CPU port and invoke the SAI hostif create API to create the netdev port for the new send_to_ingress interface.

P4Runtime will create a socket for the “submit_to_ingress” netdev port and write into this socket for packets marked to send to “submit_to_ingress”. Packets egressing out of the socket end up as incoming packets on the CPU port of the switch. The packets now follow the regular switch pipeline to get forwarded out.
P4Runtime will create a socket for the “send_to_ingress” netdev port and write into this socket for packets marked to send to “send_to_ingress”. Packets egressing out of the socket end up as incoming packets on the CPU port of the switch. The packets now follow the regular switch pipeline to get forwarded out.


## Vendor work for Transmit path

Vendor work is needed to enable the creation of the “submit_to_ingress” port and allow packets in the CPU port. The additional vendor work needed are,
Vendor work is needed to enable the creation of the “send_to_ingress” port and allow packets in the CPU port. The additional vendor work needed are,



Expand Down
File renamed without changes
178 changes: 178 additions & 0 deletions doc/pins/send_to_ingress_hld.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,178 @@
# Send to Ingress HLD

## Table of Content

* [Table of Content](#table-of-content)
* [Revision](#revision)
* [Scope](#scope)
* [Definitions/Abbreviations](#definitions-abbreviations)
* [Overview](#overview)
+ [Direct transmit](#direct-transmit)
+ [Ingress pipeline inject](#ingress-pipeline-inject)
* [Requirements](#requirements)
* [Architecture Design](#architecture-design)
* [High-Level Design](#high-level-design)
+ [CONFIG DB schema](#config-db-schema)
+ [SWSS](#swss)
+ [Multi-Asic consideration](#multi-asic-consideration)
* [SAI API](#sai-api)
* [Configuration and management](#configuration-and-management)
+ [CLI/YANG model Enhancements](#cli-yang-model-enhancements)
+ [Config DB Enhancements](#config-db-enhancements)
* [Warmboot and Fastboot Design Impact](#warmboot-and-fastboot-design-impact)
* [Restrictions/Limitations](#restrictions-limitations)
* [Testing Requirements/Design](#testing-requirements-design)
+ [Unit Test cases](#unit-test-cases)
+ [System Test cases](#system-test-cases)
* [Open/Action items - if any](#open-action-items---if-any)

## Revision

Rev | Rev Date | Author(s) | Change Description
---- | ---------- | -----------------------| ------------------
v0.1 | 10/25/2022 | Yilan Ji, Stephen Wang | Initial version

## Scope

Send to ingress feature in GPINs is to support [Packet I/O](https://github.com/sonic-net/SONiC/blob/master/doc/pins/Packet_io.md) transmit path that injects packets into the dataplane by the CPU. This doc is to extend the availability of ingress inject packet I/O to all applications in Packet I/O Transmit Path design.

## Definitions/Abbreviations

**PINS**: P4 Integrated Network Stack (PINS) provides a remote interface to SAI using P4.

## Overview

Packet I/O transmit involves taking care of 2 types of packets that have to be transmitted: Direct transmit and Ingress pipeline inject.

### Direct transmit

If the sender(applications like LACP or P4RT) already know the egress port that the packet should be sent out on, it is done by placing the packet on the socket interface of the corresponding netdev interface.

### Ingress pipeline inject

In the SDN scenario, the controller has the complete view of the whole network and programs the switch ASIC with the optimized routing rules that the switch NOS is not aware of. Also in some other scenario, that the ASIC has a better understanding of the current bandwidth/queue depth of each port that it can choose a better egress port from the ECMP/WCMP group. The sender application on the switch would like to inject the packet to the ASIC’s ingress pipeline to allow the switch ASIC to make the final decision.

Injecting packets to the ingress pipeline can also be used as a way to test ASIC routing behavior in the standalone test environment.

## Requirements

* Provide configuration support of send to ingress in the port table.

## Architecture Design

![drawing](images/send_to_ing.png)

Details of the transmit path in GPINs Packet I/O can be found in this [HLD](https://github.com/sonic-net/SONiC/blob/master/doc/pins/Packet_io.md#transmit-path).

## High-Level Design

This HLD introduces a new “Send To Ingress” port type in the port table that SWSS will create a corresponding netdev/host interface. Any application can inject the packet to the ASIC’s ingress pipeline and let the ASIC decide which port to send packet out based on the routing table and current state of the network.

Note that the Send to Ingress host interface is only for packet out as it is only used in TX path, no packet ins are expected.

### CONFIG DB schema

Add knob in PORT table in CONFIG DB or config_db.json to enable send to ingress

```
"PORT": {
"Ethernet0": {
"admin_status": "up",
"alias": "NoAliasEth0/1",
"index": "1",
"lanes": "9,10,11,12,13,14,15,16",
"mtu": "9100",
"speed": "400000"
},
},
"SEND_TO_INGRESS_PORT": {
"SEND_TO_INGRESS": {}
},
```

### SWSS

1. PortsMgr will process `SEND_TO_INGRESS_PORT|SEND_TO_INGRESS` in config_db.json during initialization, or add the `SEND_TO_INGRESS_PORT|SEND_TO_INGRESS` entry in CONFIG DB during runtime. It will be mapped to APPL_DB `SEND_TO_INGRESS_PORT_TABLE:SEND_TO_INGRESS` table entry.
2. PortsOrch then picks up the entry in `SEND_TO_INGRESS_PORT_TABLE` in APPL DB and calls `sai_hostif_api->create_hostif` or `sai_hostif_api->delete_hostif` to add/delete the send_to_ingress netdev.

```
sai_attribute_t attr;
vector<sai_attribute_t> &ingress_attribs;
attr.id = SAI_HOSTIF_ATTR_TYPE;
attr.value.s32 = SAI_HOSTIF_TYPE_NETDEV;
ingress_attribs.push_back(attr);
attr.id = SAI_HOSTIF_ATTR_NAME;
auto size = sizeof(attr.value.chardata);
strncpy(attr.value.chardata, send_to_ingress_name.c_str(), size - 1);
attr.value.chardata[size - 1] = '\0';
ingress_attribs.push_back(attr);
// If this isn't passed in true, the false setting makes
// the device unready for later attempts to set UP/RUNNING
attr.id = SAI_HOSTIF_ATTR_OPER_STATUS;
attr.value.booldata = true;
ingress_attribs.push_back(attr);
// Get CPU port object id to signal send to ingress
attr.id = SAI_SWITCH_ATTR_CPU_PORT;
auto status = sai_switch_api->get_switch_attribute(gSwitchId, 1, &attr);
if (status != SAI_STATUS_SUCCESS)
{
SWSS_LOG_ERROR("Unable to get CPU port");
return false;
}
attr.id = SAI_HOSTIF_ATTR_OBJ_ID;
ingress_attribs.push_back(attr);
sai_status = sai_hostif_api->create_hostif(&m_send_to_ingress_id,
gSwitchId,
(uint32_t)ingress_attribs.size(),
ingress_attribs.data()
);
```

SEND_TO_INGRESS port adds a netdev, similar to the behavior for the physical ports in the PORT table in CONFIG DB. As the PORT table in CONFIG DB [only holds physical ports](https://github.com/sonic-net/sonic-swss/blob/master/doc/swss-schema.md#port_table-1), the new type of port introduced is added in the new `SEND_TO_INGRESS_PORT` table. Users can choose to enable the SEND_TO_INGRESS port or not by editing the entry in `SEND_TO_INGRESS_PORT` table.

Vendor work is needed to enable the creation of the “SEND_TO_INGRESS” port and allow packets in the CPU port. Current support of the creation of netdev type hostif is only for physical port, vlan or LAG interface, vendors need to extend the SAI hostif create API to allow creation of a netdev port associated with the CPU port.

### Multi-Asic consideration

Per [SONiC multi asic HLD](https://github.com/sonic-net/SONiC/blob/master/doc/multi_asic/SONiC_multi_asic_hld.md), each ASIC will have its own replica of SWSS/SYNCD and configuration. So each ASIC can create its own send to ingress port. Each netdev will be in their own namespace.

## SAI API

N/A

## Configuration and management

New configuration of send to ingress will be added in the port table as mentioned in the design.

### CLI/YANG model Enhancements

N/A

### Config DB Enhancements

N/A

## Warmboot and Fastboot Design Impact

N/A

## Restrictions/Limitations

N/A

## Testing Requirements/Design


### Unit Test cases

PortsMgr and PortsOrch behaviors will be tested in swss portsorch_ut and pytest.

### System Test cases

System Packet I/O behaviors will be tested in Thinkit end-to-end testing.

## Open/Action items - if any

N/A
Loading

0 comments on commit a4d8c86

Please sign in to comment.