netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: Taehee Yoo <ap420073@gmail.com>
Cc: davem@davemloft.net, pabeni@redhat.com, edumazet@google.com,
	almasrymina@google.com, donald.hunter@gmail.com, corbet@lwn.net,
	michael.chan@broadcom.com, andrew+netdev@lunn.ch,
	hawk@kernel.org, ilias.apalodimas@linaro.org, ast@kernel.org,
	daniel@iogearbox.net, john.fastabend@gmail.com, dw@davidwei.uk,
	sdf@fomichev.me, asml.silence@gmail.com, brett.creeley@amd.com,
	linux-doc@vger.kernel.org, netdev@vger.kernel.org,
	kory.maincent@bootlin.com, maxime.chevallier@bootlin.com,
	danieller@nvidia.com, hengqi@linux.alibaba.com,
	ecree.xilinx@gmail.com, przemyslaw.kitszel@intel.com,
	hkallweit1@gmail.com, ahmed.zaki@intel.com,
	rrameshbabu@nvidia.com, idosch@nvidia.com, jiri@resnulli.us,
	bigeasy@linutronix.de, lorenzo@kernel.org, jdamato@fastly.com,
	aleksander.lobakin@intel.com, kaiyuanz@google.com,
	willemb@google.com, daniel.zahka@gmail.com,
	Andy Gospodarek <gospo@broadcom.com>
Subject: Re: [PATCH net-next v6 3/9] bnxt_en: add support for tcp-data-split ethtool command
Date: Wed, 18 Dec 2024 18:25:47 -0800	[thread overview]
Message-ID: <20241218182547.177d83f8@kernel.org> (raw)
In-Reply-To: <20241218144530.2963326-4-ap420073@gmail.com>

On Wed, 18 Dec 2024 14:45:24 +0000 Taehee Yoo wrote:
> +	if (tcp_data_split == ETHTOOL_TCP_DATA_SPLIT_DISABLED && hds_config_mod)
> +		return -EOPNOTSUPP;

I think ethtool ops generally return -EINVAL when param not supported.
EOPNOTSUPP means entire op is not supported (again, that's just how
ethtool ops generally work, not a kernel-wide rule).

> +	if (tcp_data_split == ETHTOOL_TCP_DATA_SPLIT_ENABLED &&
> +	    hds_config_mod && BNXT_RX_PAGE_MODE(bp)) {

Looks like patch 4 adds this check in the core. I think adding the
check in the core can be a separate patch. If you put it before this
patch in the series this bnxt check can be removed?

I mean this chunk in the core:

+	hds_config_mod = old_hds_config != kernel_ringparam.tcp_data_split;
+	if (kernel_ringparam.tcp_data_split == ETHTOOL_TCP_DATA_SPLIT_ENABLED &&
+	    hds_config_mod && dev_xdp_sb_prog_count(dev)) {
+		NL_SET_ERR_MSG(info->extack,
+			       "tcp-data-split can not be enabled with single buffer XDP");
+		return -EINVAL;
+	}

It's currently in the hds-thresh patch but really it's unrelated 
to the threshold..

> +		NL_SET_ERR_MSG_MOD(extack, "tcp-data-split is disallowed when XDP is attached");
> +		return -EOPNOTSUPP;
> +	}
> +
>  	if (netif_running(dev))
>  		bnxt_close_nic(bp, false, false);
>  
> +	if (hds_config_mod) {
> +		if (tcp_data_split == ETHTOOL_TCP_DATA_SPLIT_ENABLED)
> +			bp->flags |= BNXT_FLAG_HDS;
> +		else if (tcp_data_split == ETHTOOL_TCP_DATA_SPLIT_UNKNOWN)
> +			bp->flags &= ~BNXT_FLAG_HDS;
> +	}
> +
>  	bp->rx_ring_size = ering->rx_pending;
>  	bp->tx_ring_size = ering->tx_pending;
>  	bnxt_set_ring_params(bp);
> @@ -5354,6 +5374,7 @@ const struct ethtool_ops bnxt_ethtool_ops = {
>  				     ETHTOOL_COALESCE_STATS_BLOCK_USECS |
>  				     ETHTOOL_COALESCE_USE_ADAPTIVE_RX |
>  				     ETHTOOL_COALESCE_USE_CQE,
> +	.supported_ring_params	= ETHTOOL_RING_USE_TCP_DATA_SPLIT,
>  	.get_link_ksettings	= bnxt_get_link_ksettings,
>  	.set_link_ksettings	= bnxt_set_link_ksettings,
>  	.get_fec_stats		= bnxt_get_fec_stats,
> diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_xdp.c b/drivers/net/ethernet/broadcom/bnxt/bnxt_xdp.c
> index f88b641533fc..1bfff7f29310 100644
> --- a/drivers/net/ethernet/broadcom/bnxt/bnxt_xdp.c
> +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_xdp.c
> @@ -395,6 +395,10 @@ static int bnxt_xdp_set(struct bnxt *bp, struct bpf_prog *prog)
>  			    bp->dev->mtu, BNXT_MAX_PAGE_MODE_MTU);
>  		return -EOPNOTSUPP;
>  	}
> +	if (prog && bp->flags & BNXT_FLAG_HDS) {
> +		netdev_warn(dev, "XDP is disallowed when HDS is enabled.\n");
> +		return -EOPNOTSUPP;
> +	}

