Carmelo Cascone | 4f01102 | 2017-06-05 01:41:02 -0400 | [diff] [blame] | 1 | // Logic ports as defined in the simple_switch target |
Carmelo Cascone | 4f01102 | 2017-06-05 01:41:02 -0400 | [diff] [blame] | 2 | #define DROP_PORT 511 |
Carmelo Cascone | 16de6db | 2017-08-22 00:27:57 +0200 | [diff] [blame] | 3 | |
Carmelo Cascone | 16de6db | 2017-08-22 00:27:57 +0200 | [diff] [blame] | 4 | #define ETHERTYPE_IPV4 0x0800 |
| 5 | #define IP_PROTOCOLS_TCP 6 |
| 6 | #define IP_PROTOCOLS_UDP 17 |
| 7 | |
| 8 | // Build for Tofino by default. |
| 9 | |
| 10 | #ifdef DO_BMV2_BUILD |
| 11 | #define __BMV2_BUILD__ 1 |
| 12 | #else |
| 13 | #define __TOFINO_BUILD__ 1 |
| 14 | #endif |
| 15 | |
| 16 | #ifdef __TOFINO_BUILD__ |
| 17 | #define EGR_PORT_FIELD ig_intr_md_for_tm.ucast_egress_port |
| 18 | #define IGR_PORT_FIELD ig_intr_md.ingress_port |
Carmelo Cascone | 6230a61 | 2017-09-13 03:25:41 +0200 | [diff] [blame] | 19 | #define MAX_PORTS 512 |
Carmelo Cascone | 16de6db | 2017-08-22 00:27:57 +0200 | [diff] [blame] | 20 | #else |
| 21 | #define EGR_PORT_FIELD standard_metadata.egress_spec |
| 22 | #define IGR_PORT_FIELD standard_metadata.ingress_port |
Brian O'Connor | a6862e0 | 2017-09-08 01:17:39 -0700 | [diff] [blame] | 23 | #define MAX_PORTS 254 |
Carmelo Cascone | 16de6db | 2017-08-22 00:27:57 +0200 | [diff] [blame] | 24 | #endif |