public inbox for linux-s390@vger.kernel.org
 help / color / mirror / Atom feed
From: Eric Dumazet <eric.dumazet@gmail.com>
To: Guangbin Huang <huangguangbin2@huawei.com>,
	davem@davemloft.net, kuba@kernel.org, mkubecek@suse.cz,
	andrew@lunn.ch, amitc@mellanox.com, idosch@idosch.org,
	danieller@nvidia.com, jesse.brandeburg@intel.com,
	anthony.l.nguyen@intel.com, jdike@addtoit.com, richard@nod.at,
	anton.ivanov@cambridgegreys.com, netanel@amazon.com,
	akiyano@amazon.com, gtzalik@amazon.com, saeedb@amazon.com,
	chris.snook@gmail.com, ulli.kroll@googlemail.com,
	linus.walleij@linaro.org, jeroendb@google.com, csully@google.com,
	awogbemila@google.com, jdmason@kudzu.us,
	rain.1986.08.12@gmail.com, zyjzyj2000@gmail.com,
	kys@microsoft.com, haiyangz@microsoft.com, mst@redhat.com,
	jasowang@redhat.com, doshir@vmware.com, pv-drivers@vmware.com,
	jwi@linux.ibm.com, kgraul@linux.ibm.com, hca@linux.ibm.com,
	gor@linux.ibm.com, johannes@sipsolutions.net
Cc: netdev@vger.kernel.org, lipeng321@huawei.com,
	chenhao288@hisilicon.com, linux-s390@vger.kernel.org
Subject: Re: [PATCH V4 net-next 1/6] ethtool: add support to set/get tx copybreak buf size via ethtool
Date: Thu, 14 Oct 2021 06:58:17 -0700	[thread overview]
Message-ID: <e4e276c6-9545-cf6a-b23e-a80123e896a0@gmail.com> (raw)
In-Reply-To: <20211014113943.16231-2-huangguangbin2@huawei.com>



On 10/14/21 4:39 AM, Guangbin Huang wrote:
> From: Hao Chen <chenhao288@hisilicon.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@hisilicon.com>
> Signed-off-by: Guangbin Huang <huangguangbin2@huawei.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;
> 

  reply	other threads:[~2021-10-14 13:58 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-14 11:39 [PATCH V4 net-next 0/6] ethtool: add support to set/get tx copybreak buf size and rx buf len Guangbin Huang
2021-10-14 11:39 ` [PATCH V4 net-next 1/6] ethtool: add support to set/get tx copybreak buf size via ethtool Guangbin Huang
2021-10-14 13:58   ` Eric Dumazet [this message]
2021-10-19 13:44     ` huangguangbin (A)
2021-10-14 11:39 ` [PATCH V4 net-next 2/6] net: hns3: add support to set/get tx copybreak buf size via ethtool for hns3 driver Guangbin Huang
2021-10-14 11:39 ` [PATCH V4 net-next 3/6] ethtool: add support to set/get rx buf len via ethtool Guangbin Huang
2021-10-14 11:39 ` [PATCH V4 net-next 5/6] net: hns3: add support to set/get rx buf len via ethtool for hns3 driver Guangbin Huang
2021-10-14 11:39 ` [PATCH V4 net-next 6/6] net: hns3: remove the way to set tx spare buf via module parameter Guangbin Huang
2021-10-14 13:14 ` [PATCH V4 net-next 0/6] ethtool: add support to set/get tx copybreak buf size and rx buf len Alexander Lobakin
2021-10-15  2:41   ` Jakub Kicinski
2021-10-19 13:54   ` huangguangbin (A)
2021-10-20 10:02     ` Alexander Lobakin
2021-10-23  8:46       ` huangguangbin (A)
     [not found] ` <20211014113943.16231-5-huangguangbin2@huawei.com>
2021-10-25 13:11   ` [PATCH V4 net-next 4/6] ethtool: extend ringparam setting uAPI with rx_buf_len Marc Kleine-Budde
2021-10-25 13:27     ` Marc Kleine-Budde
2021-10-25 17:45       ` Jakub Kicinski
2021-10-25 18:50         ` Marc Kleine-Budde
2021-10-25 19:01         ` Marc Kleine-Budde
2021-10-26 14:41           ` huangguangbin (A)
2021-10-26 14:55             ` Jakub Kicinski
2021-10-27 18:59             ` Andrew Lunn

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=e4e276c6-9545-cf6a-b23e-a80123e896a0@gmail.com \
    --to=eric.dumazet@gmail.com \
    --cc=akiyano@amazon.com \
    --cc=amitc@mellanox.com \
    --cc=andrew@lunn.ch \
    --cc=anthony.l.nguyen@intel.com \
    --cc=anton.ivanov@cambridgegreys.com \
    --cc=awogbemila@google.com \
    --cc=chenhao288@hisilicon.com \
    --cc=chris.snook@gmail.com \
    --cc=csully@google.com \
    --cc=danieller@nvidia.com \
    --cc=davem@davemloft.net \
    --cc=doshir@vmware.com \
    --cc=gor@linux.ibm.com \
    --cc=gtzalik@amazon.com \
    --cc=haiyangz@microsoft.com \
    --cc=hca@linux.ibm.com \
    --cc=huangguangbin2@huawei.com \
    --cc=idosch@idosch.org \
    --cc=jasowang@redhat.com \
    --cc=jdike@addtoit.com \
    --cc=jdmason@kudzu.us \
    --cc=jeroendb@google.com \
    --cc=jesse.brandeburg@intel.com \
    --cc=johannes@sipsolutions.net \
    --cc=jwi@linux.ibm.com \
    --cc=kgraul@linux.ibm.com \
    --cc=kuba@kernel.org \
    --cc=kys@microsoft.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=lipeng321@huawei.com \
    --cc=mkubecek@suse.cz \
    --cc=mst@redhat.com \
    --cc=netanel@amazon.com \
    --cc=netdev@vger.kernel.org \
    --cc=pv-drivers@vmware.com \
    --cc=rain.1986.08.12@gmail.com \
    --cc=richard@nod.at \
    --cc=saeedb@amazon.com \
    --cc=ulli.kroll@googlemail.com \
    --cc=zyjzyj2000@gmail.com \
    /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