numam-dpdk/drivers/event/dlb2/rte_pmd_dlb2.h
David Marchand 1094dd940e cleanup compat header inclusions
With symbols going though experimental/stable stages, we accumulated
a lot of discrepancies about inclusion of the rte_compat.h header.

Some headers are including it where unneeded, while others rely on
implicit inclusion.

Fix unneeded inclusions:
$ git grep -l include..rte_compat.h |
  xargs grep -LE '__rte_(internal|experimental)' |
  xargs sed -i -e '/#include..rte_compat.h/d'

Fix missing inclusion, by inserting rte_compat.h before the first
inclusion of a DPDK header:
$ git grep -lE '__rte_(internal|experimental)' |
  xargs grep -L include..rte_compat.h |
  xargs sed -i -e \
    '0,/#include..\(rte_\|.*pmd.h.$\)/{
      s/\(#include..\(rte_\|.*pmd.h.$\)\)/#include <rte_compat.h>\n\1/
    }'

Fix missing inclusion, by inserting rte_compat.h after the last
inclusion of a non DPDK header:
$ for file in $(git grep -lE '__rte_(internal|experimental)' |
  xargs grep -L include..rte_compat.h); do
    tac $file > $file.$$
    sed -i -e \
      '0,/#include../{
        s/\(#include..*$\)/#include <rte_compat.h>\n\n\1/
      }' $file.$$
    tac $file.$$ > $file
    rm $file.$$
  done

Fix missing inclusion, by inserting rte_compat.h after the header guard:
$ git grep -lE '__rte_(internal|experimental)' |
  xargs grep -L include..rte_compat.h |
  xargs sed -i -e \
    '0,/#define/{
      s/\(#define .*$\)/\1\n\n#include <rte_compat.h>/
    }'

And finally, exclude rte_compat.h itself.
$ git checkout lib/eal/include/rte_compat.h

At the end of all this, we have a clean tree:
$ git grep -lE '__rte_(internal|experimental)' |
  xargs grep -L include..rte_compat.h
buildtools/check-symbols.sh
devtools/checkpatches.sh
doc/guides/contributing/abi_policy.rst
doc/guides/rel_notes/release_20_11.rst
lib/eal/include/rte_compat.h

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
2022-11-15 08:39:14 +01:00

75 lines
1.6 KiB
C

/* SPDX-License-Identifier: BSD-3-Clause
* Copyright(c) 2020 Intel Corporation
*/
/*!
* @file rte_pmd_dlb2.h
*
* @brief DLB PMD-specific functions
*/
#ifndef _RTE_PMD_DLB2_H_
#define _RTE_PMD_DLB2_H_
#ifdef __cplusplus
extern "C" {
#endif
#include <stdint.h>
#include <rte_compat.h>
/**
* @warning
* @b EXPERIMENTAL: this API may change, or be removed, without prior notice
*
* Selects the token pop mode for a DLB2 port.
*/
enum dlb2_token_pop_mode {
/* Pop the CQ tokens immediately after dequeuing. */
AUTO_POP,
/* Pop CQ tokens after (dequeue_depth - 1) events are released.
* Supported on load-balanced ports only.
*/
DELAYED_POP,
/* Pop the CQ tokens during next dequeue operation. */
DEFERRED_POP,
/* NUM_TOKEN_POP_MODES must be last */
NUM_TOKEN_POP_MODES
};
/*!
* @warning
* @b EXPERIMENTAL: this API may change, or be removed, without prior notice
*
* Configure the token pop mode for a DLB2 port. By default, all ports use
* AUTO_POP. This function must be called before calling rte_event_port_setup()
* for the port, but after calling rte_event_dev_configure().
*
* @param dev_id
* The identifier of the event device.
* @param port_id
* The identifier of the event port.
* @param mode
* The token pop mode.
*
* @return
* - 0: Success
* - EINVAL: Invalid dev_id, port_id, or mode
* - EINVAL: The DLB2 is not configured, is already running, or the port is
* already setup
*/
__rte_experimental
int
rte_pmd_dlb2_set_token_pop_mode(uint8_t dev_id,
uint8_t port_id,
enum dlb2_token_pop_mode mode);
#ifdef __cplusplus
}
#endif
#endif /* _RTE_PMD_DLB2_H_ */