commit aae0e8919a
Author: Eelco Chaudron <[email protected]>
dpif-offload-tc: Add port management framework.

This patch updates the existing tc offload provider to use the new
framework for port management.

> commit aae0e8919a
> Author: Eelco Chaudron <[email protected]>
> Date:   Wed Nov 12 16:35:29 2025 +0100
> 
>     dpif-offload-tc: Add port management framework.
> 
>     Existing tc offload provider is updated to use the new
>     framework for port management.
> 
>     Signed-off-by: Eelco Chaudron <[email protected]>
> 
> diff --git a/lib/dpif-offload-tc.c b/lib/dpif-offload-tc.c
> index 2c9081438..c3090829b 100644
> --- a/lib/dpif-offload-tc.c
> +++ b/lib/dpif-offload-tc.c
> @@ -44,6 +44,60 @@ dpif_offload_tc_cast(const struct dpif_offload *offload)
>      return CONTAINER_OF(offload, struct dpif_offload_tc, offload);
>  }
>  
> +static int
> +dpif_offload_tc_port_add(struct dpif_offload *dpif_offload,
> +                         struct netdev *netdev, odp_port_t port_no)
> +{
> +    struct dpif_offload_tc *offload_tc = dpif_offload_tc_cast(dpif_offload);
> +    struct dpif_offload_port_mgr_port *port = xmalloc(sizeof *port);
> +
> +    if (dpif_offload_port_mgr_add(offload_tc->port_mgr, port, netdev,
> +                                  port_no, true)) {
> +        if (dpif_offload_is_offload_enabled()) {
> +            return dpif_offload_tc_enable_offload(dpif_offload, port);
> +        }
> +        return 0;
> +    }
> +
> +    free(port);
> +    return EEXIST;
> +}

Does this code leak the port structure when dpif_offload_port_mgr_add 
succeeds but dpif_offload_tc_enable_offload fails? The function returns
the error from dpif_offload_tc_enable_offload without cleaning up the
allocated port that was successfully added to the port manager.

[ ... ]
_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to