Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

bnxt_en: Implement ethtool .set_tunable() for ETHTOOL_PFC_PREVENTION_TOUT

Support the setting of the tunable if it is supported by firmware.
The supported range is 0 to the maximum msec value reported by
firmware. PFC_STORM_PREVENTION_AUTO is also supported and 0 means it
is disabled.

Reviewed-by: Andy Gospodarek <andrew.gospodarek@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Link: https://patch.msgid.link/20250917040839.1924698-11-michael.chan@broadcom.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>

authored by

Michael Chan and committed by
Paolo Abeni
fa18932a 6684b91d

+44 -1
+23 -1
drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c
··· 4416 4416 return rc; 4417 4417 } 4418 4418 4419 + static int bnxt_hwrm_pfcwd_cfg(struct bnxt *bp, u16 val) 4420 + { 4421 + struct hwrm_queue_pfcwd_timeout_cfg_input *req; 4422 + int rc; 4423 + 4424 + rc = hwrm_req_init(bp, req, HWRM_QUEUE_PFCWD_TIMEOUT_CFG); 4425 + if (rc) 4426 + return rc; 4427 + req->pfcwd_timeout_value = cpu_to_le16(val); 4428 + rc = hwrm_req_send(bp, req); 4429 + return rc; 4430 + } 4431 + 4419 4432 static int bnxt_set_tunable(struct net_device *dev, 4420 4433 const struct ethtool_tunable *tuna, 4421 4434 const void *data) 4422 4435 { 4423 4436 struct bnxt *bp = netdev_priv(dev); 4424 - u32 rx_copybreak; 4437 + u32 rx_copybreak, val; 4425 4438 4426 4439 switch (tuna->id) { 4427 4440 case ETHTOOL_RX_COPYBREAK: ··· 4447 4434 bp->rx_copybreak = rx_copybreak; 4448 4435 } 4449 4436 return 0; 4437 + case ETHTOOL_PFC_PREVENTION_TOUT: 4438 + if (BNXT_VF(bp) || !bp->max_pfcwd_tmo_ms) 4439 + return -EOPNOTSUPP; 4440 + 4441 + val = *(u16 *)data; 4442 + if (val > bp->max_pfcwd_tmo_ms && 4443 + val != PFC_STORM_PREVENTION_AUTO) 4444 + return -EINVAL; 4445 + return bnxt_hwrm_pfcwd_cfg(bp, val); 4450 4446 default: 4451 4447 return -EOPNOTSUPP; 4452 4448 }
+21
include/linux/bnxt/hsi.h
··· 6771 6771 u8 valid; 6772 6772 }; 6773 6773 6774 + /* hwrm_queue_pfcwd_timeout_cfg_input (size:192b/24B) */ 6775 + struct hwrm_queue_pfcwd_timeout_cfg_input { 6776 + __le16 req_type; 6777 + __le16 cmpl_ring; 6778 + __le16 seq_id; 6779 + __le16 target_id; 6780 + __le64 resp_addr; 6781 + __le16 pfcwd_timeout_value; 6782 + u8 unused_0[6]; 6783 + }; 6784 + 6785 + /* hwrm_queue_pfcwd_timeout_cfg_output (size:128b/16B) */ 6786 + struct hwrm_queue_pfcwd_timeout_cfg_output { 6787 + __le16 error_code; 6788 + __le16 req_type; 6789 + __le16 seq_id; 6790 + __le16 resp_len; 6791 + u8 unused_0[7]; 6792 + u8 valid; 6793 + }; 6794 + 6774 6795 /* hwrm_queue_pfcwd_timeout_qcfg_input (size:128b/16B) */ 6775 6796 struct hwrm_queue_pfcwd_timeout_qcfg_input { 6776 6797 __le16 req_type;