netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jiri Pirko <jiri@resnulli.us>
To: Andy Strohman <andrew@andrewstrohman.com>
Cc: Andrew Lunn <andrew+netdev@lunn.ch>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Vladimir Oltean <olteanv@gmail.com>,
	Simon Horman <horms@kernel.org>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH net-next] dsa: Make offloading optional on per port basis
Date: Mon, 2 Dec 2024 10:27:25 +0100	[thread overview]
Message-ID: <Z019fbECX6R4HHpm@nanopsycho.orion> (raw)
In-Reply-To: <20241201074212.2833277-1-andrew@andrewstrohman.com>

Sun, Dec 01, 2024 at 08:42:11AM CET, andrew@andrewstrohman.com wrote:
>The author has a couple use cases for this:
>
>1) Creating a sniffer, or ethernet tap, by bridging two or more
>non-offloaded ports to the bridge, and tcpdump'ing the member
>ports. Along the same lines, it would be nice to have the ability
>to temporarily disable offloading to sniff all traffic for debugging.
>
>2) Work around bugs in the hardware switch or use features
>that are only available in software.
>
>DSA drivers can be modified to remove their port_bridge_join()
>dsa_switch_ops member to accomplish this. But, it would be better
>to make it this runtime configurable, and configurable on a per port
>basis.
>
>The key to signaling that a port is not offloading is by
>ensuring dp->bridge == NULL. With this, the VLAN and FDB
>operations that affect hardware (ie port_fdb_add, port_vlan_del, etc)
>will not run. dsa_user_fdb_event() will bail if !dp->bridge.
>dsa_user_port_obj_add() checks dsa_port_offloads_bridge_port(),
>and dsa_user_host_vlan_add() checks !dp->bridge.
>
>By being configurable on a per port basis (as opposed to switch-wide),
>we can have some subset of a switch's ports offloading and others not.
>
>While this approach is generic, and therefore will be available for all
>dsa switches, I have only tested this on a mt7530 switch. It may not be
>possible or feasible to disable offloading on other switches.
>
>A flags member was added to the dsa user port netdev private data structure
>in order to facilitate adding future dsa specific flags more easily.
>IFLA_VLAN_FLAGS was used as an example when implementing the flags member.
>
>Signed-off-by: Andy Strohman <andrew@andrewstrohman.com>

Why is this DSA specific? Plus, you say you want to disable offloading
in general (DSA_FLAG_OFFLOADING_DISABLED), but you check the flag only
when joining bridge. I mean, shouldn't this be rather something exposed
by some common UAPI?

Btw, isn't NETIF_F_HW_L2FW_DOFFLOAD what you are looking for?

  reply	other threads:[~2024-12-02  9:27 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-01  7:42 [PATCH net-next] dsa: Make offloading optional on per port basis Andy Strohman
2024-12-02  9:27 ` Jiri Pirko [this message]
2024-12-02  9:45   ` Vladimir Oltean
2024-12-11  6:31     ` Andrew Strohman
2024-12-11  6:12   ` Andrew Strohman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Z019fbECX6R4HHpm@nanopsycho.orion \
    --to=jiri@resnulli.us \
    --cc=andrew+netdev@lunn.ch \
    --cc=andrew@andrewstrohman.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=olteanv@gmail.com \
    --cc=pabeni@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).