[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID:
<PAXPR83MB055992B967622803555AA64EB4DD2@PAXPR83MB0559.EURPRD83.prod.outlook.com>
Date: Wed, 3 Jul 2024 09:20:16 +0000
From: Konstantin Taranov <kotaranov@...rosoft.com>
To: Zhu Yanjun <yanjun.zhu@...ux.dev>, Konstantin Taranov
<kotaranov@...ux.microsoft.com>, "pabeni@...hat.com" <pabeni@...hat.com>,
Haiyang Zhang <haiyangz@...rosoft.com>, KY Srinivasan <kys@...rosoft.com>,
"edumazet@...gle.com" <edumazet@...gle.com>, "kuba@...nel.org"
<kuba@...nel.org>, "davem@...emloft.net" <davem@...emloft.net>, Dexuan Cui
<decui@...rosoft.com>, "wei.liu@...nel.org" <wei.liu@...nel.org>,
"sharmaajay@...rosoft.com" <sharmaajay@...rosoft.com>, Long Li
<longli@...rosoft.com>, "jgg@...pe.ca" <jgg@...pe.ca>, "leon@...nel.org"
<leon@...nel.org>
CC: "linux-rdma@...r.kernel.org" <linux-rdma@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>
Subject: Re: [PATCH net-next v2 1/2] net: mana: introduce helper to get a
master netdev
> > +/* the caller should hold rcu_read_lock */ struct net_device
> > +*mana_get_master_netdev_rcu(struct mana_context *ac, u32 port_index)
> > +{
> > + struct net_device *ndev;
>
> From the comments, this function requires rcu_read_lock. Can the following
> be added in this function?
>
> RCU_LOCKDEP_WARN(!rcu_read_lock_held(), "no rcu read lock held");
>
> If rcu_read_lock is not held, this function will notify the caller.
> This can explicitly ensure that rcu_read_lock should be held before this
> fuction is called.
Thanks! Great idea!
>
> Best Regards,
>
> Zhu Yanjun
>
Powered by blists - more mailing lists