lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <b29f05f8-3c57-ec6a-78bb-3a22f743f7f1@huawei.com>
Date:   Thu, 27 May 2021 10:00:44 +0800
From:   Huazhong Tan <tanhuazhong@...wei.com>
To:     Jakub Kicinski <kuba@...nel.org>
CC:     <davem@...emloft.net>, <netdev@...r.kernel.org>,
        <salil.mehta@...wei.com>, <yisen.zhuang@...wei.com>,
        <huangdaode@...wei.com>, <linuxarm@...wei.com>,
        <dledford@...hat.com>, <jgg@...pe.ca>, <netanel@...zon.com>,
        <akiyano@...zon.com>, <thomas.lendacky@....com>,
        <irusskikh@...vell.com>, <michael.chan@...adcom.com>,
        <edwin.peer@...adcom.com>, <rohitm@...lsio.com>,
        <jesse.brandeburg@...el.com>, <jacob.e.keller@...el.com>,
        <ioana.ciornei@....com>, <vladimir.oltean@....com>,
        <sgoutham@...vell.com>, <sbhatta@...vell.com>, <saeedm@...dia.com>,
        <ecree.xilinx@...il.com>, <grygorii.strashko@...com>,
        <merez@...eaurora.org>, <kvalo@...eaurora.org>,
        <linux-wireless@...r.kernel.org>
Subject: Re: [RFC net-next 2/4] ethtool: extend coalesce setting uAPI with CQE
 mode


On 2021/5/27 8:00, Jakub Kicinski wrote:
> On Wed, 26 May 2021 17:27:40 +0800 Huazhong Tan wrote:
>> Currently, there many drivers who support CQE mode configuration,
>> some configure it as a fixed when initialized, some provide an
>> interface to change it by ethtool private flags. In order make it
>> more generic, add 'ETHTOOL_A_COALESCE_USE_CQE_TX' and
>> 'ETHTOOL_A_COALESCE_USE_CQE_RX' attribute and expand struct
>> kernel_ethtool_coalesce with use_cqe_mode_tx and use_cqe_mode_rx,
>> then these parameters can be accessed by ethtool netlink coalesce
>> uAPI.
>>
>> Signed-off-by: Huazhong Tan <tanhuazhong@...wei.com>
>> diff --git a/Documentation/networking/ethtool-netlink.rst b/Documentation/networking/ethtool-netlink.rst
>> index 25131df..975394e 100644
>> --- a/Documentation/networking/ethtool-netlink.rst
>> +++ b/Documentation/networking/ethtool-netlink.rst
>> @@ -937,6 +937,8 @@ Kernel response contents:
>>     ``ETHTOOL_A_COALESCE_TX_USECS_HIGH``         u32     delay (us), high Tx
>>     ``ETHTOOL_A_COALESCE_TX_MAX_FRAMES_HIGH``    u32     max packets, high Tx
>>     ``ETHTOOL_A_COALESCE_RATE_SAMPLE_INTERVAL``  u32     rate sampling interval
>> +  ``ETHTOOL_A_COALESCE_USE_CQE_TX``	       bool    Tx CQE mode
>> +  ``ETHTOOL_A_COALESCE_USE_CQE_RX``	       bool    Rx CQE mode
>>     ===========================================  ======  =======================
>>   
>>   Attributes are only included in reply if their value is not zero or the
>> @@ -975,6 +977,8 @@ Request contents:
>>     ``ETHTOOL_A_COALESCE_TX_USECS_HIGH``         u32     delay (us), high Tx
>>     ``ETHTOOL_A_COALESCE_TX_MAX_FRAMES_HIGH``    u32     max packets, high Tx
>>     ``ETHTOOL_A_COALESCE_RATE_SAMPLE_INTERVAL``  u32     rate sampling interval
>> +  ``ETHTOOL_A_COALESCE_USE_CQE_TX``	       bool    Tx CQE mode
>> +  ``ETHTOOL_A_COALESCE_USE_CQE_RX``	       bool    Rx CQE mode
>>     ===========================================  ======  =======================
>>   
>>   Request is rejected if it attributes declared as unsupported by driver (i.e.
> You need to thoroughly document the semantics. Can you point us to
> which drivers/devices implement similar modes of operation (if they
> exist we need to make sure semantics match)?


Ok, will complement the semantics.


Currently, only mlx5 provides a interface to update
this mode through ethtool priv-flag. other drivers like
broadcom and ice just use a fixed EQE and do not have
update interface.



>> diff --git a/include/linux/ethtool.h b/include/linux/ethtool.h
>> index 1030540..9d0a386 100644
>> --- a/include/linux/ethtool.h
>> +++ b/include/linux/ethtool.h
>> @@ -179,6 +179,8 @@ __ethtool_get_link_ksettings(struct net_device *dev,
>>   
>>   struct kernel_ethtool_coalesce {
>>   	struct ethtool_coalesce	base;
>> +	__u32	use_cqe_mode_tx;
>> +	__u32	use_cqe_mode_rx;
> No __ in front, this is not a user space structure.
> Why not bool or a bitfield?


bool is enough, __u32 is used here to be consistent with

fields in struct ethtool_coalesce.

This seems unnecessary?


>>   };
>>   
>>   /**
>> @@ -216,6 +223,8 @@ const struct nla_policy ethnl_coalesce_set_policy[] = {
>>   	[ETHTOOL_A_COALESCE_TX_USECS_HIGH]	= { .type = NLA_U32 },
>>   	[ETHTOOL_A_COALESCE_TX_MAX_FRAMES_HIGH]	= { .type = NLA_U32 },
>>   	[ETHTOOL_A_COALESCE_RATE_SAMPLE_INTERVAL] = { .type = NLA_U32 },
>> +	[ETHTOOL_A_COALESCE_USE_CQE_MODE_TX]	= { .type = NLA_U8 },
>> +	[ETHTOOL_A_COALESCE_USE_CQE_MODE_RX]	= { .type = NLA_U8 },
> This needs a policy to make sure values are <= 1.
>
> .

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