Giter Club home page Giter Club logo

sai's Introduction

SAI Build Status

master build

SAI (Switch Abstraction Interface)

The Switch Abstraction Interface defines the API to provide a vendor-independent way of controlling forwarding elements, such as a switching ASIC, an NPU or a software switch in a uniform manner.

sai's People

Contributors

allen-xf avatar arunsubash avatar ashokdaparthi avatar bandaru-viswanath avatar chitra-raghavan avatar gfrom2016 avatar itaibaz avatar jaiocp avatar kannankvs avatar karthik-krishnamurthy avatar kcudnik avatar lguohan avatar marian-pritsak avatar mattyk avatar mellanox-zhichenr avatar mholankar avatar mikeberesford avatar phshaikh avatar pkochmanska avatar prsunny avatar r12f avatar rajasekhar-pulluru avatar ramangupta avatar richardyu-ms avatar rlhui avatar sathishkumartr-dell avatar tushar-ty avatar vkochan-mlnx avatar wendani avatar zhoudongxu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

sai's Issues

Buffer profile issue

/** dynamic threshold for the shared usage [sai_int8_t]
 * The threshold is set to the 2^n of available buffer of the pool.
 * Mandatory when SAI_BUFFER_POOL_TH_MODE = SAI_BUFFER_THRESHOLD_MODE_DYNAMIC
 * (CREATE_AND_SET). */
SAI_BUFFER_PROFILE_ATTR_SHARED_DYNAMIC_TH, 

/** static threshold for the shared usage in bytes [sai_uint32_t]
 * Mandatory when SAI_BUFFER_POOL_TH_MODE = SAI_BUFFER_THRESHOLD_MODE_STATIC
 * When set to zero there is no limit for the shared usage.
 * (CREATE_AND_SET) */
SAI_BUFFER_PROFILE_ATTR_SHARED_STATIC_TH,

Those attributes are conditional and they depend on buffer pool attribute setting not on buffer profile setting, and pool id can be changed dynamicly event to NULL, so it causes problem what those values should be then

Function sai_get_tam_histogram_stats_fn has incorrect signature

Signature is:

typedef sai_status_t (*sai_get_tam_histogram_stats_fn)(
        _In_ sai_object_id_t tam_histogram_id,
        _Inout_ uint32_t *number_of_counters,
        _Out_ uint64_t *counters);

but should be:

typedef sai_status_t (*sai_get_tam_histogram_stats_fn)(
        _In_ sai_object_id_t tam_histogram_id,
        _In_ uint32_t number_of_counters,
        _In_ const sai_tam_microburst_stat_t *counter_ids,
        _Out_ uint64_t *counters);

or should there be another method "sai_get_tam_microburst_stats_fn" ?
please verify @VitalyVovnoboy

sai_ut tests not working

sai_ut tests don't work with latest SAI implementations. These should be updated or deprecated.

Thanks,
John

build error with SAI/test

Hi,
I got lots of build errors with SAI/tests, many errors complaints the data structure does not exsit in the head files, or the data members does not exist some datatype.
error.txt

L3MultipleEcmpLagTest

  • Create virtual router
  • Reserve port[0] for sending packet. Create a router interface for port[0]
  • Test following ECMP and LAG combination:
    • ((n-1)x1 + 1xm), where m = [2, ..., k+1-n], and n is from [2, ...,15]
      where n is the number of members in the ecmp group, and k is the total number of ports, e.g, 16 ports.
  • For each combination, using follow steps to test
    • create n-1 router interfaces on each of the (n-1) ports
    • create 1 LAG where the LAG contains m ports, create 1 router interface on top of the LAG
    • create 1 ecmp group that contains n router interfaces
    • send traffic from port[0] to the ecmp group and verify the traffic is balanced among the n router interface, then verify the traffic is balanced among m ports in the LAG

Updates to basic_router.cpp

I have an update for basic_router.cpp to work with the new SAI APIs for VLANs.
How can I send the changes?

