Xiaoping Fan | 0493b2d | 2015-08-21 19:09:38 -0700 | [diff] [blame] | 1 | /* |
Ratheesh Kannoth | 24fb1db | 2021-10-20 07:28:06 +0530 | [diff] [blame] | 2 | * sfe_api.h |
Suruchi Agarwal | 0eec7f9 | 2022-02-11 14:07:09 -0800 | [diff] [blame] | 3 | * SFE exported function headers for SFE engine. |
Xiaoping Fan | 0493b2d | 2015-08-21 19:09:38 -0700 | [diff] [blame] | 4 | * |
Ratheesh Kannoth | 24fb1db | 2021-10-20 07:28:06 +0530 | [diff] [blame] | 5 | * Copyright (c) 2015,2016, The Linux Foundation. All rights reserved. |
Guduri Prathyusha | 5f27e23 | 2022-01-06 14:39:04 +0530 | [diff] [blame] | 6 | * Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved. |
Ratheesh Kannoth | 24fb1db | 2021-10-20 07:28:06 +0530 | [diff] [blame] | 7 | * |
| 8 | * Permission to use, copy, modify, and/or distribute this software for any |
| 9 | * purpose with or without fee is hereby granted, provided that the above |
| 10 | * copyright notice and this permission notice appear in all copies. |
| 11 | * |
Xiaoping Fan | 0493b2d | 2015-08-21 19:09:38 -0700 | [diff] [blame] | 12 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES |
| 13 | * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF |
| 14 | * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR |
| 15 | * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES |
| 16 | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN |
Ratheesh Kannoth | 24fb1db | 2021-10-20 07:28:06 +0530 | [diff] [blame] | 17 | * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF |
| 18 | * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
Xiaoping Fan | 0493b2d | 2015-08-21 19:09:38 -0700 | [diff] [blame] | 19 | */ |
| 20 | |
Suruchi Agarwal | 0eec7f9 | 2022-02-11 14:07:09 -0800 | [diff] [blame] | 21 | |
| 22 | /** |
| 23 | * @file sfe_api.h |
| 24 | * SFE exported function headers for the SFE engine. |
| 25 | */ |
| 26 | |
Ratheesh Kannoth | 24fb1db | 2021-10-20 07:28:06 +0530 | [diff] [blame] | 27 | #ifndef __SFE_API_H |
| 28 | #define __SFE_API_H |
Xiaoping Fan | 0493b2d | 2015-08-21 19:09:38 -0700 | [diff] [blame] | 29 | |
Suruchi Agarwal | 0eec7f9 | 2022-02-11 14:07:09 -0800 | [diff] [blame] | 30 | /** |
| 31 | * @addtogroup nss_sfe_definitions |
| 32 | * @{ |
| 33 | */ |
Xiaoping Fan | 0493b2d | 2015-08-21 19:09:38 -0700 | [diff] [blame] | 34 | |
Suruchi Agarwal | 0eec7f9 | 2022-02-11 14:07:09 -0800 | [diff] [blame] | 35 | #define SFE_MAX_VLAN_DEPTH 2 /**< Maximum VLAN depth. */ |
| 36 | #define SFE_VLAN_ID_NOT_CONFIGURED 0xfff /**< VLAN ID not configured. */ |
Parikshit Gune | 8d03e97 | 2022-06-15 17:24:53 +0530 | [diff] [blame] | 37 | #define SFE_INVALID_VLAN_PCP 0xff /**< VLAN PCP remark is invalid for SAWF (Service Aware Wi-Fi). */ |
Suruchi Agarwal | 0eec7f9 | 2022-02-11 14:07:09 -0800 | [diff] [blame] | 38 | #define SFE_MAX_SERVICE_CLASS_ID 0x80 /**< Maximum service class ID. */ |
| 39 | #define SFE_INVALID_SERVICE_CLASS_ID 0xff /**< Service class ID not valid. */ |
Jackson Bockus | 3fafbf3 | 2022-02-13 17:15:26 -0800 | [diff] [blame] | 40 | #define SFE_SERVICE_CLASS_STATS_MAX_RETRY 100 /**< Maximum retries for fetching service class statistics. */ |
Suruchi Agarwal | 0eec7f9 | 2022-02-11 14:07:09 -0800 | [diff] [blame] | 41 | #define SFE_INVALID_MSDUQ 0xff /**< Invalid MAC Service Data Unit Queue. */ |
| 42 | |
| 43 | #define SFE_SPECIAL_INTERFACE_BASE 0x7f00 /**< Special interface base number. */ |
| 44 | #define SFE_SPECIAL_INTERFACE_IPV4 (SFE_SPECIAL_INTERFACE_BASE + 1) /**< Interface number for IPv4. */ |
| 45 | #define SFE_SPECIAL_INTERFACE_IPV6 (SFE_SPECIAL_INTERFACE_BASE + 2) /**< Interface enumber fo IPv6. */ |
| 46 | #define SFE_SPECIAL_INTERFACE_IPSEC (SFE_SPECIAL_INTERFACE_BASE + 3) /**< Interface number for IPSec. */ |
| 47 | #define SFE_SPECIAL_INTERFACE_L2TP (SFE_SPECIAL_INTERFACE_BASE + 4) /**< Interface number for L2TP. */ |
| 48 | #define SFE_SPECIAL_INTERFACE_PPTP (SFE_SPECIAL_INTERFACE_BASE + 5) /**< Interface number for PPTP. */ |
Xiaoping Fan | 0493b2d | 2015-08-21 19:09:38 -0700 | [diff] [blame] | 49 | |
| 50 | /** |
Suruchi Agarwal | 0eec7f9 | 2022-02-11 14:07:09 -0800 | [diff] [blame] | 51 | * @} |
| 52 | */ |
Ratheesh Kannoth | 24fb1db | 2021-10-20 07:28:06 +0530 | [diff] [blame] | 53 | |
Xiaoping Fan | 0493b2d | 2015-08-21 19:09:38 -0700 | [diff] [blame] | 54 | /** |
Suruchi Agarwal | 0eec7f9 | 2022-02-11 14:07:09 -0800 | [diff] [blame] | 55 | * @addtogroup nss_sfe_flags |
| 56 | * @{ |
Xiaoping Fan | 0493b2d | 2015-08-21 19:09:38 -0700 | [diff] [blame] | 57 | */ |
Ratheesh Kannoth | 29140aa | 2021-10-20 08:25:02 +0530 | [diff] [blame] | 58 | |
| 59 | /* |
Suruchi Agarwal | 0eec7f9 | 2022-02-11 14:07:09 -0800 | [diff] [blame] | 60 | * Rule creation and rule update flags. |
| 61 | */ |
| 62 | #define SFE_RULE_CREATE_FLAG_NO_SEQ_CHECK (1<<0) /**< Do not perform TCP sequence number checks. */ |
| 63 | #define SFE_RULE_CREATE_FLAG_BRIDGE_FLOW (1<<1) /**< Rule is for a pure bridge forwarding flow. */ |
| 64 | #define SFE_RULE_CREATE_FLAG_ROUTED (1<<2) /**< Rule is for a routed connection. */ |
| 65 | #define SFE_RULE_CREATE_FLAG_DSCP_MARKING (1<<3) /**< Rule has DSCP marking configured. */ |
| 66 | #define SFE_RULE_CREATE_FLAG_VLAN_MARKING (1<<4) /**< Rule has VLAN marking configured. */ |
| 67 | #define SFE_RULE_UPDATE_FLAG_CHANGE_MTU (1<<5) /**< Update MTU of connection interfaces. */ |
| 68 | #define SFE_RULE_CREATE_FLAG_ICMP_NO_CME_FLUSH (1<<6) /**< Rule to not flush CME on ICMP packets. */ |
| 69 | #define SFE_RULE_CREATE_FLAG_L2_ENCAP (1<<7) /**< Consists of an encapsulating protocol that carries an IPv4 payload within it. */ |
| 70 | #define SFE_RULE_CREATE_FLAG_USE_FLOW_BOTTOM_INTERFACE (1<<8) /**< Use flow interface number instead of top interface. */ |
| 71 | #define SFE_RULE_CREATE_FLAG_USE_RETURN_BOTTOM_INTERFACE (1<<9) /**< Use return interface number instead of top interface. */ |
Murat Sezgin | 9c53897 | 2022-05-17 13:33:17 -0700 | [diff] [blame] | 72 | #define SFE_RULE_CREATE_FLAG_FLOW_SRC_INTERFACE_CHECK (1<<10) /**< Check source interface on the flow direction. */ |
| 73 | #define SFE_RULE_CREATE_FLAG_RETURN_SRC_INTERFACE_CHECK (1<<11) |
| 74 | /**< Check source interface on the return direction. */ |
| 75 | #define SFE_RULE_CREATE_FLAG_FLOW_TRANSMIT_FAST (1<<12) /**< Original flow can be transmitted fast. */ |
| 76 | #define SFE_RULE_CREATE_FLAG_RETURN_TRANSMIT_FAST (1<<13) /**< Return flow can be transmitted fast. */ |
| 77 | #define SFE_RULE_CREATE_FLAG_FLOW_SRC_INTERFACE_CHECK_NO_FLUSH (1<<14) |
| 78 | /**< Check source interface on the flow direction but do not flush the connection. */ |
| 79 | #define SFE_RULE_CREATE_FLAG_RETURN_SRC_INTERFACE_CHECK_NO_FLUSH (1<<15) |
| 80 | /**< Check source interface on the return direction but do not flush the connection. */ |
Suruchi Agarwal | 0eec7f9 | 2022-02-11 14:07:09 -0800 | [diff] [blame] | 81 | |
| 82 | /* |
| 83 | * Rule creation validity flags. |
| 84 | */ |
| 85 | #define SFE_RULE_CREATE_CONN_VALID (1<<0) /**< IPv4 connection is valid. */ |
| 86 | #define SFE_RULE_CREATE_TCP_VALID (1<<1) /**< TCP protocol fields are valid. */ |
| 87 | #define SFE_RULE_CREATE_PPPOE_DECAP_VALID (1<<2) /**< PPPoE decapsulation fields are valid. */ |
| 88 | #define SFE_RULE_CREATE_PPPOE_ENCAP_VALID (1<<3) /**< PPPoE encapsulation fields are valid. */ |
| 89 | #define SFE_RULE_CREATE_QOS_VALID (1<<4) /**< QoS fields are valid. */ |
| 90 | #define SFE_RULE_CREATE_VLAN_VALID (1<<5) /**< VLAN fields are valid. */ |
| 91 | #define SFE_RULE_CREATE_DSCP_MARKING_VALID (1<<6) /**< DSCP marking fields are valid. */ |
| 92 | #define SFE_RULE_CREATE_VLAN_MARKING_VALID (1<<7) /**< VLAN marking fields are valid. */ |
| 93 | #define SFE_RULE_CREATE_DIRECTION_VALID (1<<8) /**< Acceleration direction is valid. */ |
| 94 | #define SFE_RULE_CREATE_SRC_MAC_VALID (1<<9) /**< Source MAC address is valid. */ |
| 95 | #define SFE_RULE_CREATE_MARK_VALID (1<<10) /**< SKB marking fields are valid. */ |
| 96 | |
| 97 | /* |
| 98 | * Source MAC address validity flags; used with the mac_valid_flags field in the sfe_ipv4_src_mac_rule structure. |
Ratheesh Kannoth | 29140aa | 2021-10-20 08:25:02 +0530 | [diff] [blame] | 99 | */ |
| 100 | #define SFE_SRC_MAC_FLOW_VALID 0x01 |
| 101 | /**< MAC address for the flow interface is valid. */ |
| 102 | #define SFE_SRC_MAC_RETURN_VALID 0x02 |
| 103 | /**< MAC address for the return interface is valid. */ |
Xiaoping Fan | 0493b2d | 2015-08-21 19:09:38 -0700 | [diff] [blame] | 104 | |
Suruchi Agarwal | 0eec7f9 | 2022-02-11 14:07:09 -0800 | [diff] [blame] | 105 | /** |
| 106 | * @} |
| 107 | */ |
| 108 | |
| 109 | /** |
| 110 | * @addtogroup nss_sfe_datatypes |
| 111 | * @{ |
| 112 | */ |
| 113 | |
Murat Sezgin | affcf9e | 2020-09-18 13:16:45 -0700 | [diff] [blame] | 114 | /* |
Suruchi Agarwal | 0eec7f9 | 2022-02-11 14:07:09 -0800 | [diff] [blame] | 115 | * 32/64-bit pointer types. |
Murat Sezgin | affcf9e | 2020-09-18 13:16:45 -0700 | [diff] [blame] | 116 | */ |
| 117 | #ifdef __LP64__ |
Suruchi Agarwal | 0eec7f9 | 2022-02-11 14:07:09 -0800 | [diff] [blame] | 118 | typedef uint64_t sfe_ptr_t; /**< 64-bit pointer. */ |
Murat Sezgin | affcf9e | 2020-09-18 13:16:45 -0700 | [diff] [blame] | 119 | #else |
Suruchi Agarwal | 0eec7f9 | 2022-02-11 14:07:09 -0800 | [diff] [blame] | 120 | typedef uint32_t sfe_ptr_t; /**< 32-bit pointer. */ |
Murat Sezgin | affcf9e | 2020-09-18 13:16:45 -0700 | [diff] [blame] | 121 | #endif |
| 122 | |
Suruchi Agarwal | 0eec7f9 | 2022-02-11 14:07:09 -0800 | [diff] [blame] | 123 | /** |
| 124 | * Synchronize reason enum. |
| 125 | */ |
| 126 | typedef enum /** @cond */ sfe_rule_sync_reason /** @endcond */ { |
| 127 | SFE_RULE_SYNC_REASON_STATS, /**< Synchronize statistics. */ |
| 128 | SFE_RULE_SYNC_REASON_FLUSH, /**< Synchronize to flush an entry. */ |
| 129 | SFE_RULE_SYNC_REASON_EVICT, /**< Synchronize to evict an entry. */ |
| 130 | SFE_RULE_SYNC_REASON_DESTROY /**< Synchronize to destroy an entry (requested by the connection manager). */ |
Xiaoping Fan | 1253cd0 | 2015-11-11 18:02:20 -0800 | [diff] [blame] | 131 | |
Xiaoping Fan | 0493b2d | 2015-08-21 19:09:38 -0700 | [diff] [blame] | 132 | } sfe_rule_sync_reason_t; |
| 133 | |
| 134 | /** |
Suruchi Agarwal | 0eec7f9 | 2022-02-11 14:07:09 -0800 | [diff] [blame] | 135 | * Tx command status. |
Xiaoping Fan | 0493b2d | 2015-08-21 19:09:38 -0700 | [diff] [blame] | 136 | */ |
| 137 | typedef enum { |
Suruchi Agarwal | 0eec7f9 | 2022-02-11 14:07:09 -0800 | [diff] [blame] | 138 | SFE_TX_SUCCESS = 0, /**< Success. */ |
| 139 | SFE_TX_FAILURE, /**< Failure other than descriptor not available. */ |
| 140 | SFE_TX_FAILURE_QUEUE, /**< failure due to descriptor not available. */ |
| 141 | SFE_TX_FAILURE_NOT_READY, /**< Failure due to SFE state uninitialized. */ |
| 142 | SFE_TX_FAILURE_TOO_LARGE, /**< Command is too large to fit in one message. */ |
| 143 | SFE_TX_FAILURE_TOO_SHORT, /**< Command or packet is shorter than expected. */ |
| 144 | SFE_TX_FAILURE_NOT_SUPPORTED, /**< Command or packet not accepted for forwarding. */ |
| 145 | SFE_TX_FAILURE_BAD_PARAM, /**< Failure due to bad parameters. */ |
| 146 | SFE_TX_FAILURE_NOT_ENABLED, /**< Failure due to SFE not enabled. */ |
Xiaoping Fan | 0493b2d | 2015-08-21 19:09:38 -0700 | [diff] [blame] | 147 | } sfe_tx_status_t; |
| 148 | |
| 149 | /** |
Ratheesh Kannoth | 24fb1db | 2021-10-20 07:28:06 +0530 | [diff] [blame] | 150 | * Common response types. |
Xiaoping Fan | 0493b2d | 2015-08-21 19:09:38 -0700 | [diff] [blame] | 151 | */ |
| 152 | enum sfe_cmn_response { |
Suruchi Agarwal | 0eec7f9 | 2022-02-11 14:07:09 -0800 | [diff] [blame] | 153 | SFE_CMN_RESPONSE_ACK, /**< Message acknowledged. */ |
| 154 | SFE_CMN_RESPONSE_EVERSION, /**< Version error. */ |
| 155 | SFE_CMN_RESPONSE_EINTERFACE, /**< Interface error. */ |
| 156 | SFE_CMN_RESPONSE_ELENGTH, /**< Length error. */ |
| 157 | SFE_CMN_RESPONSE_EMSG, /**< Message error. */ |
| 158 | SFE_CMM_RESPONSE_NOTIFY, /**< Message independant of request. */ |
| 159 | SFE_CMN_RESPONSE_LAST /**< Indicates the last item. */ |
Xiaoping Fan | 0493b2d | 2015-08-21 19:09:38 -0700 | [diff] [blame] | 160 | }; |
| 161 | |
| 162 | /** |
Suruchi Agarwal | 0eec7f9 | 2022-02-11 14:07:09 -0800 | [diff] [blame] | 163 | * IPv4 bridge/route rule messages. |
Xiaoping Fan | 0493b2d | 2015-08-21 19:09:38 -0700 | [diff] [blame] | 164 | */ |
| 165 | enum sfe_message_types { |
Ken Zhu | 7a43d88 | 2022-01-04 10:51:44 -0800 | [diff] [blame] | 166 | SFE_TX_CREATE_RULE_MSG, /**< IPv4/IPv6 create rule message. */ |
| 167 | SFE_TX_DESTROY_RULE_MSG, /**< IPv4/IPv6 destroy rule message. */ |
| 168 | SFE_RX_CONN_STATS_SYNC_MSG, /**< IPv4/IPv6 connection statistics synchronize message. */ |
| 169 | SFE_TX_CONN_STATS_SYNC_MANY_MSG,/**< IPv4/IPv6 connection statistics synchronize many message. */ |
Suruchi Agarwal | 0eec7f9 | 2022-02-11 14:07:09 -0800 | [diff] [blame] | 170 | SFE_TUN6RD_ADD_UPDATE_PEER, /**< Add/update peer for 6RD tunnel. */ |
Ken Zhu | 7a43d88 | 2022-01-04 10:51:44 -0800 | [diff] [blame] | 171 | SFE_MAX_MSG_TYPES, /**< IPv4/IPv6 message max type number. */ |
Xiaoping Fan | 0493b2d | 2015-08-21 19:09:38 -0700 | [diff] [blame] | 172 | }; |
| 173 | |
| 174 | /** |
Murat Sezgin | ef19039 | 2022-04-04 17:56:31 -0700 | [diff] [blame] | 175 | * Connection mark structure. |
| 176 | */ |
| 177 | struct sfe_connection_mark { |
| 178 | int protocol; /**< Protocol number. */ |
| 179 | __be32 src_ip[4]; /**< Source IP address. */ |
| 180 | __be32 dest_ip[4]; /**< Destination IP address. */ |
| 181 | __be16 src_port; /**< Source port number. */ |
| 182 | __be16 dest_port; /**< Destination port number. */ |
| 183 | u32 mark; /**< Mark value to be updated. */ |
| 184 | }; |
| 185 | |
| 186 | /** |
Ken Zhu | 7a43d88 | 2022-01-04 10:51:44 -0800 | [diff] [blame] | 187 | * Common message structure. |
Xiaoping Fan | 0493b2d | 2015-08-21 19:09:38 -0700 | [diff] [blame] | 188 | */ |
| 189 | struct sfe_cmn_msg { |
Suruchi Agarwal | 0eec7f9 | 2022-02-11 14:07:09 -0800 | [diff] [blame] | 190 | u16 version; /**< Version ID for the main message format. */ |
| 191 | u16 interface; /**< Primary key for all messages. */ |
| 192 | enum sfe_cmn_response response; /**< Primary response. */ |
| 193 | u32 type; /**< Decentralized request ID used to match response ID. */ |
| 194 | u32 error; /**< Decentralized specific error message; response == EMSG. */ |
| 195 | sfe_ptr_t cb; /**< Callback pointer. */ |
| 196 | sfe_ptr_t app_data; /**< Application data. */ |
| 197 | u32 len; /**< Length of the message excluding this header. */ |
Xiaoping Fan | 0493b2d | 2015-08-21 19:09:38 -0700 | [diff] [blame] | 198 | }; |
| 199 | |
| 200 | /** |
Ken Zhu | 7a43d88 | 2022-01-04 10:51:44 -0800 | [diff] [blame] | 201 | * Common 5-tuple structure. |
Xiaoping Fan | 0493b2d | 2015-08-21 19:09:38 -0700 | [diff] [blame] | 202 | */ |
| 203 | struct sfe_ipv4_5tuple { |
Suruchi Agarwal | 0eec7f9 | 2022-02-11 14:07:09 -0800 | [diff] [blame] | 204 | __be32 flow_ip; /**< Flow IP address. */ |
| 205 | __be32 return_ip; /**< Return IP address. */ |
| 206 | __be16 flow_ident; /**< Flow identifier, e.g., TCP/UDP port. */ |
| 207 | __be16 return_ident; /**< Return identifier, e.g., TCP/UDP port. */ |
| 208 | u8 protocol; /**< Protocol number. */ |
| 209 | u8 reserved[3]; /**< Reserved; padding for alignment. */ |
Xiaoping Fan | 0493b2d | 2015-08-21 19:09:38 -0700 | [diff] [blame] | 210 | }; |
| 211 | |
| 212 | /** |
Ratheesh Kannoth | 24fb1db | 2021-10-20 07:28:06 +0530 | [diff] [blame] | 213 | * IPv4 connection rule structure. |
Xiaoping Fan | 0493b2d | 2015-08-21 19:09:38 -0700 | [diff] [blame] | 214 | */ |
| 215 | struct sfe_ipv4_connection_rule { |
Suruchi Agarwal | 0eec7f9 | 2022-02-11 14:07:09 -0800 | [diff] [blame] | 216 | u8 flow_mac[6]; /**< Flow MAC address. */ |
| 217 | u8 return_mac[6]; /**< Return MAC address. */ |
| 218 | s32 flow_interface_num; /**< Flow interface number. */ |
| 219 | s32 return_interface_num; /**< Return interface number. */ |
| 220 | s32 flow_top_interface_num; /**< Top flow interface number. */ |
| 221 | s32 return_top_interface_num; /**< Top return interface number. */ |
| 222 | u32 flow_mtu; /**< Flow interface`s MTU. */ |
| 223 | u32 return_mtu; /**< Return interface`s MTU. */ |
| 224 | __be32 flow_ip_xlate; /**< Translated flow IP address. */ |
| 225 | __be32 return_ip_xlate; /**< Translated return IP address. */ |
| 226 | __be16 flow_ident_xlate; /**< Translated flow identifier, e.g., port. */ |
| 227 | __be16 return_ident_xlate; /**< Translated return identifier, e.g., port. */ |
Xiaoping Fan | 0493b2d | 2015-08-21 19:09:38 -0700 | [diff] [blame] | 228 | }; |
| 229 | |
| 230 | /** |
Suruchi Agarwal | 0eec7f9 | 2022-02-11 14:07:09 -0800 | [diff] [blame] | 231 | * TCP connection rule structure. |
Xiaoping Fan | 0493b2d | 2015-08-21 19:09:38 -0700 | [diff] [blame] | 232 | */ |
| 233 | struct sfe_protocol_tcp_rule { |
Suruchi Agarwal | 0eec7f9 | 2022-02-11 14:07:09 -0800 | [diff] [blame] | 234 | u32 flow_max_window; /**< Flow direction's largest seen window. */ |
| 235 | u32 return_max_window; /**< Return direction's largest seen window. */ |
| 236 | u32 flow_end; /**< Flow direction's largest seen sequence + segment length. */ |
| 237 | u32 return_end; /**< Return direction's largest seen sequence + segment length. */ |
| 238 | u32 flow_max_end; /**< Flow direction's largest seen ack + max(1, win). */ |
| 239 | u32 return_max_end; /**< Return direction's largest seen ack + max(1, win). */ |
| 240 | u8 flow_window_scale; /**< Flow direction's window scaling factor. */ |
| 241 | u8 return_window_scale; /**< Return direction's window scaling factor. */ |
| 242 | u16 reserved; /**< Reserved; padding for alignment. */ |
Xiaoping Fan | 0493b2d | 2015-08-21 19:09:38 -0700 | [diff] [blame] | 243 | }; |
| 244 | |
| 245 | /** |
Wayne Tan | 1cabbf1 | 2022-05-01 13:01:45 -0700 | [diff] [blame] | 246 | * sfe_pppoe_br_accel_mode_t |
| 247 | * PPPoE bridge acceleration modes. |
| 248 | */ |
| 249 | typedef enum { |
| 250 | SFE_PPPOE_BR_ACCEL_MODE_DISABLED, /**< No acceleration */ |
| 251 | SFE_PPPOE_BR_ACCEL_MODE_EN_5T, /**< 5-tuple (src_ip, dest_ip, src_port, dest_port, protocol) acceleration */ |
| 252 | SFE_PPPOE_BR_ACCEL_MODE_EN_3T, /**< 3-tuple (src_ip, dest_ip, pppoe session id) acceleration */ |
| 253 | SFE_PPPOE_BR_ACCEL_MODE_MAX /**< Indicates the last item */ |
| 254 | } __attribute__ ((__packed__)) sfe_pppoe_br_accel_mode_t; |
| 255 | |
| 256 | /** |
Suruchi Agarwal | 0eec7f9 | 2022-02-11 14:07:09 -0800 | [diff] [blame] | 257 | * PPPoE connection rules structure. |
Xiaoping Fan | 0493b2d | 2015-08-21 19:09:38 -0700 | [diff] [blame] | 258 | */ |
| 259 | struct sfe_pppoe_rule { |
Xiaoping Fan | 6a1672f | 2016-08-17 19:58:12 -0700 | [diff] [blame] | 260 | u16 flow_pppoe_session_id; /**< Flow direction`s PPPoE session ID. */ |
Suruchi Agarwal | 0eec7f9 | 2022-02-11 14:07:09 -0800 | [diff] [blame] | 261 | u8 flow_pppoe_remote_mac[ETH_ALEN]; /**< Flow direction`s PPPoE server MAC address. */ |
| 262 | u16 return_pppoe_session_id; /**< Return direction's PPPoE session ID. */ |
| 263 | u8 return_pppoe_remote_mac[ETH_ALEN]; /**< Return direction's PPPoE server MAC address. */ |
Xiaoping Fan | 0493b2d | 2015-08-21 19:09:38 -0700 | [diff] [blame] | 264 | }; |
| 265 | |
Suruchi Suman | c1a4a61 | 2021-10-21 14:50:23 +0530 | [diff] [blame] | 266 | /** |
Suruchi Agarwal | 0eec7f9 | 2022-02-11 14:07:09 -0800 | [diff] [blame] | 267 | * Information for source MAC address rules. |
Ratheesh Kannoth | 29140aa | 2021-10-20 08:25:02 +0530 | [diff] [blame] | 268 | */ |
| 269 | struct sfe_src_mac_rule { |
| 270 | uint32_t mac_valid_flags; /**< MAC address validity flags. */ |
| 271 | uint16_t flow_src_mac[3]; /**< Source MAC address for the flow direction. */ |
| 272 | uint16_t return_src_mac[3]; /**< Source MAC address for the return direction. */ |
| 273 | }; |
| 274 | |
Xiaoping Fan | 0493b2d | 2015-08-21 19:09:38 -0700 | [diff] [blame] | 275 | /** |
Suruchi Agarwal | 0eec7f9 | 2022-02-11 14:07:09 -0800 | [diff] [blame] | 276 | * QoS connection rule structure. |
Xiaoping Fan | 0493b2d | 2015-08-21 19:09:38 -0700 | [diff] [blame] | 277 | */ |
| 278 | struct sfe_qos_rule { |
Suruchi Agarwal | 0eec7f9 | 2022-02-11 14:07:09 -0800 | [diff] [blame] | 279 | u32 flow_qos_tag; /**< QoS tag associated with this rule for flow direction. */ |
| 280 | u32 return_qos_tag; /**< QoS tag associated with this rule for return direction. */ |
Ken Zhu | 37040ea | 2021-09-09 21:11:15 -0700 | [diff] [blame] | 281 | }; |
| 282 | |
Xiaoping Fan | 0493b2d | 2015-08-21 19:09:38 -0700 | [diff] [blame] | 283 | /** |
Suruchi Agarwal | 0eec7f9 | 2022-02-11 14:07:09 -0800 | [diff] [blame] | 284 | * Mark rule structure. |
| 285 | */ |
| 286 | struct sfe_mark_rule { |
| 287 | u32 flow_mark; /**< SKB mark associated with this rule for flow direction. */ |
| 288 | u32 return_mark; /**< SKB mark associated with this rule for return direction. */ |
| 289 | }; |
| 290 | |
| 291 | /** |
| 292 | * DSCP connection rule structure. |
Xiaoping Fan | 0493b2d | 2015-08-21 19:09:38 -0700 | [diff] [blame] | 293 | */ |
| 294 | struct sfe_dscp_rule { |
Suruchi Agarwal | 0eec7f9 | 2022-02-11 14:07:09 -0800 | [diff] [blame] | 295 | u8 flow_dscp; /**< Egress DSCP value for flow direction. */ |
| 296 | u8 return_dscp; /**< Egress DSCP value for return direction. */ |
| 297 | u8 reserved[2]; /**< Reserved; padding for alignment. */ |
Xiaoping Fan | 0493b2d | 2015-08-21 19:09:38 -0700 | [diff] [blame] | 298 | }; |
| 299 | |
| 300 | /** |
Suruchi Agarwal | 0eec7f9 | 2022-02-11 14:07:09 -0800 | [diff] [blame] | 301 | * VLAN connection rule structure. |
Xiaoping Fan | 0493b2d | 2015-08-21 19:09:38 -0700 | [diff] [blame] | 302 | */ |
| 303 | struct sfe_vlan_rule { |
Suruchi Agarwal | 0eec7f9 | 2022-02-11 14:07:09 -0800 | [diff] [blame] | 304 | u32 ingress_vlan_tag; /**< VLAN tag for ingress packets. */ |
| 305 | u32 egress_vlan_tag; /**< VLAN tag for egress packets. */ |
Xiaoping Fan | 0493b2d | 2015-08-21 19:09:38 -0700 | [diff] [blame] | 306 | }; |
| 307 | |
| 308 | /** |
Suruchi Agarwal | 0eec7f9 | 2022-02-11 14:07:09 -0800 | [diff] [blame] | 309 | * Acceleration direction rule structure. |
| 310 | * Sometimes it is useful to accelerate traffic in one direction and not in another. |
Xiaoping Fan | ee0afe0 | 2015-09-10 17:34:00 -0700 | [diff] [blame] | 311 | */ |
| 312 | struct sfe_acceleration_direction_rule { |
Suruchi Agarwal | 0eec7f9 | 2022-02-11 14:07:09 -0800 | [diff] [blame] | 313 | u8 flow_accel; /**< Accelerate in flow direction. */ |
| 314 | u8 return_accel; /**< Accelerate in return direction. */ |
| 315 | u8 reserved[2]; /**< Reserved; padding for alignment. */ |
Xiaoping Fan | ee0afe0 | 2015-09-10 17:34:00 -0700 | [diff] [blame] | 316 | }; |
| 317 | |
| 318 | /** |
Suruchi Agarwal | 0eec7f9 | 2022-02-11 14:07:09 -0800 | [diff] [blame] | 319 | * Service class rule information in both directions. |
Parikshit Gune | d31a820 | 2022-01-05 22:15:04 +0530 | [diff] [blame] | 320 | */ |
| 321 | struct sfe_service_class_rule { |
Ken Zhu | 7a43d88 | 2022-01-04 10:51:44 -0800 | [diff] [blame] | 322 | uint32_t flow_mark; /**< Service class information in flow direction. */ |
| 323 | uint32_t return_mark; /**< Service class information in return direction. */ |
Parikshit Gune | d31a820 | 2022-01-05 22:15:04 +0530 | [diff] [blame] | 324 | }; |
| 325 | |
| 326 | /** |
Suruchi Agarwal | 0eec7f9 | 2022-02-11 14:07:09 -0800 | [diff] [blame] | 327 | * IPv4 rule create submessage structure. |
Xiaoping Fan | 0493b2d | 2015-08-21 19:09:38 -0700 | [diff] [blame] | 328 | */ |
| 329 | struct sfe_ipv4_rule_create_msg { |
| 330 | /* Request */ |
Suruchi Agarwal | 0eec7f9 | 2022-02-11 14:07:09 -0800 | [diff] [blame] | 331 | u16 valid_flags; /**< Bit flags associated with paramater validity. */ |
| 332 | u16 rule_flags; /**< Bit flags associated with the rule. */ |
Xiaoping Fan | 0493b2d | 2015-08-21 19:09:38 -0700 | [diff] [blame] | 333 | |
Suruchi Agarwal | 0eec7f9 | 2022-02-11 14:07:09 -0800 | [diff] [blame] | 334 | struct sfe_ipv4_5tuple tuple; /**< Holds values of 5-tuple. */ |
Xiaoping Fan | 0493b2d | 2015-08-21 19:09:38 -0700 | [diff] [blame] | 335 | |
Suruchi Agarwal | 0eec7f9 | 2022-02-11 14:07:09 -0800 | [diff] [blame] | 336 | struct sfe_ipv4_connection_rule conn_rule; /**< Basic connection-specific data. */ |
| 337 | struct sfe_protocol_tcp_rule tcp_rule; /**< TCP-related acceleration parameters. */ |
| 338 | struct sfe_pppoe_rule pppoe_rule; /**< PPPoE-related acceleration parameters. */ |
| 339 | struct sfe_qos_rule qos_rule; /**< QoS-related acceleration parameters. */ |
| 340 | struct sfe_src_mac_rule src_mac_rule; /**< Source MAC address rule. */ |
| 341 | struct sfe_mark_rule mark_rule; /**< SKB mark-related acceleration parameters. */ |
| 342 | struct sfe_dscp_rule dscp_rule; /**< DSCP-related acceleration parameters. */ |
| 343 | struct sfe_vlan_rule vlan_primary_rule; /**< Primary VLAN-related acceleration parameters. */ |
| 344 | struct sfe_vlan_rule vlan_secondary_rule; /**< Secondary VLAN-related acceleration parameters. */ |
Xiaoping Fan | ee0afe0 | 2015-09-10 17:34:00 -0700 | [diff] [blame] | 345 | #ifdef CONFIG_XFRM |
Suruchi Agarwal | 0eec7f9 | 2022-02-11 14:07:09 -0800 | [diff] [blame] | 346 | struct sfe_acceleration_direction_rule direction_rule; |
| 347 | /**< Direction related acceleration parameters. */ |
Xiaoping Fan | ee0afe0 | 2015-09-10 17:34:00 -0700 | [diff] [blame] | 348 | #endif |
Xiaoping Fan | 0493b2d | 2015-08-21 19:09:38 -0700 | [diff] [blame] | 349 | /* Response */ |
Parikshit Gune | d31a820 | 2022-01-05 22:15:04 +0530 | [diff] [blame] | 350 | struct sfe_service_class_rule sawf_rule; |
| 351 | /**< Service class related information */ |
Suruchi Agarwal | 0eec7f9 | 2022-02-11 14:07:09 -0800 | [diff] [blame] | 352 | u32 index; /**< Slot ID for cache statistics to host OS. */ |
Xiaoping Fan | 0493b2d | 2015-08-21 19:09:38 -0700 | [diff] [blame] | 353 | }; |
| 354 | |
| 355 | /** |
Suruchi Agarwal | 0eec7f9 | 2022-02-11 14:07:09 -0800 | [diff] [blame] | 356 | * IPv4 rule destroy submessage structure. |
Xiaoping Fan | 0493b2d | 2015-08-21 19:09:38 -0700 | [diff] [blame] | 357 | */ |
| 358 | struct sfe_ipv4_rule_destroy_msg { |
Suruchi Agarwal | 0eec7f9 | 2022-02-11 14:07:09 -0800 | [diff] [blame] | 359 | struct sfe_ipv4_5tuple tuple; /**< Holds values of 5-tuple. */ |
Xiaoping Fan | 0493b2d | 2015-08-21 19:09:38 -0700 | [diff] [blame] | 360 | }; |
| 361 | |
| 362 | /** |
| 363 | * The SFE IPv4 rule sync structure. |
| 364 | */ |
| 365 | struct sfe_ipv4_conn_sync { |
Suruchi Agarwal | 0eec7f9 | 2022-02-11 14:07:09 -0800 | [diff] [blame] | 366 | u32 index; /**< Slot ID for cache statistics to host OS. */ |
| 367 | u8 protocol; /**< Protocol number. */ |
| 368 | __be32 flow_ip; /**< Flow IP address. */ |
| 369 | __be32 flow_ip_xlate; /**< Translated flow IP address. */ |
| 370 | __be16 flow_ident; /**< Flow identifier, e.g., port. */ |
| 371 | __be16 flow_ident_xlate; /**< Translated flow identifier, e.g., port. */ |
| 372 | u32 flow_max_window; /**< Flow direction's largest seen window. */ |
| 373 | u32 flow_end; /**< Flow direction's largest seen sequence + segment length. */ |
| 374 | u32 flow_max_end; /**< Flow direction's largest seen ack + max(1, win). */ |
| 375 | u32 flow_rx_packet_count; /**< Flow interface's Rx packet count. */ |
| 376 | u32 flow_rx_byte_count; /**< Flow interface's Rx byte count. */ |
| 377 | u32 flow_tx_packet_count; /**< Flow interface's Tx packet count. */ |
| 378 | u32 flow_tx_byte_count; /**< Flow interface's Tx byte count. */ |
| 379 | u16 flow_pppoe_session_id; /**< Flow interface`s PPPoE session ID. */ |
| 380 | u16 flow_pppoe_remote_mac[3]; /**< Flow interface's PPPoE remote server MAC address (if present). */ |
| 381 | __be32 return_ip; /**< Return IP address. */ |
Xiaoping Fan | 0493b2d | 2015-08-21 19:09:38 -0700 | [diff] [blame] | 382 | __be32 return_ip_xlate; /**< Translated return IP address */ |
Suruchi Agarwal | 0eec7f9 | 2022-02-11 14:07:09 -0800 | [diff] [blame] | 383 | __be16 return_ident; /**< Return identifier, e.g., port. */ |
| 384 | __be16 return_ident_xlate; /**< Translated return identifier, e.g., port. */ |
| 385 | u32 return_max_window; /**< Return direction's largest seen window. */ |
| 386 | u32 return_end; /**< Return direction's largest seen sequence + segment length. */ |
| 387 | u32 return_max_end; /**< Return direction's largest seen ack + max(1, win). */ |
| 388 | u32 return_rx_packet_count; /**< Return interface's Rx packet count. */ |
| 389 | u32 return_rx_byte_count; /**< Return interface's Rx byte count. */ |
| 390 | u32 return_tx_packet_count; /**< Return interface's Tx packet count. */ |
| 391 | u32 return_tx_byte_count; /**< Return interface's Tx byte count. */ |
| 392 | u16 return_pppoe_session_id; /**< Return interface`s PPPoE session ID. */ |
| 393 | u16 return_pppoe_remote_mac[3]; /**< Return interface's PPPoE remote server MAC address (if present). */ |
| 394 | u32 inc_ticks; /**< Number of ticks since the last sync. */ |
| 395 | u32 reason; /**< Synchronization reason. */ |
Xiaoping Fan | 0493b2d | 2015-08-21 19:09:38 -0700 | [diff] [blame] | 396 | |
Suruchi Agarwal | 0eec7f9 | 2022-02-11 14:07:09 -0800 | [diff] [blame] | 397 | u8 flags; /**< Bit flags associated with the rule. */ |
| 398 | u32 qos_tag; /**< QoS tag. */ |
| 399 | u32 cause; /**< Flush cause. */ |
Xiaoping Fan | 0493b2d | 2015-08-21 19:09:38 -0700 | [diff] [blame] | 400 | }; |
| 401 | |
| 402 | /** |
Ken Zhu | 7a43d88 | 2022-01-04 10:51:44 -0800 | [diff] [blame] | 403 | * Information for a multiple IPv4 connection statistics synchronization message. |
| 404 | */ |
| 405 | struct sfe_ipv4_conn_sync_many_msg { |
| 406 | /* |
| 407 | * Request |
| 408 | */ |
| 409 | uint16_t index; /**< Request connection statistics from the index. */ |
| 410 | uint16_t size; /**< Buffer size of this message. */ |
| 411 | |
| 412 | /* |
| 413 | * Response |
| 414 | */ |
| 415 | uint16_t next; /**< Firmware response for the next connection to be requested. */ |
| 416 | uint16_t count; /**< Number of synchronized connections included in this message. */ |
| 417 | struct sfe_ipv4_conn_sync conn_sync[]; /**< Array for the statistics. */ |
| 418 | }; |
| 419 | |
| 420 | /** |
Suruchi Agarwal | 0eec7f9 | 2022-02-11 14:07:09 -0800 | [diff] [blame] | 421 | * Message structure to send/receive IPv4 bridge/route commands |
| 422 | */ |
| 423 | struct sfe_ipv4_msg { |
| 424 | struct sfe_cmn_msg cm; /**< Message header. */ |
| 425 | union { |
| 426 | struct sfe_ipv4_rule_create_msg rule_create; /**< Rule create message. */ |
| 427 | struct sfe_ipv4_rule_destroy_msg rule_destroy; /**< Rule destroy message. */ |
Ken Zhu | 7a43d88 | 2022-01-04 10:51:44 -0800 | [diff] [blame] | 428 | struct sfe_ipv4_conn_sync conn_stats; /**< Connection statistics synchronization message. */ |
| 429 | struct sfe_ipv4_conn_sync_many_msg conn_stats_many; |
| 430 | /**< Many connections' statistics synchronization message. */ |
Suruchi Agarwal | 0eec7f9 | 2022-02-11 14:07:09 -0800 | [diff] [blame] | 431 | } msg; /**< IPv4 message. */ |
| 432 | }; |
| 433 | |
| 434 | /** |
| 435 | * @} |
| 436 | */ |
| 437 | |
| 438 | /** |
| 439 | * @addtogroup nss_sfe_functions |
| 440 | * @{ |
| 441 | */ |
| 442 | |
| 443 | /** |
| 444 | * IPv4 message received callback. |
Xiaoping Fan | 0493b2d | 2015-08-21 19:09:38 -0700 | [diff] [blame] | 445 | */ |
| 446 | typedef void (*sfe_ipv4_msg_callback_t)(void *app_data, struct sfe_ipv4_msg *msg); |
| 447 | |
| 448 | /** |
Suruchi Agarwal | 0eec7f9 | 2022-02-11 14:07:09 -0800 | [diff] [blame] | 449 | * @} |
| 450 | */ |
| 451 | |
| 452 | /** |
| 453 | * @addtogroup nss_sfe_datatypes |
| 454 | * @{ |
| 455 | */ |
| 456 | |
| 457 | /** |
Ratheesh Kannoth | 24fb1db | 2021-10-20 07:28:06 +0530 | [diff] [blame] | 458 | * IPv6 5-tuple structure. |
| 459 | */ |
| 460 | struct sfe_ipv6_5tuple { |
Suruchi Agarwal | 0eec7f9 | 2022-02-11 14:07:09 -0800 | [diff] [blame] | 461 | __be32 flow_ip[4]; /**< Flow IP address. */ |
| 462 | __be32 return_ip[4]; /**< Return IP address. */ |
| 463 | __be16 flow_ident; /**< Flow identifier, e.g.,TCP/UDP port. */ |
| 464 | __be16 return_ident; /**< Return identifier, e.g., TCP/UDP port. */ |
| 465 | u8 protocol; /**< Protocol number. */ |
| 466 | u8 reserved[3]; /**< Reserved; padding for alignment. */ |
Ratheesh Kannoth | 24fb1db | 2021-10-20 07:28:06 +0530 | [diff] [blame] | 467 | }; |
| 468 | |
| 469 | /** |
| 470 | * IPv6 connection rule structure. |
| 471 | */ |
| 472 | struct sfe_ipv6_connection_rule { |
Suruchi Agarwal | 0eec7f9 | 2022-02-11 14:07:09 -0800 | [diff] [blame] | 473 | u8 flow_mac[6]; /**< Flow MAC address. */ |
| 474 | u8 return_mac[6]; /**< Return MAC address. */ |
| 475 | s32 flow_interface_num; /**< Flow interface number. */ |
| 476 | s32 return_interface_num; /**< Return interface number. */ |
| 477 | s32 flow_top_interface_num; /**< Top flow interface number. */ |
| 478 | s32 return_top_interface_num; /**< Top return interface number. */ |
| 479 | u32 flow_mtu; /**< Flow interface's MTU. */ |
| 480 | u32 return_mtu; /**< Return interface's MTU. */ |
Ratheesh Kannoth | 24fb1db | 2021-10-20 07:28:06 +0530 | [diff] [blame] | 481 | }; |
| 482 | |
| 483 | /** |
Suruchi Agarwal | 0eec7f9 | 2022-02-11 14:07:09 -0800 | [diff] [blame] | 484 | * IPv6 rule create submessage structure. |
Xiaoping Fan | 0493b2d | 2015-08-21 19:09:38 -0700 | [diff] [blame] | 485 | */ |
| 486 | struct sfe_ipv6_rule_create_msg { |
| 487 | /* |
| 488 | * Request |
| 489 | */ |
Suruchi Agarwal | 0eec7f9 | 2022-02-11 14:07:09 -0800 | [diff] [blame] | 490 | u16 valid_flags; /**< Bit flags associated with parameter validity. */ |
| 491 | u16 rule_flags; /**< Bit flags associated with the rule. */ |
| 492 | struct sfe_ipv6_5tuple tuple; /**< Holds values of the sfe_ipv6_5tuple tuple. */ |
| 493 | struct sfe_ipv6_connection_rule conn_rule; /**< Basic connection-specific data. */ |
| 494 | struct sfe_protocol_tcp_rule tcp_rule; /**< Protocol-related acceleration parameters. */ |
| 495 | struct sfe_pppoe_rule pppoe_rule; /**< PPPoE-related acceleration parameters. */ |
| 496 | struct sfe_qos_rule qos_rule; /**< QoS-related acceleration parameters. */ |
| 497 | struct sfe_src_mac_rule src_mac_rule; /**< Source MAC address rule. */ |
| 498 | struct sfe_mark_rule mark_rule; /**< SKB mark-related acceleration parameters. */ |
| 499 | struct sfe_dscp_rule dscp_rule; /**< DSCP-related acceleration parameters. */ |
| 500 | struct sfe_vlan_rule vlan_primary_rule; /**< VLAN-related acceleration parameters. */ |
| 501 | struct sfe_vlan_rule vlan_secondary_rule; /**< VLAN-related acceleration parameters. */ |
Xiaoping Fan | ee0afe0 | 2015-09-10 17:34:00 -0700 | [diff] [blame] | 502 | #ifdef CONFIG_XFRM |
Suruchi Agarwal | 0eec7f9 | 2022-02-11 14:07:09 -0800 | [diff] [blame] | 503 | struct sfe_acceleration_direction_rule direction_rule; |
| 504 | /**< Direction-related acceleration parameters. */ |
Xiaoping Fan | ee0afe0 | 2015-09-10 17:34:00 -0700 | [diff] [blame] | 505 | #endif |
Xiaoping Fan | 0493b2d | 2015-08-21 19:09:38 -0700 | [diff] [blame] | 506 | /* |
| 507 | * Response |
| 508 | */ |
Suruchi Agarwal | 0eec7f9 | 2022-02-11 14:07:09 -0800 | [diff] [blame] | 509 | struct sfe_service_class_rule sawf_rule; /**< Service class related information. */ |
| 510 | u32 index; /**< Slot ID for cache statistics to host OS. */ |
Xiaoping Fan | 0493b2d | 2015-08-21 19:09:38 -0700 | [diff] [blame] | 511 | }; |
| 512 | |
| 513 | /** |
Suruchi Agarwal | 0eec7f9 | 2022-02-11 14:07:09 -0800 | [diff] [blame] | 514 | * IPv6 rule destroy submessage structure. |
Xiaoping Fan | 0493b2d | 2015-08-21 19:09:38 -0700 | [diff] [blame] | 515 | */ |
| 516 | struct sfe_ipv6_rule_destroy_msg { |
Suruchi Agarwal | 0eec7f9 | 2022-02-11 14:07:09 -0800 | [diff] [blame] | 517 | struct sfe_ipv6_5tuple tuple; /**< Holds values of the sfe_ipv6_5tuple tuple */ |
Xiaoping Fan | 0493b2d | 2015-08-21 19:09:38 -0700 | [diff] [blame] | 518 | }; |
| 519 | |
| 520 | /** |
Suruchi Agarwal | 0eec7f9 | 2022-02-11 14:07:09 -0800 | [diff] [blame] | 521 | * SFE IPv6 rule sync structure. |
Xiaoping Fan | 0493b2d | 2015-08-21 19:09:38 -0700 | [diff] [blame] | 522 | */ |
| 523 | struct sfe_ipv6_conn_sync { |
Suruchi Agarwal | 0eec7f9 | 2022-02-11 14:07:09 -0800 | [diff] [blame] | 524 | u32 index; /**< Slot ID for cache statistics to host OS. */ |
| 525 | u8 protocol; /**< Protocol number. */ |
| 526 | __be32 flow_ip[4]; /**< Flow IP address. */ |
| 527 | __be16 flow_ident; /**< Flow identifier, e.g., port. */ |
| 528 | u32 flow_max_window; /**< Flow direction's largest seen window. */ |
| 529 | u32 flow_end; /**< Flow direction's largest seen sequence + segment length. */ |
| 530 | u32 flow_max_end; /**< Flow direction's largest seen ack + max(1, win). */ |
| 531 | u32 flow_rx_packet_count; /**< Flow interface's Rx packet count. */ |
| 532 | u32 flow_rx_byte_count; /**< Flow interface's Rx byte count. */ |
| 533 | u32 flow_tx_packet_count; /**< Flow interface's Tx packet count. */ |
| 534 | u32 flow_tx_byte_count; /**< Flow interface's Tx byte count. */ |
| 535 | u16 flow_pppoe_session_id; /**< Flow interface`s PPPoE session ID. */ |
| 536 | u16 flow_pppoe_remote_mac[3]; /**< Flow interface's PPPoE remote server MAC address (if present). */ |
| 537 | __be32 return_ip[4]; /**< Return IP address. */ |
| 538 | __be16 return_ident; /**< Return identifer, e.g., port. */ |
| 539 | u32 return_max_window; /**< Return direction's largest seen window. */ |
| 540 | u32 return_end; /**< Return direction's largest seen sequence + segment length. */ |
| 541 | u32 return_max_end; /**< Return direction's largest seen ack + max(1, win). */ |
| 542 | u32 return_rx_packet_count; /**< Return interface's Rx packet count. */ |
| 543 | u32 return_rx_byte_count; /**< Return interface's Rx byte count. */ |
| 544 | u32 return_tx_packet_count; /**< Return interface's Tx packet count. */ |
| 545 | u32 return_tx_byte_count; /**< Return interface's Tx byte count. */ |
| 546 | u16 return_pppoe_session_id; /**< Return interface`s PPPoE session ID. */ |
| 547 | u16 return_pppoe_remote_mac[3]; /**< Return interface's PPPoE remote server MAC address (if present). */ |
| 548 | u32 inc_ticks; /**< Number of ticks since the last sync. */ |
| 549 | u32 reason; /**< Sync reason. */ |
| 550 | u8 flags; /**< Bit flags associated with the rule. */ |
| 551 | u32 qos_tag; /**< QoS tag. */ |
| 552 | u32 cause; /**< Flush cause associated with the rule. */ |
Xiaoping Fan | 0493b2d | 2015-08-21 19:09:38 -0700 | [diff] [blame] | 553 | }; |
| 554 | |
| 555 | /** |
Ken Zhu | 7a43d88 | 2022-01-04 10:51:44 -0800 | [diff] [blame] | 556 | * Information for a multiple IPv6 connection statistics synchronization message. |
| 557 | */ |
| 558 | struct sfe_ipv6_conn_sync_many_msg { |
| 559 | /* |
| 560 | * Request: |
| 561 | */ |
| 562 | uint16_t index; /**< Request connection statistics from the index. */ |
| 563 | uint16_t size; /**< Buffer size of this message. */ |
| 564 | |
| 565 | /* |
| 566 | * Response: |
| 567 | */ |
| 568 | uint16_t next; /**< Firmware response for the next connection to be requested. */ |
| 569 | uint16_t count; /**< Number of synchronized connections included in this message. */ |
| 570 | struct sfe_ipv6_conn_sync conn_sync[]; /**< Array for the statistics. */ |
| 571 | }; |
| 572 | |
| 573 | /** |
Suruchi Agarwal | 0eec7f9 | 2022-02-11 14:07:09 -0800 | [diff] [blame] | 574 | * Message structure to send/receive IPv6 bridge/route commands. |
Xiaoping Fan | 0493b2d | 2015-08-21 19:09:38 -0700 | [diff] [blame] | 575 | */ |
| 576 | struct sfe_ipv6_msg { |
Suruchi Agarwal | 0eec7f9 | 2022-02-11 14:07:09 -0800 | [diff] [blame] | 577 | struct sfe_cmn_msg cm; /**< Message header. */ |
Xiaoping Fan | 0493b2d | 2015-08-21 19:09:38 -0700 | [diff] [blame] | 578 | union { |
Suruchi Agarwal | 0eec7f9 | 2022-02-11 14:07:09 -0800 | [diff] [blame] | 579 | struct sfe_ipv6_rule_create_msg rule_create; |
| 580 | /**< Rule create message. */ |
| 581 | struct sfe_ipv6_rule_destroy_msg rule_destroy; |
| 582 | /**< Rule destroy message. */ |
| 583 | struct sfe_ipv6_conn_sync conn_stats; |
Ken Zhu | 7a43d88 | 2022-01-04 10:51:44 -0800 | [diff] [blame] | 584 | /**< Statistics synchronization message. */ |
| 585 | struct sfe_ipv6_conn_sync_many_msg conn_stats_many; |
| 586 | /**< Many Connections' statistics synchronizaion message. */ |
Suruchi Agarwal | 0eec7f9 | 2022-02-11 14:07:09 -0800 | [diff] [blame] | 587 | } msg; /**< IPv6 message. */ |
Xiaoping Fan | 0493b2d | 2015-08-21 19:09:38 -0700 | [diff] [blame] | 588 | }; |
| 589 | |
| 590 | /** |
Suruchi Agarwal | 0eec7f9 | 2022-02-11 14:07:09 -0800 | [diff] [blame] | 591 | * @} |
| 592 | */ |
| 593 | |
| 594 | /** |
| 595 | * @addtogroup nss_sfe_functions |
| 596 | * @{ |
| 597 | */ |
| 598 | |
| 599 | /** |
| 600 | * IPv6 message received callback. |
Xiaoping Fan | 0493b2d | 2015-08-21 19:09:38 -0700 | [diff] [blame] | 601 | */ |
| 602 | typedef void (*sfe_ipv6_msg_callback_t)(void *app_data, struct sfe_ipv6_msg *msg); |
| 603 | |
| 604 | /** |
Suruchi Agarwal | 0eec7f9 | 2022-02-11 14:07:09 -0800 | [diff] [blame] | 605 | * @} |
| 606 | */ |
| 607 | |
| 608 | /** |
| 609 | * @addtogroup nss_sfe_datatypes |
| 610 | * @{ |
| 611 | */ |
| 612 | |
| 613 | /** |
| 614 | * 6rd tunnel peer address. |
Xiaoping Fan | 0493b2d | 2015-08-21 19:09:38 -0700 | [diff] [blame] | 615 | */ |
| 616 | struct sfe_tun6rd_set_peer_msg { |
Suruchi Agarwal | 0eec7f9 | 2022-02-11 14:07:09 -0800 | [diff] [blame] | 617 | __be32 ipv6_address[4]; /**< The peer's IPv6 address. */ |
| 618 | __be32 dest; /**< The peer's IPv4 address. */ |
Xiaoping Fan | 0493b2d | 2015-08-21 19:09:38 -0700 | [diff] [blame] | 619 | }; |
| 620 | |
| 621 | /** |
Suruchi Agarwal | 0eec7f9 | 2022-02-11 14:07:09 -0800 | [diff] [blame] | 622 | * Message structure to send/receive 6rd tunnel messages. |
Xiaoping Fan | 0493b2d | 2015-08-21 19:09:38 -0700 | [diff] [blame] | 623 | */ |
| 624 | struct sfe_tun6rd_msg { |
Suruchi Agarwal | 0eec7f9 | 2022-02-11 14:07:09 -0800 | [diff] [blame] | 625 | struct sfe_cmn_msg cm; /**< Message header. */ |
Xiaoping Fan | 0493b2d | 2015-08-21 19:09:38 -0700 | [diff] [blame] | 626 | union { |
Suruchi Agarwal | 0eec7f9 | 2022-02-11 14:07:09 -0800 | [diff] [blame] | 627 | struct sfe_tun6rd_set_peer_msg peer; /**< Add or update peer message. */ |
| 628 | } msg; /**< 6RD tunnel message. */ |
Xiaoping Fan | 0493b2d | 2015-08-21 19:09:38 -0700 | [diff] [blame] | 629 | }; |
| 630 | |
Suruchi Agarwal | 0eec7f9 | 2022-02-11 14:07:09 -0800 | [diff] [blame] | 631 | /** |
Ratheesh Kannoth | 24fb1db | 2021-10-20 07:28:06 +0530 | [diff] [blame] | 632 | * SFE context instance. |
Xiaoping Fan | 0493b2d | 2015-08-21 19:09:38 -0700 | [diff] [blame] | 633 | */ |
Ratheesh Kannoth | 24fb1db | 2021-10-20 07:28:06 +0530 | [diff] [blame] | 634 | struct sfe_ctx_instance { |
Suruchi Agarwal | 0eec7f9 | 2022-02-11 14:07:09 -0800 | [diff] [blame] | 635 | int not_used; /**< Not used. */ |
Xiaoping Fan | 0493b2d | 2015-08-21 19:09:38 -0700 | [diff] [blame] | 636 | }; |
| 637 | |
Suruchi Agarwal | 0eec7f9 | 2022-02-11 14:07:09 -0800 | [diff] [blame] | 638 | /** |
| 639 | * @} |
| 640 | */ |
| 641 | |
| 642 | /** |
| 643 | * @addtogroup nss_sfe_functions |
| 644 | * @{ |
| 645 | */ |
| 646 | |
| 647 | /** |
Jackson Bockus | 3fafbf3 | 2022-02-13 17:15:26 -0800 | [diff] [blame] | 648 | * Copy the IPv4 statistics for the given service class. |
| 649 | * |
| 650 | * @param sid Service class ID |
| 651 | * @param bytes Pointer to where byte count should be written. |
| 652 | * @param packets Pointer to where packet count should be written. |
| 653 | * |
| 654 | * @return |
| 655 | * True if successful, false if maximum retries exceeded; bool. |
| 656 | */ |
| 657 | extern bool sfe_service_class_stats_get(uint8_t sid, uint64_t *bytes, uint64_t *packets); |
| 658 | |
| 659 | /** |
Suruchi Agarwal | 0eec7f9 | 2022-02-11 14:07:09 -0800 | [diff] [blame] | 660 | * Gets the maximum number of IPv4 connections supported by the SFE acceleration engine. |
Xiaoping Fan | 0493b2d | 2015-08-21 19:09:38 -0700 | [diff] [blame] | 661 | * |
Suruchi Agarwal | 0eec7f9 | 2022-02-11 14:07:09 -0800 | [diff] [blame] | 662 | * @return |
| 663 | * The maximum number of connections that can be accelerated by the SFE. |
Xiaoping Fan | 0493b2d | 2015-08-21 19:09:38 -0700 | [diff] [blame] | 664 | */ |
Ratheesh Kannoth | 24fb1db | 2021-10-20 07:28:06 +0530 | [diff] [blame] | 665 | int sfe_ipv4_max_conn_count(void); |
Xiaoping Fan | 0493b2d | 2015-08-21 19:09:38 -0700 | [diff] [blame] | 666 | |
Suruchi Agarwal | 0eec7f9 | 2022-02-11 14:07:09 -0800 | [diff] [blame] | 667 | /** |
| 668 | * Transmits an IPv4 message to the SFE. |
Xiaoping Fan | 0493b2d | 2015-08-21 19:09:38 -0700 | [diff] [blame] | 669 | * |
Suruchi Agarwal | 0eec7f9 | 2022-02-11 14:07:09 -0800 | [diff] [blame] | 670 | * @param sfe_ctx SFE context. |
| 671 | * @param msg The IPv4 message. |
Xiaoping Fan | 0493b2d | 2015-08-21 19:09:38 -0700 | [diff] [blame] | 672 | * |
Suruchi Agarwal | 0eec7f9 | 2022-02-11 14:07:09 -0800 | [diff] [blame] | 673 | * @return |
| 674 | * The status of the Tx operation (#sfe_tx_status_t). |
Xiaoping Fan | 0493b2d | 2015-08-21 19:09:38 -0700 | [diff] [blame] | 675 | */ |
Ratheesh Kannoth | 24fb1db | 2021-10-20 07:28:06 +0530 | [diff] [blame] | 676 | extern sfe_tx_status_t sfe_ipv4_tx(struct sfe_ctx_instance *sfe_ctx, struct sfe_ipv4_msg *msg); |
Xiaoping Fan | 0493b2d | 2015-08-21 19:09:38 -0700 | [diff] [blame] | 677 | |
Suruchi Agarwal | 0eec7f9 | 2022-02-11 14:07:09 -0800 | [diff] [blame] | 678 | /** |
| 679 | * Registers a notifier callback for IPv4 messages from the SFE. |
Xiaoping Fan | 0493b2d | 2015-08-21 19:09:38 -0700 | [diff] [blame] | 680 | * |
Ken Zhu | 7a43d88 | 2022-01-04 10:51:44 -0800 | [diff] [blame] | 681 | * @param one_rule_cb The callback pointer for one rule. |
| 682 | * @param many_rules_cb The callback pointer for many rules. |
Suruchi Agarwal | 0eec7f9 | 2022-02-11 14:07:09 -0800 | [diff] [blame] | 683 | * @param app_data The application context for this message. |
Xiaoping Fan | 0493b2d | 2015-08-21 19:09:38 -0700 | [diff] [blame] | 684 | * |
Suruchi Agarwal | 0eec7f9 | 2022-02-11 14:07:09 -0800 | [diff] [blame] | 685 | * @return |
| 686 | * The SFE context (#sfe_ctx_instance). |
Xiaoping Fan | 0493b2d | 2015-08-21 19:09:38 -0700 | [diff] [blame] | 687 | */ |
Ken Zhu | 7a43d88 | 2022-01-04 10:51:44 -0800 | [diff] [blame] | 688 | extern struct sfe_ctx_instance *sfe_ipv4_notify_register(sfe_ipv4_msg_callback_t one_rule_cb, |
| 689 | sfe_ipv4_msg_callback_t many_rules_cb,void *app_data); |
Xiaoping Fan | 0493b2d | 2015-08-21 19:09:38 -0700 | [diff] [blame] | 690 | |
Suruchi Agarwal | 0eec7f9 | 2022-02-11 14:07:09 -0800 | [diff] [blame] | 691 | /** |
| 692 | * Unregisters a notifier callback for IPv4 messages from the SFE. |
| 693 | * |
| 694 | * @return |
| 695 | * None. |
Xiaoping Fan | 0493b2d | 2015-08-21 19:09:38 -0700 | [diff] [blame] | 696 | */ |
Ratheesh Kannoth | 24fb1db | 2021-10-20 07:28:06 +0530 | [diff] [blame] | 697 | extern void sfe_ipv4_notify_unregister(void); |
Xiaoping Fan | 0493b2d | 2015-08-21 19:09:38 -0700 | [diff] [blame] | 698 | |
Suruchi Agarwal | 0eec7f9 | 2022-02-11 14:07:09 -0800 | [diff] [blame] | 699 | /** |
| 700 | * Initializes an IPv4 message. |
| 701 | * |
| 702 | * @param nim The IPv4 message pointer. |
| 703 | * @param if_num The interface number. |
| 704 | * @param type The type of the message. |
| 705 | * @param len The length of the message. |
| 706 | * @param cb The message callback. |
| 707 | * @param app_data The application context for this message. |
| 708 | * |
Xiaoping Fan | 0493b2d | 2015-08-21 19:09:38 -0700 | [diff] [blame] | 709 | */ |
Xiaoping Fan | 6a1672f | 2016-08-17 19:58:12 -0700 | [diff] [blame] | 710 | extern void sfe_ipv4_msg_init(struct sfe_ipv4_msg *nim, u16 if_num, u32 type, u32 len, |
Xiaoping Fan | 0493b2d | 2015-08-21 19:09:38 -0700 | [diff] [blame] | 711 | sfe_ipv4_msg_callback_t cb, void *app_data); |
| 712 | |
Suruchi Agarwal | 0eec7f9 | 2022-02-11 14:07:09 -0800 | [diff] [blame] | 713 | /** |
| 714 | * Gets the maximum number of IPv6 connections supported by the SFE acceleration engine. |
Xiaoping Fan | 0493b2d | 2015-08-21 19:09:38 -0700 | [diff] [blame] | 715 | * |
Suruchi Agarwal | 0eec7f9 | 2022-02-11 14:07:09 -0800 | [diff] [blame] | 716 | * @return |
| 717 | * The maximum number of connections that can be accelerated by the SFE; integer. |
Xiaoping Fan | 0493b2d | 2015-08-21 19:09:38 -0700 | [diff] [blame] | 718 | */ |
Ratheesh Kannoth | 24fb1db | 2021-10-20 07:28:06 +0530 | [diff] [blame] | 719 | int sfe_ipv6_max_conn_count(void); |
Xiaoping Fan | 0493b2d | 2015-08-21 19:09:38 -0700 | [diff] [blame] | 720 | |
Suruchi Agarwal | 0eec7f9 | 2022-02-11 14:07:09 -0800 | [diff] [blame] | 721 | /** |
| 722 | * Transmits an IPv6 message to the SFE. |
Xiaoping Fan | 0493b2d | 2015-08-21 19:09:38 -0700 | [diff] [blame] | 723 | * |
Suruchi Agarwal | 0eec7f9 | 2022-02-11 14:07:09 -0800 | [diff] [blame] | 724 | * @param sfe_ctx The SFE context. |
| 725 | * @param msg The IPv6 message. |
Xiaoping Fan | 0493b2d | 2015-08-21 19:09:38 -0700 | [diff] [blame] | 726 | * |
Suruchi Agarwal | 0eec7f9 | 2022-02-11 14:07:09 -0800 | [diff] [blame] | 727 | * @return |
| 728 | * The status of the Tx operation (#sfe_tx_status_t). |
Xiaoping Fan | 0493b2d | 2015-08-21 19:09:38 -0700 | [diff] [blame] | 729 | */ |
Ratheesh Kannoth | 24fb1db | 2021-10-20 07:28:06 +0530 | [diff] [blame] | 730 | extern sfe_tx_status_t sfe_ipv6_tx(struct sfe_ctx_instance *sfe_ctx, struct sfe_ipv6_msg *msg); |
Xiaoping Fan | 0493b2d | 2015-08-21 19:09:38 -0700 | [diff] [blame] | 731 | |
Suruchi Agarwal | 0eec7f9 | 2022-02-11 14:07:09 -0800 | [diff] [blame] | 732 | /** |
| 733 | * Registers a notifier callback for IPv6 messages from the SFE. |
Xiaoping Fan | 0493b2d | 2015-08-21 19:09:38 -0700 | [diff] [blame] | 734 | * |
Ken Zhu | 7a43d88 | 2022-01-04 10:51:44 -0800 | [diff] [blame] | 735 | * @param one_rule_cb The callback pointer for one rule. |
| 736 | * @param many_rules_cb The callback pointer for many rules. |
Xiaoping Fan | 0493b2d | 2015-08-21 19:09:38 -0700 | [diff] [blame] | 737 | * |
Suruchi Agarwal | 0eec7f9 | 2022-02-11 14:07:09 -0800 | [diff] [blame] | 738 | * @return |
| 739 | * The SFE context (#sfe_ctx_instance). |
Xiaoping Fan | 0493b2d | 2015-08-21 19:09:38 -0700 | [diff] [blame] | 740 | */ |
Ken Zhu | 7a43d88 | 2022-01-04 10:51:44 -0800 | [diff] [blame] | 741 | extern struct sfe_ctx_instance *sfe_ipv6_notify_register(sfe_ipv6_msg_callback_t one_rule_cb, |
| 742 | sfe_ipv6_msg_callback_t many_rules_cb,void *app_data); |
Xiaoping Fan | 0493b2d | 2015-08-21 19:09:38 -0700 | [diff] [blame] | 743 | |
Suruchi Agarwal | 0eec7f9 | 2022-02-11 14:07:09 -0800 | [diff] [blame] | 744 | /** |
| 745 | * Unregisters a notifier callback for IPv6 messages from the SFE. |
Xiaoping Fan | 0493b2d | 2015-08-21 19:09:38 -0700 | [diff] [blame] | 746 | */ |
Ratheesh Kannoth | 24fb1db | 2021-10-20 07:28:06 +0530 | [diff] [blame] | 747 | extern void sfe_ipv6_notify_unregister(void); |
Xiaoping Fan | 0493b2d | 2015-08-21 19:09:38 -0700 | [diff] [blame] | 748 | |
Suruchi Agarwal | 0eec7f9 | 2022-02-11 14:07:09 -0800 | [diff] [blame] | 749 | /** |
| 750 | * Initializes an IPv6 message. |
| 751 | * |
| 752 | * @param nim The IPv6 message pointer. |
| 753 | * @param if_num The interface number. |
| 754 | * @param type The type of the message. |
| 755 | * @param len The length of the message. |
| 756 | * @param cb The message callback. |
| 757 | * @param app_data The application context for this message. |
| 758 | * |
| 759 | * @return |
| 760 | * None. |
Xiaoping Fan | 0493b2d | 2015-08-21 19:09:38 -0700 | [diff] [blame] | 761 | */ |
Xiaoping Fan | 6a1672f | 2016-08-17 19:58:12 -0700 | [diff] [blame] | 762 | extern void sfe_ipv6_msg_init(struct sfe_ipv6_msg *nim, u16 if_num, u32 type, u32 len, |
Xiaoping Fan | 0493b2d | 2015-08-21 19:09:38 -0700 | [diff] [blame] | 763 | sfe_ipv6_msg_callback_t cb, void *app_data); |
| 764 | |
Suruchi Agarwal | 0eec7f9 | 2022-02-11 14:07:09 -0800 | [diff] [blame] | 765 | /** |
| 766 | * Transmits a 6rd tunnel message to the SFE. |
| 767 | * |
| 768 | * @param sfe_ctx The SFE context pointer. |
| 769 | * @param msg The 6rd tunnel message pointer. |
| 770 | * |
| 771 | * @return |
| 772 | * The status of the Tx operation (#sfe_tx_status_t). |
Xiaoping Fan | 0493b2d | 2015-08-21 19:09:38 -0700 | [diff] [blame] | 773 | */ |
Ratheesh Kannoth | 24fb1db | 2021-10-20 07:28:06 +0530 | [diff] [blame] | 774 | sfe_tx_status_t sfe_tun6rd_tx(struct sfe_ctx_instance *sfe_ctx, struct sfe_tun6rd_msg *msg); |
Xiaoping Fan | 0493b2d | 2015-08-21 19:09:38 -0700 | [diff] [blame] | 775 | |
Suruchi Agarwal | 0eec7f9 | 2022-02-11 14:07:09 -0800 | [diff] [blame] | 776 | /** |
| 777 | * Initializes a 6rd tunnel message. |
| 778 | * |
| 779 | * @param ncm The 6rd tunnel message pointer. |
| 780 | * @param if_num The interface number. |
| 781 | * @param type The type of the message. |
| 782 | * @param len The length of the message. |
| 783 | * @param cb The message callback. |
| 784 | * @param app_data The application context for this message. |
| 785 | * |
| 786 | * @return |
| 787 | * None. |
Xiaoping Fan | 0493b2d | 2015-08-21 19:09:38 -0700 | [diff] [blame] | 788 | */ |
Xiaoping Fan | 6a1672f | 2016-08-17 19:58:12 -0700 | [diff] [blame] | 789 | void sfe_tun6rd_msg_init(struct sfe_tun6rd_msg *ncm, u16 if_num, u32 type, u32 len, |
Xiaoping Fan | 0493b2d | 2015-08-21 19:09:38 -0700 | [diff] [blame] | 790 | void *cb, void *app_data); |
| 791 | |
Suruchi Agarwal | 0eec7f9 | 2022-02-11 14:07:09 -0800 | [diff] [blame] | 792 | /** |
| 793 | * Indicates whether the l2 feature flag is enabled or disabled. |
Ratheesh Kannoth | dd382ed | 2021-11-23 09:36:30 +0530 | [diff] [blame] | 794 | * |
Suruchi Agarwal | 0eec7f9 | 2022-02-11 14:07:09 -0800 | [diff] [blame] | 795 | * @return |
| 796 | * True if enabled; false if disabled. |
Ratheesh Kannoth | dd382ed | 2021-11-23 09:36:30 +0530 | [diff] [blame] | 797 | */ |
| 798 | bool sfe_is_l2_feature_enabled(void); |
| 799 | |
Suruchi Agarwal | 0eec7f9 | 2022-02-11 14:07:09 -0800 | [diff] [blame] | 800 | /** |
Murat Sezgin | ef19039 | 2022-04-04 17:56:31 -0700 | [diff] [blame] | 801 | * Updates mark values of an IPv4 connection. |
| 802 | * |
| 803 | * @param mark The mark object. |
| 804 | * |
| 805 | * @return |
| 806 | * None. |
| 807 | */ |
| 808 | void sfe_ipv4_mark_rule_update(struct sfe_connection_mark *mark); |
| 809 | |
| 810 | /** |
| 811 | * Updates mark values of an IPv6 connection. |
| 812 | * |
| 813 | * @param mark The mark object. |
| 814 | * |
| 815 | * @return |
| 816 | * None. |
| 817 | */ |
| 818 | void sfe_ipv6_mark_rule_update(struct sfe_connection_mark *mark); |
| 819 | |
| 820 | /** |
Wayne Tan | 1cabbf1 | 2022-05-01 13:01:45 -0700 | [diff] [blame] | 821 | * Gets the acceleration mode of PPPoE bridge. |
| 822 | * |
| 823 | * @return |
| 824 | * The acceleration mode. |
| 825 | */ |
| 826 | sfe_pppoe_br_accel_mode_t sfe_pppoe_get_br_accel_mode(void); |
| 827 | |
| 828 | /** |
Suruchi Agarwal | 0eec7f9 | 2022-02-11 14:07:09 -0800 | [diff] [blame] | 829 | * @} |
| 830 | */ |
| 831 | |
Ratheesh Kannoth | 24fb1db | 2021-10-20 07:28:06 +0530 | [diff] [blame] | 832 | #endif /* __SFE_API_H */ |