DPDK 23.11.0
Loading...
Searching...
No Matches
rte_pipeline.h
Go to the documentation of this file.
1/* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(c) 2010-2016 Intel Corporation
3 */
4
5#ifndef __INCLUDE_RTE_PIPELINE_H__
6#define __INCLUDE_RTE_PIPELINE_H__
7
8#ifdef __cplusplus
9extern "C" {
10#endif
11
56#include <stdint.h>
57
58#include <rte_port.h>
59#include <rte_table.h>
60#include <rte_common.h>
61
62struct rte_mbuf;
63
64/*
65 * Pipeline
66 */
68struct rte_pipeline;
69
73 const char *name;
74
78
83};
84
94
103
123
132struct rte_pipeline *rte_pipeline_create(struct rte_pipeline_params *params);
133
142int rte_pipeline_free(struct rte_pipeline *p);
143
152int rte_pipeline_check(struct rte_pipeline *p);
153
162int rte_pipeline_run(struct rte_pipeline *p);
163
172int rte_pipeline_flush(struct rte_pipeline *p);
173
174/*
175 * Actions
176 */
194
195/*
196 * Table
197 */
200#define RTE_PIPELINE_TABLE_MAX 64
201
214
215 union {
218 uint32_t port_id;
220 uint32_t table_id;
221 };
223 __extension__ uint8_t action_data[0];
224};
225
256 struct rte_pipeline *p,
257 struct rte_mbuf **pkts,
258 uint64_t pkts_mask,
259 struct rte_pipeline_table_entry **entries,
260 void *arg);
261
292 struct rte_pipeline *p,
293 struct rte_mbuf **pkts,
294 uint64_t pkts_mask,
295 struct rte_pipeline_table_entry *entry,
296 void *arg);
297
321
335int rte_pipeline_table_create(struct rte_pipeline *p,
336 struct rte_pipeline_table_params *params,
337 uint32_t *table_id);
338
360int rte_pipeline_table_default_entry_add(struct rte_pipeline *p,
361 uint32_t table_id,
362 struct rte_pipeline_table_entry *default_entry,
363 struct rte_pipeline_table_entry **default_entry_ptr);
364
383 uint32_t table_id,
384 struct rte_pipeline_table_entry *entry);
385
409int rte_pipeline_table_entry_add(struct rte_pipeline *p,
410 uint32_t table_id,
411 void *key,
412 struct rte_pipeline_table_entry *entry,
413 int *key_found,
414 struct rte_pipeline_table_entry **entry_ptr);
415
436int rte_pipeline_table_entry_delete(struct rte_pipeline *p,
437 uint32_t table_id,
438 void *key,
439 int *key_found,
440 struct rte_pipeline_table_entry *entry);
441
468int rte_pipeline_table_entry_add_bulk(struct rte_pipeline *p,
469 uint32_t table_id,
470 void **keys,
471 struct rte_pipeline_table_entry **entries,
472 uint32_t n_keys,
473 int *key_found,
474 struct rte_pipeline_table_entry **entries_ptr);
475
499int rte_pipeline_table_entry_delete_bulk(struct rte_pipeline *p,
500 uint32_t table_id,
501 void **keys,
502 uint32_t n_keys,
503 int *key_found,
504 struct rte_pipeline_table_entry **entries);
505
523int rte_pipeline_table_stats_read(struct rte_pipeline *p, uint32_t table_id,
524 struct rte_pipeline_table_stats *stats, int clear);
525
526/*
527 * Port IN
528 */
531#define RTE_PIPELINE_PORT_IN_MAX 64
532
556 struct rte_pipeline *p,
557 struct rte_mbuf **pkts,
558 uint32_t n,
559 void *arg);
560
577
591int rte_pipeline_port_in_create(struct rte_pipeline *p,
592 struct rte_pipeline_port_in_params *params,
593 uint32_t *port_id);
594
607int rte_pipeline_port_in_connect_to_table(struct rte_pipeline *p,
608 uint32_t port_id,
609 uint32_t table_id);
610
621int rte_pipeline_port_in_enable(struct rte_pipeline *p,
622 uint32_t port_id);
623
634int rte_pipeline_port_in_disable(struct rte_pipeline *p,
635 uint32_t port_id);
636
654int rte_pipeline_port_in_stats_read(struct rte_pipeline *p, uint32_t port_id,
655 struct rte_pipeline_port_in_stats *stats, int clear);
656
657/*
658 * Port OUT
659 */
662#define RTE_PIPELINE_PORT_OUT_MAX 64
663
688 struct rte_pipeline *p,
689 struct rte_mbuf **pkts,
690 uint64_t pkts_mask,
691 void *arg);
692
709
723int rte_pipeline_port_out_create(struct rte_pipeline *p,
724 struct rte_pipeline_port_out_params *params,
725 uint32_t *port_id);
726
744int rte_pipeline_port_out_stats_read(struct rte_pipeline *p, uint32_t port_id,
745 struct rte_pipeline_port_out_stats *stats, int clear);
746
747/*
748 * Functions to be called as part of the port IN/OUT or table action handlers
749 */
770int rte_pipeline_port_out_packet_insert(struct rte_pipeline *p,
771 uint32_t port_id,
772 struct rte_mbuf *pkt);
773
774#define rte_pipeline_ah_port_out_packet_insert \
775 rte_pipeline_port_out_packet_insert
776
802int rte_pipeline_ah_packet_hijack(struct rte_pipeline *p,
803 uint64_t pkts_mask);
804
833int rte_pipeline_ah_packet_drop(struct rte_pipeline *p,
834 uint64_t pkts_mask);
835
836#ifdef __cplusplus
837}
838#endif
839
840#endif
int rte_pipeline_table_entry_add(struct rte_pipeline *p, uint32_t table_id, void *key, struct rte_pipeline_table_entry *entry, int *key_found, struct rte_pipeline_table_entry **entry_ptr)
int rte_pipeline_table_entry_delete_bulk(struct rte_pipeline *p, uint32_t table_id, void **keys, uint32_t n_keys, int *key_found, struct rte_pipeline_table_entry **entries)
int rte_pipeline_port_out_create(struct rte_pipeline *p, struct rte_pipeline_port_out_params *params, uint32_t *port_id)
int rte_pipeline_ah_packet_drop(struct rte_pipeline *p, uint64_t pkts_mask)
int rte_pipeline_port_out_packet_insert(struct rte_pipeline *p, uint32_t port_id, struct rte_mbuf *pkt)
int rte_pipeline_table_stats_read(struct rte_pipeline *p, uint32_t table_id, struct rte_pipeline_table_stats *stats, int clear)
int rte_pipeline_run(struct rte_pipeline *p)
int(* rte_pipeline_table_action_handler_miss)(struct rte_pipeline *p, struct rte_mbuf **pkts, uint64_t pkts_mask, struct rte_pipeline_table_entry *entry, void *arg)
rte_pipeline_action
@ RTE_PIPELINE_ACTIONS
@ RTE_PIPELINE_ACTION_PORT_META
@ RTE_PIPELINE_ACTION_TABLE
@ RTE_PIPELINE_ACTION_PORT
@ RTE_PIPELINE_ACTION_DROP
int rte_pipeline_port_in_disable(struct rte_pipeline *p, uint32_t port_id)
int rte_pipeline_port_in_stats_read(struct rte_pipeline *p, uint32_t port_id, struct rte_pipeline_port_in_stats *stats, int clear)
int rte_pipeline_free(struct rte_pipeline *p)
int rte_pipeline_table_default_entry_add(struct rte_pipeline *p, uint32_t table_id, struct rte_pipeline_table_entry *default_entry, struct rte_pipeline_table_entry **default_entry_ptr)
int rte_pipeline_table_entry_delete(struct rte_pipeline *p, uint32_t table_id, void *key, int *key_found, struct rte_pipeline_table_entry *entry)
int rte_pipeline_table_entry_add_bulk(struct rte_pipeline *p, uint32_t table_id, void **keys, struct rte_pipeline_table_entry **entries, uint32_t n_keys, int *key_found, struct rte_pipeline_table_entry **entries_ptr)
struct rte_pipeline * rte_pipeline_create(struct rte_pipeline_params *params)
int(* rte_pipeline_table_action_handler_hit)(struct rte_pipeline *p, struct rte_mbuf **pkts, uint64_t pkts_mask, struct rte_pipeline_table_entry **entries, void *arg)
int rte_pipeline_port_in_create(struct rte_pipeline *p, struct rte_pipeline_port_in_params *params, uint32_t *port_id)
int rte_pipeline_port_out_stats_read(struct rte_pipeline *p, uint32_t port_id, struct rte_pipeline_port_out_stats *stats, int clear)
int(* rte_pipeline_port_out_action_handler)(struct rte_pipeline *p, struct rte_mbuf **pkts, uint64_t pkts_mask, void *arg)
int rte_pipeline_flush(struct rte_pipeline *p)
int rte_pipeline_table_default_entry_delete(struct rte_pipeline *p, uint32_t table_id, struct rte_pipeline_table_entry *entry)
int rte_pipeline_check(struct rte_pipeline *p)
int rte_pipeline_port_in_connect_to_table(struct rte_pipeline *p, uint32_t port_id, uint32_t table_id)
int(* rte_pipeline_port_in_action_handler)(struct rte_pipeline *p, struct rte_mbuf **pkts, uint32_t n, void *arg)
int rte_pipeline_ah_packet_hijack(struct rte_pipeline *p, uint64_t pkts_mask)
int rte_pipeline_table_create(struct rte_pipeline *p, struct rte_pipeline_table_params *params, uint32_t *table_id)
int rte_pipeline_port_in_enable(struct rte_pipeline *p, uint32_t port_id)
const char * name
rte_pipeline_port_in_action_handler f_action
struct rte_port_in_ops * ops
struct rte_port_in_stats stats
rte_pipeline_port_out_action_handler f_action
struct rte_port_out_ops * ops
struct rte_port_out_stats stats
__extension__ uint8_t action_data[0]
uint32_t table_id
uint32_t port_id
enum rte_pipeline_action action
rte_pipeline_table_action_handler_miss f_action_miss
rte_pipeline_table_action_handler_hit f_action_hit
struct rte_table_ops * ops
uint64_t n_pkts_dropped_by_lkp_hit_ah
struct rte_table_stats stats
uint64_t n_pkts_dropped_by_lkp_miss_ah