Re: [PATCH net-next v5 1/7] bnxt_en: add support for rx-copybreak ethtool command

Michael Chan
2024-11-15T00:22:39Z

[-- Attachment #1: Type: text/plain, Size: 2022 bytes --]

On Wed, Nov 13, 2024 at 9:32 AM Taehee Yoo <ap420073@gmail.com> wrote:
>
> The bnxt_en driver supports rx-copybreak, but it couldn't be set by
> userspace. Only the default value(256) has worked.
> This patch makes the bnxt_en driver support following command.
> `ethtool --set-tunable <devname> rx-copybreak <value> ` and
> `ethtool --get-tunable <devname> rx-copybreak`.
>
> By this patch, hds_threshol is set to the rx-copybreak value.
> But it will be set by `ethtool -G eth0 header-data-split-thresh N`
> in the next patch.
>
> Reviewed-by: Brett Creeley <brett.creeley@amd.com>
> Tested-by: Stanislav Fomichev <sdf@fomichev.me>
> Signed-off-by: Taehee Yoo <ap420073@gmail.com>

> @@ -6417,16 +6422,14 @@ 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->hds_threshold = cpu_to_le16(bp->rx_copybreak);

I double checked our hardware spec and the HDS threshold is 10 bits,
so the maximum value is 1023. When we get to patch #5, the HDS
threshold is separated from RX copybreak and the HDS maximum becomes
256. So it is within the hardware limit.

[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4209 bytes --]