Skip to content

Commit e72ee3e

Browse files
committed
Merge branch 'qlcnic-enhancements'
Shahed Shaikh says: ==================== qlcnic: enhancements This series adds few enhancements. o Patch from Harish reorders the sequence of header files inclusion, keeping kernel's header files on top. o Firmware introduced a new feature which allows driver to increases the size of firmware dump of iSCSI function which is being collected by NIC driver. o Print buffer address which is holding a firmware dump. o Use vzalloc() instead kzalloc() for allocating large chunk of memory which will avoid potential memory allocation failure. o Add new device ID for 0x8C30 which is a 83xx series based VF function. Please apply this series to net-next. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
2 parents 07151bc + 02509f1 commit e72ee3e

File tree

12 files changed

+102
-32
lines changed

12 files changed

+102
-32
lines changed

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

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,7 @@
2424
#include <linux/mii.h>
2525
#include <linux/timer.h>
2626
#include <linux/irq.h>
27-
2827
#include <linux/vmalloc.h>
29-
3028
#include <linux/io.h>
3129
#include <asm/byteorder.h>
3230
#include <linux/bitops.h>
@@ -39,8 +37,8 @@
3937

4038
#define _QLCNIC_LINUX_MAJOR 5
4139
#define _QLCNIC_LINUX_MINOR 3
42-
#define _QLCNIC_LINUX_SUBVERSION 62
43-
#define QLCNIC_LINUX_VERSIONID "5.3.62"
40+
#define _QLCNIC_LINUX_SUBVERSION 63
41+
#define QLCNIC_LINUX_VERSIONID "5.3.63"
4442
#define QLCNIC_DRV_IDC_VER 0x01
4543
#define QLCNIC_DRIVER_VERSION ((_QLCNIC_LINUX_MAJOR << 16) |\
4644
(_QLCNIC_LINUX_MINOR << 8) | (_QLCNIC_LINUX_SUBVERSION))
@@ -926,6 +924,7 @@ struct qlcnic_mac_vlan_list {
926924
#define QLCNIC_FW_CAPABILITY_SET_DRV_VER BIT_5
927925
#define QLCNIC_FW_CAPABILITY_2_BEACON BIT_7
928926
#define QLCNIC_FW_CAPABILITY_2_PER_PORT_ESWITCH_CFG BIT_9
927+
#define QLCNIC_FW_CAPABILITY_2_EXT_ISCSI_DUMP BIT_13
929928

930929
#define QLCNIC_83XX_FW_CAPAB_ENCAP_RX_OFFLOAD BIT_0
931930
#define QLCNIC_83XX_FW_CAPAB_ENCAP_TX_OFFLOAD BIT_1
@@ -2291,8 +2290,9 @@ extern const struct ethtool_ops qlcnic_ethtool_failed_ops;
22912290

22922291
#define PCI_DEVICE_ID_QLOGIC_QLE824X 0x8020
22932292
#define PCI_DEVICE_ID_QLOGIC_QLE834X 0x8030
2294-
#define PCI_DEVICE_ID_QLOGIC_QLE8830 0x8830
22952293
#define PCI_DEVICE_ID_QLOGIC_VF_QLE834X 0x8430
2294+
#define PCI_DEVICE_ID_QLOGIC_QLE8830 0x8830
2295+
#define PCI_DEVICE_ID_QLOGIC_VF_QLE8C30 0x8C30
22962296
#define PCI_DEVICE_ID_QLOGIC_QLE844X 0x8040
22972297
#define PCI_DEVICE_ID_QLOGIC_VF_QLE844X 0x8440
22982298

@@ -2319,7 +2319,8 @@ static inline bool qlcnic_83xx_check(struct qlcnic_adapter *adapter)
23192319
(device == PCI_DEVICE_ID_QLOGIC_QLE8830) ||
23202320
(device == PCI_DEVICE_ID_QLOGIC_QLE844X) ||
23212321
(device == PCI_DEVICE_ID_QLOGIC_VF_QLE844X) ||
2322-
(device == PCI_DEVICE_ID_QLOGIC_VF_QLE834X)) ? true : false;
2322+
(device == PCI_DEVICE_ID_QLOGIC_VF_QLE834X) ||
2323+
(device == PCI_DEVICE_ID_QLOGIC_VF_QLE8C30)) ? true : false;
23232324

