1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(c) 2020 Intel Corporation
5 #include "rte_eventdev.h"
6 #include "rte_eventdev_pmd.h"
7 #include "rte_pmd_dlb.h"
9 #include "dlb_inline_fns.h"
12 rte_pmd_dlb_set_token_pop_mode(uint8_t dev_id,
14 enum dlb_token_pop_mode mode)
16 struct dlb_eventdev *dlb;
17 struct rte_eventdev *dev;
19 RTE_EVENTDEV_VALID_DEVID_OR_ERR_RET(dev_id, -EINVAL);
20 dev = &rte_eventdevs[dev_id];
22 dlb = dlb_pmd_priv(dev);
24 if (mode >= NUM_TOKEN_POP_MODES)
27 /* The event device must be configured, but not yet started */
28 if (!dlb->configured || dlb->run_state != DLB_RUN_STATE_STOPPED)
31 /* The token pop mode must be set before configuring the port */
32 if (port_id >= dlb->num_ports || dlb->ev_ports[port_id].setup_done)
35 dlb->ev_ports[port_id].qm_port.token_pop_mode = mode;