Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp1349510pxb; Fri, 20 Nov 2020 07:27:43 -0800 (PST) X-Google-Smtp-Source: ABdhPJxkNbe7TUau5bXTO6KfM7C6SvvuIcLYI2L0NJuUc8T8rrwG+YnZw7q82/PubP1lflilIobR X-Received: by 2002:a17:907:3d8d:: with SMTP id he13mr16669814ejc.306.1605886062773; Fri, 20 Nov 2020 07:27:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605886062; cv=none; d=google.com; s=arc-20160816; b=fmRs90EIubuSVYCUkQER0cj2L5QWJdwVvHO4+4tkHf2uRWE7CUgb4Hj5U7pMpWSlZO vfHJ5NFHgwbKHk8tcTRHjiKx3m+CEEVb2U8uQCGNGxjSldSq0GNLcf5CPd8y4VOf773x i0yVGXfYkP/0JA3+dn7JQlgaCZRaBktRi//kFHtP0I0xy+yKPi+VGsdWUKcDTUeSSP+M 5L8rFWWJEReL4FDpNRZsg2rp1hT9ykyr3So2qdSlJ0jELyHPOyJY/6lJQJSPXwdIUr9l Jt/fhqrilXec+iIy7VEEDp8Bid0JL8evbkHS6X3KHRiNbEtDKt/Qf9TANM/J7yMnWkrk 1Rfg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=kSuD2V1GSxDHxZbZ7kgnpBYQ8TOvLVluTa398+ne+6Y=; b=Ss8as5RbgfAU4WXam8RBhy7A+Q1/zH4CLN0ODlrdV5VIUwlsM/K8DXJO4wYJYLah5D 5DqF6RYH+gnsWFwZyf5NFl4b6o1ev75r5sIter0J/cyI+hNXBNPTd6lDQjZ8M4vsyIL6 trMgiYJKRdLkDL5fZXi9YMwxbKHhaurrAiXx5N9En4mVoaQ7c//k/nokShHP1igJ6eG7 dd5XdO+OSMyhPODk3UkLnpMkMGH1NIIsU4WTo0q5Kk5GIWeGyeZ58hZTPRkY5EXk+olD MdDG0wSEZEsxes+bnHksb+NsqQKvhLXdCatdel7YFdrYE0LhNItlFETi31d84zI2GQdp Uk+A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b9si1811338ejd.156.2020.11.20.07.27.19; Fri, 20 Nov 2020 07:27:42 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727273AbgKTPZw (ORCPT + 99 others); Fri, 20 Nov 2020 10:25:52 -0500 Received: from vps0.lunn.ch ([185.16.172.187]:41448 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726255AbgKTPZv (ORCPT ); Fri, 20 Nov 2020 10:25:51 -0500 Received: from andrew by vps0.lunn.ch with local (Exim 4.94) (envelope-from ) id 1kg8IG-008857-4u; Fri, 20 Nov 2020 16:25:48 +0100 Date: Fri, 20 Nov 2020 16:25:48 +0100 From: Andrew Lunn To: Huazhong Tan 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 Message-ID: <20201120152548.GN1853236@lunn.ch> References: <1605853479-4483-1-git-send-email-tanhuazhong@huawei.com> <1605853479-4483-2-git-send-email-tanhuazhong@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1605853479-4483-2-git-send-email-tanhuazhong@huawei.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > @@ -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