Merge "[qca-ssdk] fix acl rule structure comments"
diff --git a/include/fal/fal_acl.h b/include/fal/fal_acl.h
index 8df2c25..35c03af 100755
--- a/include/fal/fal_acl.h
+++ b/include/fal/fal_acl.h
@@ -76,11 +76,11 @@
*/
typedef enum
{
- FAL_ACL_UDF_TYPE_L2 = 0, /**< */
- FAL_ACL_UDF_TYPE_L3, /**< */
- FAL_ACL_UDF_TYPE_L4, /**< */
- FAL_ACL_UDF_TYPE_L2_SNAP, /**< */
- FAL_ACL_UDF_TYPE_L3_PLUS, /**< */
+ FAL_ACL_UDF_TYPE_L2 = 0, /*start from L2 */
+ FAL_ACL_UDF_TYPE_L3, /*start from L3 */
+ FAL_ACL_UDF_TYPE_L4, /*start from L4 */
+ FAL_ACL_UDF_TYPE_L2_SNAP, /*start from SNAP L2 */
+ FAL_ACL_UDF_TYPE_L3_PLUS, /*start from SNAP L3 */
FAL_ACL_UDF_TYPE_BUTT,
} fal_acl_udf_type_t;
@@ -88,9 +88,9 @@
@brief This enum defines the ACL rule type.
*/
typedef enum {
- FAL_ACL_UDF_NON_IP = 0,
- FAL_ACL_UDF_IP4,
- FAL_ACL_UDF_IP6,
+ FAL_ACL_UDF_NON_IP = 0, /*UDF for non-ip packets*/
+ FAL_ACL_UDF_IP4, /*UDF for IPv4 packets*/
+ FAL_ACL_UDF_IP6, /*UDF for IPv6 packets*/
FAL_ACL_UDF_BUTT,
}fal_acl_udf_pkt_type_t;
@@ -307,201 +307,197 @@
* vid - If FAL_ACL_ACTION_MODIFY_VLAN or FAL_ACL_ACTION_NEST_VLAN bit is
* setted in action_flg it's the expected vlan id value.
*/
- typedef struct
- {
- fal_acl_rule_type_t rule_type;
- fal_acl_field_map_t field_flg;
+typedef struct
+{
+ fal_acl_rule_type_t rule_type;/*mac, IP4, IP6 and UDF*/
+ fal_acl_field_map_t field_flg;/*Indicate which fields are selected*/
- /* fields of mac rule */
- fal_mac_addr_t src_mac_val;
- fal_mac_addr_t src_mac_mask;
- fal_mac_addr_t dest_mac_val;
- fal_mac_addr_t dest_mac_mask;
- a_uint16_t ethtype_val;
- a_uint16_t ethtype_mask;
- a_uint16_t vid_val;
- a_uint16_t vid_mask;
- fal_acl_field_op_t vid_op;
- a_uint8_t tagged_val;
- a_uint8_t tagged_mask;
- a_uint8_t up_val;
- a_uint8_t up_mask;
- a_uint8_t cfi_val;
- a_uint8_t cfi_mask;
- a_uint16_t resv0;
+ /* fields of mac rule */
+ fal_mac_addr_t src_mac_val;/*source mac*/
+ fal_mac_addr_t src_mac_mask;/*source mac mask*/
+ fal_mac_addr_t dest_mac_val;/*destination mac*/
+ fal_mac_addr_t dest_mac_mask;/*destionation mac mask*/
+ a_uint16_t ethtype_val;/*ethernet type*/
+ a_uint16_t ethtype_mask;/*ethernet type mask*/
+ a_uint16_t vid_val;/*vlan id, IPQ807x not support*/
+ a_uint16_t vid_mask;/*vlan id mask*/
+ fal_acl_field_op_t vid_op;/*vlan id operation, larger than or smaller than or range or mask*/
+ a_uint8_t tagged_val;/*tagged or not, IPQ807x not support*/
+ a_uint8_t tagged_mask;/*tagged or not mask*/
+ a_uint8_t up_val;/*cos priority, IPQ807x not support*/
+ a_uint8_t up_mask;/*cos priority mask*/
+ a_uint8_t cfi_val;/*CFI value, IPQ807x not support*/
+ a_uint8_t cfi_mask;/*CFI value mask*/
+ a_uint16_t resv0;/*reserved*/
- /* fields of enhanced mac rule*/
- a_uint8_t stagged_val; /*for s17c : 0-untag, 1-tag, for hawkeye: 2-pritag, 3-utag+pritag, 4- untag+tag, 5-tag+pritag, 6-all*/
- a_uint8_t stagged_mask;
- a_uint8_t ctagged_val;
- a_uint8_t ctagged_mask;
- a_uint16_t stag_vid_val;
- a_uint16_t stag_vid_mask;
- fal_acl_field_op_t stag_vid_op;
- a_uint16_t ctag_vid_val;
- a_uint16_t ctag_vid_mask;
- fal_acl_field_op_t ctag_vid_op;
- a_uint8_t stag_pri_val;
- a_uint8_t stag_pri_mask;
- a_uint8_t ctag_pri_val;
- a_uint8_t ctag_pri_mask;
- a_uint8_t stag_dei_val;
- a_uint8_t stag_dei_mask;
- a_uint8_t ctag_cfi_val;
- a_uint8_t ctag_cfi_mask;
+ /* fields of enhanced mac rule*/
+ a_uint8_t stagged_val; /*for s17c : 0-untag, 1-tag, for hawkeye: 2-pritag, 3-utag+pritag, 4- untag+tag, 5-tag+pritag, 6-all*/
+ a_uint8_t stagged_mask;
+ a_uint8_t ctagged_val;/*same as stagged define*/
+ a_uint8_t ctagged_mask;
+ a_uint16_t stag_vid_val;/*stag vlan id*/
+ a_uint16_t stag_vid_mask;/*stag vlan id mask*/
+ fal_acl_field_op_t stag_vid_op;/*vlan id operation, larger than or smaller than or range or mask*/
+ a_uint16_t ctag_vid_val;
+ a_uint16_t ctag_vid_mask;
+ fal_acl_field_op_t ctag_vid_op;
+ a_uint8_t stag_pri_val;/*stag priority*/
+ a_uint8_t stag_pri_mask;/*stag priority mask*/
+ a_uint8_t ctag_pri_val;
+ a_uint8_t ctag_pri_mask;
+ a_uint8_t stag_dei_val;/*stag dei*/
+ a_uint8_t stag_dei_mask;/*stag dei mask*/
+ a_uint8_t ctag_cfi_val;/*ctag cfi*/
+ a_uint8_t ctag_cfi_mask;/*ctag cfi mask*/
+ /* fields of ip4 rule */
+ fal_ip4_addr_t src_ip4_val;/*source ipv4 address*/
+ fal_ip4_addr_t src_ip4_mask;/*source ipv4 address mask*/
+ fal_ip4_addr_t dest_ip4_val;/*destination ipv4 address*/
+ fal_ip4_addr_t dest_ip4_mask;/*destination ipv4 address mask*/
- /* fields of ip4 rule */
- fal_ip4_addr_t src_ip4_val;
- fal_ip4_addr_t src_ip4_mask;
- fal_ip4_addr_t dest_ip4_val;
- fal_ip4_addr_t dest_ip4_mask;
+ /* fields of ip6 rule */
+ a_uint32_t ip6_lable_val;/*ipv6 flow lable, IPQ807x not support*/
+ a_uint32_t ip6_lable_mask;/*ipv6 flow lable mask*/
+ fal_ip6_addr_t src_ip6_val;/*source ipv6 address*/
+ fal_ip6_addr_t src_ip6_mask;/*source ipv6 address mask*/
+ fal_ip6_addr_t dest_ip6_val;/*destination ipv6 address*/
+ fal_ip6_addr_t dest_ip6_mask;/*destination ipv6 address mask*/
- /* fields of ip6 rule */
- a_uint32_t ip6_lable_val;
- a_uint32_t ip6_lable_mask;
- fal_ip6_addr_t src_ip6_val;
- fal_ip6_addr_t src_ip6_mask;
- fal_ip6_addr_t dest_ip6_val;
- fal_ip6_addr_t dest_ip6_mask;
+ /* fields of ip rule */
+ a_uint8_t ip_proto_val;/*IP protocal*/
+ a_uint8_t ip_proto_mask;/*IP protocal mask*/
+ a_uint8_t ip_dscp_val;/*IP DSCP*/
+ a_uint8_t ip_dscp_mask;/*IP DSCP mask*/
- /* fields of ip rule */
- a_uint8_t ip_proto_val;
- a_uint8_t ip_proto_mask;
- a_uint8_t ip_dscp_val;
- a_uint8_t ip_dscp_mask;
+ /* fields of layer four */
+ a_uint16_t src_l4port_val;/*source L4 port*/
+ a_uint16_t src_l4port_mask;/*source L4 port mask*/
+ fal_acl_field_op_t src_l4port_op;/*source L4 port operation*/
+ a_uint16_t dest_l4port_val;/*destination L4 port*/
+ a_uint16_t dest_l4port_mask;/*destination L4 mask*/
+ fal_acl_field_op_t dest_l4port_op;/*destination L4 operation*/
+ a_uint8_t icmp_type_val;/*ICMP type*/
+ a_uint8_t icmp_type_mask;/*ICMP type mask*/
+ a_uint8_t icmp_code_val;/*ICMP code*/
+ a_uint8_t icmp_code_mask;/*ICMP code mask*/
+ a_uint8_t tcp_flag_val;/*tcp flags value*/
+ a_uint8_t tcp_flag_mask;/*tcp flags mask*/
+ a_uint8_t ripv1_val;/*Is RIPv1 or not, IPQ807x not support*/
+ a_uint8_t ripv1_mask;/*RIPv1 mask*/
+ a_uint8_t dhcpv4_val;/*Is DHCPv4 or not, IPQ807x not support*/
+ a_uint8_t dhcpv4_mask;
+ a_uint8_t dhcpv6_val;/*Is DHCPv6 or not, IPQ807x not support*/
+ a_uint8_t dhcpv6_mask;
- /* fields of layer four */
- a_uint16_t src_l4port_val;
- a_uint16_t src_l4port_mask;
- fal_acl_field_op_t src_l4port_op;
- a_uint16_t dest_l4port_val;
- a_uint16_t dest_l4port_mask;
- fal_acl_field_op_t dest_l4port_op;
- a_uint8_t icmp_type_val;
- a_uint8_t icmp_type_mask;
- a_uint8_t icmp_code_val;
- a_uint8_t icmp_code_mask;
- a_uint8_t tcp_flag_val;
- a_uint8_t tcp_flag_mask;
- a_uint8_t ripv1_val;
- a_uint8_t ripv1_mask;
- a_uint8_t dhcpv4_val;
- a_uint8_t dhcpv4_mask;
- a_uint8_t dhcpv6_val;
- a_uint8_t dhcpv6_mask;
+ /* user defined fields */
+ fal_acl_udf_type_t udf_type;/*UDF type, IPQ807x not support*/
+ a_uint8_t udf_offset;/*UDF offset, IPQ807x not support*/
+ a_uint8_t udf_len;/*UDF length, IPQ807x not support*/
+ a_uint8_t udf_val[FAL_ACL_UDF_MAX_LENGTH];/*UDF field value*/
+ a_uint8_t udf_mask[FAL_ACL_UDF_MAX_LENGTH];/*UDF field mask*/
- /* user defined fields */
- fal_acl_udf_type_t udf_type;
- a_uint8_t udf_offset;
- a_uint8_t udf_len;
- a_uint8_t udf_val[FAL_ACL_UDF_MAX_LENGTH];
- a_uint8_t udf_mask[FAL_ACL_UDF_MAX_LENGTH];
+ /* fields of action */
+ fal_acl_action_map_t action_flg;/*Indicate which action apply*/
+ fal_pbmp_t ports; /*high 2bits, 00-port bitmap, 01-nexthop, 10-vp*/
+ a_uint32_t match_cnt;/*rule match frame counter*/
+ a_uint16_t vid;/*modify vlan id, IPQ807x not support*/
+ a_uint8_t up;/*modify COS priority, IPQ807x not support*/
+ a_uint8_t queue;/*modify queue*/
+ a_uint16_t stag_vid;/*modify stag vlan id*/
+ a_uint8_t stag_pri;/*modify stag priority*/
+ a_uint8_t stag_dei;/*modify stag dei*/
+ a_uint16_t ctag_vid;/*modify ctag vlan id*/
+ a_uint8_t ctag_pri;/*modify ctag priority*/
+ a_uint8_t ctag_cfi;/*modify ctag dei*/
+ a_uint16_t policer_ptr;/*specify policer index*/
+ a_uint16_t arp_ptr;/*specify arp table index, IPQ807x not support*/
+ a_uint16_t wcmp_ptr;/*specify wcmp table index, IPQ807x not support*/
+ a_uint8_t dscp;/*modify dscp*/
+ a_uint8_t rsv;
+ fal_policy_forward_t policy_fwd;/*SNAT or DNAT or ROUTE, IPQ807x not support*/
+ fal_combined_t combined;
- /* fields of action */
- fal_acl_action_map_t action_flg;
- fal_pbmp_t ports; /*high 2bits, 00-port bitmap, 01-nexthop, 10-vp*/
- a_uint32_t match_cnt;
- a_uint16_t vid;
- a_uint8_t up;
- a_uint8_t queue;
- a_uint16_t stag_vid;
- a_uint8_t stag_pri;
- a_uint8_t stag_dei;
- a_uint16_t ctag_vid;
- a_uint8_t ctag_pri;
- a_uint8_t ctag_cfi;
- a_uint16_t policer_ptr;
- a_uint16_t arp_ptr;
- a_uint16_t wcmp_ptr;
- a_uint8_t dscp;
- a_uint8_t rsv;
- fal_policy_forward_t policy_fwd;
- fal_combined_t combined;
+ /*Only IPQ807x support start*/
+ a_uint8_t pri; /*rule priority 0-7*/
+ a_bool_t post_routing;/*post routing or not*/
+ a_uint8_t acl_pool;/*acl pool*/
- /*new add match fields for hawkeye*/
- a_uint8_t pri; /*rule priority 0-7*/
- a_bool_t post_routing;
- a_uint8_t acl_pool;
-
- a_bool_t is_ip_val;
+ a_bool_t is_ip_val;/*is ip or not*/
a_uint8_t is_ip_mask;
-
- a_bool_t is_ipv6_val;
+ a_bool_t is_ipv6_val;/*is ipv6 or ipv4*/
a_uint8_t is_ipv6_mask;
-
- a_bool_t is_fake_mac_header_val;
+ a_bool_t is_fake_mac_header_val;/*is fake mac header or not*/
a_uint8_t is_fake_mac_header_mask;
-
- a_bool_t is_snap_val;
+ a_bool_t is_snap_val;/*is snap or not*/
a_uint8_t is_snap_mask;
-
- a_bool_t is_ethernet_val;
+ a_bool_t is_ethernet_val;/*is ethernet or not*/
a_uint8_t is_ethernet_mask;
- a_bool_t is_fragement_val;
+ a_bool_t is_fragement_val;/*is fragment or not*/
a_uint8_t is_fragement_mask;
- a_bool_t is_ah_header_val;
+ a_bool_t is_ah_header_val;/*is ah header or not*/
a_uint8_t is_ah_header_mask;
- a_bool_t is_esp_header_val;
+ a_bool_t is_esp_header_val;/*is esp header or not*/
a_uint8_t is_esp_header_mask;
- a_bool_t is_mobility_header_val;
+ a_bool_t is_mobility_header_val;/*is mobility header or not*/
a_uint8_t is_mobility_header_mask;
- a_bool_t is_fragment_header_val;
+ a_bool_t is_fragment_header_val;/*is fragment header or not*/
a_uint8_t is_fragment_header_mask;
- a_bool_t is_other_header_val;
+ a_bool_t is_other_header_val;/*is other header or not*/
a_uint8_t is_other_header_mask;
- a_bool_t is_ipv4_option_val;
+ a_bool_t is_ipv4_option_val;/*is ipv4 option or not*/
a_uint8_t is_ipv4_option_mask;
- a_bool_t is_first_frag_val;
+ a_bool_t is_first_frag_val;/*is first fragment or not*/
a_uint8_t is_first_frag_mask;
/*fields of VLAN rule*/
- a_bool_t vsi_valid;
- a_uint8_t vsi_valid_mask;
- a_uint8_t vsi; /*0-31*/
- a_uint8_t vsi_mask; /*0-31*/
- /*fields of L2 MISC rule*/
- a_uint16_t pppoe_sessionid;
- a_uint16_t pppoe_sessionid_mask;
- fal_acl_field_op_t icmp_type_code_op;
- /*fields of IP MISC rule*/
- a_uint8_t l3_ttl;
- a_uint8_t l3_ttl_mask;
- fal_acl_field_op_t l3_length_op;
- a_uint16_t l3_length;
- a_uint16_t l3_length_mask;
- a_uint16_t l3_pkt_type;
- a_uint16_t l3_pkt_type_mask;
- /*field of udf*/
- fal_acl_field_op_t udf0_op;
- a_uint16_t udf0_val;
- a_uint16_t udf0_mask;
- fal_acl_field_op_t udf1_op;
- a_uint16_t udf1_val;
- a_uint16_t udf1_mask;
- a_uint16_t udf2_val;
- a_uint16_t udf2_mask;
- a_uint16_t udf3_val;
- a_uint16_t udf3_mask;
+ a_bool_t vsi_valid;/*vsi valid or not*/
+ a_uint8_t vsi_valid_mask;
+ a_uint8_t vsi; /*vsi value 0-31*/
+ a_uint8_t vsi_mask; /*vsi mask 0-31*/
+ /*fields of L2 MISC rule*/
+ a_uint16_t pppoe_sessionid;/*pppoe session id*/
+ a_uint16_t pppoe_sessionid_mask;/*pppoe session mask*/
+ fal_acl_field_op_t icmp_type_code_op;/*icmp type operation*/
+ /*fields of IP MISC rule*/
+ a_uint8_t l3_ttl;/*L3 TTL,0-ttl 0, 1-ttl 1, 2-ttl 255, 3- ttl other*/
+ a_uint8_t l3_ttl_mask;/*L3 TTL mask*/
+ fal_acl_field_op_t l3_length_op;/*L3 TTL operation*/
+ a_uint16_t l3_length;/*L3 length*/
+ a_uint16_t l3_length_mask;/*L3 length mask*/
+ a_uint16_t l3_pkt_type;/*l3 packet type, 0-tcp, 1-udp, 3-udp_lite, 5-arp, 7-icmp*/
+ a_uint16_t l3_pkt_type_mask;
+ /*field of udf*/
+ fal_acl_field_op_t udf0_op;/*udf operation*/
+ a_uint16_t udf0_val;/*udf value, 2bytes*/
+ a_uint16_t udf0_mask;/*udf mask, 2bytes*/
+ fal_acl_field_op_t udf1_op;
+ a_uint16_t udf1_val;
+ a_uint16_t udf1_mask;
+ a_uint16_t udf2_val;
+ a_uint16_t udf2_mask;
+ a_uint16_t udf3_val;
+ a_uint16_t udf3_mask;
- /*new add acl action for hawkeye*/
- a_uint32_t bypass_bitmap;
- a_uint8_t enqueue_pri;
- a_uint8_t stag_fmt;
- a_uint8_t ctag_fmt;
- a_uint8_t int_dp;
- a_uint8_t service_code;
- a_uint8_t cpu_code;
- a_uint64_t match_bytes;
- } fal_acl_rule_t;
+ /*new add acl action for hawkeye*/
+ a_uint32_t bypass_bitmap;/*bypass bitmap*/
+ a_uint8_t enqueue_pri;/*enqueue priority*/
+ a_uint8_t stag_fmt;/*stag format*/
+ a_uint8_t ctag_fmt;/*ctag format*/
+ a_uint8_t int_dp;/*internal dp*/
+ a_uint8_t service_code;/*service code*/
+ a_uint8_t cpu_code;/*cpu code*/
+ a_uint64_t match_bytes;/*rule match bytes counter*/
+ /*Only IPQ807x support End*/
+} fal_acl_rule_t;
/**