Skip to content

Commit

Permalink
Change BINCODE to META - PR change request
Browse files Browse the repository at this point in the history
  • Loading branch information
nadershinouda committed Aug 7, 2024
1 parent bdf9e01 commit e5ae1ee
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 48 deletions.
38 changes: 19 additions & 19 deletions doc/ACL/SAI-Proposal-ACL-Bincode.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# ACL BINCODE Field Matching
# ACL META Field Matching
-------------------------------------------------------------------------------
Title | ACL BINCODE Field Matching
Title | ACL META Field Matching
-------------|-----------------------------------------------------------------
Authors | Nader Shinouda, Cisco
Status | In review
Expand All @@ -12,35 +12,35 @@

## 1.0 Introduction ##

This spec enhances the existing ACL spec to add support for bincode field matching. Bincode is part of prefix compression, where an IP prefix is mapped to Bincode.
This spec enhances the existing ACL spec to add support for meta field matching. Meta data is part of prefix compression entry, where an IP prefix is mapped to a meta value.

New table attributes allow setting a source and destination prefix compression tables on the creation of an ACL table. New field entry attributes allow for matching on a specific bincode from either the source or destionation prefix tables.
New table attributes allow setting a source and destination prefix compression tables on the creation of an ACL table. New field entry attributes allow for matching on a specific meta-data from either the source or destionation prefix tables.

## 2.0 Specification ##

New table attributes allow for setting both the source and destination prefix compression tables that will be used in field matching
```c
/**
* @brief SRC BINCODE
* @brief SRC META data
*
* This key is dedicated to matching on a SRC BINCODE
* This key is dedicated to matching on a SRC META data
*
* @type bool
* @flags CREATE_ONLY
* @default false
*/
SAI_ACL_TABLE_ATTR_FIELD_SRC_PREFIX_BINCODE
SAI_ACL_TABLE_ATTR_FIELD_SRC_PREFIX_META

/**
* @brief DST BINCODE
* @brief DST META data
*
* This key is dedicated to matching on a DST BINCODE
* This key is dedicated to matching on a DST META data
*
* @type bool
* @flags CREATE_ONLY
* @default false
*/
SAI_ACL_TABLE_ATTR_FIELD_DST_PREFIX_BINCODE
SAI_ACL_TABLE_ATTR_FIELD_DST_PREFIX_META

/**
* @brief SRC prefix Table Object ID
Expand Down Expand Up @@ -71,33 +71,33 @@ New table attributes allow for setting both the source and destination prefix co
SAI_ACL_TABLE_ATTR_DST_PREFIX_COMPRESSION_TABLE,
```

New field entry attributes allow for lookups based on a bincode value.
New field entry attributes allow for lookups based on a meta value.

```c
/**
* @brief SRC BINCODE
* @brief SRC META data
*
* @type sai_acl_field_data_t sai_uint32_t
* @flags CREATE_AND_SET
* @default disabled
*/
SAI_ACL_ENTRY_ATTR_FIELD_SRC_PREFIX_BINCODE,
SAI_ACL_ENTRY_ATTR_FIELD_SRC_PREFIX_META,

/**
* @brief DST BINCODE
* @brief DST META data
*
* @type sai_acl_field_data_t sai_uint32_t
* @flags CREATE_AND_SET
* @default disabled
*/
SAI_ACL_ENTRY_ATTR_FIELD_DST_PREFIX_BINCODE,
SAI_ACL_ENTRY_ATTR_FIELD_DST_PREFIX_META,
```

## 3.0 Examples ##

