diff --git a/hw/qca8074/v1/rx_flow_search_entry.h b/hw/qca8074/v1/rx_flow_search_entry.h new file mode 100644 index 000000000000..d76734b0d3c2 --- /dev/null +++ b/hw/qca8074/v1/rx_flow_search_entry.h @@ -0,0 +1,656 @@ +/* + * Copyright (c) 2016-2019 The Linux Foundation. All rights reserved. + * + * Permission to use, copy, modify, and/or distribute this software for + * any purpose with or without fee is hereby granted, provided that the + * above copyright notice and this permission notice appear in all + * copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL + * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE + * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL + * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR + * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER + * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. + */ + +#ifndef _RX_FLOW_SEARCH_ENTRY_H_ +#define _RX_FLOW_SEARCH_ENTRY_H_ +#if !defined(__ASSEMBLER__) +#endif + + +// ################ START SUMMARY ################# +// +// Dword Fields +// 0 src_ip_127_96[31:0] +// 1 src_ip_95_64[31:0] +// 2 src_ip_63_32[31:0] +// 3 src_ip_31_0[31:0] +// 4 dest_ip_127_96[31:0] +// 5 dest_ip_95_64[31:0] +// 6 dest_ip_63_32[31:0] +// 7 dest_ip_31_0[31:0] +// 8 src_port[15:0], dest_port[31:16] +// 9 l4_protocol[7:0], valid[8], reserved_9[29:9], reo_destination_handler[31:30] +// 10 metadata[31:0] +// 11 reo_destination_indication[4:0], msdu_drop[5], reserved_11[7:6], msdu_count[31:8] +// 12 msdu_byte_count[31:0] +// 13 timestamp[31:0] +// +// ################ END SUMMARY ################# + +#define NUM_OF_DWORDS_RX_FLOW_SEARCH_ENTRY 14 + +struct rx_flow_search_entry { + uint32_t src_ip_127_96 : 32; //[31:0] + uint32_t src_ip_95_64 : 32; //[31:0] + uint32_t src_ip_63_32 : 32; //[31:0] + uint32_t src_ip_31_0 : 32; //[31:0] + uint32_t dest_ip_127_96 : 32; //[31:0] + uint32_t dest_ip_95_64 : 32; //[31:0] + uint32_t dest_ip_63_32 : 32; //[31:0] + uint32_t dest_ip_31_0 : 32; //[31:0] + uint32_t src_port : 16, //[15:0] + dest_port : 16; //[31:16] + uint32_t l4_protocol : 8, //[7:0] + valid : 1, //[8] + reserved_9 : 21, //[29:9] + reo_destination_handler : 2; //[31:30] + uint32_t metadata : 32; //[31:0] + uint32_t reo_destination_indication : 5, //[4:0] + msdu_drop : 1, //[5] + reserved_11 : 2, //[7:6] + msdu_count : 24; //[31:8] + uint32_t msdu_byte_count : 32; //[31:0] + uint32_t timestamp : 32; //[31:0] +}; + +/* + +src_ip_127_96 + + Uppermost 32 bits of source IPv6 address or prefix as + per Common Parser register field IP_DA_SA_PREFIX (with the + first byte in the MSB and the last byte in the LSB, i.e. + requiring a byte-swap for little-endian SW w.r.t. the byte + order in an IPv6 packet) + + + +src_ip_95_64 + + Next 32 bits of source IPv6 address or prefix (requiring + a byte-swap for little-endian SW) + +src_ip_63_32 + + Next 32 bits of source IPv6 address or lowest 32 bits of + prefix (requiring a byte-swap for little-endian SW) + + + +src_ip_31_0 + + Lowest 32 bits of source IPv6 address, or source IPv4 + address (requiring a byte-swap for little-endian SW w.r.t. + the byte order in an IPv6 or IPv4 packet) + + + +dest_ip_127_96 + + Uppermost 32 bits of destination IPv6 address or prefix + as per Common Parser register field IP_DA_SA_PREFIX (with + the first byte in the MSB and the last byte in the LSB, i.e. + requiring a byte-swap for little-endian SW w.r.t. the byte + order as in an IPv6 packet) + + + +dest_ip_95_64 + + Next 32 bits of destination IPv6 address or prefix + (requiring a byte-swap for little-endian SW) + + + +dest_ip_63_32 + + Next 32 bits of destination IPv6 address or lowest 32 + bits of prefix (requiring a byte-swap for little-endian SW) + + + +dest_ip_31_0 + + Lowest 32 bits of destination IPv6 address, or + destination IPv4 address (requiring a byte-swap for + little-endian SW w.r.t. the byte order in an IPv6 or IPv4 + packet) + + + +src_port + + LSB of SPI in case of ESP/AH + + else source port in case of TCP/UDP without IPsec, + + else zeros in case of ICMP (with the first/third byte in + the MSB and the second/fourth byte in the LSB, i.e. + requiring a byte-swap for little-endian SW w.r.t. the byte + order as in an IPv6 or IPv4 packet) + +dest_port + + MSB of SPI in case of ESP/AH + + else destination port in case of TCP/UDP without IPsec, + + else zeros in case of ICMP (with the first byte in the + MSB and the second byte in the LSB, i.e. requiring a + byte-swap for little-endian SW w.r.t. the byte order as in + an IPv6 or IPv4 packet) + + + +l4_protocol + + IPsec or L4 protocol + + + + + + + + + + + + + + + + + +valid + + Indicates validity of entry + + + +reserved_9 + + + +reo_destination_handler + + Indicates how to decide the REO destination indication + + Follow this entry + + Use address search+peer table + entry + + Follow this entry + + Use CCE super-rule + + + +metadata + + Value to be passed to SW if this flow search entry + matches + + + +reo_destination_indication + + The ID of the REO exit ring where the MSDU frame shall + push after (MPDU level) reordering has finished. + + + + Reo will push the frame + into the REO2TCL ring + + Reo will push the frame + into the REO2SW1 ring + + Reo will push the frame + into the REO2SW1 ring + + Reo will push the frame + into the REO2SW1 ring + + Reo will push the frame + into the REO2SW1 ring + + Reo will push the frame + into the REO_release ring + + Reo will push the frame into + the REO2FW ring + + REO remaps this + + REO remaps this REO remaps this REO remaps this + + REO remaps this + + REO remaps this REO remaps this + + REO remaps this + + REO remaps this + + REO remaps this + + REO remaps this + + REO remaps this + + REO remaps this + + REO remaps this + + REO remaps this + + REO remaps this + + REO remaps this + + REO remaps this + + REO remaps this + + REO remaps this + + REO remaps this + + REO remaps this + + REO remaps this + + REO remaps this + + REO remaps this + + + + + +msdu_drop + + Overriding indication to REO to forward to REO release + ring + + + +reserved_11 + + + +msdu_count + + Number of Rx MSDUs matching this flow + + + +msdu_byte_count + + Number of bytes in Rx MSDUs matching this flow + + + +timestamp + + Time of last reception (as measured at Rx OLE) matching + this flow + + +*/ + + +/* Description RX_FLOW_SEARCH_ENTRY_0_SRC_IP_127_96 + + Uppermost 32 bits of source IPv6 address or prefix as + per Common Parser register field IP_DA_SA_PREFIX (with the + first byte in the MSB and the last byte in the LSB, i.e. + requiring a byte-swap for little-endian SW w.r.t. the byte + order in an IPv6 packet) + + +*/ +#define RX_FLOW_SEARCH_ENTRY_0_SRC_IP_127_96_OFFSET 0x00000000 +#define RX_FLOW_SEARCH_ENTRY_0_SRC_IP_127_96_LSB 0 +#define RX_FLOW_SEARCH_ENTRY_0_SRC_IP_127_96_MASK 0xffffffff + +/* Description RX_FLOW_SEARCH_ENTRY_1_SRC_IP_95_64 + + Next 32 bits of source IPv6 address or prefix (requiring + a byte-swap for little-endian SW) +*/ +#define RX_FLOW_SEARCH_ENTRY_1_SRC_IP_95_64_OFFSET 0x00000004 +#define RX_FLOW_SEARCH_ENTRY_1_SRC_IP_95_64_LSB 0 +#define RX_FLOW_SEARCH_ENTRY_1_SRC_IP_95_64_MASK 0xffffffff + +/* Description RX_FLOW_SEARCH_ENTRY_2_SRC_IP_63_32 + + Next 32 bits of source IPv6 address or lowest 32 bits of + prefix (requiring a byte-swap for little-endian SW) + + +*/ +#define RX_FLOW_SEARCH_ENTRY_2_SRC_IP_63_32_OFFSET 0x00000008 +#define RX_FLOW_SEARCH_ENTRY_2_SRC_IP_63_32_LSB 0 +#define RX_FLOW_SEARCH_ENTRY_2_SRC_IP_63_32_MASK 0xffffffff + +/* Description RX_FLOW_SEARCH_ENTRY_3_SRC_IP_31_0 + + Lowest 32 bits of source IPv6 address, or source IPv4 + address (requiring a byte-swap for little-endian SW w.r.t. + the byte order in an IPv6 or IPv4 packet) + + +*/ +#define RX_FLOW_SEARCH_ENTRY_3_SRC_IP_31_0_OFFSET 0x0000000c +#define RX_FLOW_SEARCH_ENTRY_3_SRC_IP_31_0_LSB 0 +#define RX_FLOW_SEARCH_ENTRY_3_SRC_IP_31_0_MASK 0xffffffff + +/* Description RX_FLOW_SEARCH_ENTRY_4_DEST_IP_127_96 + + Uppermost 32 bits of destination IPv6 address or prefix + as per Common Parser register field IP_DA_SA_PREFIX (with + the first byte in the MSB and the last byte in the LSB, i.e. + requiring a byte-swap for little-endian SW w.r.t. the byte + order as in an IPv6 packet) + + +*/ +#define RX_FLOW_SEARCH_ENTRY_4_DEST_IP_127_96_OFFSET 0x00000010 +#define RX_FLOW_SEARCH_ENTRY_4_DEST_IP_127_96_LSB 0 +#define RX_FLOW_SEARCH_ENTRY_4_DEST_IP_127_96_MASK 0xffffffff + +/* Description RX_FLOW_SEARCH_ENTRY_5_DEST_IP_95_64 + + Next 32 bits of destination IPv6 address or prefix + (requiring a byte-swap for little-endian SW) + + +*/ +#define RX_FLOW_SEARCH_ENTRY_5_DEST_IP_95_64_OFFSET 0x00000014 +#define RX_FLOW_SEARCH_ENTRY_5_DEST_IP_95_64_LSB 0 +#define RX_FLOW_SEARCH_ENTRY_5_DEST_IP_95_64_MASK 0xffffffff + +/* Description RX_FLOW_SEARCH_ENTRY_6_DEST_IP_63_32 + + Next 32 bits of destination IPv6 address or lowest 32 + bits of prefix (requiring a byte-swap for little-endian SW) + + +*/ +#define RX_FLOW_SEARCH_ENTRY_6_DEST_IP_63_32_OFFSET 0x00000018 +#define RX_FLOW_SEARCH_ENTRY_6_DEST_IP_63_32_LSB 0 +#define RX_FLOW_SEARCH_ENTRY_6_DEST_IP_63_32_MASK 0xffffffff + +/* Description RX_FLOW_SEARCH_ENTRY_7_DEST_IP_31_0 + + Lowest 32 bits of destination IPv6 address, or + destination IPv4 address (requiring a byte-swap for + little-endian SW w.r.t. the byte order in an IPv6 or IPv4 + packet) + + +*/ +#define RX_FLOW_SEARCH_ENTRY_7_DEST_IP_31_0_OFFSET 0x0000001c +#define RX_FLOW_SEARCH_ENTRY_7_DEST_IP_31_0_LSB 0 +#define RX_FLOW_SEARCH_ENTRY_7_DEST_IP_31_0_MASK 0xffffffff + +/* Description RX_FLOW_SEARCH_ENTRY_8_SRC_PORT + + LSB of SPI in case of ESP/AH + + else source port in case of TCP/UDP without IPsec, + + else zeros in case of ICMP (with the first/third byte in + the MSB and the second/fourth byte in the LSB, i.e. + requiring a byte-swap for little-endian SW w.r.t. the byte + order as in an IPv6 or IPv4 packet) +*/ +#define RX_FLOW_SEARCH_ENTRY_8_SRC_PORT_OFFSET 0x00000020 +#define RX_FLOW_SEARCH_ENTRY_8_SRC_PORT_LSB 0 +#define RX_FLOW_SEARCH_ENTRY_8_SRC_PORT_MASK 0x0000ffff + +/* Description RX_FLOW_SEARCH_ENTRY_8_DEST_PORT + + MSB of SPI in case of ESP/AH + + else destination port in case of TCP/UDP without IPsec, + + else zeros in case of ICMP (with the first byte in the + MSB and the second byte in the LSB, i.e. requiring a + byte-swap for little-endian SW w.r.t. the byte order as in + an IPv6 or IPv4 packet) + + +*/ +#define RX_FLOW_SEARCH_ENTRY_8_DEST_PORT_OFFSET 0x00000020 +#define RX_FLOW_SEARCH_ENTRY_8_DEST_PORT_LSB 16 +#define RX_FLOW_SEARCH_ENTRY_8_DEST_PORT_MASK 0xffff0000 + +/* Description RX_FLOW_SEARCH_ENTRY_9_L4_PROTOCOL + + IPsec or L4 protocol + + + + + + + + + + + + + + + + +*/ +#define RX_FLOW_SEARCH_ENTRY_9_L4_PROTOCOL_OFFSET 0x00000024 +#define RX_FLOW_SEARCH_ENTRY_9_L4_PROTOCOL_LSB 0 +#define RX_FLOW_SEARCH_ENTRY_9_L4_PROTOCOL_MASK 0x000000ff + +/* Description RX_FLOW_SEARCH_ENTRY_9_VALID + + Indicates validity of entry + + +*/ +#define RX_FLOW_SEARCH_ENTRY_9_VALID_OFFSET 0x00000024 +#define RX_FLOW_SEARCH_ENTRY_9_VALID_LSB 8 +#define RX_FLOW_SEARCH_ENTRY_9_VALID_MASK 0x00000100 + +/* Description RX_FLOW_SEARCH_ENTRY_9_RESERVED_9 + + +*/ +#define RX_FLOW_SEARCH_ENTRY_9_RESERVED_9_OFFSET 0x00000024 +#define RX_FLOW_SEARCH_ENTRY_9_RESERVED_9_LSB 9 +#define RX_FLOW_SEARCH_ENTRY_9_RESERVED_9_MASK 0x3ffffe00 + +/* Description RX_FLOW_SEARCH_ENTRY_9_REO_DESTINATION_HANDLER + + Indicates how to decide the REO destination indication + + Follow this entry + + Use address search+peer table + entry + + Follow this entry + + Use CCE super-rule + + +*/ +#define RX_FLOW_SEARCH_ENTRY_9_REO_DESTINATION_HANDLER_OFFSET 0x00000024 +#define RX_FLOW_SEARCH_ENTRY_9_REO_DESTINATION_HANDLER_LSB 30 +#define RX_FLOW_SEARCH_ENTRY_9_REO_DESTINATION_HANDLER_MASK 0xc0000000 + +/* Description RX_FLOW_SEARCH_ENTRY_10_METADATA + + Value to be passed to SW if this flow search entry + matches + + +*/ +#define RX_FLOW_SEARCH_ENTRY_10_METADATA_OFFSET 0x00000028 +#define RX_FLOW_SEARCH_ENTRY_10_METADATA_LSB 0 +#define RX_FLOW_SEARCH_ENTRY_10_METADATA_MASK 0xffffffff + +/* Description RX_FLOW_SEARCH_ENTRY_11_REO_DESTINATION_INDICATION + + The ID of the REO exit ring where the MSDU frame shall + push after (MPDU level) reordering has finished. + + + + Reo will push the frame + into the REO2TCL ring + + Reo will push the frame + into the REO2SW1 ring + + Reo will push the frame + into the REO2SW1 ring + + Reo will push the frame + into the REO2SW1 ring + + Reo will push the frame + into the REO2SW1 ring + + Reo will push the frame + into the REO_release ring + + Reo will push the frame into + the REO2FW ring + + REO remaps this + + REO remaps this REO remaps this REO remaps this + + REO remaps this + + REO remaps this REO remaps this + + REO remaps this + + REO remaps this + + REO remaps this + + REO remaps this + + REO remaps this + + REO remaps this + + REO remaps this + + REO remaps this + + REO remaps this + + REO remaps this + + REO remaps this + + REO remaps this + + REO remaps this + + REO remaps this + + REO remaps this + + REO remaps this + + REO remaps this + + REO remaps this + + + + +*/ +#define RX_FLOW_SEARCH_ENTRY_11_REO_DESTINATION_INDICATION_OFFSET 0x0000002c +#define RX_FLOW_SEARCH_ENTRY_11_REO_DESTINATION_INDICATION_LSB 0 +#define RX_FLOW_SEARCH_ENTRY_11_REO_DESTINATION_INDICATION_MASK 0x0000001f + +/* Description RX_FLOW_SEARCH_ENTRY_11_MSDU_DROP + + Overriding indication to REO to forward to REO release + ring + + +*/ +#define RX_FLOW_SEARCH_ENTRY_11_MSDU_DROP_OFFSET 0x0000002c +#define RX_FLOW_SEARCH_ENTRY_11_MSDU_DROP_LSB 5 +#define RX_FLOW_SEARCH_ENTRY_11_MSDU_DROP_MASK 0x00000020 + +/* Description RX_FLOW_SEARCH_ENTRY_11_RESERVED_11 + + +*/ +#define RX_FLOW_SEARCH_ENTRY_11_RESERVED_11_OFFSET 0x0000002c +#define RX_FLOW_SEARCH_ENTRY_11_RESERVED_11_LSB 6 +#define RX_FLOW_SEARCH_ENTRY_11_RESERVED_11_MASK 0x000000c0 + +/* Description RX_FLOW_SEARCH_ENTRY_11_MSDU_COUNT + + Number of Rx MSDUs matching this flow + + +*/ +#define RX_FLOW_SEARCH_ENTRY_11_MSDU_COUNT_OFFSET 0x0000002c +#define RX_FLOW_SEARCH_ENTRY_11_MSDU_COUNT_LSB 8 +#define RX_FLOW_SEARCH_ENTRY_11_MSDU_COUNT_MASK 0xffffff00 + +/* Description RX_FLOW_SEARCH_ENTRY_12_MSDU_BYTE_COUNT + + Number of bytes in Rx MSDUs matching this flow + + +*/ +#define RX_FLOW_SEARCH_ENTRY_12_MSDU_BYTE_COUNT_OFFSET 0x00000030 +#define RX_FLOW_SEARCH_ENTRY_12_MSDU_BYTE_COUNT_LSB 0 +#define RX_FLOW_SEARCH_ENTRY_12_MSDU_BYTE_COUNT_MASK 0xffffffff + +/* Description RX_FLOW_SEARCH_ENTRY_13_TIMESTAMP + + Time of last reception (as measured at Rx OLE) matching + this flow + + +*/ +#define RX_FLOW_SEARCH_ENTRY_13_TIMESTAMP_OFFSET 0x00000034 +#define RX_FLOW_SEARCH_ENTRY_13_TIMESTAMP_LSB 0 +#define RX_FLOW_SEARCH_ENTRY_13_TIMESTAMP_MASK 0xffffffff + + +#endif // _RX_FLOW_SEARCH_ENTRY_H_