MCPcopy Create free account
hub / github.com/F-Stack/f-stack / rte_mtr_ops_get

Function rte_mtr_ops_get

dpdk/lib/ethdev/rte_mtr.c:14–41  ·  view source on GitHub ↗

Get generic traffic metering & policing operations structure from a port. */

Source from the content-addressed store, hash-verified

12
13/* Get generic traffic metering & policing operations structure from a port. */
14const struct rte_mtr_ops *
15rte_mtr_ops_get(uint16_t port_id, struct rte_mtr_error *error)
16{
17 struct rte_eth_dev *dev = &rte_eth_devices[port_id];
18 const struct rte_mtr_ops *ops;
19
20 if (!rte_eth_dev_is_valid_port(port_id)) {
21 rte_mtr_error_set(error,
22 ENODEV,
23 RTE_MTR_ERROR_TYPE_UNSPECIFIED,
24 NULL,
25 rte_strerror(ENODEV));
26 return NULL;
27 }
28
29 if ((dev->dev_ops->mtr_ops_get == NULL) ||
30 (dev->dev_ops->mtr_ops_get(dev, &ops) != 0) ||
31 (ops == NULL)) {
32 rte_mtr_error_set(error,
33 ENOSYS,
34 RTE_MTR_ERROR_TYPE_UNSPECIFIED,
35 NULL,
36 rte_strerror(ENOSYS));
37 return NULL;
38 }
39
40 return ops;
41}
42
43#define RTE_MTR_FUNC(port_id, func) \
44({ \

Callers

nothing calls this directly

Calls 3

rte_mtr_error_setFunction · 0.85
rte_strerrorFunction · 0.85

Tested by

no test coverage detected