NVIDIA DOCA SDK Data Center on a Chip Framework Documentation
flow_tcp_seq_sample.c File Reference
#include <string.h>
#include <unistd.h>
#include <doca_bitfield.h>
#include <doca_log.h>
#include <doca_flow.h>
#include "flow_common.h"
Include dependency graph for flow_tcp_seq_sample.c:

Go to the source code of this file.

Macros

#define NB_ACTION_DESC   (1)
 
#define WAITING_TIME   (5)
 

Functions

 DOCA_LOG_REGISTER (FLOW_TCP_SEQ)
 
static doca_error_t create_root_pipe (struct doca_flow_port *port, struct doca_flow_pipe *next_pipe, struct doca_flow_pipe **pipe)
 
static doca_error_t create_comparison_pipe (struct doca_flow_port *port, struct doca_flow_pipe **pipe)
 
static doca_error_t add_comparison_pipe_entry (struct doca_flow_pipe *pipe, struct doca_flow_pipe *next_pipe, struct entries_status *status)
 
static doca_error_t create_action_pipe (struct doca_flow_port *port, int port_id, struct doca_flow_pipe **pipe)
 
doca_error_t flow_tcp_seq (int nb_queues)
 

Macro Definition Documentation

◆ NB_ACTION_DESC

#define NB_ACTION_DESC   (1)

Definition at line 36 of file flow_tcp_seq_sample.c.

◆ WAITING_TIME

#define WAITING_TIME   (5)

Definition at line 38 of file flow_tcp_seq_sample.c.

Function Documentation

◆ add_comparison_pipe_entry()

static doca_error_t add_comparison_pipe_entry ( struct doca_flow_pipe *  pipe,
struct doca_flow_pipe *  next_pipe,
struct entries_status status 
)
static

Add DOCA Flow pipe entry to the comparison pipe The entry compares TCP sequence number field and forwards matched traffic

@pipe [in]: pipe of the entries. @next_pipe [in]: next pipe to forward the matched traffic @status [in]: user context for adding entry.

Returns
: DOCA_SUCCESS on success and DOCA_ERROR otherwise.

Definition at line 129 of file flow_tcp_seq_sample.c.

◆ create_action_pipe()

static doca_error_t create_action_pipe ( struct doca_flow_port *  port,
int  port_id,
struct doca_flow_pipe **  pipe 
)
static

Create DOCA Flow action pipe The pipe adds constant value to acknowledgment number field of each TCP packet and forwards the packet to other port

@port [in]: port of the pipe @port_id [in]: port ID for forwarding to. @pipe [out]: created pipe pointer

Returns
: DOCA_SUCCESS on success and DOCA_ERROR otherwise.

Definition at line 174 of file flow_tcp_seq_sample.c.

◆ create_comparison_pipe()

static doca_error_t create_comparison_pipe ( struct doca_flow_port *  port,
struct doca_flow_pipe **  pipe 
)
static

Create DOCA Flow control pipe

@port [in]: port of the pipe @pipe [out]: created pipe pointer

Returns
: DOCA_SUCCESS on success and DOCA_ERROR otherwise.

Definition at line 96 of file flow_tcp_seq_sample.c.

◆ create_root_pipe()

static doca_error_t create_root_pipe ( struct doca_flow_port *  port,
struct doca_flow_pipe *  next_pipe,
struct doca_flow_pipe **  pipe 
)
static

Create DOCA Flow pipe root pipe to match on TCP packets

@port [in]: port of the pipe @next_pipe [in]: next pipe to forward the matched traffic @pipe [out]: created pipe pointer

Returns
: DOCA_SUCCESS on success and DOCA_ERROR otherwise.

Definition at line 50 of file flow_tcp_seq_sample.c.

◆ DOCA_LOG_REGISTER()

DOCA_LOG_REGISTER ( FLOW_TCP_SEQ  )

◆ flow_tcp_seq()

doca_error_t flow_tcp_seq ( int  nb_queues)

Definition at line 238 of file flow_tcp_seq_sample.c.