lkml.org 
[lkml]   [2020]   [Nov]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC V2 net-next 1/2] ethtool: add support for controling the type of adaptive coalescing
> @@ -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

\
 
 \ /
  Last update: 2020-11-20 16:28    [W:0.064 / U:0.128 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site