git sha: 35e0208c29de46a1e9a4ed59b77470b96da16155
Author: Eelco Chaudron <[email protected]>
Subject: dpif-netlink: Remove entangled hardware offload.

This commit removes hardware offload logic from the dpif-netlink
implementation, moving it up one layer to be handled by the dpif-offload
provider as part of the dpif_operate() function.

> ---
>  lib/dpif-netdev.c   |   3 +-
>  lib/dpif-netlink.c  | 337 +-------------------------------------------
>  lib/dpif-provider.h |   7 +-
>  lib/dpif.c          |   5 +-
>  4 files changed, 8 insertions(+), 344 deletions(-)
> 
> diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c
> index c09b1c7c7..df6c94912 100644
> --- a/lib/dpif-netdev.c
> +++ b/lib/dpif-netdev.c
> @@ -4709,8 +4709,7 @@ dpif_netdev_execute(struct dpif *dpif, struct 
> dpif_execute *execute)
>  }
>  
>  static void
> -dpif_netdev_operate(struct dpif *dpif, struct dpif_op **ops, size_t n_ops,
> -                    enum dpif_offload_type offload_type OVS_UNUSED)
> +dpif_netdev_operate(struct dpif *dpif, struct dpif_op **ops, size_t n_ops)
>  {
>      size_t i;
>  
> diff --git a/lib/dpif-netlink.c b/lib/dpif-netlink.c
> index 165f76ace..d384e8f09 100644
> --- a/lib/dpif-netlink.c
> +++ b/lib/dpif-netlink.c

[ ... ]

> @@ -2065,224 +2005,11 @@ dpif_netlink_operate__(struct dpif_netlink *dpif,
>      return n_ops;
>  }
>  
> -static int
> -parse_flow_get(struct dpif_netlink *dpif, struct dpif_flow_get *get)
> -{

[ ... ]

>  static void
> -dpif_netlink_operate_chunks(struct dpif_netlink *dpif, struct dpif_op **ops,
> -                            size_t n_ops)
> +dpif_netlink_operate(struct dpif *dpif_, struct dpif_op **ops, size_t n_ops)
>  {
> +    struct dpif_netlink *dpif = dpif_netlink_cast(dpif_);
> +
>      while (n_ops > 0) {
>          size_t chunk = dpif_netlink_operate__(dpif, ops, n_ops);
>  
> @@ -2291,64 +2018,6 @@ dpif_netlink_operate_chunks(struct dpif_netlink *dpif, 
> struct dpif_op **ops,
>      }
>  }
>  
> -static void
> -dpif_netlink_operate(struct dpif *dpif_, struct dpif_op **ops, size_t n_ops,
> -                     enum dpif_offload_type offload_type)
> -{

[ ... ]

> diff --git a/lib/dpif-provider.h b/lib/dpif-provider.h
> index d27ad5165..e1c91caff 100644
> --- a/lib/dpif-provider.h
> +++ b/lib/dpif-provider.h
> @@ -363,11 +363,8 @@ struct dpif_class {
>      /* Executes each of the 'n_ops' operations in 'ops' on 'dpif', in the 
> order
>       * in which they are specified, placing each operation's results in the
>       * "output" members documented in comments and the 'error' member of each
> -     * dpif_op. The offload_type argument tells the provider if 'ops' should
> -     * be submitted to to a netdev (only offload) or to the kernel datapath
> -     * (never offload) or to both (offload if possible; software fallback). 
> */
> -    void (*operate)(struct dpif *dpif, struct dpif_op **ops, size_t n_ops,
> -                    enum dpif_offload_type offload_type);
> +     * dpif_op. */
> +    void (*operate)(struct dpif *dpif, struct dpif_op **ops, size_t n_ops);

Does this signature change properly maintain ABI compatibility with other
dpif implementations in the codebase? The removal of the offload_type
parameter changes both the function signature and call conventions.

> diff --git a/lib/dpif.c b/lib/dpif.c
> index 4b068b013..323a2bf6c 100644
> --- a/lib/dpif.c
> +++ b/lib/dpif.c
> @@ -1423,12 +1423,11 @@ dpif_operate(struct dpif *dpif, struct dpif_op **ops, 
> size_t n_ops,
>                  ops_left = dpif_offload_operate(dpif, ops_copy, chunk,
>                                                  offload_type);
>                  if (ops_left) {
> -                    dpif->dpif_class->operate(dpif, ops_copy, ops_left,
> -                                              offload_type);
> +                    dpif->dpif_class->operate(dpif, ops_copy, ops_left);
>                  }
>                  free(ops_copy);
>              } else {
> -                dpif->dpif_class->operate(dpif, ops, chunk, offload_type);
> +                dpif->dpif_class->operate(dpif, ops, chunk);
>              }

Is there a risk that this code path still needs the offload_type parameter
for proper operation? The removal assumes that dpif_offload_operate always
handles offload decisions, but what happens when offload is disabled or
unavailable?
_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to