From: Vinicius Costa Gomes <vinicius.gomes@intel.com>
To: Vladimir Oltean <vladimir.oltean@nxp.com>
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>,
"jhs@mojatatu.com" <jhs@mojatatu.com>,
"xiyou.wangcong@gmail.com" <xiyou.wangcong@gmail.com>,
"jiri@resnulli.us" <jiri@resnulli.us>,
"kuba@kernel.org" <kuba@kernel.org>,
"m-karicheri2@ti.com" <m-karicheri2@ti.com>,
"Jose.Abreu@synopsys.com" <Jose.Abreu@synopsys.com>,
Po Liu <po.liu@nxp.com>,
"intel-wired-lan@lists.osuosl.org"
<intel-wired-lan@lists.osuosl.org>,
"anthony.l.nguyen@intel.com" <anthony.l.nguyen@intel.com>,
"mkubecek@suse.cz" <mkubecek@suse.cz>
Subject: Re: [PATCH net-next v2 1/8] ethtool: Add support for configuring frame preemption
Date: Tue, 19 Jan 2021 15:03:42 -0800 [thread overview]
Message-ID: <87v9bszfzl.fsf@vcostago-mobl2.amr.corp.intel.com> (raw)
In-Reply-To: <20210119005224.yqrpyr2d7xawhbtf@skbuf>
Hi Vladimir,
Vladimir Oltean <vladimir.oltean@nxp.com> writes:
> On Mon, Jan 18, 2021 at 04:40:21PM -0800, Vinicius Costa Gomes wrote:
>> +int ethnl_set_preempt(struct sk_buff *skb, struct genl_info *info)
>> +{
>> + struct ethnl_req_info req_info = {};
>> + struct nlattr **tb = info->attrs;
>> + struct ethtool_fp preempt = {};
>> + struct net_device *dev;
>> + bool mod = false;
>> + int ret;
>> +
>> + ret = ethnl_parse_header_dev_get(&req_info,
>> + tb[ETHTOOL_A_PREEMPT_HEADER],
>> + genl_info_net(info), info->extack,
>> + true);
>> + if (ret < 0)
>> + return ret;
>> + dev = req_info.dev;
>> + ret = -EOPNOTSUPP;
>> + if (!dev->ethtool_ops->get_preempt ||
>> + !dev->ethtool_ops->set_preempt)
>> + goto out_dev;
>> +
>> + rtnl_lock();
>
> I'm a bit of a noob when it comes to ethtool (netlink or otherwise).
> Why do you take the rtnl_mutex when updating some purely hardware
> values, what netdev state is there to protect? Can this get->modify->set
> sequence be serialized using other locking mechanism than rtnl_mutex?
From what I understand, configuration changes to netdevice should be
protected by rtnl_mutex, for example, to avoid the device disappearing
while the configuration is in progress. I don't think there's any other
finer grained lock that can be used here.
Cheers,
--
Vinicius
next prev parent reply other threads:[~2021-01-19 23:05 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-19 0:40 [PATCH net-next v2 0/8] ethtool: Add support for frame preemption Vinicius Costa Gomes
2021-01-19 0:40 ` [PATCH net-next v2 1/8] ethtool: Add support for configuring " Vinicius Costa Gomes
2021-01-19 0:52 ` Vladimir Oltean
2021-01-19 23:03 ` Vinicius Costa Gomes [this message]
2021-01-20 2:17 ` Jakub Kicinski
2021-01-21 23:18 ` Vinicius Costa Gomes
2021-01-19 0:40 ` [PATCH net-next v2 2/8] taprio: Add support for frame preemption offload Vinicius Costa Gomes
2021-01-20 2:21 ` Jakub Kicinski
2021-01-21 23:17 ` Vinicius Costa Gomes
2021-01-19 0:40 ` [PATCH net-next v2 3/8] igc: Set the RX packet buffer size for TSN mode Vinicius Costa Gomes
2021-01-19 0:40 ` [PATCH net-next v2 4/8] igc: Only dump registers if configured to dump HW information Vinicius Costa Gomes
2021-01-19 0:40 ` [PATCH net-next v2 5/8] igc: Avoid TX Hangs because long cycles Vinicius Costa Gomes
2021-01-19 0:40 ` [PATCH net-next v2 6/8] igc: Add support for tuning frame preemption via ethtool Vinicius Costa Gomes
2021-01-20 2:23 ` Jakub Kicinski
2021-01-21 23:18 ` Vinicius Costa Gomes
2021-01-19 0:40 ` [PATCH net-next v2 7/8] igc: Add support for Frame Preemption offload Vinicius Costa Gomes
2021-01-19 0:40 ` [PATCH net-next v2 8/8] igc: Separate TSN configurations that can be updated Vinicius Costa Gomes
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=87v9bszfzl.fsf@vcostago-mobl2.amr.corp.intel.com \
--to=vinicius.gomes@intel.com \
--cc=Jose.Abreu@synopsys.com \
--cc=anthony.l.nguyen@intel.com \
--cc=intel-wired-lan@lists.osuosl.org \
--cc=jhs@mojatatu.com \
--cc=jiri@resnulli.us \
--cc=kuba@kernel.org \
--cc=m-karicheri2@ti.com \
--cc=mkubecek@suse.cz \
--cc=netdev@vger.kernel.org \
--cc=po.liu@nxp.com \
--cc=vladimir.oltean@nxp.com \
--cc=xiyou.wangcong@gmail.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).