* [PATCH net-next v2 0/2] rocker: Two small changes
@ 2022-11-01 12:39 Ido Schimmel
2022-11-01 12:39 ` [PATCH net-next v2 1/2] rocker: Avoid unnecessary scheduling of work item Ido Schimmel
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Ido Schimmel @ 2022-11-01 12:39 UTC (permalink / raw)
To: netdev
Cc: davem, kuba, pabeni, edumazet, jiri, vladimir.oltean, netdev,
mlxsw, Ido Schimmel
Patch #1 avoids allocating and scheduling a work item when it is not
doing any work.
Patch #2 aligns rocker with other switchdev drivers to explicitly mark
FDB entries as offloaded. Needed for upcoming MAB offload [1].
[1] https://lore.kernel.org/netdev/20221025100024.1287157-1-idosch@nvidia.com/
Ido Schimmel (2):
rocker: Avoid unnecessary scheduling of work item
rocker: Explicitly mark learned FDB entries as offloaded
drivers/net/ethernet/rocker/rocker_ofdpa.c | 15 ++++++++-------
1 file changed, 8 insertions(+), 7 deletions(-)
--
2.37.3
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH net-next v2 1/2] rocker: Avoid unnecessary scheduling of work item
2022-11-01 12:39 [PATCH net-next v2 0/2] rocker: Two small changes Ido Schimmel
@ 2022-11-01 12:39 ` Ido Schimmel
2022-11-01 16:21 ` Vladimir Oltean
2022-11-01 12:39 ` [PATCH net-next v2 2/2] rocker: Explicitly mark learned FDB entries as offloaded Ido Schimmel
2022-11-03 3:50 ` [PATCH net-next v2 0/2] rocker: Two small changes patchwork-bot+netdevbpf
2 siblings, 1 reply; 6+ messages in thread
From: Ido Schimmel @ 2022-11-01 12:39 UTC (permalink / raw)
To: netdev
Cc: davem, kuba, pabeni, edumazet, jiri, vladimir.oltean, netdev,
mlxsw, Ido Schimmel
The work item function ofdpa_port_fdb_learn_work() does not do anything
when 'OFDPA_OP_FLAG_LEARNED' is not set in the work item's flags.
Therefore, do not allocate and do not schedule the work item when the
flag is not set.
Suggested-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: Ido Schimmel <idosch@nvidia.com>
---
Notes:
v2:
* New patch
drivers/net/ethernet/rocker/rocker_ofdpa.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/drivers/net/ethernet/rocker/rocker_ofdpa.c b/drivers/net/ethernet/rocker/rocker_ofdpa.c
index 58cf7cc54f40..77ad09ad8304 100644
--- a/drivers/net/ethernet/rocker/rocker_ofdpa.c
+++ b/drivers/net/ethernet/rocker/rocker_ofdpa.c
@@ -1821,19 +1821,16 @@ static void ofdpa_port_fdb_learn_work(struct work_struct *work)
const struct ofdpa_fdb_learn_work *lw =
container_of(work, struct ofdpa_fdb_learn_work, work);
bool removing = (lw->flags & OFDPA_OP_FLAG_REMOVE);
- bool learned = (lw->flags & OFDPA_OP_FLAG_LEARNED);
struct switchdev_notifier_fdb_info info = {};
+ enum switchdev_notifier_type event;
info.addr = lw->addr;
info.vid = lw->vid;
+ event = removing ? SWITCHDEV_FDB_DEL_TO_BRIDGE :
+ SWITCHDEV_FDB_ADD_TO_BRIDGE;
rtnl_lock();
- if (learned && removing)
- call_switchdev_notifiers(SWITCHDEV_FDB_DEL_TO_BRIDGE,
- lw->ofdpa_port->dev, &info.info, NULL);
- else if (learned && !removing)
- call_switchdev_notifiers(SWITCHDEV_FDB_ADD_TO_BRIDGE,
- lw->ofdpa_port->dev, &info.info, NULL);
+ call_switchdev_notifiers(event, lw->ofdpa_port->dev, &info.info, NULL);
rtnl_unlock();
kfree(work);
@@ -1865,6 +1862,9 @@ static int ofdpa_port_fdb_learn(struct ofdpa_port *ofdpa_port,
if (!ofdpa_port_is_bridged(ofdpa_port))
return 0;
+ if (!(flags & OFDPA_OP_FLAG_LEARNED))
+ return 0;
+
lw = kzalloc(sizeof(*lw), GFP_ATOMIC);
if (!lw)
return -ENOMEM;
--
2.37.3
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH net-next v2 2/2] rocker: Explicitly mark learned FDB entries as offloaded
2022-11-01 12:39 [PATCH net-next v2 0/2] rocker: Two small changes Ido Schimmel
2022-11-01 12:39 ` [PATCH net-next v2 1/2] rocker: Avoid unnecessary scheduling of work item Ido Schimmel
@ 2022-11-01 12:39 ` Ido Schimmel
2022-11-01 16:21 ` Vladimir Oltean
2022-11-03 3:50 ` [PATCH net-next v2 0/2] rocker: Two small changes patchwork-bot+netdevbpf
2 siblings, 1 reply; 6+ messages in thread
From: Ido Schimmel @ 2022-11-01 12:39 UTC (permalink / raw)
To: netdev
Cc: davem, kuba, pabeni, edumazet, jiri, vladimir.oltean, netdev,
mlxsw, Ido Schimmel
Currently, FDB entries that are notified to the bridge driver via
'SWITCHDEV_FDB_ADD_TO_BRIDGE' are always marked as offloaded by the
bridge. With MAB enabled, this will no longer be universally true.
Device drivers will report locked FDB entries to the bridge to let it
know that the corresponding hosts required authorization, but it does
not mean that these entries are necessarily programmed in the underlying
hardware.
We would like to solve it by having the bridge driver determine the
offload indication based of the 'offloaded' bit in the FDB notification
[1].
Prepare for that change by having rocker explicitly mark learned FDB
entries as offloaded. This is consistent with all the other switchdev
drivers.
[1] https://lore.kernel.org/netdev/20221025100024.1287157-4-idosch@nvidia.com/
Signed-off-by: Ido Schimmel <idosch@nvidia.com>
---
Notes:
v2:
* Simplify condition.
drivers/net/ethernet/rocker/rocker_ofdpa.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/net/ethernet/rocker/rocker_ofdpa.c b/drivers/net/ethernet/rocker/rocker_ofdpa.c
index 77ad09ad8304..826990459fa4 100644
--- a/drivers/net/ethernet/rocker/rocker_ofdpa.c
+++ b/drivers/net/ethernet/rocker/rocker_ofdpa.c
@@ -1826,6 +1826,7 @@ static void ofdpa_port_fdb_learn_work(struct work_struct *work)
info.addr = lw->addr;
info.vid = lw->vid;
+ info.offloaded = !removing;
event = removing ? SWITCHDEV_FDB_DEL_TO_BRIDGE :
SWITCHDEV_FDB_ADD_TO_BRIDGE;
--
2.37.3
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH net-next v2 1/2] rocker: Avoid unnecessary scheduling of work item
2022-11-01 12:39 ` [PATCH net-next v2 1/2] rocker: Avoid unnecessary scheduling of work item Ido Schimmel
@ 2022-11-01 16:21 ` Vladimir Oltean
0 siblings, 0 replies; 6+ messages in thread
From: Vladimir Oltean @ 2022-11-01 16:21 UTC (permalink / raw)
To: Ido Schimmel
Cc: netdev@vger.kernel.org, davem@davemloft.net, kuba@kernel.org,
pabeni@redhat.com, edumazet@google.com, jiri@resnulli.us,
netdev@kapio-technology.com, mlxsw@nvidia.com
On Tue, Nov 01, 2022 at 02:39:35PM +0200, Ido Schimmel wrote:
> The work item function ofdpa_port_fdb_learn_work() does not do anything
> when 'OFDPA_OP_FLAG_LEARNED' is not set in the work item's flags.
>
> Therefore, do not allocate and do not schedule the work item when the
> flag is not set.
>
> Suggested-by: Vladimir Oltean <vladimir.oltean@nxp.com>
> Signed-off-by: Ido Schimmel <idosch@nvidia.com>
> ---
Reviewed-by: Vladimir Oltean <vladimir.oltean@nxp.com>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH net-next v2 2/2] rocker: Explicitly mark learned FDB entries as offloaded
2022-11-01 12:39 ` [PATCH net-next v2 2/2] rocker: Explicitly mark learned FDB entries as offloaded Ido Schimmel
@ 2022-11-01 16:21 ` Vladimir Oltean
0 siblings, 0 replies; 6+ messages in thread
From: Vladimir Oltean @ 2022-11-01 16:21 UTC (permalink / raw)
To: Ido Schimmel
Cc: netdev@vger.kernel.org, davem@davemloft.net, kuba@kernel.org,
pabeni@redhat.com, edumazet@google.com, jiri@resnulli.us,
netdev@kapio-technology.com, mlxsw@nvidia.com
On Tue, Nov 01, 2022 at 02:39:36PM +0200, Ido Schimmel wrote:
> Currently, FDB entries that are notified to the bridge driver via
> 'SWITCHDEV_FDB_ADD_TO_BRIDGE' are always marked as offloaded by the
> bridge. With MAB enabled, this will no longer be universally true.
> Device drivers will report locked FDB entries to the bridge to let it
> know that the corresponding hosts required authorization, but it does
> not mean that these entries are necessarily programmed in the underlying
> hardware.
>
> We would like to solve it by having the bridge driver determine the
> offload indication based of the 'offloaded' bit in the FDB notification
> [1].
>
> Prepare for that change by having rocker explicitly mark learned FDB
> entries as offloaded. This is consistent with all the other switchdev
> drivers.
>
> [1] https://lore.kernel.org/netdev/20221025100024.1287157-4-idosch@nvidia.com/
>
> Signed-off-by: Ido Schimmel <idosch@nvidia.com>
> ---
Reviewed-by: Vladimir Oltean <vladimir.oltean@nxp.com>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH net-next v2 0/2] rocker: Two small changes
2022-11-01 12:39 [PATCH net-next v2 0/2] rocker: Two small changes Ido Schimmel
2022-11-01 12:39 ` [PATCH net-next v2 1/2] rocker: Avoid unnecessary scheduling of work item Ido Schimmel
2022-11-01 12:39 ` [PATCH net-next v2 2/2] rocker: Explicitly mark learned FDB entries as offloaded Ido Schimmel
@ 2022-11-03 3:50 ` patchwork-bot+netdevbpf
2 siblings, 0 replies; 6+ messages in thread
From: patchwork-bot+netdevbpf @ 2022-11-03 3:50 UTC (permalink / raw)
To: Ido Schimmel
Cc: netdev, davem, kuba, pabeni, edumazet, jiri, vladimir.oltean,
netdev, mlxsw
Hello:
This series was applied to netdev/net-next.git (master)
by Jakub Kicinski <kuba@kernel.org>:
On Tue, 1 Nov 2022 14:39:34 +0200 you wrote:
> Patch #1 avoids allocating and scheduling a work item when it is not
> doing any work.
>
> Patch #2 aligns rocker with other switchdev drivers to explicitly mark
> FDB entries as offloaded. Needed for upcoming MAB offload [1].
>
> [1] https://lore.kernel.org/netdev/20221025100024.1287157-1-idosch@nvidia.com/
>
> [...]
Here is the summary with links:
- [net-next,v2,1/2] rocker: Avoid unnecessary scheduling of work item
https://git.kernel.org/netdev/net-next/c/42e51de97cb4
- [net-next,v2,2/2] rocker: Explicitly mark learned FDB entries as offloaded
https://git.kernel.org/netdev/net-next/c/386b4174827c
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2022-11-03 3:50 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-11-01 12:39 [PATCH net-next v2 0/2] rocker: Two small changes Ido Schimmel
2022-11-01 12:39 ` [PATCH net-next v2 1/2] rocker: Avoid unnecessary scheduling of work item Ido Schimmel
2022-11-01 16:21 ` Vladimir Oltean
2022-11-01 12:39 ` [PATCH net-next v2 2/2] rocker: Explicitly mark learned FDB entries as offloaded Ido Schimmel
2022-11-01 16:21 ` Vladimir Oltean
2022-11-03 3:50 ` [PATCH net-next v2 0/2] rocker: Two small changes patchwork-bot+netdevbpf
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).