And this check should also live in the core, now that core has access
to dev->ethtool->hds_config ? I think you can add this check to the
core in the same patch as the chunk referred to above.

  reply	other threads:[~2024-12-19  2:25 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-18 14:45 [PATCH net-next v6 0/9] bnxt_en: implement tcp-data-split and thresh option Taehee Yoo
2024-12-18 14:45 ` [PATCH net-next v6 1/9] bnxt_en: add support for rx-copybreak ethtool command Taehee Yoo
2024-12-19  2:07   ` Jakub Kicinski
2024-12-19 13:24     ` Taehee Yoo
2024-12-18 14:45 ` [PATCH net-next v6 2/9] net: ethtool: add hds_config member in ethtool_netdev_state Taehee Yoo
2024-12-19  2:16   ` Jakub Kicinski
2024-12-18 14:45 ` [PATCH net-next v6 3/9] bnxt_en: add support for tcp-data-split ethtool command Taehee Yoo
2024-12-19  2:25   ` Jakub Kicinski [this message]
2024-12-19  2:41     ` Jakub Kicinski
2024-12-19 14:05     ` Taehee Yoo
2024-12-19 14:29       ` Jakub Kicinski
2024-12-19 15:14         ` Taehee Yoo
2024-12-19 15:25           ` Jakub Kicinski
2024-12-19 19:33             ` Andy Gospodarek
2024-12-19 20:18               ` Jakub Kicinski
2024-12-19 23:41                 ` Michael Chan
2024-12-20  2:08                   ` Jakub Kicinski
2024-12-18 14:45 ` [PATCH net-next v6 4/9] net: ethtool: add support for configuring hds-thresh Taehee Yoo
2024-12-19  2:35   ` Jakub Kicinski
2024-12-19 14:10     ` Taehee Yoo
2024-12-18 14:45 ` [PATCH net-next v6 5/9] bnxt_en: add support for hds-thresh ethtool command Taehee Yoo
2024-12-19  2:40   ` Jakub Kicinski
2024-12-19 14:12     ` Taehee Yoo
2024-12-18 14:45 ` [PATCH net-next v6 6/9] net: devmem: add ring parameter filtering Taehee Yoo
2024-12-18 14:45 ` [PATCH net-next v6 7/9] net: ethtool: " Taehee Yoo
2024-12-18 14:45 ` [PATCH net-next v6 8/9] net: disallow setup single buffer XDP when tcp-data-split is enabled Taehee Yoo
2024-12-19  2:44   ` Jakub Kicinski
2024-12-19 14:14     ` Taehee Yoo
2024-12-18 14:45 ` [PATCH net-next v6 9/9] netdevsim: add HDS feature Taehee Yoo
2024-12-19  2:49   ` Jakub Kicinski
2024-12-19 14:37     ` Taehee Yoo
2024-12-19 14:45       ` Jakub Kicinski
2024-12-19 15:19         ` Taehee Yoo
2024-12-19 15:28           ` Jakub Kicinski

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=20241218182547.177d83f8@kernel.org \
    --to=kuba@kernel.org \
    --cc=ahmed.zaki@intel.com \
    --cc=aleksander.lobakin@intel.com \
    --cc=almasrymina@google.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=ap420073@gmail.com \
    --cc=asml.silence@gmail.com \
    --cc=ast@kernel.org \
    --cc=bigeasy@linutronix.de \
    --cc=brett.creeley@amd.com \
    --cc=corbet@lwn.net \
    --cc=daniel.zahka@gmail.com \
    --cc=daniel@iogearbox.net \
    --cc=danieller@nvidia.com \
    --cc=davem@davemloft.net \
    --cc=donald.hunter@gmail.com \
    --cc=dw@davidwei.uk \
    --cc=ecree.xilinx@gmail.com \
    --cc=edumazet@google.com \
    --cc=gospo@broadcom.com \
    --cc=hawk@kernel.org \
    --cc=hengqi@linux.alibaba.com \
    --cc=hkallweit1@gmail.com \
    --cc=idosch@nvidia.com \
    --cc=ilias.apalodimas@linaro.org \
    --cc=jdamato@fastly.com \
    --cc=jiri@resnulli.us \
    --cc=john.fastabend@gmail.com \
    --cc=kaiyuanz@google.com \
    --cc=kory.maincent@bootlin.com \
    --cc=linux-doc@vger.kernel.org \
    --cc=lorenzo@kernel.org \
    --cc=maxime.chevallier@bootlin.com \
    --cc=michael.chan@broadcom.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=przemyslaw.kitszel@intel.com \
    --cc=rrameshbabu@nvidia.com \
    --cc=sdf@fomichev.me \
    --cc=willemb@google.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;
as well as URLs for NNTP newsgroup(s).