mirror of
https://github.com/openvswitch/ovs
synced 2025-09-01 23:05:29 +00:00
netdev: Dynamic per-port Flow API.
Current issues with Flow API: * OVS calls offloading functions regardless of successful flow API initialization. (ex. on init_flow_api failure) * Static initilaization of Flow API for a netdev_class forbids having different offloading types for different instances of netdev with the same netdev_class. (ex. different vports in 'system' and 'netdev' datapaths at the same time) Solution: * Move Flow API from the netdev_class to netdev instance. * Make Flow API dynamic, i.e. probe the APIs and choose the suitable one. Side effects: * Flow API providers localized as possible in their modules. * Now we have an ability to make runtime checks. For example, we could check if particular device supports features we need, like if dpdk device supports RSS+MARK action. Signed-off-by: Ilya Maximets <i.maximets@samsung.com> Acked-by: Roi Dayan <roid@mellanox.com>
This commit is contained in:
@@ -4212,6 +4212,27 @@ unlock:
|
||||
return err;
|
||||
}
|
||||
|
||||
bool
|
||||
netdev_dpdk_flow_api_supported(struct netdev *netdev)
|
||||
{
|
||||
struct netdev_dpdk *dev;
|
||||
bool ret = false;
|
||||
|
||||
if (!is_dpdk_class(netdev->netdev_class)) {
|
||||
goto out;
|
||||
}
|
||||
|
||||
dev = netdev_dpdk_cast(netdev);
|
||||
ovs_mutex_lock(&dev->mutex);
|
||||
if (dev->type == DPDK_DEV_ETH) {
|
||||
/* TODO: Check if we able to offload some minimal flow. */
|
||||
ret = true;
|
||||
}
|
||||
ovs_mutex_unlock(&dev->mutex);
|
||||
out:
|
||||
return ret;
|
||||
}
|
||||
|
||||
int
|
||||
netdev_dpdk_rte_flow_destroy(struct netdev *netdev,
|
||||
struct rte_flow *rte_flow,
|
||||
@@ -4276,8 +4297,7 @@ netdev_dpdk_rte_flow_create(struct netdev *netdev,
|
||||
.get_features = netdev_dpdk_get_features, \
|
||||
.get_status = netdev_dpdk_get_status, \
|
||||
.reconfigure = netdev_dpdk_reconfigure, \
|
||||
.rxq_recv = netdev_dpdk_rxq_recv, \
|
||||
DPDK_FLOW_OFFLOAD_API
|
||||
.rxq_recv = netdev_dpdk_rxq_recv
|
||||
|
||||
static const struct netdev_class dpdk_class = {
|
||||
.type = "dpdk",
|
||||
|
Reference in New Issue
Block a user