```c
// Example: Create Prefix Compression Table
sai_attr_table_list[0].id = SAI_PREFIX_COMPRESSION_TABLE_ATTR_DEFAULT_ENTRY_BINCODE;
sai_attr_table_list[0].id = SAI_PREFIX_COMPRESSION_TABLE_ATTR_DEFAULT_ENTRY_META;
sai_attr_table_list[0].value.u32 = 9000;
attr_table_count = 1;

Expand All @@ -116,7 +116,7 @@ entry_v4_src_1.prefix_table_id = src_prefix_compression_table_id;
entry_v4_src_1.prefix.addr_family = SAI_IP_ADDR_FAMILY_IPV4;
entry_v4_src_1.prefix.addr.ipv4 = "1.1.1.1";
entry_v4_src_1.prefix_mask.ipv4 = "255.255.255.0";
sai_attr_list_src[1].id = SAI_PREFIX_COMPRESSION_ENTRY_ATTR_BINCODE;
sai_attr_list_src[1].id = SAI_PREFIX_COMPRESSION_ENTRY_ATTR_META;
sai_attr_list_src[1].value.u32 = 500;

entry_list_src = [entry_v4_src_1];
Expand Down Expand Up @@ -144,13 +144,13 @@ sai_create_acl_table_fn(
sai_table_attr_count,
sai_table_attr_list);

sai_entry_attr_list[0].id = SAI_ACL_ENTRY_ATTR_FIELD_SRC_PREFIX_BINCODE;
sai_entry_attr_list[0].id = SAI_ACL_ENTRY_ATTR_FIELD_SRC_PREFIX_META;
sai_attr_list[1].value.aclfield.enable = true;
sai_attr_list[1].value.aclfield.mask = 0xFFFFFF;
sai_attr_list[1].value.aclfield.data = 500;
sai_entry_attr_count = 1;

// Create an Entry to match on Bincode 1
// Create an Entry to match on META data of value 1
sai_create_acl_entry_fn(
&acl_entry_id,
switch_id,
Expand Down
26 changes: 13 additions & 13 deletions doc/SAI-Proposal-Prefix-Compression.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@

## 1.0 Introduction ##

This spec adds Prefix Compression. Prefix Compression allows mapping an IP prefix/mask to a bincode. These prefix/bincode mapping can be grouped together to form prefix compression table. Tables can have both IPV4 and IPV6 entries.
This spec adds Prefix Compression. Prefix Compression allows mapping an IP prefix/mask to a meta data value. These prefix/meta-data mapping can be grouped together to form a prefix compression table. Tables can have both IPV4 and IPV6 entries.

Prefix Compression tables can be used in features such as ACL to match on a specific bincode. This allows additional functionality to ACL or any feature that can take advantage of such groupings.
Prefix Compression tables can be used in features such as ACL to match on a specific meta field. This allows additional functionality to ACL or any feature that can take advantage of such groupings.

## 1.1.0 Function Requirement of Prefix Compression
- Enable the creation of a prefix compresison table as a SAI object
- Enable adding IPV4/IPV6 Prefix mapping to a BINCODE value
- Enable adding IPV4/IPV6 Prefix mapping to a META value

## 2.0 Specification ##

Expand All @@ -39,7 +39,7 @@ Two new types: SAI_OBJECT_TYPE_PREFIX_COMPRESSION_TABLE and SAI_OBJECT_TYPE_PREF
#### sai_prefix_compression_table_attr_t ####
This defines the prefix compression attributes table

Tables are composed of prefix compression entries. These entries map a specific IP prefix to a bincode. Both IPV4 and IPV6 entries can be added to the same table. During a table creation a bincode must be provided for the default entry. A default entry bincode is a default bincode applied to any address that does not match a prefix in the table. A default entry is an entry where the prefix/length is zero
Tables are composed of prefix compression entries. These entries map a specific IP prefix to a meta data value. Both IPV4 and IPV6 entries can be added to the same table. During a table creation a meta data value must be provided for the default entry. A default entry is an entry is when the prefix/length is zero.

IPV4 defaulty entry: 0.0.0.0/0.0.0.0
IPV6 default entry: ::/::
Expand All @@ -62,13 +62,13 @@ typedef enum _sai_prefix_compression_table_attr_t
SAI_PREFIX_COMPRESSION_TABLE_ATTR_LABEL = SAI_PREFIX_COMPRESSION_TABLE_ATTR_START,

/**
* @brief Prefix Compression table default entry bincode.
* Bincode applied to any address that does not match a prefix in the table
* @brief Prefix Compression table default entry META data.
* Meta data applied to any address that does not match a prefix in the table
*
* @type sai_uint32_t
* @flags MANDATORY_ON_CREATE | CREATE_AND_SET
*/
SAI_PREFIX_COMPRESSION_TABLE_ATTR_DEFAULT_ENTRY_BINCODE,
SAI_PREFIX_COMPRESSION_TABLE_ATTR_DEFAULT_ENTRY_META,

```
Expand All @@ -88,12 +88,12 @@ Attributes structure for prefix compression entries
SAI_PREFIX_COMPRESSION_ENTRY_ATTR_START,
/**
* @brief Prefix Compression entry Bincode
* @brief Prefix Compression entry META data
*
* @type sai_uint32_t
* @flags MANDATORY_ON_CREATE | CREATE_AND_SET
*/
SAI_PREFIX_COMPRESSION_ENTRY_ATTR_BINCODE = SAI_PREFIX_COMPRESSION_ENTRY_ATTR_START,
SAI_PREFIX_COMPRESSION_ENTRY_ATTR_META = SAI_PREFIX_COMPRESSION_ENTRY_ATTR_START,
```

#### sai_prefix_compression_entry_t ####
Expand Down Expand Up @@ -192,7 +192,7 @@ typedef struct _sai_prefix_compression_api_t

```c
sai_attr_table_list[];
sai_attr_table_list[0].id = SAI_PREFIX_COMPRESSION_TABLE_ATTR_DEFAULT_ENTRY_BINCODE;
sai_attr_table_list[0].id = SAI_PREFIX_COMPRESSION_TABLE_ATTR_DEFAULT_ENTRY_META;
sai_attr_table_list[0].value.u32 = 9000;
attr_table_count = 0;
sai_create_prefix_compression_table_fn(
Expand All @@ -209,7 +209,7 @@ entry_v4_1.prefix_table_id = src_prefix_compression_table_id;
entry_v4_1.prefix.addr_family = SAI_IP_ADDR_FAMILY_IPV4;
entry_v4_1.prefix.addr.ipv4 = "1.1.1.1";
entry_v4_1.prefix_mask.ipv4 = "255.255.255.0";
sai_entry_list[0].id = SAI_PREFIX_COMPRESSION_ENTRY_ATTR_BINCODE;
sai_entry_list[0].id = SAI_PREFIX_COMPRESSION_ENTRY_ATTR_META;
sai_entry_list[0].value.u32 = 2;

// IPV4 Second Entry
Expand All @@ -219,7 +219,7 @@ entry_v4_1.prefix_table_id = src_prefix_compression_table_id;
entry_v4_1.prefix.addr_family = SAI_IP_ADDR_FAMILY_IPV4;
entry_v4_1.prefix.addr.ipv4 = "2.2.2.1";
entry_v4_1.prefix_mask.ipv4 = "255.255.255.0";
sai_entries_attribute_list[0].id = SAI_PREFIX_COMPRESSION_ENTRY_ATTR_BINCODE;
sai_entries_attribute_list[0].id = SAI_PREFIX_COMPRESSION_ENTRY_ATTR_META;
sai_entries_attribute_list[0].value.u32 = 800;

// IPV6 Entry
Expand All @@ -229,7 +229,7 @@ entry_v6_1.prefix_table_id = src_prefix_compression_table_id;
entry_v6_1.prefix.addr_family = SAI_IP_ADDR_FAMILY_IPV6;
entry_v6_1.prefix.addr.ipv4 ="2001:1::4";
entry_v6_1.prefix_mask = "ffff:ffff:ffff:ffff:ffff:ffff:ffff:fffc";
sai_entries_attribute_list[1].id = SAI_PREFIX_COMPRESSION_ENTRY_ATTR_BINCODE;
sai_entries_attribute_list[1].id = SAI_PREFIX_COMPRESSION_ENTRY_ATTR_META;
sai_entries_attribute_list[1].value.u32 = 4;

entries_list = [entry_v4_2, entry_v6_1];
Expand Down
24 changes: 12 additions & 12 deletions inc/saiacl.h
Original file line number Diff line number Diff line change
Expand Up @@ -1542,31 +1542,31 @@ typedef enum _sai_acl_table_attr_t
SAI_ACL_TABLE_ATTR_FIELD_TUNNEL_TERMINATED = SAI_ACL_TABLE_ATTR_FIELD_START + 0x15f,

/**
* @brief SRC BINCODE
* @brief SRC META data
*
* This key is dedicated to matching on a SRC BINCODE
* This key is dedicated to matching on a SRC META data
*
* @type bool
* @flags CREATE_ONLY
* @default false
*/
SAI_ACL_TABLE_ATTR_FIELD_SRC_PREFIX_BINCODE = SAI_ACL_TABLE_ATTR_FIELD_START + 0x160,
SAI_ACL_TABLE_ATTR_FIELD_SRC_PREFIX_META = SAI_ACL_TABLE_ATTR_FIELD_START + 0x160,

/**
* @brief DST BINCODE
* @brief DST META data
*
* This key is dedicated to matching on a DST BINCODE
* This key is dedicated to matching on a DST META data
*
* @type bool
* @flags CREATE_ONLY
* @default false
*/
SAI_ACL_TABLE_ATTR_FIELD_DST_PREFIX_BINCODE = SAI_ACL_TABLE_ATTR_FIELD_START + 0x161,
SAI_ACL_TABLE_ATTR_FIELD_DST_PREFIX_META = SAI_ACL_TABLE_ATTR_FIELD_START + 0x161,

/**
* @brief End of ACL Table Match Field
*/
SAI_ACL_TABLE_ATTR_FIELD_END = SAI_ACL_TABLE_ATTR_FIELD_DST_PREFIX_BINCODE,
SAI_ACL_TABLE_ATTR_FIELD_END = SAI_ACL_TABLE_ATTR_FIELD_DST_PREFIX_META,

/**
* @brief ACL table entries associated with this table.
Expand Down Expand Up @@ -2674,27 +2674,27 @@ typedef enum _sai_acl_entry_attr_t
SAI_ACL_ENTRY_ATTR_FIELD_TUNNEL_TERMINATED = SAI_ACL_ENTRY_ATTR_FIELD_START + 0x15f,

/**
* @brief SRC BINCODE
* @brief SRC META data
*
* @type sai_acl_field_data_t sai_uint32_t
* @flags CREATE_AND_SET
* @default disabled
*/
SAI_ACL_ENTRY_ATTR_FIELD_SRC_PREFIX_BINCODE = SAI_ACL_ENTRY_ATTR_FIELD_START + 0x160,
SAI_ACL_ENTRY_ATTR_FIELD_SRC_PREFIX_META = SAI_ACL_ENTRY_ATTR_FIELD_START + 0x160,

/**
* @brief DST BINCODE
* @brief DST META data
*
* @type sai_acl_field_data_t sai_uint32_t
* @flags CREATE_AND_SET
* @default disabled
*/
SAI_ACL_ENTRY_ATTR_FIELD_DST_PREFIX_BINCODE = SAI_ACL_ENTRY_ATTR_FIELD_START + 0x161,
SAI_ACL_ENTRY_ATTR_FIELD_DST_PREFIX_META = SAI_ACL_ENTRY_ATTR_FIELD_START + 0x161,

/**
* @brief End of Rule Match Fields
*/
SAI_ACL_ENTRY_ATTR_FIELD_END = SAI_ACL_ENTRY_ATTR_FIELD_DST_PREFIX_BINCODE,
SAI_ACL_ENTRY_ATTR_FIELD_END = SAI_ACL_ENTRY_ATTR_FIELD_DST_PREFIX_META,

/*
* Actions [sai_acl_action_data_t]
Expand Down
6 changes: 3 additions & 3 deletions inc/saiprefixcompression.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,13 @@ typedef enum _sai_prefix_compression_table_attr_t
SAI_PREFIX_COMPRESSION_TABLE_ATTR_LABEL = SAI_PREFIX_COMPRESSION_TABLE_ATTR_START,

/**
* @brief Prefix Compression table default entry BINCODE.
* BINCODE applied to any address that does not match a prefix in the table
* @brief Prefix Compression table default entry META data.
* META data applied to any address that does not match a prefix in the table
*
* @type sai_uint32_t
* @flags MANDATORY_ON_CREATE | CREATE_AND_SET
*/
SAI_PREFIX_COMPRESSION_TABLE_ATTR_DEFAULT_ENTRY_BINCODE,
SAI_PREFIX_COMPRESSION_TABLE_ATTR_DEFAULT_ENTRY_META,

/**
* @brief End of attributes
Expand Down
1 change: 0 additions & 1 deletion meta/acronyms.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ ASIC - Application Specific Integrated Circuit
BFD - Bidirectional Forwarding Detection
BFDV6 - Bidirectional Forwarding Detection for IPv6
BGP - Border Gateway Protocol
BINCODE - Binary code
BMTOR - Behavioral Model Top-of-Rack
BOS - Bottom Of Stack
BW - Bandwidth
Expand Down

0 comments on commit e5ae1ee

Please sign in to comment.