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: <e4e276c6-9545-cf6a-b23e-a80123e896a0@gmail.com>
Date:   Thu, 14 Oct 2021 06:58:17 -0700
From:   Eric Dumazet <eric.dumazet@...il.com>
To:     Guangbin Huang <huangguangbin2@...wei.com>, davem@...emloft.net,
        kuba@...nel.org, mkubecek@...e.cz, andrew@...n.ch,
        amitc@...lanox.com, idosch@...sch.org, danieller@...dia.com,
        jesse.brandeburg@...el.com, anthony.l.nguyen@...el.com,
        jdike@...toit.com, richard@....at, anton.ivanov@...bridgegreys.com,
        netanel@...zon.com, akiyano@...zon.com, gtzalik@...zon.com,
        saeedb@...zon.com, chris.snook@...il.com,
        ulli.kroll@...glemail.com, linus.walleij@...aro.org,
        jeroendb@...gle.com, csully@...gle.com, awogbemila@...gle.com,
        jdmason@...zu.us, rain.1986.08.12@...il.com, zyjzyj2000@...il.com,
        kys@...rosoft.com, haiyangz@...rosoft.com, mst@...hat.com,
        jasowang@...hat.com, doshir@...are.com, pv-drivers@...are.com,
        jwi@...ux.ibm.com, kgraul@...ux.ibm.com, hca@...ux.ibm.com,
        gor@...ux.ibm.com, johannes@...solutions.net
Cc:     netdev@...r.kernel.org, lipeng321@...wei.com,
        chenhao288@...ilicon.com, linux-s390@...r.kernel.org
Subject: Re: [PATCH V4 net-next 1/6] ethtool: add support to set/get tx
 copybreak buf size via ethtool



On 10/14/21 4:39 AM, Guangbin Huang wrote:
> From: Hao Chen <chenhao288@...ilicon.com>
> 
> Add support for ethtool to set/get tx copybreak buf size.

What is the unit ?

Frankly, having to size the 'buffer' based on number of slots in TX ring buffer
is not good.

What happens later when/if ethtool -G tx xxxxx' is trying
to change number of slots ?

The 'tx copybreak' should instead give a number of bytes per TX ring slot.

Eg, 128 or 256 bytes.

This is very similar to what drivers using net/core/tso.c do.

They usually use TSO_HEADER_SIZE for this.

> 
> Signed-off-by: Hao Chen <chenhao288@...ilicon.com>
> Signed-off-by: Guangbin Huang <huangguangbin2@...wei.com>
> ---
>  include/uapi/linux/ethtool.h | 1 +
>  net/ethtool/common.c         | 1 +
>  net/ethtool/ioctl.c          | 1 +
>  3 files changed, 3 insertions(+)
> 
> diff --git a/include/uapi/linux/ethtool.h b/include/uapi/linux/ethtool.h
> index a2223b685451..7bc4b8def12c 100644
> --- a/include/uapi/linux/ethtool.h
> +++ b/include/uapi/linux/ethtool.h
> @@ -231,6 +231,7 @@ enum tunable_id {
>  	ETHTOOL_RX_COPYBREAK,
>  	ETHTOOL_TX_COPYBREAK,
>  	ETHTOOL_PFC_PREVENTION_TOUT, /* timeout in msecs */
> +	ETHTOOL_TX_COPYBREAK_BUF_SIZE,
>  	/*
>  	 * Add your fresh new tunable attribute above and remember to update
>  	 * tunable_strings[] in net/ethtool/common.c
> diff --git a/net/ethtool/common.c b/net/ethtool/common.c
> index c63e0739dc6a..0c5210015911 100644
> --- a/net/ethtool/common.c
> +++ b/net/ethtool/common.c
> @@ -89,6 +89,7 @@ tunable_strings[__ETHTOOL_TUNABLE_COUNT][ETH_GSTRING_LEN] = {
>  	[ETHTOOL_RX_COPYBREAK]	= "rx-copybreak",
>  	[ETHTOOL_TX_COPYBREAK]	= "tx-copybreak",
>  	[ETHTOOL_PFC_PREVENTION_TOUT] = "pfc-prevention-tout",
> +	[ETHTOOL_TX_COPYBREAK_BUF_SIZE] = "tx-copybreak-buf-size",
>  };
>  
>  const char
> diff --git a/net/ethtool/ioctl.c b/net/ethtool/ioctl.c
> index bf6e8c2f9bf7..617ebc4183d9 100644
> --- a/net/ethtool/ioctl.c
> +++ b/net/ethtool/ioctl.c
> @@ -2383,6 +2383,7 @@ static int ethtool_tunable_valid(const struct ethtool_tunable *tuna)
>  	switch (tuna->id) {
>  	case ETHTOOL_RX_COPYBREAK:
>  	case ETHTOOL_TX_COPYBREAK:
> +	case ETHTOOL_TX_COPYBREAK_BUF_SIZE:
>  		if (tuna->len != sizeof(u32) ||
>  		    tuna->type_id != ETHTOOL_TUNABLE_U32)
>  			return -EINVAL;
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