On 1/11/24 16:33, [email protected] wrote:
> From: Numan Siddique <[email protected]>
>
> Signed-off-by: Numan Siddique <[email protected]>
> ---
Hi Numan,
[...]
> @@ -16647,6 +16605,86 @@ lflow_handle_northd_lb_changes(struct ovsdb_idl_txn
> *ovnsb_txn,
> return true;
> }
>
> +bool
> +lflow_handle_lr_stateful_changes(struct ovsdb_idl_txn *ovnsb_txn,
> + struct lr_stateful_tracked_data *trk_data,
> + struct lflow_input *lflow_input,
> + struct lflow_table *lflows)
> +{
> + struct lr_stateful_record *lr_stateful_rec;
> + struct hmapx_node *hmapx_node;
> +
> + HMAPX_FOR_EACH (hmapx_node, &trk_data->crupdated) {
> + lr_stateful_rec = hmapx_node->data;
> + /* Unlink old lflows. */
> + lflow_ref_unlink_lflows(lr_stateful_rec->lflow_ref);
> +
> + /* Generate new lflows. */
> + struct ds match = DS_EMPTY_INITIALIZER;
> + struct ds actions = DS_EMPTY_INITIALIZER;
> +
> + build_lr_stateful_flows(lr_stateful_rec, lflows,
> lflow_input->ls_ports,
> + lflow_input->lr_ports, &match, &actions,
> + lflow_input->meter_groups,
> + lflow_input->features);
> +
> + /* Sync the new flows to SB. */
> + bool handled = lflow_ref_sync_lflows(
> + lr_stateful_rec->lflow_ref, lflows, ovnsb_txn,
> + lflow_input->ls_datapaths, lflow_input->lr_datapaths,
> + lflow_input->ovn_internal_version_changed,
> + lflow_input->sbrec_logical_flow_table,
> + lflow_input->sbrec_logical_dp_group_table);
> + if (!handled) {
We leak match and actions here.
> + return false;
> + }
> +
> + struct ovn_port *op;
> + HMAP_FOR_EACH (op, dp_node, &lr_stateful_rec->od->ports) {
> + lflow_ref_unlink_lflows(op->stateful_lflow_ref);
> +
> + build_lbnat_lflows_iterate_by_lrp(op,
> + lflow_input->lr_stateful_table,
> + lflow_input->meter_groups,
> + &match, &actions,
> + lflows);
> +
> + handled = lflow_ref_sync_lflows(
> + op->stateful_lflow_ref, lflows, ovnsb_txn,
> + lflow_input->ls_datapaths, lflow_input->lr_datapaths,
> + lflow_input->ovn_internal_version_changed,
> + lflow_input->sbrec_logical_flow_table,
> + lflow_input->sbrec_logical_dp_group_table);
> + if (!handled) {
We leak match and actions here.
> + return false;
> + }
> +
> + if (op->peer && op->peer->nbsp) {
> + lflow_ref_unlink_lflows(op->peer->stateful_lflow_ref);
> +
> + build_lbnat_lflows_iterate_by_lsp(
> + op->peer, lflow_input->lr_stateful_table, &match,
> &actions,
> + lflows);
> +
> + handled = lflow_ref_sync_lflows(
> + op->peer->stateful_lflow_ref, lflows, ovnsb_txn,
> + lflow_input->ls_datapaths, lflow_input->lr_datapaths,
> + lflow_input->ovn_internal_version_changed,
> + lflow_input->sbrec_logical_flow_table,
> + lflow_input->sbrec_logical_dp_group_table);
> + if (!handled) {
We leak match and actions here.
> + return false;
> + }
> + }
> + }
> +
> + ds_destroy(&match);
> + ds_destroy(&actions);
> + }
> +
> + return true;
> +}
> +
> static bool
> mirror_needs_update(const struct nbrec_mirror *nb_mirror,
> const struct sbrec_mirror *sb_mirror)
Regards,
Dumitru
_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev