1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(c) 2020 Intel Corporation
4 #ifndef __INCLUDE_RTE_SWX_EXTERN_H__
5 #define __INCLUDE_RTE_SWX_EXTERN_H__
13 * RTE SWX Extern objects and functions
15 * Extern object and extern function interfaces. The extern objects and extern
16 * functions provide the mechanisms to hook external functionality into the
17 * packet processing pipeline.
27 * Extern object constructor
30 * Extern object constructor arguments. It may be NULL.
32 * Extern object handle.
35 (*rte_swx_extern_type_constructor_t)(const char *args);
38 * Extern object destructor
41 * Extern object handle.
44 (*rte_swx_extern_type_destructor_t)(void *object);
47 * Extern object member function
49 * The mailbox is used to pass input arguments to the member function and
50 * retrieve the output results. The mailbox mechanism allows for multiple
51 * concurrent executions of the same member function for the same extern object.
53 * Multiple invocations of the same member function may be required in order for
54 * the associated operation to complete. The completion is flagged by a return
55 * value of 1, in which case the results are available in the mailbox; in case
56 * of a return value of 0, the operation is not yet completed, so the member
57 * function must be invoked again with exactly the same object and mailbox
61 * Extern object handle.
63 * Extern object mailbox.
65 * 0 when the operation is not yet completed, and 1 when the operation is
66 * completed. No other return values are allowed.
69 (*rte_swx_extern_type_member_func_t)(void *object, void *mailbox);
75 /** The mailbox is used to pass input arguments to the extern function and
76 * retrieve the output results. The mailbox mechanism allows for multiple
77 * concurrent executions of the same extern function.
79 * Multiple invocations of the same extern function may be required in order for
80 * the associated operation to complete. The completion is flagged by a return
81 * value of 1, in which case the results are available in the mailbox; in case
82 * of a return value of 0, the operation is not yet completed, so the extern
83 * function must be invoked again with exactly the same mailbox argument.
86 * Extern object mailbox.
88 * 0 when the operation is not yet completed, and 1 when the operation is
89 * completed. No other return values are allowed.
92 (*rte_swx_extern_func_t)(void *mailbox);