Skip to content

Commit d01a6d3

Browse files
Shahed Shaikhdavem330
authored andcommitted
qlcnic: Add support to enable capability to extend minidump for iSCSI
In some cases it is required to capture minidump for iSCSI functions as part of default minidump collection process. To enable this, firmware exports it's capability and driver need to enable that capability by issuing a mailbox command. With this feature, firmware can provide additional iSCSI function's minidump with smaller minidump capture mask (0x1f). Signed-off-by: Shahed Shaikh <shahed.shaikh@qlogic.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent a930a46 commit d01a6d3

File tree

5 files changed

+61
-0
lines changed

5 files changed

+61
-0
lines changed

drivers/net/ethernet/qlogic/qlcnic/qlcnic.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -924,6 +924,7 @@ struct qlcnic_mac_vlan_list {
924924
#define QLCNIC_FW_CAPABILITY_SET_DRV_VER BIT_5
925925
#define QLCNIC_FW_CAPABILITY_2_BEACON BIT_7
926926
#define QLCNIC_FW_CAPABILITY_2_PER_PORT_ESWITCH_CFG BIT_9
927+
#define QLCNIC_FW_CAPABILITY_2_EXT_ISCSI_DUMP BIT_13
927928

928929
#define QLCNIC_83XX_FW_CAPAB_ENCAP_RX_OFFLOAD BIT_0
929930
#define QLCNIC_83XX_FW_CAPAB_ENCAP_TX_OFFLOAD BIT_1

drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ static const struct qlcnic_mailbox_metadata qlcnic_83xx_mbx_tbl[] = {
119119
{QLCNIC_CMD_DCB_QUERY_CAP, 1, 2},
120120
{QLCNIC_CMD_DCB_QUERY_PARAM, 1, 50},
121121
{QLCNIC_CMD_SET_INGRESS_ENCAP, 2, 1},
122+
{QLCNIC_CMD_83XX_EXTEND_ISCSI_DUMP_CAP, 4, 1},
122123
};
123124

124125
const u32 qlcnic_83xx_ext_reg_tbl[] = {
@@ -3514,6 +3515,31 @@ void qlcnic_83xx_get_stats(struct qlcnic_adapter *adapter, u64 *data)
35143515
qlcnic_free_mbx_args(&cmd);
35153516
}
35163517

3518+
#define QLCNIC_83XX_ADD_PORT0 BIT_0
3519+
#define QLCNIC_83XX_ADD_PORT1 BIT_1
3520+
#define QLCNIC_83XX_EXTENDED_MEM_SIZE 13 /* In MB */
3521+
int qlcnic_83xx_extend_md_capab(struct qlcnic_adapter *adapter)
3522+
{
3523+
struct qlcnic_cmd_args cmd;
3524+
int err;
3525+
3526+
err = qlcnic_alloc_mbx_args(&cmd, adapter,
3527+
QLCNIC_CMD_83XX_EXTEND_ISCSI_DUMP_CAP);
3528+
if (err)
3529+
return err;
3530+
3531+
cmd.req.arg[1] = (QLCNIC_83XX_ADD_PORT0 | QLCNIC_83XX_ADD_PORT1);
3532+
cmd.req.arg[2] = QLCNIC_83XX_EXTENDED_MEM_SIZE;
3533+
cmd.req.arg[3] = QLCNIC_83XX_EXTENDED_MEM_SIZE;
3534+
3535+
err = qlcnic_issue_cmd(adapter, &cmd);
3536+
if (err)
3537+
dev_err(&adapter->pdev->dev,
3538+
"failed to issue extend iSCSI minidump capability\n");
3539+
3540+
return err;
3541+
}
3542+
35173543
int qlcnic_83xx_reg_test(struct qlcnic_adapter *adapter)
35183544
{
35193545
u32 major, minor, sub;

drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -627,6 +627,7 @@ int qlcnic_83xx_set_port_eswitch_status(struct qlcnic_adapter *, int, int *);
627627

628628
void qlcnic_83xx_get_minidump_template(struct qlcnic_adapter *);
629629
void qlcnic_83xx_get_stats(struct qlcnic_adapter *adapter, u64 *data);
630+
int qlcnic_83xx_extend_md_capab(struct qlcnic_adapter *);
630631
int qlcnic_83xx_get_settings(struct qlcnic_adapter *, struct ethtool_cmd *);
631632
int qlcnic_83xx_set_settings(struct qlcnic_adapter *, struct ethtool_cmd *);
632633
void qlcnic_83xx_get_pauseparam(struct qlcnic_adapter *,

drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ enum qlcnic_regs {
109109
#define QLCNIC_CMD_GET_LED_CONFIG 0x6A
110110
#define QLCNIC_CMD_83XX_SET_DRV_VER 0x6F
111111
#define QLCNIC_CMD_ADD_RCV_RINGS 0x0B
112+
#define QLCNIC_CMD_83XX_EXTEND_ISCSI_DUMP_CAP 0x37
112113

113114
#define QLCNIC_INTRPT_INTX 1
114115
#define QLCNIC_INTRPT_MSIX 3

drivers/net/ethernet/qlogic/qlcnic/qlcnic_minidump.c

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1396,19 +1396,51 @@ int qlcnic_dump_fw(struct qlcnic_adapter *adapter)
13961396
return 0;
13971397
}
13981398

1399+
static inline bool
1400+
qlcnic_83xx_md_check_extended_dump_capability(struct qlcnic_adapter *adapter)
1401+
{
1402+
/* For special adapters (with 0x8830 device ID), where iSCSI firmware
1403+
* dump needs to be captured as part of regular firmware dump
1404+
* collection process, firmware exports it's capability through
1405+
* capability registers
1406+
*/
1407+
return ((adapter->pdev->device == PCI_DEVICE_ID_QLOGIC_QLE8830) &&
1408+
(adapter->ahw->extra_capability[0] &
1409+
QLCNIC_FW_CAPABILITY_2_EXT_ISCSI_DUMP));
1410+
}
1411+
13991412
void qlcnic_83xx_get_minidump_template(struct qlcnic_adapter *adapter)
14001413
{
14011414
u32 prev_version, current_version;
14021415
struct qlcnic_hardware_context *ahw = adapter->ahw;
14031416
struct qlcnic_fw_dump *fw_dump = &ahw->fw_dump;
14041417
struct pci_dev *pdev = adapter->pdev;
1418+
bool extended = false;
14051419

14061420
prev_version = adapter->fw_version;
14071421
current_version = qlcnic_83xx_get_fw_version(adapter);
14081422

14091423
if (fw_dump->tmpl_hdr == NULL || current_version > prev_version) {
14101424
vfree(fw_dump->tmpl_hdr);
1425+
1426+
if (qlcnic_83xx_md_check_extended_dump_capability(adapter))
1427+
extended = !qlcnic_83xx_extend_md_capab(adapter);
1428+
14111429
if (!qlcnic_fw_cmd_get_minidump_temp(adapter))
14121430
dev_info(&pdev->dev, "Supports FW dump capability\n");
1431+
1432+
/* Once we have minidump template with extended iSCSI dump
1433+
* capability, update the minidump capture mask to 0x1f as
1434+
* per FW requirement
1435+
*/
1436+
if (extended) {
1437+
struct qlcnic_83xx_dump_template_hdr *hdr;
1438+
1439+
hdr = fw_dump->tmpl_hdr;
1440+
hdr->drv_cap_mask = 0x1f;
1441+
fw_dump->cap_mask = 0x1f;
1442+
dev_info(&pdev->dev,
1443+
"Extended iSCSI dump capability and updated capture mask to 0x1f\n");
1444+
}
14131445
}
14141446
}

0 commit comments

Comments
 (0)