Skip to content

Asymmetric PFC High Level Design

Mykola F edited this page Feb 4, 2019 · 4 revisions

Asymmetric PFC in SONiC

High Level Design Document

Rev 0.1

Table of Contents

List of Tables

Revision
Rev Date Author Change Description
0.1 Volodymyr Samotiy Initial version

About this Manual

This document provides general information about the asymmetric PFC feature implementation in SONiC.

Scope

This document describes the high level design of the Assymetric PFC feature.

Definitions/Abbreviation

Table 2: Abbreviations
Definitions/Abbreviation Description
PFC Priority Flow Control
API Application Programmable Interface
SAI Switch Abstraction Interface

1 Subsystem Requirements Overview

1.1 Functional requirements

This section describes the SONiC requirements for asymmetric PFC feature.

  • Asymmetric PFC should be per-interface configuration parameter.
  • Asymmetric PFC should be disabled by default.
  • When asymmetric PFC is disabled, there is no change to standard PFC behavior.
  • When asymmetric PFC is enabled, there are following changes to standard PFC behavior:
    • The interface should handle incoming pause frames on all priorities, not just on lossless.
    • The interface should only generate pause frames on priorities that are configured to be lossless.

1.2 CLI requirements

  • User should be able to enable and disable asymmetric PFC mode on the interfaces.
  • User should be able to query configured on the interfaces asymmetric PFC mode.

2 Modules Design

2.1 Config DB

New "pfc_asym" attribute should be added to "PORT" table in order to store asymmetric PFC mode.

key                   = PORT            ; Port configuration
; field               = value
pfc_asym              = "on" / "off"    ; Asymmetric PFC mode
...

Example of "PORT" table output after adding new "pfc_asym" attribute:

127.0.0.1:6379[4]> HGETALL PORT|Ethernet0
1) "speed"
2) "100000"
3) "lanes"
4) "0,1,2,3"
5) "alias"
6) "Ethernet0"
7) "pfc_asym"
8) "on"

2.2 Orchestration Agent

2.2.1 PortsOrch

"PortsOrch" should be updated in order to handle new "pfc_asym" attribute. Also "PortsOrch" should provide public API to set PFC values according to configured asymmetric mode (it is needed by PFC_WD).

When "pfc_asym" attribute is set to "on", orchagent should do the following:

  • Set PFC mode attribute to the "SEPARATE" value:
     SAI_PORT_ATTR_PRIORITY_FLOW_CONTROL_MODE = SAI_PORT_PRIORITY_FLOW_CONTROL_MODE_SEPARATE
    
  • Get list of lossless priorities (on which PFC is enabled).
  • Set TX PFC attribute to the retrieved list of lossless priorities.
     SAI_PORT_ATTR_PRIORITY_FLOW_CONTROL_TX = <bit_vector>
    
  • Set RX PFC attribute to the list of all priorities.
     SAI_PORT_ATTR_PRIORITY_FLOW_CONTROL_RX = 0xFF
    

When "pfc_asym" attribute is set to "off", orchagent should do the following:

  • Set PFC mode attribute to the "COMBINED" value:
     SAI_PORT_ATTR_PRIORITY_FLOW_CONTROL_MODE = SAI_PORT_PRIORITY_FLOW_CONTROL_MODE_COMBINED
    
  • Get list of lossless priorities (on which PFC is enabled for TX).
  • Set PFC attribute to the retrieved list of priorities.
     SAI_PORT_ATTR_PRIORITY_FLOW_CONTROL = <bit_vector>
    

2.2.2 PfcwdOrch

"PfcwdOrch" should be updated in order to handle setting of PFC priorities according to the asymmetric mode, to do so it should use "PortsOrch" API for setting PFC values.

2.3 CLI

New "pfc" utility script should be implement in "sonic-utilities" in order to configure and display asymmetric pfc related information.

2.3.1 PFC utility help output

Usage: pfc [OPTIONS] COMMAND [ARGS]...

  Utility to operate with PFC configuration.

Options:
  --help  Show this message and exit.

Commands:
  config   Set PFC configuration.
  show     Show PFC information.

2.3.2 PFC utility config mode

2.3.2.1 Syntax

pfc config asymmetric <on|off> <interface_name>

2.3.2.2 Alias

Global "config" command should be extended in order to add "pfc" alias to the PFC utility.

# config interface pfc ?
Usage: config interface pfc [OPTIONS] COMMAND [ARGS]...

  PFC related configuration.

Options:
  --help  Show this message and exit.

Commands:
  asymmetric  Set asymmetric PFC configuration

2.3.3 PFC utility show mode

2.3.3.1 Syntax

pfc show asymmetric [<interface_name>]

2.3.3.2 Output example

# pfc show asymmetric

   Interface    Asymmetric
------------  ------------
  Ethernet0             on
  Ethernet4            off
  ...

2.3.3.3 General interface status CLI

The "show interface status" command is able to show the asymmetric pfc status for each port.

admin@sonic:~$ show interface status
  Interface            Lanes    Speed    MTU    Alias    Oper    Admin    Type    Asym PFC
-----------  ---------------  -------  -----  -------  ------  -------  ------  ----------
  Ethernet0          0,1,2,3      40G   9100     etp1      up       up   QSFP+          on
  Ethernet4          4,5,6,7      40G   9100     etp2      up       up   QSFP+         off
  Ethernet8        8,9,10,11      40G   9100     etp3      up       up   QSFP+         off
 Ethernet12      12,13,14,15      40G   9100     etp4      up       up   QSFP+         off

3 Flows

3.1 Asymmetric PFC

4 Open Questions

Clone this wiki locally