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

Function rte_flow_configure

dpdk/lib/ethdev/rte_flow.c:1661–1717  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1659}
1660
1661int
1662rte_flow_configure(uint16_t port_id,
1663 const struct rte_flow_port_attr *port_attr,
1664 uint16_t nb_queue,
1665 const struct rte_flow_queue_attr *queue_attr[],
1666 struct rte_flow_error *error)
1667{
1668 struct rte_eth_dev *dev = &rte_eth_devices[port_id];
1669 const struct rte_flow_ops *ops = rte_flow_ops_get(port_id, error);
1670 int ret;
1671
1672 if (unlikely(!ops))
1673 return -rte_errno;
1674 if (dev->data->dev_configured == 0) {
1675 RTE_FLOW_LOG(INFO,
1676 "Device with port_id=%"PRIu16" is not configured.\n",
1677 port_id);
1678 goto error;
1679 }
1680 if (dev->data->dev_started != 0) {
1681 RTE_FLOW_LOG(INFO,
1682 "Device with port_id=%"PRIu16" already started.\n",
1683 port_id);
1684 goto error;
1685 }
1686 if (port_attr == NULL) {
1687 RTE_FLOW_LOG(ERR, "Port %"PRIu16" info is NULL.\n", port_id);
1688 goto error;
1689 }
1690 if (queue_attr == NULL) {
1691 RTE_FLOW_LOG(ERR, "Port %"PRIu16" queue info is NULL.\n", port_id);
1692 goto error;
1693 }
1694 if ((port_attr->flags & RTE_FLOW_PORT_FLAG_SHARE_INDIRECT) &&
1695 !rte_eth_dev_is_valid_port(port_attr->host_port_id)) {
1696 return rte_flow_error_set(error, ENODEV,
1697 RTE_FLOW_ERROR_TYPE_UNSPECIFIED,
1698 NULL, rte_strerror(ENODEV));
1699 }
1700 if (likely(!!ops->configure)) {
1701 ret = ops->configure(dev, port_attr, nb_queue, queue_attr, error);
1702 if (ret == 0)
1703 dev->data->flow_configured = 1;
1704 ret = flow_err(port_id, ret, error);
1705
1706 rte_flow_trace_configure(port_id, port_attr, nb_queue, queue_attr, ret);
1707
1708 return ret;
1709 }
1710 return rte_flow_error_set(error, ENOTSUP,
1711 RTE_FLOW_ERROR_TYPE_UNSPECIFIED,
1712 NULL, rte_strerror(ENOTSUP));
1713error:
1714 return rte_flow_error_set(error, EINVAL,
1715 RTE_FLOW_ERROR_TYPE_UNSPECIFIED,
1716 NULL, rte_strerror(EINVAL));
1717}
1718

Callers 1

port_flow_configureFunction · 0.85

Calls 5

rte_flow_ops_getFunction · 0.85
rte_flow_error_setFunction · 0.85
rte_strerrorFunction · 0.85
flow_errFunction · 0.85

Tested by

no test coverage detected