About warmboot

It is written in the document that this doc deals with restart and upgrade without impacting data plane. So the switching CHIP will not be reset, while NPU SDK might get re-initialized??

Queue attribute need to be moved to Queue Stats

As per SAI 1.2 Queue header we have an attribute that indicates HW state.
See the code below.

   /**
     * @brief Queue pause status
     *
     * This attribute represents the queue internal hardware state and is
     * updated upon receiving PFC frames. True indicates the queue is paused.
     *
     * @type bool
     * @flags READ_ONLY
     */
SAI_QUEUE_ATTR_PAUSE_STATUS = 0x00000007,

Why this attribute is placed on a Queue, but not on QueueStats? It`s a non-SAI controlled attribute.

sai_hostif_vlan_tag_t:SAI_HOSTIF_VLAN_TAG_ORIGINAL Description and behavior are a bit confusing.

* When the host interface is VLAN, the packet delivered to host interface will not have tag.

Why is an exception required for vlan intf ?

Maybe the description should say that this only applies to port and lag based interfaces and the behavior for vlan intf is always 'strip tag' unless specified otherwise via 'keep tag'.
The following statements appear very contradictory:

 * @brief Keep the packet same as the incoming packet
 *
 * The packet delivered to host interface is the same as the original packet.

vs

  • When the host interface is VLAN, the packet delivered to host interface will not have tag.

How to check the version of SAI from code?

Hi,

I want to check what SAI version I used from code, but I find that there's no way to do it.

I am using SAI v1.2.4, which is tag with commit id 949cec8a15e926239e78c92a8e57c49c9f0e3874. I think SAI/debian/changelog should be the file I want. However, changelog file haven't been modified with the latest SAI version.

So I think this is a bug, and wish it would be fixed.

Regards,
sunnogo

Port Creation behavior from 0.9.4 -> 1.0

Hi All,

We have encountered different expectations in the port creation logic post-0.9.4 and wanted to get this clarified so we all users of SAI has the same expectations since doxygen comments are vague on this. In 0.9.4, sai_create_port_fn didn't exist, so folks expected all ports to be created. 0.9.6 and onward, the API exists and views on initial behavior start to differ.

Here are the two different views:

  1. Since we have sai_create_port_fn in 0.9.6 onward, we should follow the CRUD methodology. So sai_initialize_switch_fn will NOT create the ports. Need to call sai_create_port_fn to create the ports after init.
  2. Follow 0.9.4 convention, sai_initialize_switch_fn will create all the ports in default mode (like 128x10G or 32x100G). Only use sai_create/remove_port_fn to change to breakout mode or change port speeds

If we can agree on the proper way moving forward, we can avoid trying to support multiple customer specific expectations.

CC @lguohan / @zubinshah / @atitjain

STUB fails to compile

I'm trying to compile the STUB following the README instructions and it fails with multiple errors.

The instructions don't mention any specific version of GCC; I'm using 4.9.2. I've tried otrer versions with same results.

Please see: make.log.txt

This is for master; tried other banches (e.g. v1.0) with similar results.

IPv6 PTF Tests

This issue will have discussions about the IPv6 PTF tests that are needed for SAI.

Scheduler group parent node as port

In the commit:
e819bc4|| Add check for mixed object types on object id lists (#364)

it was added SAI_OBJECT_TYPE_PORT into @objects section for the SAI_SCHEDULER_GROUP_ATTR_PARENT_NODE attribute,
but there already exists SAI_SCHEDULER_GROUP_ATTR_PORT_ID attribute which can be used in case if the parent node is not specified,
is there any other reason to specify a port twice in parent node & port attributes ?

add L2 unknown unicast drop test

In the Flood test in sail2.py
after the flooding and the verifying checks,
Need to set SWITCH_ATTR_FDB_UNICAST_MISS_ACTION to SAI_PACKET_ACTION_DROP
And send the packets again and see that the packets are been drop.

SAI_HOSTIF_TRAP_ATTR_PORT_LIST needs more explanation

/** enable trap for a list of SAI ports [sai_object_list_t]
 * (default to all SAI ports) */
SAI_HOSTIF_TRAP_ATTR_PORT_LIST,

what objects can be provided to that list ? only SAI_OBJECT_TYPE_PORT ?
what happens if we create/remove/create port and this attribute is not set?

Also if we set empty list here does empty list will mean "to all ports" ?
if not, then after set, user will need to keep updating this every time port changes

Switch contains attributes with invalid ranges

Ex. attribute SAI_SWITCH_ATTR_PFC_TC_DLD_INTERVAL has type sai_map_list_t, which has key as uint32_t and value as int32_t, but SAI_SWITCH_ATTR_PFC_TC_DLD_INTERVAL_RANGE declares only uint32_t for min and max fields.

Need to fix value field type to uint32_t.

Also there is no metrics for the timer. Please provide exact time units (us or ms or s)

the maximum member number can be added to a acl table group

Before a acl table group is bound to a binding point, how many group members can be added to this group? Are the number of group member in a group depended on the asic implementation?For example, there are 12 tcam blocks in Broadcom chip, so the maximum group member number in a acl group is 12 or less? Thank you very much.

SAI_QOS_MAP_ATTR_MAP_TO_VALUE_LIST needs more information

/** Dot1p to TC Mapping [sai_qos_map_list_t],
 *
 * Defaults:
 *   All Dot1p/DSCP maps to traffic class 0
 *   All Dot1p/DSCP maps to color SAI_PACKET_COLOR_GREEN
 *   All traffic class maps to queue 0.
 */
 SAI_QOS_MAP_ATTR_MAP_TO_VALUE_LIST = 0x00000001,

What those defaults mean? is there a default list with qos maps assigned when we create new qosmap ?
how many entries are on that list ? should this parameter be MANDATORY_ON_CREATE|CREATE_ONLY ?

SAI L3 Intf 0 MTU size

Hi,

Current SAI, e.g.: v3.1.3.4, L3 Intf 0 is with fixed size 1514, and ASIC is only able to forward L3 routing packets up to 1532 bytes (1514 + 14 bytes L2 header + 4 bytes FCS). Need fix to make it maximum value or configurable from SONiC.

root@SONiC-Inventec-d7032-100:/home/admin# bcmcmd "l3 intf show"
l3 intf show
Free L3INTF entries: 8188
Unit Intf VRF Group VLAN Source Mac MTU TTL Tunnel InnerVlan NATRealm

0 0 0 0 1 00:8c:fa:c7:b4:38 1514 0 0 0 0 <---- L3 Intf 0 interface
0 1 0 0 4094 00:8c:fa:c7:b4:38 9100 0 0 0 0
0 2 0 0 4093 00:8c:fa:c7:b4:38 9100 0 0 0 0

drivshell>
root@SONiC-Inventec-d7032-100:/home/admin#

Thanks!

Wilson

Metadata for ACL USER_DEFINED_FIELD group of attributes

@kcudnik can you please consider adding a metadata for the following attributes:
SAI_ACL_TABLE_ATTR_USER_DEFINED_FIELD_GROUP_MIN
SAI_ACL_TABLE_ATTR_USER_DEFINED_FIELD_GROUP_MAX
SAI_ACL_ENTRY_ATTR_USER_DEFINED_FIELD_MIN
SAI_ACL_ENTRY_ATTR_USER_DEFINED_FIELD_MAX

Thanks

CPU port

Is cpu port treated as SAI_OBJECT_TYPE_PORT and can be assigned in every place where PORT can be assigned ? Like in LAG or TUNNEL? if not, then we need separate type for it like SAI_OBJECT_TYPE_CPU_PORT

Setting actual count for overflow in the called routine.

Is the following mechanism accurate ?
"the callee will set the count"
i.e will it work while the address of the count is not passed to the called routine..

Maybe an example showing the working mechanism would help.

/**

  • @brief Defines a list of SAI object ids used as SAI attribute value.
  • In set attribute function call, the count member defines the number of
  • objects.
  • In get attribute function call, the function call returns a list of objects
  • to the caller in the list member. The caller is responsible for allocating the
  • buffer for the list member and set the count member to the size of allocated object
  • list. If the size is large enough to accommodate the list of object id, the
  • callee will then fill the list member and set the count member to the actual
  • number of objects. If the list size is not large enough, the callee will set the
  • count member to the actual number of object id and return
  • #SAI_STATUS_BUFFER_OVERFLOW. Once the caller gets such return code, it should
  • use the returned count member to re-allocate list and retry.
    */
    typedef struct _sai_object_list_t {
    uint32_t count;
    sai_object_id_t *list;
    } sai_object_list_t;

With p4c from today (11/29/2018) flexsai fails to build

I used the steps to build from https://github.com/opencomputeproject/SAI/tree/master/flexsai/p4/README.md.

The p4c used is from today. I see the following error on invoking 'make -j3' in p4c/build/

/home/hemant/bak/p4c/extensions/sai/json_stage/sai.cpp: In function ‘int main_wrapper(int, char* const*)’:
/home/hemant/bak/p4c/extensions/sai/json_stage/sai.cpp:128:18: error: ‘Py_DecodeLocale’ was not declared in this scope
py_argv[0] = Py_DecodeLocale("P4_compiler.py", NULL);
^~~~~~~~~~~~~~~
/home/hemant/bak/p4c/extensions/sai/json_stage/sai.cpp:128:18: note: suggested alternative: ‘PyEval_GetLocals’
py_argv[0] = Py_DecodeLocale("P4_compiler.py", NULL);
^~~~~~~~~~~~~~~
PyEval_GetLocals
/home/hemant/bak/p4c/extensions/sai/json_stage/sai.cpp:141:35: error: cannot convert ‘wchar_t**’ to ‘char**’ for argument ‘2’ to ‘void PySys_SetArgv(int, char**)’
PySys_SetArgv(py_argc, py_argv);
^
extensions/sai/CMakeFiles/p4c-sai.dir/build.make:62: recipe for target 'extensions/sai/CMakeFiles/p4c-sai.dir/json_stage/sai.cpp.o' failed
make[2]: *** [extensions/sai/CMakeFiles/p4c-sai.dir/json_stage/sai.cpp.o] Error 1
CMakeFiles/Makefile2:734: recipe for target 'extensions/sai/CMakeFiles/p4c-sai.dir/all' failed
make[1]: *** [extensions/sai/CMakeFiles/p4c-sai.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[ 98%] Linking CXX executable gtestp4c
[ 98%] Built target gtestp4c
Makefile:140: recipe for target 'all' failed
make: *** [all] Error 2
hemant@ubuntu:~/bak/p4c/build$

SAI_SWITCH_ATTR_INIT_SWITCH purpose explanation

Is this attriute needed ? Can it be explained more? Current description is not precise and it suggest that create_switch() need to be called twice to create single switch, please provide extensive explanation for this flag

QoS Map reset the previous state

Hi,

Just faced with an QoS Map implementation artifacts.

Once we apply QoS Map with the several items, is that expected to reset the previous mapping for the rest available items in Switch before SET operation?

Example:

Create QoS Map 1, Dot1P (PCP or Vlan priority) -> TC [0->1, 1->2]
Create QoS Map 2, Dot1P (PCP or Vlan priority) -> TC [2->3, 3->4]
Apply QoS Map 1 on the Port 1.
Apply QoS Map 2 on the Port 1.

Which mapping is now saved on the Port 1???

[0->1, 1->2, 2->3, 3->4, 4->0, 5->0, 6->0, 7->0]
OR
[0->0, 1->0, 2->3, 3->4, 4->0, 5->0, 6->0, 7->0]

Thanks

SAI_ACL_TABLE_ATTR_GROUP_ID is object id but no api to create it

SAI_ACL_TABLE_ATTR_GROUP_ID is object id but there is no API that user can call
to create acl table group_id. What is usecase of acl group then? are acl groups created on switch?

It will be tricky to track this object usage since user is not explicitly creating this object.
If user create acl table, and get this group id, then pass it when creating other acl table, and remove first table, group id will still be in force on second table. It would be better if user could explicitly create acl table group and assign when creating acl table explicitly as mandatory on create.

Add output of test case to flexsai/p4

It is expected that flexsai/p4 code will change, even if it's minor tweaks. Folks changing the code and working with flexsai/p4 for the first time, have no way of verifying if their code changes pass unit testing. It would be good to add the log of one test run to the repo, using example.p4, so that folks can see what is output in the sai_p4_compiler/output/example directory.

Later, a formal test case should be added. Many such test cases exist for p4c.

1.0 ACL spec bind point type assignments clarification.

In the following documentation/example:


Example 3 - Create an ACL group

This example creates and ACL group with more than one ACL table and bind it to a port, the very same way an ACL table was bound to a port in Example 1.

// CREATE AN INGRESS ACL TABLE GROUP
sai_object_id_t acl_grp_id1 = 0ULL;
acl_grp_attr[0].id = SAI_ACL_TABLE_GROUP_ATTR_ACL_STAGE;
acl_grp_attr[0].value.s32 = SAI_ACL_STAGE_INGRESS;

acl_grp_attr[1].id = SAI_ACL_TABLE_GROUP_ATTR_ACL_BIND_POINT_TYPE_LIST;
acl_grp_attr[1].value.objlist.count = 1;
acl_grp_attr[1].value.objlist.list[0] = SAI_ACL_BIND_POINT_TYPE_PORT;

acl_grp_attr[2].id = SAI_ACL_TABLE_GROUP_ATTR_TYPE;
acl_grp_attr[2].value.s32 = SAI_ACL_TABLE_GROUP_SEQUENTIAL;

saistatus = sai_acl_api->create_acl_table_group(&acl_grp_id1, 2, acl_grp_attr);
if (saistatus != SAI_STATUS_SUCCESS) {
return saistatus;
}

// Create an ACL table acl_table_id3 , to be part of this group acl_grp_id1
sai_object_id_t acl_table_id3 = 0ULL;
acl_attr_list[0].id = SAI_ACL_TABLE_ATTR_ACL_STAGE;
acl_attr_list[0].value.s32 = SAI_ACL_STAGE_INGRESS;

acl_attr_list[1].id = SAI_ACL_TABLE_GROUP_ATTR_ACL_BIND_POINT_TYPE_LIST;
acl_attr_list[1].value.objlist.count = 1;
acl_attr_list[1].value.objlist.list[0] = SAI_ACL_BIND_POINT_TYPE_PORT;

acl_attr_list[2].id = SAI_ACL_TABLE_ATTR_FIELD_SRC_MAC;
acl_attr_list[2].value.booldata = True;

saistatus = sai_acl_api->create_acl_table(&acl_table_id3, 4, acl_attr_list);
if (saistatus != SAI_STATUS_SUCCESS) {
return saistatus;
}

Is one of these bind point type assignments redundant OR a requirement:

acl_grp_attr[1].value.objlist.list[0] = SAI_ACL_BIND_POINT_TYPE_PORT;
and
acl_attr_list[1].value.objlist.list[0] = SAI_ACL_BIND_POINT_TYPE_PORT;

Pls clarify or update in the doc.

SAI_SWITCH_ATTR_COUNTER_REFRESH_INTERVAL

Since description of this attribute suggest that there can be provided invalid value and error may be returned, there should be an attribute that will get valid ranges for this attribute

ACL UDF attributes

Hi,

I want to discuss ACL UDF attributes

Let's consider an example.
We want to match an IPv4 packet with header length 20 bytes

It requires the following steps:

  1. Creating UDF Group (which needs a UDF and UDF Match)
  2. Specifying the UDF Group.
  3. Specifying the actual data to match. Which is {value: 0x05, mask: 0x0F}

The issue is that current ACL attributes (SAI_ACL_TABLE_ATTR_USER_DEFINED_FIELD_GROUP, SAI_ACL_ENTRY_ATTR_USER_DEFINED_FIELD_GROUP) don't support that.
Currently, we can only specify the UDF Group object for ACL Entry, which only gives the information about base, length and offset.
There is no way to pass the value and mask.

I want to propose the changes for ACL UDF attributes:

   /**
     * @brief User Defined Field Groups
     *
     * @type sai_object_id_t
     * @flags CREATE_ONLY
     * @objects SAI_OBJECT_TYPE_UDF_GROUP
     * @allownull true
     * @default SAI_NULL_OBJECT_ID
     * @range SAI_ACL_USER_DEFINED_FIELD_ATTR_ID_RANGE
     */
    SAI_ACL_TABLE_ATTR_USER_DEFINED_FIELD_GROUP_MIN,
	
  /**
     * @brief User Defined Field data for the UDF Groups in ACL Table
     *
     * @type sai_acl_field_data_t sai_u8_list_t
     * @flags CREATE_AND_SET
     * @default disabled
     * @range SAI_ACL_USER_DEFINED_FIELD_ATTR_ID_RANGE
     */
    SAI_ACL_ENTRY_ATTR_USER_DEFINED_FIELD_GROUP_MIN,

In this case, the code would look like this:

/* UDF Match for IPv4 packet
udf_match_attrs[0].id = SAI_UDF_MATCH_ATTR_L2_TYPE;
udf_match_attrs[0].value.aclfield.enable = true;
udf_match_attrs[0].value.aclfield.data.u16 = 0x0800;
udf_match_attrs[0].value.aclfield.mask.u16 = 0xFFFF;
udf_api->create_udf_match(&udf_match_id, switch_id, 1, udf_match_attrs);

/* UDF Group with lenght 1 */
udf_group_attrs[0].id = SAI_UDF_GROUP_ATTR_TYPE;
udf_group_attrs[0].value.s32 = SAI_UDF_GROUP_TYPE_GENERIC;
udf_group_attrs[1].id = SAI_UDF_GROUP_ATTR_LENGTH;
udf_group_attrs[1].value.s32 = 1;
udf_api->create_udf_group(&udf_group_id, switch_id, 2, udf_group_attrs);

/* UDF with offest 0 */
udf_attrs[0].id = SAI_UDF_ATTR_MATCH_ID;
udf_attrs[0].value.oid = udf_match_id;
udf_attrs[1].id = SAI_UDF_ATTR_GROUP_ID;
udf_attrs[1].value.oid = udf_group_id;
udf_attrs[2].id = SAI_UDF_ATTR_BASE;
udf_attrs[2].value.s32 = SAI_UDF_BASE_L3;
udf_attrs[3].id = SAI_UDF_ATTR_OFFSET;
udf_attrs[3].value.u16 = 0;
udf_api->create_udf(&udf_id, switch_id, 4, udf_attrs));

/* ACL Table */
acl_attrs[0].id = SAI_ACL_TABLE_ATTR_ACL_STAGE;
acl_attrs[0].value.s32 = SAI_ACL_STAGE_INGRESS;
acl_attrs[1].id = SAI_ACL_TABLE_ATTR_USER_DEFINED_FIELD_GROUP_MIN;
acl_attrs[1].value.oid = udf_group_id;
acl_api->create_acl_table(&acl_table_id, switch_id, 2, acl_attrs);

/* ACL Entry */
acl_attrs[0].id = SAI_ACL_ENTRY_ATTR_TABLE_ID;
acl_attrs[0].value.oid = acl_table_id;
acl_attrs[1].id = SAI_ACL_ENTRY_ATTR_PRIORITY;
acl_attrs[1].value.u32 = 1;
acl_attrs[2].id = SAI_ACL_ENTRY_ATTR_ADMIN_STATE;
acl_attrs[2].value.booldata = true;
acl_attrs[3].id = SAI_ACL_ENTRY_ATTR_USER_DEFINED_FIELD_MIN;
acl_attrs[3].value.aclfield.enable = true;
udf_val[0] = 0x05;
udf_mask[0] = 0x0F;
acl_attrs[3].value.aclfield.data.u8list.count = 1;
acl_attrs[3].value.aclfield.data.u8list.list = udf_val;
acl_attrs[3].value.aclfield.mask.u8list.count = 1;
acl_attrs[3].value.aclfield.mask.u8list.list = udf_mask;
acl_api->create_acl_entry(&acl_entry_id, get_switch_id(), 4, acl_attrs));

Thanks

Complete feature list of SAI

Which document provides the complete list of features of SAI?

I am trying to compare multiple devices based on their features.

Questions about QOS TC and COLOR mapping

I have two questions about the QOS TC/Color mapping design

  1. Why separate DSCP to TC and COLOR to two different tables (SAI_QOS_MAP_DSCP_TO_TC and SAI_QOS_MAP_DSCP_TO_COLOR) ?
    It seems asymmetric to SAI_QOS_MAP_TC_AND_COLOR_TO_DSCP.
    For ASIC which treats it as one map, there is additional effort to mange the relationship between SAI qosmaps and SDK qos profile. Same issue also happened to DOT1P ->TC and Color.
  2. Why isn't there DEI to COLOR map?
    DEI indicates the drop eligible of packets.
    Using DEL to Color is more precise than DOT1P to Color.

Mix advertised & attr FEC mode?

Hi All,

There has been two different interpretations of the use of below port attributes and we wanted to query the group to see what is the "expected" behavior:
SAI_PORT_ATTR_ADVERTISED_FEC_MODE
SAI_PORT_ATTR_FEC_MODE

Interpretation #1:
They are mutually exclusive and cannot be combined in the same call. SAI_PORT_ATTR_ADVERTISED_FEC_MODE is for AN and SAI_PORT_ATTR_FEC_MODE is for fixed mode. Combining both doesn't make sense since fixed mode & AN are two separate modes. Especially in the 25G/50G scenario where you could have multiple FEC modes:

SAI_PORT_ATTR_ADVERTISED_FEC_MODE == SAI_PORT_FEC_MODE_RS && SAI_PORT_FEC_MODE_FC
SAI_PORT_ATTR_FEC_MODE == SAI_PORT_FEC_MODE_RS

What would above example result in?

Interpretation #2:
Always set both of them at the same time for AN. SAI_PORT_ATTR_FEC_MODE is the priority for FEC AN since there is no obvious "priority" between FC & RS-FEC. So in above example, we would AN RS/FC but RS-FEC wins if both RS & FC get negotiated.
If only SAI_PORT_ATTR_FEC_MODE is set alone, it is fixed mode.

Long story short, if one passes multiple attributes, does SAI expect to process them one by one in order; or does it have to do a summation of them (via some pre-processing) and do non-conflicting actions that is not exactly any of attributes individually.

So in interpretation #2

  1. SAI_PORT_ATTR_FEC_MODE by itself would mean to hardcode the FEC.
  2. SAI_PORT_ATTR_FEC_MODE && SAI_PORT_ATTR_ADVERTISED_FEC_MODE, SAI_PORT_ATTR_FEC_MODE means it is FEC priority for SAI_PORT_ATTR_ADVERTISED_FEC_MODE.

ATTR_PORT_ID in fdb entry MANDATORY_ON_CREATE?

In saifdb.h, SAI_FDB_ENTRY_ATTR_PORT_ID refers to the dest port/LAG/l2tunnel of the fdb entry, which is marked as MANDATORY_ON_CREATE. If I'm creating a fdb entry with packet action DROP,do I still have to set the SAI_FDB_ENTRY_ATTR_PORT_ID attribute??

saiport.h has controversial api for set/get attribute(s)

Current implementation of set and get functions are different. Set works only with one attribute, but get can parse list of attributes.
See code below(saiport.h):
get

typedef sai_status_t (*sai_get_port_attribute_fn)(
        _In_ sai_object_id_t port_id,
        _In_ uint32_t attr_count,
_Inout_ sai_attribute_t *attr_list);

set

typedef sai_status_t (*sai_set_port_attribute_fn)(
        _In_ sai_object_id_t port_id,
_In_ const sai_attribute_t *attr);

Solution: need to change set function in sync with get function

Convert acl capability to switch attributes

Currently for different acl stage GET api will return different values which is not unified with other "GET" apis of sai objects, please convert acl capability for each stage to readonly attribute of switch, still it will be possible to add new stages in the future as new switch attributes

SAI_TUNNEL_ATTR_ENCAP_GRE_KEY_VALID should be removed

/** tunnel GRE key valid bool (default = false)
* (valid only when SAI_TUNNEL_ATTR_TYPE = SAI_TUNNEL_IPINIP_GRE) */
SAI_TUNNEL_ATTR_ENCAP_GRE_KEY_VALID,

/** tunnel GRE key [sai_uint32_t](MANDATORY_ON_CREATE when
* SAI_TUNNEL_ATTR_ENCAP_GRE_KEY_VALID=true) (CREATE_ONLY) */
SAI_TUNNEL_ATTR_ENCAP_GRE_KEY,

SAI_TUNNEL_ATTR_ENCAP_GRE_KEY should be mandatory on create when SAI_TUNNEL_ATTR_TYPE = SAI_TUNNEL_IPINIP_GRE, there is no need for extra *_VALID attribute

SAI_HOSTIF_TRAP_ATTR_FD missing object type

/** file descriptor [sai_object_id_t]
* Valid only when SAI_HOSTIF_TRAP_ATTR_TRAP_CHANNEL == SAI_HOSTIF_TRAP_CHANNEL_FD
* Must be set before set SAI_HOSTIF_TRAP_ATTR_TRAP_CHANNEL to SAI_HOSTIF_TRAP_CHANNEL_FD
* (default to SAI_NULL_OBJECT_ID) */
SAI_HOSTIF_TRAP_ATTR_FD,

Transporter

Hi,

Could you please give me an idea what the transporter object is used for in the saitam.h file?

Bind list attrib type change for disable flow.

For the following bind unbind mechanism (same for port, router intf, etc):


/**
* @brief LAG bind point for ingress ACL object
*
* Bind (or unbind) an ingress acl table or acl group on a LAG. Enable/Update
* ingress ACL table or ACL group filtering by assigning the list of valid
* object id. Disable ingress filtering by assigning SAI_NULL_OBJECT_ID
* in the attribute value.
*
* @type sai_object_list_t
* @objects SAI_OBJECT_TYPE_ACL_TABLE, SAI_OBJECT_TYPE_ACL_TABLE_GROUP
* @flags CREATE_AND_SET
* @allownull true
* @default SAI_NULL_OBJECT_ID
*/
SAI_LAG_ATTR_INGRESS_ACL,

Could we define a slightly different attrib type which contains a bool 'enable/disable' field along with count and object items. Otherwise we are imposing complication in the SAI adapter implementation for the disable sequence by only passing the NULL object and then in the implementation we need to maintain some kind of association of what all ACLs bind this lag/port/intf etc. and then we need to traverse, search update all effected entries. The application would anyways have this association info as it passed the object list while binding, so it can pass the same list again and mention 'disable/unbind', thereby simplifying the adapter implementation ?

We just need a new attrib type:

typedef struct _sai_acl_bind_list_t {
booldata enable; /* TRUE/FALSE */
sai_object_id_t *list;
uint32_t count;
} sai_acl_bind_list_t;

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.