public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Paolo Abeni <pabeni@redhat.com>
To: "Michael Dege" <michael.dege@renesas.com>,
	"Yoshihiro Shimoda" <yoshihiro.shimoda.uh@renesas.com>,
	"Andrew Lunn" <andrew+netdev@lunn.ch>,
	"David S. Miller" <davem@davemloft.net>,
	"Eric Dumazet" <edumazet@google.com>,
	"Jakub Kicinski" <kuba@kernel.org>,
	"Niklas Söderlund" <niklas.soderlund@ragnatech.se>,
	"Paul Barker" <paul@pbarker.dev>
Cc: netdev@vger.kernel.org, linux-renesas-soc@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH net-next v3 12/13] net: renesas: rswitch: add handler for FDB notification
Date: Thu, 2 Apr 2026 15:06:27 +0200	[thread overview]
Message-ID: <09e99e68-f7b1-415d-b1ed-efe632432222@redhat.com> (raw)
In-Reply-To: <20260331-rswitch_add_vlans-v3-12-c37f41b1c556@renesas.com>

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.

/P


  parent reply	other threads:[~2026-04-02 13:06 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-31 10:03 [net-next PATCH v3 00/13] net: renesas: rswitch: R-Car S4 add VLAN aware switching Michael Dege
2026-03-31 10:03 ` [PATCH net-next v3 01/13] net: renesas: rswitch: improve port change mode functions Michael Dege
2026-04-02 12:59   ` [net-next,v3,01/13] " Paolo Abeni
2026-03-31 10:03 ` [PATCH net-next v3 02/13] net: renesas: rswitch: use device instead of net_device Michael Dege
2026-03-31 10:03 ` [PATCH net-next v3 03/13] net: renesas: rswitch: fix FWPC2 register access macros Michael Dege
2026-03-31 10:03 ` [PATCH net-next v3 04/13] net: renesas: rswitch: add register definitions for vlan support Michael Dege
2026-04-02 12:59   ` [net-next,v3,04/13] " Paolo Abeni
2026-04-02 13:02   ` [PATCH net-next v3 04/13] " Paolo Abeni
2026-03-31 10:03 ` [PATCH net-next v3 05/13] net: renesas: rswitch: add exception path for packets with unknown dst MAC Michael Dege
2026-04-02 12:59   ` [net-next,v3,05/13] " Paolo Abeni
2026-03-31 10:04 ` [PATCH net-next v3 06/13] net: renesas: rswitch: add forwarding rules for gwca Michael Dege
2026-04-02 12:59   ` [net-next,v3,06/13] " Paolo Abeni
2026-03-31 10:04 ` [PATCH net-next v3 07/13] net: renesas: rswitch: make helper functions available to whole driver Michael Dege
2026-03-31 10:04 ` [PATCH net-next v3 08/13] net: renesas: rswitch: add basic vlan init to rswitch_fwd_init Michael Dege
2026-03-31 10:04 ` [PATCH net-next v3 09/13] net: renesas: rswitch: update port HW init Michael Dege
2026-03-31 10:04 ` [PATCH net-next v3 10/13] net: renesas: rswitch: clean up is_rdev rswitch_device checking Michael Dege
2026-03-31 10:04 ` [PATCH net-next v3 11/13] net: renesas: rswitch: add passing of rswitch_private into notifiers Michael Dege
2026-03-31 10:04 ` [PATCH net-next v3 12/13] net: renesas: rswitch: add handler for FDB notification Michael Dege
2026-04-02 12:59   ` [net-next,v3,12/13] " Paolo Abeni
2026-04-02 13:06   ` Paolo Abeni [this message]
2026-03-31 10:04 ` [PATCH net-next v3 13/13] net: renesas: rswitch: add vlan aware switching Michael Dege
2026-04-02 12:59   ` [net-next,v3,13/13] " Paolo Abeni

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=09e99e68-f7b1-415d-b1ed-efe632432222@redhat.com \
    --to=pabeni@redhat.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=michael.dege@renesas.com \
    --cc=netdev@vger.kernel.org \
    --cc=niklas.soderlund@ragnatech.se \
    --cc=paul@pbarker.dev \
    --cc=yoshihiro.shimoda.uh@renesas.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