[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CACDg6nUcoaumrk-9gm2gp6PnsUCLy0K0HAs5ka9u1F4vH+Rz=Q@mail.gmail.com>
Date: Wed, 8 Jan 2025 10:38:55 -0500
From: Andy Gospodarek <andrew.gospodarek@...adcom.com>
To: Taehee Yoo <ap420073@...il.com>
Cc: davem@...emloft.net, kuba@...nel.org, pabeni@...hat.com,
edumazet@...gle.com, almasrymina@...gle.com, donald.hunter@...il.com,
corbet@....net, michael.chan@...adcom.com, andrew+netdev@...n.ch,
hawk@...nel.org, ilias.apalodimas@...aro.org, ast@...nel.org,
daniel@...earbox.net, john.fastabend@...il.com, dw@...idwei.uk,
sdf@...ichev.me, asml.silence@...il.com, brett.creeley@....com,
linux-doc@...r.kernel.org, netdev@...r.kernel.org, kory.maincent@...tlin.com,
maxime.chevallier@...tlin.com, danieller@...dia.com, hengqi@...ux.alibaba.com,
ecree.xilinx@...il.com, przemyslaw.kitszel@...el.com, hkallweit1@...il.com,
ahmed.zaki@...el.com, rrameshbabu@...dia.com, idosch@...dia.com,
jiri@...nulli.us, bigeasy@...utronix.de, lorenzo@...nel.org,
jdamato@...tly.com, aleksander.lobakin@...el.com, kaiyuanz@...gle.com,
willemb@...gle.com, daniel.zahka@...il.com,
Andy Gospodarek <gospo@...adcom.com>
Subject: Re: [PATCH net-next v7 08/10] bnxt_en: add support for hds-thresh
ethtool command
On Fri, Jan 3, 2025 at 10:04 AM Taehee Yoo <ap420073@...il.com> wrote:
>
> The bnxt_en driver has configured the hds_threshold value automatically
> when TPA is enabled based on the rx-copybreak default value.
> Now the hds-thresh ethtool command is added, so it adds an
> implementation of hds-thresh option.
>
> Configuration of the hds-thresh is applied only when
> the tcp-data-split is enabled. The default value of
> hds-thresh is 256, which is the default value of
> rx-copybreak, which used to be the hds_thresh value.
>
> The maximum hds-thresh is 1023.
>
> # Example:
> # ethtool -G enp14s0f0np0 tcp-data-split on hds-thresh 256
> # ethtool -g enp14s0f0np0
> Ring parameters for enp14s0f0np0:
> Pre-set maximums:
> ...
> HDS thresh: 1023
> Current hardware settings:
> ...
> TCP data split: on
> HDS thresh: 256
>
> Tested-by: Stanislav Fomichev <sdf@...ichev.me>
> Tested-by: Andy Gospodarek <gospo@...adcom.com>
I'll give this set one more run today.
> Signed-off-by: Taehee Yoo <ap420073@...il.com>
> ---
>
> v7:
> - Use dev->ethtool->hds_thresh instead of bp->hds_thresh
>
> v6:
> - HDS_MAX is changed to 1023.
> - Add Test tag from Andy.
>
> v5:
> - No changes.
>
> v4:
> - Reduce hole in struct bnxt.
> - Add ETHTOOL_RING_USE_HDS_THRS to indicate bnxt_en driver support
> header-data-split-thresh option.
> - Add Test tag from Stanislav.
>
> v3:
> - Drop validation logic tcp-data-split and tcp-data-split-thresh.
>
> v2:
> - Patch added.
>
> drivers/net/ethernet/broadcom/bnxt/bnxt.c | 4 +++-
> drivers/net/ethernet/broadcom/bnxt/bnxt.h | 2 ++
> drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c | 7 ++++++-
> 3 files changed, 11 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
> index 7198d05cd27b..df03f218a570 100644
> --- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c
> +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
> @@ -4603,6 +4603,7 @@ void bnxt_set_tpa_flags(struct bnxt *bp)
> static void bnxt_init_ring_params(struct bnxt *bp)
> {
> bp->rx_copybreak = BNXT_DEFAULT_RX_COPYBREAK;
> + bp->dev->ethtool->hds_thresh = BNXT_DEFAULT_RX_COPYBREAK;
> }
>
> /* bp->rx_ring_size, bp->tx_ring_size, dev->mtu, BNXT_FLAG_{G|L}RO flags must
> @@ -6562,6 +6563,7 @@ static void bnxt_hwrm_update_rss_hash_cfg(struct bnxt *bp)
>
> static int bnxt_hwrm_vnic_set_hds(struct bnxt *bp, struct bnxt_vnic_info *vnic)
> {
> + u16 hds_thresh = (u16)bp->dev->ethtool->hds_thresh;
> struct hwrm_vnic_plcmodes_cfg_input *req;
> int rc;
>
> @@ -6578,7 +6580,7 @@ static int bnxt_hwrm_vnic_set_hds(struct bnxt *bp, struct bnxt_vnic_info *vnic)
> VNIC_PLCMODES_CFG_REQ_FLAGS_HDS_IPV6);
> req->enables |=
> cpu_to_le32(VNIC_PLCMODES_CFG_REQ_ENABLES_HDS_THRESHOLD_VALID);
> - req->hds_threshold = cpu_to_le16(bp->rx_copybreak);
> + req->hds_threshold = cpu_to_le16(hds_thresh);
> }
> req->vnic_id = cpu_to_le32(vnic->fw_vnic_id);
> return hwrm_req_send(bp, req);
> diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.h b/drivers/net/ethernet/broadcom/bnxt/bnxt.h
> index 7dc06e07bae2..8f481dd9c224 100644
> --- a/drivers/net/ethernet/broadcom/bnxt/bnxt.h
> +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.h
> @@ -2779,6 +2779,8 @@ struct bnxt {
> #define SFF_MODULE_ID_QSFP28 0x11
> #define BNXT_MAX_PHY_I2C_RESP_SIZE 64
>
> +#define BNXT_HDS_THRESHOLD_MAX 1023
> +
> static inline u32 bnxt_tx_avail(struct bnxt *bp,
> const struct bnxt_tx_ring_info *txr)
> {
> diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c b/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c
> index 413007190f50..829697bfdab3 100644
> --- a/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c
> +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c
> @@ -833,6 +833,9 @@ static void bnxt_get_ringparam(struct net_device *dev,
> ering->rx_pending = bp->rx_ring_size;
> ering->rx_jumbo_pending = bp->rx_agg_ring_size;
> ering->tx_pending = bp->tx_ring_size;
> +
> + kernel_ering->hds_thresh = dev->ethtool->hds_thresh;
> + kernel_ering->hds_thresh_max = BNXT_HDS_THRESHOLD_MAX;
> }
>
> static int bnxt_set_ringparam(struct net_device *dev,
> @@ -869,6 +872,7 @@ static int bnxt_set_ringparam(struct net_device *dev,
> bp->flags &= ~BNXT_FLAG_HDS;
> }
>
> + dev->ethtool->hds_thresh = kernel_ering->hds_thresh;
> bp->rx_ring_size = ering->rx_pending;
> bp->tx_ring_size = ering->tx_pending;
> bnxt_set_ring_params(bp);
> @@ -5390,7 +5394,8 @@ 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,
> + .supported_ring_params = ETHTOOL_RING_USE_TCP_DATA_SPLIT |
> + ETHTOOL_RING_USE_HDS_THRS,
> .get_link_ksettings = bnxt_get_link_ksettings,
> .set_link_ksettings = bnxt_set_link_ksettings,
> .get_fec_stats = bnxt_get_fec_stats,
> --
> 2.34.1
>
Powered by blists - more mailing lists