23242325
return status;
23252326
}
@@ -2335,7 +2336,8 @@ static inline bool qlcnic_sriov_vf_check(struct qlcnic_adapter *adapter)
23352336
bool status;
23362337

23372338
status = ((device == PCI_DEVICE_ID_QLOGIC_VF_QLE834X) ||
2338-
(device == PCI_DEVICE_ID_QLOGIC_VF_QLE844X)) ? true : false;
2339+
(device == PCI_DEVICE_ID_QLOGIC_VF_QLE844X) ||
2340+
(device == PCI_DEVICE_ID_QLOGIC_VF_QLE8C30)) ? true : false;
23392341

23402342
return status;
23412343
}
@@ -2351,7 +2353,8 @@ static inline bool qlcnic_83xx_vf_check(struct qlcnic_adapter *adapter)
23512353
{
23522354
unsigned short device = adapter->pdev->device;
23532355

2354-
return (device == PCI_DEVICE_ID_QLOGIC_VF_QLE834X) ? true : false;
2356+
return ((device == PCI_DEVICE_ID_QLOGIC_VF_QLE834X) ||
2357+
(device == PCI_DEVICE_ID_QLOGIC_VF_QLE8C30)) ? true : false;
23552358
}
23562359

23572360
static inline bool qlcnic_sriov_check(struct qlcnic_adapter *adapter)

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

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,15 @@
55
* See LICENSE.qlcnic for copyright and licensing details.
66
*/
77

8-
#include "qlcnic.h"
9-
#include "qlcnic_sriov.h"
108
#include <linux/if_vlan.h>
119
#include <linux/ipv6.h>
1210
#include <linux/ethtool.h>
1311
#include <linux/interrupt.h>
1412
#include <linux/aer.h>
1513

