blob: cfada189eaad8ea6ad6d865d753dcb5346faa300 [file] [log] [blame]
Carmelo Cascone4f011022017-06-05 01:41:02 -04001// Logic ports as defined in the simple_switch target
Carmelo Cascone4f011022017-06-05 01:41:02 -04002#define DROP_PORT 511
Carmelo Cascone16de6db2017-08-22 00:27:57 +02003
Carmelo Cascone16de6db2017-08-22 00:27:57 +02004#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 Cascone6230a612017-09-13 03:25:41 +020019#define MAX_PORTS 512
Carmelo Cascone16de6db2017-08-22 00:27:57 +020020#else
21#define EGR_PORT_FIELD standard_metadata.egress_spec
22#define IGR_PORT_FIELD standard_metadata.ingress_port
Brian O'Connora6862e02017-09-08 01:17:39 -070023#define MAX_PORTS 254
Carmelo Cascone16de6db2017-08-22 00:27:57 +020024#endif