....
@@ -3343,6 +3346,556 @@ unlock:
return err;
}
+/*
+ * A mapping from ufid to dpdk rte_flow.
+ */
+static struct cmap ufid_to_rte_flow = CMAP_INITIALIZER;
+
+struct ufid_to_rte_flow_data {
+ struct cmap_node node;
+ ovs_u128 ufid;
Is it better to rename ufid to mega_ufid as
dp_netdev_flow's mega_ufid is stored here?
And I'm not sure why you add mega_ufid in the second patch, it looks like
dp_netdev_flow's ufid is an unique identifier for a flow.
+ struct rte_flow *rte_flow;
+};
+
+/* Find rte_flow with @ufid */
+static struct rte_flow *
+ufid_to_rte_flow_find(const ovs_u128 *ufid)
+{
+ size_t hash = hash_bytes(ufid, sizeof(*ufid), 0);
+ struct ufid_to_rte_flow_data *data;
+
+ CMAP_FOR_EACH_WITH_HASH (data, node, hash, &ufid_to_rte_flow) {
+ if (ovs_u128_equals(*ufid, data->ufid)) {
+ return data->rte_flow;
+ }
+ }
+
+ return NULL;
+}
_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev