Linux Documentation
 help / color / mirror / Atom feed
From: Andy Gospodarek <andrew.gospodarek@broadcom.com>
To: Michael Chan <michael.chan@broadcom.com>
Cc: Taehee Yoo <ap420073@gmail.com>,
	davem@davemloft.net, kuba@kernel.org, pabeni@redhat.com,
	edumazet@google.com, almasrymina@google.com,
	donald.hunter@gmail.com, corbet@lwn.net, 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,
	Andrew Gospodarek <andrew.gospodarek@broadcom.com>
Subject: Re: [PATCH net-next v4 2/8] bnxt_en: add support for tcp-data-split ethtool command
Date: Fri, 25 Oct 2024 15:24:22 -0400	[thread overview]
Message-ID: <ZxvwZmJsdFOStYcV@JRM7P7Q02P.dhcp.broadcom.net> (raw)
In-Reply-To: <CACKFLikBKi2jBNG6_O1uFUmMwfBC30ef5AG4ACjVv_K=vv38PA@mail.gmail.com>

On Thu, Oct 24, 2024 at 10:02:30PM -0700, Michael Chan wrote:
> On Tue, Oct 22, 2024 at 9:24 AM Taehee Yoo <ap420073@gmail.com> wrote:
> >
> > NICs that uses bnxt_en driver supports tcp-data-split feature by the
> > name of HDS(header-data-split).
> > But there is no implementation for the HDS to enable or disable by
> > ethtool.
> > Only getting the current HDS status is implemented and The HDS is just
> > automatically enabled only when either LRO, HW-GRO, or JUMBO is enabled.
> > The hds_threshold follows rx-copybreak value. and it was unchangeable.
> >
> > This implements `ethtool -G <interface name> tcp-data-split <value>`
> > command option.
> > The value can be <on>, <off>, and <auto> but the <auto> will be
> > automatically changed to <on>.
> >
> > HDS feature relies on the aggregation ring.
> > So, if HDS is enabled, the bnxt_en driver initializes the aggregation
> > ring.
> > This is the reason why BNXT_FLAG_AGG_RINGS contains HDS condition.
> >
> > Tested-by: Stanislav Fomichev <sdf@fomichev.me>
> > Signed-off-by: Taehee Yoo <ap420073@gmail.com>
> > ---
> >
> > v4:
> >  - Do not support disable tcp-data-split.
> >  - Add Test tag from Stanislav.
> >
> > v3:
> >  - No changes.
> >
> > v2:
> >  - Do not set hds_threshold to 0.
> >
> >  drivers/net/ethernet/broadcom/bnxt/bnxt.c         |  8 +++-----
> >  drivers/net/ethernet/broadcom/bnxt/bnxt.h         |  5 +++--
> >  drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c | 13 +++++++++++++
> >  3 files changed, 19 insertions(+), 7 deletions(-)
> >
> > diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
> > index 0f5fe9ba691d..91ea42ff9b17 100644
> > --- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c
> > +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
> 
> > @@ -6420,15 +6420,13 @@ static int bnxt_hwrm_vnic_set_hds(struct bnxt *bp, struct bnxt_vnic_info *vnic)
> >
> >         req->flags = cpu_to_le32(VNIC_PLCMODES_CFG_REQ_FLAGS_JUMBO_PLACEMENT);
> >         req->enables = cpu_to_le32(VNIC_PLCMODES_CFG_REQ_ENABLES_JUMBO_THRESH_VALID);
> > +       req->jumbo_thresh = cpu_to_le16(bp->rx_buf_use_size);
> >
> > -       if (BNXT_RX_PAGE_MODE(bp)) {
> > -               req->jumbo_thresh = cpu_to_le16(bp->rx_buf_use_size);
> 
> Please explain why this "if" condition is removed.
> BNXT_RX_PAGE_MODE() means that we are in XDP mode and we currently
> don't support HDS in XDP mode.  Added Andy Gospo to CC so he can also
> comment.
> 

In bnxt_set_rx_skb_mode we set BNXT_FLAG_RX_PAGE_MODE and clear
BNXT_FLAG_AGG_RINGS, so this should work.  The only issue is that we
have spots in the driver where we check BNXT_RX_PAGE_MODE(bp) to
indicate that XDP single-buffer mode is enabled on the device.

If you need to respin this series I would prefer that the change is like
below to key off the page mode being disabled and BNXT_FLAG_AGG_RINGS
being enabled to setup HDS.  This will serve as a reminder that this is
for XDP.

@@ -6418,15 +6418,13 @@ static int bnxt_hwrm_vnic_set_hds(struct bnxt *bp, struct bnxt_vnic_info *vnic)
 
        req->flags = cpu_to_le32(VNIC_PLCMODES_CFG_REQ_FLAGS_JUMBO_PLACEMENT);
        req->enables = cpu_to_le32(VNIC_PLCMODES_CFG_REQ_ENABLES_JUMBO_THRESH_VALID);
+       req->jumbo_thresh = cpu_to_le16(bp->rx_buf_use_size);
 
-       if (BNXT_RX_PAGE_MODE(bp)) {
-               req->jumbo_thresh = cpu_to_le16(bp->rx_buf_use_size);
-       } else {
+       if (!BNXT_RX_PAGE_MODE(bp) && (bp->flags & BNXT_FLAG_AGG_RINGS)) {
                req->flags |= cpu_to_le32(VNIC_PLCMODES_CFG_REQ_FLAGS_HDS_IPV4 |
                                          VNIC_PLCMODES_CFG_REQ_FLAGS_HDS_IPV6);
                req->enables |=
                        cpu_to_le32(VNIC_PLCMODES_CFG_REQ_ENABLES_HDS_THRESHOLD_VALID);
-               req->jumbo_thresh = cpu_to_le16(bp->rx_copy_thresh);
                req->hds_threshold = cpu_to_le16(bp->rx_copy_thresh);
        }
        req->vnic_id = cpu_to_le32(vnic->fw_vnic_id);

> > -       } else {
> > +       if (bp->flags & BNXT_FLAG_AGG_RINGS) {
> >                 req->flags |= cpu_to_le32(VNIC_PLCMODES_CFG_REQ_FLAGS_HDS_IPV4 |
> >                                           VNIC_PLCMODES_CFG_REQ_FLAGS_HDS_IPV6);
> >                 req->enables |=
> >                         cpu_to_le32(VNIC_PLCMODES_CFG_REQ_ENABLES_HDS_THRESHOLD_VALID);
> > -               req->jumbo_thresh = cpu_to_le16(bp->rx_copybreak);
> >                 req->hds_threshold = cpu_to_le16(bp->rx_copybreak);
> >         }
> >         req->vnic_id = cpu_to_le32(vnic->fw_vnic_id);



  parent reply	other threads:[~2024-10-25 19:24 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-22 16:23 [PATCH net-next v4 0/7] bnxt_en: implement device memory TCP for bnxt Taehee Yoo
2024-10-22 16:23 ` [PATCH net-next v4 1/8] bnxt_en: add support for rx-copybreak ethtool command Taehee Yoo
2024-10-24  6:40   ` Michael Chan
2024-10-24 16:38     ` Taehee Yoo
2024-10-25  4:54       ` Michael Chan
2024-10-25  8:07         ` Taehee Yoo
2024-10-22 16:23 ` [PATCH net-next v4 2/8] bnxt_en: add support for tcp-data-split " Taehee Yoo
2024-10-25  5:02   ` Michael Chan
2024-10-25  7:59     ` Taehee Yoo
2024-10-25 19:24     ` Andy Gospodarek [this message]
2024-10-25 22:00       ` Michael Chan
2024-10-26  5:11         ` Taehee Yoo
2024-10-30 20:39           ` Andy Gospodarek
2024-10-31  5:20             ` Taehee Yoo
2024-10-22 16:23 ` [PATCH net-next v4 3/8] net: ethtool: add support for configuring header-data-split-thresh Taehee Yoo
2024-11-01 14:55   ` Mina Almasry
2024-11-01 18:50     ` Taehee Yoo
2024-10-22 16:23 ` [PATCH net-next v4 4/8] bnxt_en: add support for header-data-split-thresh ethtool command Taehee Yoo
2024-10-22 16:23 ` [PATCH net-next v4 5/8] net: devmem: add ring parameter filtering Taehee Yoo
2024-11-01 14:29   ` Mina Almasry
2024-11-01 18:02     ` Taehee Yoo
2024-11-01 20:40       ` Mina Almasry
2024-10-22 16:23 ` [PATCH net-next v4 6/8] net: ethtool: " Taehee Yoo
2024-11-01 14:35   ` Mina Almasry
2024-11-01 18:08     ` Taehee Yoo
2024-10-22 16:23 ` [PATCH net-next v4 7/8] net: netmem: add netmem_is_pfmemalloc() helper function Taehee Yoo
2024-11-01 14:36   ` Mina Almasry
2024-10-22 16:23 ` [PATCH net-next v4 8/8] bnxt_en: add support for device memory tcp Taehee Yoo
2024-11-01 14:53   ` Mina Almasry
2024-11-01 18:24     ` Taehee Yoo
2025-02-19  0:15       ` David Wei
2025-02-19  2:37         ` Taehee Yoo

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=ZxvwZmJsdFOStYcV@JRM7P7Q02P.dhcp.broadcom.net \
    --to=andrew.gospodarek@broadcom.com \
    --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=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=kuba@kernel.org \
    --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