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 .get_tunable() for ETHTOOL_PFC_PREVENTION_TOUT

Return the current PFC watchdog timeout value if it is supported.

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

authored by

Michael Chan and committed by
Paolo Abeni
6684b91d 7ef55292

+81
+18
drivers/net/ethernet/broadcom/bnxt/bnxt.c
··· 14748 14748 return false; 14749 14749 } 14750 14750 14751 + static void bnxt_hwrm_pfcwd_qcaps(struct bnxt *bp) 14752 + { 14753 + struct hwrm_queue_pfcwd_timeout_qcaps_output *resp; 14754 + struct hwrm_queue_pfcwd_timeout_qcaps_input *req; 14755 + int rc; 14756 + 14757 + bp->max_pfcwd_tmo_ms = 0; 14758 + rc = hwrm_req_init(bp, req, HWRM_QUEUE_PFCWD_TIMEOUT_QCAPS); 14759 + if (rc) 14760 + return; 14761 + resp = hwrm_req_hold(bp, req); 14762 + rc = hwrm_req_send_silent(bp, req); 14763 + if (!rc) 14764 + bp->max_pfcwd_tmo_ms = le16_to_cpu(resp->max_pfcwd_timeout); 14765 + hwrm_req_drop(bp, req); 14766 + } 14767 + 14751 14768 static int bnxt_fw_init_one_p1(struct bnxt *bp) 14752 14769 { 14753 14770 int rc; ··· 14842 14825 if (bnxt_fw_pre_resv_vnics(bp)) 14843 14826 bp->fw_cap |= BNXT_FW_CAP_PRE_RESV_VNICS; 14844 14827 14828 + bnxt_hwrm_pfcwd_qcaps(bp); 14845 14829 bnxt_hwrm_func_qcfg(bp); 14846 14830 bnxt_hwrm_vnic_qcaps(bp); 14847 14831 bnxt_hwrm_port_led_qcaps(bp);
+2
drivers/net/ethernet/broadcom/bnxt/bnxt.h
··· 2426 2426 u8 max_q; 2427 2427 u8 num_tc; 2428 2428 2429 + u16 max_pfcwd_tmo_ms; 2430 + 2429 2431 u8 tph_mode; 2430 2432 2431 2433 unsigned int current_interval;
+21
drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c
··· 4399 4399 return 0; 4400 4400 } 4401 4401 4402 + static int bnxt_hwrm_pfcwd_qcfg(struct bnxt *bp, u16 *val) 4403 + { 4404 + struct hwrm_queue_pfcwd_timeout_qcfg_output *resp; 4405 + struct hwrm_queue_pfcwd_timeout_qcfg_input *req; 4406 + int rc; 4407 + 4408 + rc = hwrm_req_init(bp, req, HWRM_QUEUE_PFCWD_TIMEOUT_QCFG); 4409 + if (rc) 4410 + return rc; 4411 + resp = hwrm_req_hold(bp, req); 4412 + rc = hwrm_req_send(bp, req); 4413 + if (!rc) 4414 + *val = le16_to_cpu(resp->pfcwd_timeout_value); 4415 + hwrm_req_drop(bp, req); 4416 + return rc; 4417 + } 4418 + 4402 4419 static int bnxt_set_tunable(struct net_device *dev, 4403 4420 const struct ethtool_tunable *tuna, 4404 4421 const void *data) ··· 4448 4431 case ETHTOOL_RX_COPYBREAK: 4449 4432 *(u32 *)data = bp->rx_copybreak; 4450 4433 break; 4434 + case ETHTOOL_PFC_PREVENTION_TOUT: 4435 + if (!bp->max_pfcwd_tmo_ms) 4436 + return -EOPNOTSUPP; 4437 + return bnxt_hwrm_pfcwd_qcfg(bp, data); 4451 4438 default: 4452 4439 return -EOPNOTSUPP; 4453 4440 }
+40
include/linux/bnxt/hsi.h
··· 6751 6751 u8 valid; 6752 6752 }; 6753 6753 6754 + /* hwrm_queue_pfcwd_timeout_qcaps_input (size:128b/16B) */ 6755 + struct hwrm_queue_pfcwd_timeout_qcaps_input { 6756 + __le16 req_type; 6757 + __le16 cmpl_ring; 6758 + __le16 seq_id; 6759 + __le16 target_id; 6760 + __le64 resp_addr; 6761 + }; 6762 + 6763 + /* hwrm_queue_pfcwd_timeout_qcaps_output (size:128b/16B) */ 6764 + struct hwrm_queue_pfcwd_timeout_qcaps_output { 6765 + __le16 error_code; 6766 + __le16 req_type; 6767 + __le16 seq_id; 6768 + __le16 resp_len; 6769 + __le16 max_pfcwd_timeout; 6770 + u8 unused_0[5]; 6771 + u8 valid; 6772 + }; 6773 + 6774 + /* hwrm_queue_pfcwd_timeout_qcfg_input (size:128b/16B) */ 6775 + struct hwrm_queue_pfcwd_timeout_qcfg_input { 6776 + __le16 req_type; 6777 + __le16 cmpl_ring; 6778 + __le16 seq_id; 6779 + __le16 target_id; 6780 + __le64 resp_addr; 6781 + }; 6782 + 6783 + /* hwrm_queue_pfcwd_timeout_qcfg_output (size:128b/16B) */ 6784 + struct hwrm_queue_pfcwd_timeout_qcfg_output { 6785 + __le16 error_code; 6786 + __le16 req_type; 6787 + __le16 seq_id; 6788 + __le16 resp_len; 6789 + __le16 pfcwd_timeout_value; 6790 + u8 unused_0[5]; 6791 + u8 valid; 6792 + }; 6793 + 6754 6794 /* hwrm_vnic_alloc_input (size:192b/24B) */ 6755 6795 struct hwrm_vnic_alloc_input { 6756 6796 __le16 req_type;