Skip to content

Commit 6b43673

Browse files
TaeheeYookuba-moo
authored andcommitted
bnxt_en: add support for hds-thresh ethtool command
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 <[email protected]> Tested-by: Andy Gospodarek <[email protected]> Signed-off-by: Taehee Yoo <[email protected]> Reviewed-by: Michael Chan <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 87c8f84 commit 6b43673

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

drivers/net/ethernet/broadcom/bnxt/bnxt.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4610,6 +4610,7 @@ void bnxt_set_tpa_flags(struct bnxt *bp)
46104610
static void bnxt_init_ring_params(struct bnxt *bp)
46114611
{
46124612
bp->rx_copybreak = BNXT_DEFAULT_RX_COPYBREAK;
4613+
bp->dev->ethtool->hds_thresh = BNXT_DEFAULT_RX_COPYBREAK;
46134614
}
46144615

46154616
/* bp->rx_ring_size, bp->tx_ring_size, dev->mtu, BNXT_FLAG_{G|L}RO flags must
@@ -6569,6 +6570,7 @@ static void bnxt_hwrm_update_rss_hash_cfg(struct bnxt *bp)
65696570

65706571
static int bnxt_hwrm_vnic_set_hds(struct bnxt *bp, struct bnxt_vnic_info *vnic)
65716572
{
6573+
u16 hds_thresh = (u16)bp->dev->ethtool->hds_thresh;
65726574
struct hwrm_vnic_plcmodes_cfg_input *req;
65736575
int rc;
65746576

@@ -6585,7 +6587,7 @@ static int bnxt_hwrm_vnic_set_hds(struct bnxt *bp, struct bnxt_vnic_info *vnic)
65856587
VNIC_PLCMODES_CFG_REQ_FLAGS_HDS_IPV6);
65866588
req->enables |=
65876589
cpu_to_le32(VNIC_PLCMODES_CFG_REQ_ENABLES_HDS_THRESHOLD_VALID);
6588-
req->hds_threshold = cpu_to_le16(bp->rx_copybreak);
6590+
req->hds_threshold = cpu_to_le16(hds_thresh);
65896591
}
65906592
req->vnic_id = cpu_to_le32(vnic->fw_vnic_id);
65916593
return hwrm_req_send(bp, req);

drivers/net/ethernet/broadcom/bnxt/bnxt.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2779,6 +2779,8 @@ struct bnxt {
27792779
#define SFF_MODULE_ID_QSFP28 0x11
27802780
#define BNXT_MAX_PHY_I2C_RESP_SIZE 64
27812781

2782+
#define BNXT_HDS_THRESHOLD_MAX 1023
2783+
27822784
static inline u32 bnxt_tx_avail(struct bnxt *bp,
27832785
const struct bnxt_tx_ring_info *txr)
27842786
{

drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -833,6 +833,9 @@ static void bnxt_get_ringparam(struct net_device *dev,
833833
ering->rx_pending = bp->rx_ring_size;
834834
ering->rx_jumbo_pending = bp->rx_agg_ring_size;
835835
ering->tx_pending = bp->tx_ring_size;
836+
837+
kernel_ering->hds_thresh = dev->ethtool->hds_thresh;
838+
kernel_ering->hds_thresh_max = BNXT_HDS_THRESHOLD_MAX;
836839
}
837840

838841
static int bnxt_set_ringparam(struct net_device *dev,
@@ -5390,7 +5393,8 @@ const struct ethtool_ops bnxt_ethtool_ops = {
53905393
ETHTOOL_COALESCE_STATS_BLOCK_USECS |
53915394
ETHTOOL_COALESCE_USE_ADAPTIVE_RX |
53925395
ETHTOOL_COALESCE_USE_CQE,
5393-
.supported_ring_params = ETHTOOL_RING_USE_TCP_DATA_SPLIT,
5396+
.supported_ring_params = ETHTOOL_RING_USE_TCP_DATA_SPLIT |
5397+
ETHTOOL_RING_USE_HDS_THRS,
53945398
.get_link_ksettings = bnxt_get_link_ksettings,
53955399
.set_link_ksettings = bnxt_set_link_ksettings,
53965400
.get_fec_stats = bnxt_get_fec_stats,

0 commit comments

Comments
 (0)