DPDK 25.03.0-rc0
rte_distributor_single.h
Go to the documentation of this file.
1/* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(c) 2010-2014 Intel Corporation
3 */
4
5#ifndef _RTE_DISTRIB_SINGLE_H_
6#define _RTE_DISTRIB_SINGLE_H_
7
16#ifdef __cplusplus
17extern "C" {
18#endif
19
20#define RTE_DISTRIBUTOR_NAMESIZE 32
22struct rte_distributor_single;
23struct rte_mbuf;
24
41struct rte_distributor_single *
42rte_distributor_create_single(const char *name, unsigned int socket_id,
43 unsigned int num_workers);
44
45/* *** APIS to be called on the distributor lcore *** */
46/*
47 * The following APIs are the public APIs which are designed for use on a
48 * single lcore which acts as the distributor lcore for a given distributor
49 * instance. These functions cannot be called on multiple cores simultaneously
50 * without using locking to protect access to the internals of the distributor.
51 *
52 * NOTE: a given lcore cannot act as both a distributor lcore and a worker lcore
53 * for the same distributor instance, otherwise deadlock will result.
54 */
55
76int
77rte_distributor_process_single(struct rte_distributor_single *d,
78 struct rte_mbuf **mbufs, unsigned int num_mbufs);
79
94int
95rte_distributor_returned_pkts_single(struct rte_distributor_single *d,
96 struct rte_mbuf **mbufs, unsigned int max_mbufs);
97
109int
110rte_distributor_flush_single(struct rte_distributor_single *d);
111
121void
122rte_distributor_clear_returns_single(struct rte_distributor_single *d);
123
124/* *** APIS to be called on the worker lcores *** */
125/*
126 * The following APIs are the public APIs which are designed for use on
127 * multiple lcores which act as workers for a distributor. Each lcore should use
128 * a unique worker id when requesting packets.
129 *
130 * NOTE: a given lcore cannot act as both a distributor lcore and a worker lcore
131 * for the same distributor instance, otherwise deadlock will result.
132 */
133
150struct rte_mbuf *
151rte_distributor_get_pkt_single(struct rte_distributor_single *d,
152 unsigned int worker_id, struct rte_mbuf *oldpkt);
153
166int
167rte_distributor_return_pkt_single(struct rte_distributor_single *d,
168 unsigned int worker_id, struct rte_mbuf *mbuf);
169
190void
191rte_distributor_request_pkt_single(struct rte_distributor_single *d,
192 unsigned int worker_id, struct rte_mbuf *oldpkt);
193
210struct rte_mbuf *
211rte_distributor_poll_pkt_single(struct rte_distributor_single *d,
212 unsigned int worker_id);
213
214#ifdef __cplusplus
215}
216#endif
217
218#endif
int rte_distributor_process_single(struct rte_distributor_single *d, struct rte_mbuf **mbufs, unsigned int num_mbufs)
void rte_distributor_request_pkt_single(struct rte_distributor_single *d, unsigned int worker_id, struct rte_mbuf *oldpkt)
struct rte_mbuf * rte_distributor_get_pkt_single(struct rte_distributor_single *d, unsigned int worker_id, struct rte_mbuf *oldpkt)
struct rte_distributor_single * rte_distributor_create_single(const char *name, unsigned int socket_id, unsigned int num_workers)
struct rte_mbuf * rte_distributor_poll_pkt_single(struct rte_distributor_single *d, unsigned int worker_id)
int rte_distributor_returned_pkts_single(struct rte_distributor_single *d, struct rte_mbuf **mbufs, unsigned int max_mbufs)
int rte_distributor_return_pkt_single(struct rte_distributor_single *d, unsigned int worker_id, struct rte_mbuf *mbuf)
void rte_distributor_clear_returns_single(struct rte_distributor_single *d)
int rte_distributor_flush_single(struct rte_distributor_single *d)