From: tanhuazhong <tanhuazhong@huawei.com>
To: Michal Kubecek <mkubecek@suse.cz>, Andrew Lunn <andrew@lunn.ch>
Cc: <davem@davemloft.net>, <netdev@vger.kernel.org>,
<linux-kernel@vger.kernel.org>, <linuxarm@huawei.com>,
<kuba@kernel.org>
Subject: Re: [RFC net-next 1/2] ethtool: add support for controling the type of adaptive coalescing
Date: Sat, 21 Nov 2020 09:56:02 +0800 [thread overview]
Message-ID: <4451853d-bcbe-5de0-6a44-a3e87b211f6b@huawei.com> (raw)
In-Reply-To: <20201120212243.n7vnwo3ldzisr4hl@lion.mk-sys.cz>
On 2020/11/21 5:22, Michal Kubecek wrote:
> On Fri, Nov 20, 2020 at 02:39:38PM +0100, Andrew Lunn wrote:
>> On Fri, Nov 20, 2020 at 08:23:22AM +0100, Michal Kubecek wrote:
>>> On Fri, Nov 20, 2020 at 10:59:59AM +0800, tanhuazhong wrote:
>>>> On 2020/11/20 6:02, Michal Kubecek wrote:
>>>>> We could use a similar approach as struct ethtool_link_ksettings, e.g.
>>>>>
>>>>> struct kernel_ethtool_coalesce {
>>>>> struct ethtool_coalesce base;
>>>>> /* new members which are not part of UAPI */
>>>>> }
>>>>>
>>>>> get_coalesce() and set_coalesce() would get pointer to struct
>>>>> kernel_ethtool_coalesce and ioctl code would be modified to only touch
>>>>> the base (legacy?) part.
>>>>> > While already changing the ops arguments, we could also add extack
>>>>> pointer, either as a separate argument or as struct member (I slightly
>>>>> prefer the former).
>>>> If changing the ops arguments, each driver who implement
>>>> set_coalesce/get_coalesce of ethtool_ops need to be updated. Is it
>>>> acceptable adding two new ops to get/set ext_coalesce info (like
>>>> ecc31c60240b ("ethtool: Add link extended state") does)? Maybe i can send V2
>>>> in this way, and then could you help to see which one is more suitable?
>>> If it were just this one case, adding an extra op would be perfectly
>>> fine. But from long term point of view, we should expect extending also
>>> other existing ethtool requests and going this way for all of them would
>>> essentially double the number of callbacks in struct ethtool_ops.
>> coccinella might be useful here.
> I played with spatch a bit and it with the spatch and patch below, I got
> only three build failures (with allmodconfig) that would need to be
> addressed manually - these drivers call the set_coalesce() callback on
> device initialization.
>
> I also tried to make the structure argument const in ->set_coalesce()
> but that was more tricky as adjusting other functions that the structure
> is passed to required either running the spatch three times or repeating
> the same two rules three times in the spatch (or perhaps there is
> a cleaner way but I'm missing relevant knowledge of coccinelle). Then
> there was one more problem in i40e driver which modifies the structure
> before passing it on to its helpers. It could be worked around but I'm
> not sure if constifying the argument is worth these extra complications.
>
> Michal
will implement it like this in V3.
Regards,
Huazhong.
next prev parent reply other threads:[~2020-11-21 1:56 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-19 3:54 [RFC net-next 0/2] net: updates for -next Huazhong Tan
2020-11-19 3:54 ` [RFC net-next 1/2] ethtool: add support for controling the type of adaptive coalescing Huazhong Tan
2020-11-19 4:15 ` Andrew Lunn
2020-11-19 8:56 ` tanhuazhong
2020-11-19 22:02 ` Michal Kubecek
2020-11-20 1:52 ` tanhuazhong
2020-11-20 2:59 ` tanhuazhong
2020-11-20 7:23 ` Michal Kubecek
2020-11-20 13:39 ` Andrew Lunn
2020-11-20 21:22 ` Michal Kubecek
2020-11-21 1:56 ` tanhuazhong [this message]
2020-11-19 21:43 ` Michal Kubecek
2020-11-19 3:54 ` [RFC 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=4451853d-bcbe-5de0-6a44-a3e87b211f6b@huawei.com \
--to=tanhuazhong@huawei.com \
--cc=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 \
/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).