Re: [RFC net-next v1 2/2] net: dsa: add option for bridge port HW offload

From: Andrew Lunn
Date: Sun Jan 19 2025 - 21:39:46 EST


On Mon, Jan 20, 2025 at 01:49:12PM +1300, Aryan Srivastava wrote:
> Currently the DSA framework will HW offload any bridge port if there is
> a driver available to support HW offloading. This may not always be the
> preferred case. In cases where it is preferred that all traffic still
> hit the CPU, do software bridging instead.
>
> To prevent HW bridging (and potential CPU bypass), make the DSA
> framework aware of the devlink port function attr, bridge_offload, and
> add a matching field to the port struct. Add get/set functions to
> configure the field, and use this field to condition HW config for
> offloading a bridge port.

This is not a very convincing description. What is your real use case
for not offloading?

>
> Signed-off-by: Aryan Srivastava <aryan.srivastava@xxxxxxxxxxxxxxxxxxx>
> ---
> include/net/dsa.h | 1 +
> net/dsa/devlink.c | 27 ++++++++++++++++++++++++++-
> net/dsa/dsa.c | 1 +
> net/dsa/port.c | 3 ++-
> 4 files changed, 30 insertions(+), 2 deletions(-)
>
> diff --git a/include/net/dsa.h b/include/net/dsa.h
> index a0a9481c52c2..9ee2d7ccfff8 100644
> --- a/include/net/dsa.h
> +++ b/include/net/dsa.h
> @@ -291,6 +291,7 @@ struct dsa_port {
>
> struct device_node *dn;
> unsigned int ageing_time;
> + bool bridge_offloading;

Indentation is not consistent here.

net-next is closed for the merge window.

Andrew

---
pw-bot: cr