Skip to content

Commit 59af38c

Browse files
committed
Merge branch 'bnxt_en-update-for-net-next'
Michael Chan says: ==================== bnxt_en: Update for net-next The first patch changes the FW message timeout threshold for a warning message. The second patch adjusts the ethtool -w coredump length to suppress a warning. The last 2 patches are small cleanup patches for the bnxt_ulp RoCE auxbus code. v1: https://lore.kernel.org/netdev/[email protected]/ ==================== Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
2 parents 50f2570 + 76a69f3 commit 59af38c

File tree

5 files changed

+17
-16
lines changed

5 files changed

+17
-16
lines changed

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

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10110,7 +10110,7 @@ static int bnxt_hwrm_ver_get(struct bnxt *bp)
1011010110
struct hwrm_ver_get_input *req;
1011110111
u16 fw_maj, fw_min, fw_bld, fw_rsv;
1011210112
u32 dev_caps_cfg, hwrm_ver;
10113-
int rc, len;
10113+
int rc, len, max_tmo_secs;
1011410114

1011510115
rc = hwrm_req_init(bp, req, HWRM_VER_GET);
1011610116
if (rc)
@@ -10183,9 +10183,12 @@ static int bnxt_hwrm_ver_get(struct bnxt *bp)
1018310183
bp->hwrm_cmd_max_timeout = le16_to_cpu(resp->max_req_timeout) * 1000;
1018410184
if (!bp->hwrm_cmd_max_timeout)
1018510185
bp->hwrm_cmd_max_timeout = HWRM_CMD_MAX_TIMEOUT;
10186-
else if (bp->hwrm_cmd_max_timeout > HWRM_CMD_MAX_TIMEOUT)
10187-
netdev_warn(bp->dev, "Device requests max timeout of %d seconds, may trigger hung task watchdog\n",
10188-
bp->hwrm_cmd_max_timeout / 1000);
10186+
max_tmo_secs = bp->hwrm_cmd_max_timeout / 1000;
10187+
if (bp->hwrm_cmd_max_timeout > HWRM_CMD_MAX_TIMEOUT ||
10188+
max_tmo_secs > CONFIG_DEFAULT_HUNG_TASK_TIMEOUT) {
10189+
netdev_warn(bp->dev, "Device requests max timeout of %d seconds, may trigger hung task watchdog (kernel default %ds)\n",
10190+
max_tmo_secs, CONFIG_DEFAULT_HUNG_TASK_TIMEOUT);
10191+
}
1018910192

1019010193
if (resp->hwrm_intf_maj_8b >= 1) {
1019110194
bp->hwrm_max_req_len = le16_to_cpu(resp->max_req_win_len);

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

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -496,9 +496,16 @@ static int __bnxt_get_coredump(struct bnxt *bp, u16 dump_type, void *buf,
496496
start_utc, coredump.total_segs + 1,
497497
rc);
498498
kfree(coredump.data);
499-
*dump_len += sizeof(struct bnxt_coredump_record);
500-
if (rc == -ENOBUFS)
499+
if (!rc) {
500+
*dump_len += sizeof(struct bnxt_coredump_record);
501+
/* The actual coredump length can be smaller than the FW
502+
* reported length earlier. Use the ethtool provided length.
503+
*/
504+
if (buf_len)
505+
*dump_len = buf_len;
506+
} else if (rc == -ENOBUFS) {
501507
netdev_err(bp->dev, "Firmware returned large coredump buffer\n");
508+
}
502509
return rc;
503510
}
504511

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ void hwrm_update_token(struct bnxt *bp, u16 seq, enum bnxt_hwrm_wait_state s);
5858

5959
#define BNXT_HWRM_MAX_REQ_LEN (bp->hwrm_max_req_len)
6060
#define BNXT_HWRM_SHORT_REQ_LEN sizeof(struct hwrm_short_input)
61-
#define HWRM_CMD_MAX_TIMEOUT 40000U
61+
#define HWRM_CMD_MAX_TIMEOUT 60000U
6262
#define SHORT_HWRM_CMD_TIMEOUT 20
6363
#define HWRM_CMD_TIMEOUT (bp->hwrm_cmd_timeout)
6464
#define HWRM_RESET_TIMEOUT ((HWRM_CMD_TIMEOUT) * 4)

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

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,6 @@ void bnxt_unregister_dev(struct bnxt_en_dev *edev)
148148
struct net_device *dev = edev->net;
149149
struct bnxt *bp = netdev_priv(dev);
150150
struct bnxt_ulp *ulp;
151-
int i = 0;
152151

153152
ulp = edev->ulp_tbl;
154153
netdev_lock(dev);
@@ -164,10 +163,6 @@ void bnxt_unregister_dev(struct bnxt_en_dev *edev)
164163
synchronize_rcu();
165164
ulp->max_async_event_id = 0;
166165
ulp->async_events_bmap = NULL;
167-
while (atomic_read(&ulp->ref_count) != 0 && i < 10) {
168-
msleep(100);
169-
i++;
170-
}
171166
mutex_unlock(&edev->en_dev_lock);
172167
netdev_unlock(dev);
173168
return;

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

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,6 @@
1010
#ifndef BNXT_ULP_H
1111
#define BNXT_ULP_H
1212

13-
#define BNXT_ROCE_ULP 0
14-
#define BNXT_MAX_ULP 1
15-
1613
#define BNXT_MIN_ROCE_CP_RINGS 2
1714
#define BNXT_MIN_ROCE_STAT_CTXS 1
1815

@@ -50,7 +47,6 @@ struct bnxt_ulp {
5047
unsigned long *async_events_bmap;
5148
u16 max_async_event_id;
5249
u16 msix_requested;
53-
atomic_t ref_count;
5450
};
5551

5652
struct bnxt_en_dev {

0 commit comments

Comments
 (0)