1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(c) 2010-2015 Intel Corporation
5 #ifndef __INCLUDE_PIPELINE_ROUTING_BE_H__
6 #define __INCLUDE_PIPELINE_ROUTING_BE_H__
10 #include "pipeline_common_be.h"
13 * Pipeline argument parsing
15 #ifndef PIPELINE_ROUTING_N_ROUTES_DEFAULT
16 #define PIPELINE_ROUTING_N_ROUTES_DEFAULT 4096
19 enum pipeline_routing_encap {
20 PIPELINE_ROUTING_ENCAP_ETHERNET = 0,
21 PIPELINE_ROUTING_ENCAP_ETHERNET_QINQ,
22 PIPELINE_ROUTING_ENCAP_ETHERNET_MPLS,
25 struct pipeline_routing_params {
28 uint32_t port_local_dest;
30 /* routing packet encapsulation */
31 enum pipeline_routing_encap encap;
33 uint32_t mpls_color_mark;
36 uint32_t n_arp_entries;
38 /* packet buffer offsets */
39 uint32_t ip_hdr_offset;
40 uint32_t arp_key_offset;
41 uint32_t color_offset;
44 uint32_t dbg_ah_disable;
48 pipeline_routing_parse_args(struct pipeline_routing_params *p,
49 struct pipeline_params *params);
54 enum pipeline_routing_route_key_type {
55 PIPELINE_ROUTING_ROUTE_IPV4,
58 struct pipeline_routing_route_key_ipv4 {
63 struct pipeline_routing_route_key {
64 enum pipeline_routing_route_key_type type;
66 struct pipeline_routing_route_key_ipv4 ipv4;
70 enum pipeline_routing_route_flags {
71 PIPELINE_ROUTING_ROUTE_LOCAL = 1 << 0, /* 0 = remote; 1 = local */
72 PIPELINE_ROUTING_ROUTE_ARP = 1 << 1, /* 0 = ARP OFF; 1 = ARP ON */
73 PIPELINE_ROUTING_ROUTE_QINQ = 1 << 2, /* 0 = QINQ OFF; 1 = QINQ ON */
74 PIPELINE_ROUTING_ROUTE_MPLS = 1 << 3, /* 0 = MPLS OFF; 1 = MPLS ON */
77 #define PIPELINE_ROUTING_MPLS_LABELS_MAX 4
79 struct pipeline_routing_route_data {
81 uint32_t port_id; /* Output port ID */
84 /* Next hop IP (valid only when ARP is enabled) */
87 /* Next hop MAC address (valid only when ARP disabled */
88 struct ether_addr macaddr;
98 uint32_t labels[PIPELINE_ROUTING_MPLS_LABELS_MAX];
107 enum pipeline_routing_arp_key_type {
108 PIPELINE_ROUTING_ARP_IPV4,
111 struct pipeline_routing_arp_key_ipv4 {
116 struct pipeline_routing_arp_key {
117 enum pipeline_routing_arp_key_type type;
119 struct pipeline_routing_arp_key_ipv4 ipv4;
126 enum pipeline_routing_msg_req_type {
127 PIPELINE_ROUTING_MSG_REQ_ROUTE_ADD,
128 PIPELINE_ROUTING_MSG_REQ_ROUTE_DEL,
129 PIPELINE_ROUTING_MSG_REQ_ROUTE_ADD_DEFAULT,
130 PIPELINE_ROUTING_MSG_REQ_ROUTE_DEL_DEFAULT,
131 PIPELINE_ROUTING_MSG_REQ_ARP_ADD,
132 PIPELINE_ROUTING_MSG_REQ_ARP_DEL,
133 PIPELINE_ROUTING_MSG_REQ_ARP_ADD_DEFAULT,
134 PIPELINE_ROUTING_MSG_REQ_ARP_DEL_DEFAULT,
135 PIPELINE_ROUTING_MSG_REQ_SET_MACADDR,
136 PIPELINE_ROUTING_MSG_REQS
142 struct pipeline_routing_route_add_msg_req {
143 enum pipeline_msg_req_type type;
144 enum pipeline_routing_msg_req_type subtype;
147 struct pipeline_routing_route_key key;
150 struct pipeline_routing_route_data data;
153 struct pipeline_routing_route_add_msg_rsp {
162 struct pipeline_routing_route_delete_msg_req {
163 enum pipeline_msg_req_type type;
164 enum pipeline_routing_msg_req_type subtype;
167 struct pipeline_routing_route_key key;
170 struct pipeline_routing_route_delete_msg_rsp {
176 * MSG ROUTE ADD DEFAULT
178 struct pipeline_routing_route_add_default_msg_req {
179 enum pipeline_msg_req_type type;
180 enum pipeline_routing_msg_req_type subtype;
186 struct pipeline_routing_route_add_default_msg_rsp {
192 * MSG ROUTE DELETE DEFAULT
194 struct pipeline_routing_route_delete_default_msg_req {
195 enum pipeline_msg_req_type type;
196 enum pipeline_routing_msg_req_type subtype;
199 struct pipeline_routing_route_delete_default_msg_rsp {
206 struct pipeline_routing_arp_add_msg_req {
207 enum pipeline_msg_req_type type;
208 enum pipeline_routing_msg_req_type subtype;
211 struct pipeline_routing_arp_key key;
214 struct ether_addr macaddr;
217 struct pipeline_routing_arp_add_msg_rsp {
226 struct pipeline_routing_arp_delete_msg_req {
227 enum pipeline_msg_req_type type;
228 enum pipeline_routing_msg_req_type subtype;
231 struct pipeline_routing_arp_key key;
234 struct pipeline_routing_arp_delete_msg_rsp {
240 * MSG ARP ADD DEFAULT
242 struct pipeline_routing_arp_add_default_msg_req {
243 enum pipeline_msg_req_type type;
244 enum pipeline_routing_msg_req_type subtype;
250 struct pipeline_routing_arp_add_default_msg_rsp {
256 * MSG ARP DELETE DEFAULT
258 struct pipeline_routing_arp_delete_default_msg_req {
259 enum pipeline_msg_req_type type;
260 enum pipeline_routing_msg_req_type subtype;
263 struct pipeline_routing_arp_delete_default_msg_rsp {
270 struct pipeline_routing_set_macaddr_msg_req {
271 enum pipeline_msg_req_type type;
272 enum pipeline_routing_msg_req_type subtype;
274 uint64_t macaddr[PIPELINE_MAX_PORT_OUT];
277 struct pipeline_routing_set_macaddr_msg_rsp {
281 extern struct pipeline_be_ops pipeline_routing_be_ops;