14+
#include "qlcnic.h"
15+
#include "qlcnic_sriov.h"
16+
1617
static void __qlcnic_83xx_process_aen(struct qlcnic_adapter *);
1718
static int qlcnic_83xx_clear_lb_mode(struct qlcnic_adapter *, u8);
1819
static void qlcnic_83xx_configure_mac(struct qlcnic_adapter *, u8 *, u8,
@@ -118,6 +119,7 @@ static const struct qlcnic_mailbox_metadata qlcnic_83xx_mbx_tbl[] = {
118119
{QLCNIC_CMD_DCB_QUERY_CAP, 1, 2},
119120
{QLCNIC_CMD_DCB_QUERY_PARAM, 1, 50},
120121
{QLCNIC_CMD_SET_INGRESS_ENCAP, 2, 1},
122+
{QLCNIC_CMD_83XX_EXTEND_ISCSI_DUMP_CAP, 4, 1},
121123
};
122124

123125
const u32 qlcnic_83xx_ext_reg_tbl[] = {
@@ -3513,6 +3515,31 @@ void qlcnic_83xx_get_stats(struct qlcnic_adapter *adapter, u64 *data)
35133515
qlcnic_free_mbx_args(&cmd);
35143516
}
35153517

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+
35163543
int qlcnic_83xx_reg_test(struct qlcnic_adapter *adapter)
35173544
{
35183545
u32 major, minor, sub;

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
#include <linux/types.h>
1212
#include <linux/etherdevice.h>
13+
1314
#include "qlcnic_hw.h"
1415

1516
#define QLCNIC_83XX_BAR0_LENGTH 0x4000
@@ -626,6 +627,7 @@ int qlcnic_83xx_set_port_eswitch_status(struct qlcnic_adapter *, int, int *);
626627

627628
void qlcnic_83xx_get_minidump_template(struct qlcnic_adapter *);
628629
void qlcnic_83xx_get_stats(struct qlcnic_adapter *adapter, u64 *data);
630+
int qlcnic_83xx_extend_md_capab(struct qlcnic_adapter *);
629631
int qlcnic_83xx_get_settings(struct qlcnic_adapter *, struct ethtool_cmd *);
630632
int qlcnic_83xx_set_settings(struct qlcnic_adapter *, struct ethtool_cmd *);
631633
void qlcnic_83xx_get_pauseparam(struct qlcnic_adapter *,

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1384,7 +1384,7 @@ static int qlcnic_83xx_copy_fw_file(struct qlcnic_adapter *adapter)
13841384
size_t size;
13851385
u64 addr;
13861386

1387-
temp = kzalloc(fw->size, GFP_KERNEL);
1387+
temp = vzalloc(fw->size);
13881388
if (!temp) {
13891389
release_firmware(fw);
13901390
fw_info->fw = NULL;
@@ -1430,7 +1430,7 @@ static int qlcnic_83xx_copy_fw_file(struct qlcnic_adapter *adapter)
14301430
exit:
14311431
release_firmware(fw);
14321432
fw_info->fw = NULL;
1433-
kfree(temp);
1433+
vfree(temp);
14341434

14351435
return ret;
14361436
}

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@
55
* See LICENSE.qlcnic for copyright and licensing details.
66
*/
77

8-
#include "qlcnic.h"
9-
#include "qlcnic_hdr.h"
10-
118
#include <linux/slab.h>
129
#include <net/ip.h>
1310
#include <linux/bitops.h>
1411

12+
#include "qlcnic.h"
13+
#include "qlcnic_hdr.h"
14+
1515
#define MASK(n) ((1ULL<<(n))-1)
1616
#define OCM_WIN_P3P(addr) (addr & 0xffc0000)
1717

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_main.c

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,6 @@
77

88
#include <linux/vmalloc.h>
99
#include <linux/interrupt.h>
10-
11-
#include "qlcnic.h"
12-
#include "qlcnic_sriov.h"
13-
#include "qlcnic_hw.h"
14-
1510
#include <linux/swab.h>
1611
#include <linux/dma-mapping.h>
1712
#include <linux/if_vlan.h>
@@ -25,6 +20,10 @@
2520
#include <net/vxlan.h>
2621
#endif
2722

23+
#include "qlcnic.h"
24+
#include "qlcnic_sriov.h"
25+
#include "qlcnic_hw.h"
26+
2827
MODULE_DESCRIPTION("QLogic 1/10 GbE Converged/Intelligent Ethernet Driver");
2928
MODULE_LICENSE("GPL");
3029
MODULE_VERSION(QLCNIC_LINUX_VERSIONID);
@@ -111,8 +110,9 @@ static u32 qlcnic_vlan_tx_check(struct qlcnic_adapter *adapter)
111110
static const struct pci_device_id qlcnic_pci_tbl[] = {
112111
ENTRY(PCI_DEVICE_ID_QLOGIC_QLE824X),
113112
ENTRY(PCI_DEVICE_ID_QLOGIC_QLE834X),
114-
ENTRY(PCI_DEVICE_ID_QLOGIC_QLE8830),
115113
ENTRY(PCI_DEVICE_ID_QLOGIC_VF_QLE834X),
114+
ENTRY(PCI_DEVICE_ID_QLOGIC_QLE8830),
115+
ENTRY(PCI_DEVICE_ID_QLOGIC_VF_QLE8C30),
116116
ENTRY(PCI_DEVICE_ID_QLOGIC_QLE844X),
117117
ENTRY(PCI_DEVICE_ID_QLOGIC_VF_QLE844X),
118118
{0,}
@@ -1149,6 +1149,7 @@ static void qlcnic_get_bar_length(u32 dev_id, ulong *bar)
11491149
case PCI_DEVICE_ID_QLOGIC_QLE844X:
11501150
case PCI_DEVICE_ID_QLOGIC_VF_QLE834X:
11511151
case PCI_DEVICE_ID_QLOGIC_VF_QLE844X:
1152+
case PCI_DEVICE_ID_QLOGIC_VF_QLE8C30:
11521153
*bar = QLCNIC_83XX_BAR0_LENGTH;
11531154
break;
11541155
default:
@@ -2491,6 +2492,7 @@ qlcnic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
24912492
qlcnic_83xx_register_map(ahw);
24922493
break;
24932494
case PCI_DEVICE_ID_QLOGIC_VF_QLE834X:
2495+
case PCI_DEVICE_ID_QLOGIC_VF_QLE8C30:
24942496
case PCI_DEVICE_ID_QLOGIC_VF_QLE844X:
24952497
qlcnic_sriov_vf_register_map(ahw);
24962498
break;

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

Lines changed: 37 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@
55
* See LICENSE.qlcnic for copyright and licensing details.
66
*/
77

8+
#include <net/ip.h>
9+
810
#include "qlcnic.h"
911
#include "qlcnic_hdr.h"
1012
#include "qlcnic_83xx_hw.h"
1113
#include "qlcnic_hw.h"
1214

13-
#include <net/ip.h>
14-
1515
#define QLC_83XX_MINIDUMP_FLASH 0x520000
1616
#define QLC_83XX_OCM_INDEX 3
1717
#define QLC_83XX_PCI_INDEX 0
@@ -1388,27 +1388,60 @@ int qlcnic_dump_fw(struct qlcnic_adapter *adapter)
13881388
fw_dump->clr = 1;
13891389
snprintf(mesg, sizeof(mesg), "FW_DUMP=%s", adapter->netdev->name);
13901390
netdev_info(adapter->netdev,
1391-
"Dump data %d bytes captured, template header size %d bytes\n",
1392-
fw_dump->size, fw_dump->tmpl_hdr_size);
1391+
"Dump data %d bytes captured, dump data address = %p, template header size %d bytes, template address = %p\n",
1392+
fw_dump->size, fw_dump->data, fw_dump->tmpl_hdr_size,
1393+
fw_dump->tmpl_hdr);
13931394
/* Send a udev event to notify availability of FW dump */
13941395
kobject_uevent_env(&dev->kobj, KOBJ_CHANGE, msg);
13951396

13961397
return 0;
13971398
}
13981399

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

14061421
prev_version = adapter->fw_version;
14071422
current_version = qlcnic_83xx_get_fw_version(adapter);
14081423

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

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,11 @@
88
#ifndef _QLCNIC_83XX_SRIOV_H_
99
#define _QLCNIC_83XX_SRIOV_H_
1010

11-
#include "qlcnic.h"
1211
#include <linux/types.h>
1312
#include <linux/pci.h>
1413

14+
#include "qlcnic.h"
15+
1516
extern const u32 qlcnic_83xx_reg_tbl[];
1617
extern const u32 qlcnic_83xx_ext_reg_tbl[];
1718

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,11 @@
55
* See LICENSE.qlcnic for copyright and licensing details.
66
*/
77

8+
#include <linux/types.h>
9+
810
#include "qlcnic_sriov.h"
911
#include "qlcnic.h"
1012
#include "qlcnic_83xx_hw.h"
11-
#include <linux/types.h>
1213

1314
#define QLC_BC_COMMAND 0
1415
#define QLC_BC_RESPONSE 1

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,10 @@
55
* See LICENSE.qlcnic for copyright and licensing details.
66
*/
77

8+
#include <linux/types.h>
9+
810
#include "qlcnic_sriov.h"
911
#include "qlcnic.h"
10-
#include <linux/types.h>
1112

1213
#define QLCNIC_SRIOV_VF_MAX_MAC 7
1314
#define QLC_VF_MIN_TX_RATE 100

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

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,6 @@
77

88
#include <linux/slab.h>
99
#include <linux/interrupt.h>
10-
11-
#include "qlcnic.h"
12-
#include "qlcnic_hw.h"
13-
1410
#include <linux/swab.h>
1511
#include <linux/dma-mapping.h>
1612
#include <net/ip.h>
@@ -24,6 +20,9 @@
2420
#include <linux/hwmon-sysfs.h>
2521
#endif
2622

23+
#include "qlcnic.h"
24+
#include "qlcnic_hw.h"
25+
2726
int qlcnicvf_config_bridged_mode(struct qlcnic_adapter *adapter, u32 enable)
2827
{
2928
return -EOPNOTSUPP;

0 commit comments

Comments
 (0)