RE: [PATCH net-next v3 12/13] net: renesas: rswitch: add handler for FDB notification

From: Michael Dege

Date: Mon May 11 2026 - 05:27:50 EST


Hello Paolo,

Thank you for your review comments.

> -----Original Message-----
> From: Paolo Abeni <pabeni@xxxxxxxxxx>
> Sent: Thursday, April 2, 2026 3:06 PM
> To: Michael Dege <michael.dege@xxxxxxxxxxx>; Yoshihiro Shimoda <yoshihiro.shimoda.uh@xxxxxxxxxxx>;
> Andrew Lunn <andrew+netdev@xxxxxxx>; David S. Miller <davem@xxxxxxxxxxxxx>; Eric Dumazet
> <edumazet@xxxxxxxxxx>; Jakub Kicinski <kuba@xxxxxxxxxx>; niklas.soderlund
> <niklas.soderlund@xxxxxxxxxxxx>; Paul Barker <paul@xxxxxxxxxxx>
> Cc: netdev@xxxxxxxxxxxxxxx; linux-renesas-soc@xxxxxxxxxxxxxxx; linux-kernel@xxxxxxxxxxxxxxx
> Subject: Re: [PATCH net-next v3 12/13] net: renesas: rswitch: add handler for FDB notification
>
> On 3/31/26 12:04 PM, Michael Dege wrote:
> > +/* called under rcu_read_lock() */
> > +static int rswitch_switchdev_event(struct notifier_block *nb,
> > + unsigned long event,
> > + void *ptr)
> > +{
> > + struct net_device *ndev = switchdev_notifier_info_to_dev(ptr);
> > + struct rswitch_switchdev_event_work *switchdev_work;
> > + struct switchdev_notifier_fdb_info *fdb_info;
> > + struct switchdev_notifier_info *info = ptr;
> > + struct rswitch_private *priv;
> > + int err;
> > +
> > + priv = container_of(nb, struct rswitch_private,
> > +rswitch_switchdev_nb);
> > +
> > + switch (event) {
> > + case SWITCHDEV_FDB_ADD_TO_DEVICE:
> > + fallthrough;
> > + case SWITCHDEV_FDB_DEL_TO_DEVICE:
> > + switchdev_work = kzalloc(sizeof(*switchdev_work), GFP_ATOMIC);
> > +
> > + if (!switchdev_work)
> > + return NOTIFY_BAD;
> > +
> > + switchdev_work->ndev = info->dev;
> > + switchdev_work->priv = priv;
> > + switchdev_work->event = event;
> > +
> > + fdb_info = container_of(info,
> > + struct switchdev_notifier_fdb_info,
> > + info);
> > +
> > + INIT_WORK(&switchdev_work->work,
> > +rswitch_switchdev_bridge_fdb_event_work);
> > +
> > + memcpy(&switchdev_work->fdb_info, ptr,
> > +sizeof(switchdev_work->fdb_info));
> > +
> > + switchdev_work->fdb_info.addr = kzalloc(ETH_ALEN, GFP_ATOMIC);
> > + if (!switchdev_work->fdb_info.addr)
> > + goto err_addr_alloc;
> > +
> > + ether_addr_copy((u8 *)switchdev_work->fdb_info.addr,
> > + fdb_info->addr);
> > + dev_hold(ndev);
>
> Please switch to netdev_hold()/netdev_put(), providing a suitable netdevice_tracker.

Done.

Best regards,

Michael
>
> /P