NVIDIA DOCA SDK Data Center on a Chip Framework Documentation
upf_accel_pipeline.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2025 NVIDIA CORPORATION AND AFFILIATES. All rights reserved.
3  *
4  * Redistribution and use in source and binary forms, with or without modification, are permitted
5  * provided that the following conditions are met:
6  * * Redistributions of source code must retain the above copyright notice, this list of
7  * conditions and the following disclaimer.
8  * * Redistributions in binary form must reproduce the above copyright notice, this list of
9  * conditions and the following disclaimer in the documentation and/or other materials
10  * provided with the distribution.
11  * * Neither the name of the NVIDIA CORPORATION nor the names of its contributors may be used
12  * to endorse or promote products derived from this software without specific prior written
13  * permission.
14  *
15  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
16  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
17  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NVIDIA CORPORATION BE LIABLE
18  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
19  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
20  * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
21  * STRICT LIABILITY, OR TOR (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
22  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23  *
24  */
25 
26 #ifndef UPF_ACCEL_PIPELINE_H_
27 #define UPF_ACCEL_PIPELINE_H_
28 
29 #include "upf_accel.h"
30 
31 #define UPF_ACCEL_PACKET_BURST 128
32 
33 #define UPF_ACCEL_LOG_MAX_NUM_QER 16
34 #define UPF_ACCEL_MAX_NUM_QER (1ul << UPF_ACCEL_LOG_MAX_NUM_QER)
35 #define UPF_ACCEL_LOG_MAX_NUM_URR 16
36 #define UPF_ACCEL_MAX_NUM_URR (1ul << UPF_ACCEL_LOG_MAX_NUM_URR)
37 #define UPF_ACCEL_LOG_MAX_NUM_CONNECTIONS 19
38 #define UPF_ACCEL_MAX_NUM_CONNECTIONS (1ul << UPF_ACCEL_LOG_MAX_NUM_CONNECTIONS)
39 #define UPF_ACCEL_LOG_MAX_NUM_VNIS 10
40 #define UPF_ACCEL_MAX_NUM_VNIS (1ul << UPF_ACCEL_LOG_MAX_NUM_VNIS)
41 
42 #define UPF_ACCEL_VERSION_IHL_IPV4 0x4500
43 #define UPF_ACCEL_ENCAP_TTL UINT8_MAX
44 
45 #define UPF_ACCEL_QFI_NONE 0
46 
47 /*
48  * Extra space in the software hash table for flows that failed to be
49  * accelerated due to lack of space in the hardware table.
50  */
51 #define UPF_ACCEL_MAX_NUM_FAILED_ACCEL_PER_CORE (1 << 15)
52 
53 /*
54  * Adds a static table entry to a table
55  *
56  * @upf_accel_ctx [in]: UPF Acceleration context.
57  * @port_id [in]: Port ID.
58  * @pipe_queue [in]: Queue identifier.
59  * @pipe [in]: Pointer to pipe.
60  * @match [in]: Pointer to match, indicate specific packet match information.
61  * @actions [in]: Pointer to modify actions, indicate specific modify information.
62  * @mon [in]: Pointer to monitor actions.
63  * @fwd [in]: Pointer to fwd actions.
64  * @flags [in]: Flow entry will be pushed to hw immediately or not. enum doca_flow_flags_type.
65  * @usr_ctx [in]: Pointer to user context.
66  * @entry [out]: Pipe entry handler on success.
67  * @return: DOCA_SUCCESS on success and DOCA_ERROR otherwise
68  */
70  enum upf_accel_port port_id,
71  uint16_t pipe_queue,
72  struct doca_flow_pipe *pipe,
73  const struct doca_flow_match *match,
74  const struct doca_flow_actions *actions,
75  const struct doca_flow_monitor *mon,
76  const struct doca_flow_fwd *fwd,
77  uint32_t flags,
78  void *usr_ctx,
79  struct doca_flow_pipe_entry **entry);
80 
81 /*
82  * Create pipeline
83  *
84  * @upf_accel_ctx [in]: UPF Acceleration context.
85  * @return: DOCA_SUCCESS on success and DOCA_ERROR otherwise
86  */
88 
89 #endif /* UPF_ACCEL_PIPELINE_H_ */
static struct doca_flow_actions actions
Definition: flow_parser.c:107
static struct doca_flow_fwd fwd
Definition: flow_parser.c:109
static struct doca_flow_pipe_entry * entry[MAX_ENTRIES]
enum doca_error doca_error_t
DOCA API return codes.
doca flow actions information
Definition: doca_flow.h:684
forwarding configuration
Definition: doca_flow.h:779
doca flow matcher information
Definition: doca_flow.h:491
doca monitor action configuration
Definition: doca_flow.h:968
upf_accel_port
Definition: upf_accel.h:40
doca_error_t upf_accel_pipeline_create(struct upf_accel_ctx *upf_accel_ctx)
doca_error_t upf_accel_pipe_static_entry_add(struct upf_accel_ctx *upf_accel_ctx, enum upf_accel_port port_id, uint16_t pipe_queue, struct doca_flow_pipe *pipe, const struct doca_flow_match *match, const struct doca_flow_actions *actions, const struct doca_flow_monitor *mon, const struct doca_flow_fwd *fwd, uint32_t flags, void *usr_ctx, struct doca_flow_pipe_entry **entry)