From: Andy Gospodarek <andrew.gospodarek@broadcom.com>
To: Taehee Yoo <ap420073@gmail.com>
Cc: Michael Chan <michael.chan@broadcom.com>,
Andy Gospodarek <andrew.gospodarek@broadcom.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
Subject: Re: [PATCH net-next v4 2/8] bnxt_en: add support for tcp-data-split ethtool command
Date: Wed, 30 Oct 2024 16:39:23 -0400 [thread overview]
Message-ID: <ZyKZe9a20cQwEhFd@JRM7P7Q02P.dhcp.broadcom.net> (raw)
In-Reply-To: <CAMArcTWrA0ib9XHnSGGH-sNqQ9TG0BaRq+5nsGC3iQv6Zd40rQ@mail.gmail.com>
On Sat, Oct 26, 2024 at 02:11:15PM +0900, Taehee Yoo wrote:
> On Sat, Oct 26, 2024 at 7:00 AM Michael Chan <michael.chan@broadcom.com> wrote:
> >
> > On Fri, Oct 25, 2024 at 12:24 PM Andy Gospodarek
> > <andrew.gospodarek@broadcom.com> wrote:
>
> Hi Andy,
> Thank you so much for your review!
>
> > >
> > > 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
> >
> > The BNXT_FLAG_AGG_RINGS flag is true if the JUMBO, GRO, or LRO flag is
> > set. So even though it is initially cleared in
> > bnxt_set_rx_skb_mode(), we'll set the JUMBO flag if we are in
> > multi-buffer XDP mode. Again, we don't enable HDS in any XDP mode so
> > I think we need to keep the original logic here to skip setting the
> > HDS threshold if BNXT_FLAG_RX_PAGE_MODE is set.
>
> I thought the HDS is disallowed only when single-buffer XDP is set.
> By this series, Core API disallows tcp-data-split only when
> single-buffer XDP is set, but it allows tcp-data-split to set when
> multi-buffer XDP is set.
So you are saying that a user could set copybreak with ethtool (included
in patch 1) and when a multibuffer XDP program is attached to an
interface with an MTU of 9k, only the header will be in the first page
and all the TCP data will be in the pages that follow?
> + if (kernel_ringparam.tcp_data_split == ETHTOOL_TCP_DATA_SPLIT_ENABLED &&
> + 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;
> + }
>
> I think other drivers would allow tcp-data-split on multi buffer XDP,
> so I wouldn't like to remove this condition check code.
>
I have no problem keeping that logic in the core kernel. I'm just
asking you to please preserve the existing logic since it is
functionally equivalent and easier to read/compare to other spots where
XDP single-buffer mode is used.
> I will not set HDS if XDP is set in the bnxt_hwrm_vnic_set_hds()
> In addition, I think we need to add a condition to check XDP is set in
> bnxt_set_ringparam().
>
> >
> > > , 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);
> > >
>
> Thanks a lot!
> Taehee Yoo
next prev parent reply other threads:[~2024-10-30 20:39 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
2024-10-25 22:00 ` Michael Chan
2024-10-26 5:11 ` Taehee Yoo
2024-10-30 20:39 ` Andy Gospodarek [this message]
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=ZyKZe9a20cQwEhFd@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