From: Andrew Lunn <andrew@lunn.ch>
To: Huazhong Tan <tanhuazhong@huawei.com>
Cc: davem@davemloft.net, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org, linuxarm@huawei.com,
kuba@kernel.org, mkubecek@suse.cz
Subject: Re: [RFC V2 net-next 1/2] ethtool: add support for controling the type of adaptive coalescing
Date: Fri, 20 Nov 2020 16:25:48 +0100 [thread overview]
Message-ID: <20201120152548.GN1853236@lunn.ch> (raw)
In-Reply-To: <1605853479-4483-2-git-send-email-tanhuazhong@huawei.com>
> @@ -310,6 +334,13 @@ int ethnl_set_coalesce(struct sk_buff *skb, struct genl_info *info)
> ret = dev->ethtool_ops->set_coalesce(dev, &coalesce);
> if (ret < 0)
> goto out_ops;
> +
> + if (ops->set_ext_coalesce) {
> + ret = ops->set_ext_coalesce(dev, &ext_coalesce);
> + if (ret < 0)
> + goto out_ops;
> + }
> +
The problem here is, if ops->set_ext_coalesce() fails, you need to
undo what dev->ethtool_ops->set_coalesce() did. From the users
perspective, this should be atomic. It does everything, or it does
nothing and returns an error code.
And that is not easy given this structure of two op calls.
Andrew
next prev parent reply other threads:[~2020-11-20 15:26 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-20 6:24 [RFC V2 net-next 0/2] net: updates for -next Huazhong Tan
2020-11-20 6:24 ` [RFC V2 net-next 1/2] ethtool: add support for controling the type of adaptive coalescing Huazhong Tan
2020-11-20 15:25 ` Andrew Lunn [this message]
2020-11-21 2:00 ` tanhuazhong
2020-11-20 15:44 ` Jakub Kicinski
2020-11-20 6:24 ` [RFC V2 net-next 2/2] net: hns3: add support for dynamic interrupt moderation Huazhong Tan
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=20201120152548.GN1853236@lunn.ch \
--to=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxarm@huawei.com \
--cc=mkubecek@suse.cz \
--cc=netdev@vger.kernel.org \
--cc=tanhuazhong@huawei.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