Skip to content

Commit fa5004a

Browse files
committed
update to 5.9
1 parent f4b15f3 commit fa5004a

15 files changed

Lines changed: 131 additions & 267 deletions

qlcnic.h

Lines changed: 12 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -418,7 +418,7 @@ struct qlcnic_83xx_dump_template_hdr {
418418
u32 saved_state[16];
419419
u32 cap_sizes[8];
420420
u32 ocm_wnd_reg[16];
421-
u32 rsvd[0];
421+
u32 rsvd[];
422422
};
423423

424424
struct qlcnic_82xx_dump_template_hdr {
@@ -436,7 +436,7 @@ struct qlcnic_82xx_dump_template_hdr {
436436
u32 cap_sizes[8];
437437
u32 rsvd[7];
438438
u32 capabilities;
439-
u32 rsvd1[0];
439+
u32 rsvd1[];
440440
};
441441

442442
#define QLC_PEX_DMA_READ_SIZE (PAGE_SIZE * 16)
@@ -497,7 +497,7 @@ struct qlcnic_hardware_context {
497497
u16 board_type;
498498
u16 supported_type;
499499

500-
u16 link_speed;
500+
u32 link_speed;
501501
u16 link_duplex;
502502
u16 link_autoneg;
503503
u16 module_type;
@@ -536,8 +536,6 @@ struct qlcnic_hardware_context {
536536
u8 extend_lb_time;
537537
u8 phys_port_id[ETH_ALEN];
538538
u8 lb_mode;
539-
u8 vxlan_port_count;
540-
u16 vxlan_port;
541539
struct device *hwmon_dev;
542540
u32 post_mode;
543541
bool run_post;
@@ -740,7 +738,7 @@ struct qlcnic_hostrq_rx_ctx {
740738
The following is packed:
741739
- N hostrq_rds_rings
742740
- N hostrq_sds_rings */
743-
char data[0];
741+
char data[];
744742
} __packed;
745743

746744
struct qlcnic_cardrsp_rds_ring{
@@ -769,7 +767,7 @@ struct qlcnic_cardrsp_rx_ctx {
769767
The following is packed:
770768
- N cardrsp_rds_rings
771769
- N cardrs_sds_rings */
772-
char data[0];
770+
char data[];
773771
} __packed;
774772

775773
#define SIZEOF_HOSTRQ_RX(HOSTRQ_RX, rds_rings, sds_rings) \
@@ -1026,9 +1024,6 @@ struct qlcnic_ipaddr {
10261024
#define QLCNIC_HAS_PHYS_PORT_ID 0x40000
10271025
#define QLCNIC_TSS_RSS 0x80000
10281026

1029-
#define QLCNIC_ADD_VXLAN_PORT 0x100000
1030-
#define QLCNIC_DEL_VXLAN_PORT 0x200000
1031-
10321027
#define QLCNIC_VLAN_FILTERING 0x800000
10331028

10341029
#define QLCNIC_IS_MSI_FAMILY(adapter) \
@@ -1700,6 +1695,8 @@ int qlcnic_init_pci_info(struct qlcnic_adapter *);
17001695
int qlcnic_set_default_offload_settings(struct qlcnic_adapter *);
17011696
int qlcnic_reset_npar_config(struct qlcnic_adapter *);
17021697
int qlcnic_set_eswitch_port_config(struct qlcnic_adapter *);
1698+
int qlcnic_set_vxlan_port(struct qlcnic_adapter *adapter, u16 port);
1699+
int qlcnic_set_vxlan_parsing(struct qlcnic_adapter *adapter, u16 port);
17031700
int qlcnic_83xx_configure_opmode(struct qlcnic_adapter *adapter);
17041701
int qlcnic_read_mac_addr(struct qlcnic_adapter *);
17051702
int qlcnic_setup_netdev(struct qlcnic_adapter *, struct net_device *, int);
@@ -1800,7 +1797,8 @@ struct qlcnic_hardware_ops {
18001797
int (*config_loopback) (struct qlcnic_adapter *, u8);
18011798
int (*clear_loopback) (struct qlcnic_adapter *, u8);
18021799
int (*config_promisc_mode) (struct qlcnic_adapter *, u32);
1803-
void (*change_l2_filter) (struct qlcnic_adapter *, u64 *, u16);
1800+
void (*change_l2_filter)(struct qlcnic_adapter *adapter, u64 *addr,
1801+
u16 vlan, struct qlcnic_host_tx_ring *tx_ring);
18041802
int (*get_board_info) (struct qlcnic_adapter *);
18051803
void (*set_mac_filter_count) (struct qlcnic_adapter *);
18061804
void (*free_mac_list) (struct qlcnic_adapter *);
@@ -1879,12 +1877,6 @@ static inline void qlcnic_write_crb(struct qlcnic_adapter *adapter, char *buf,
18791877
adapter->ahw->hw_ops->write_crb(adapter, buf, offset, size);
18801878
}
18811879

1882-
static inline int qlcnic_hw_write_wx_2M(struct qlcnic_adapter *adapter,
1883-
ulong off, u32 data)
1884-
{
1885-
return adapter->ahw->hw_ops->write_reg(adapter, off, data);
1886-
}
1887-
18881880
static inline int qlcnic_get_mac_address(struct qlcnic_adapter *adapter,
18891881
u8 *mac, u8 function)
18901882
{
@@ -2064,9 +2056,10 @@ static inline int qlcnic_nic_set_promisc(struct qlcnic_adapter *adapter,
20642056
}
20652057

20662058
static inline void qlcnic_change_filter(struct qlcnic_adapter *adapter,
2067-
u64 *addr, u16 id)
2059+
u64 *addr, u16 vlan,
2060+
struct qlcnic_host_tx_ring *tx_ring)
20682061
{
2069-
adapter->ahw->hw_ops->change_l2_filter(adapter, addr, id);
2062+
adapter->ahw->hw_ops->change_l2_filter(adapter, addr, vlan, tx_ring);
20702063
}
20712064

20722065
static inline int qlcnic_get_board_info(struct qlcnic_adapter *adapter)

qlcnic_83xx_hw.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2135,7 +2135,8 @@ int qlcnic_83xx_sre_macaddr_change(struct qlcnic_adapter *adapter, u8 *addr,
21352135
}
21362136

21372137
void qlcnic_83xx_change_l2_filter(struct qlcnic_adapter *adapter, u64 *addr,
2138-
u16 vlan_id)
2138+
u16 vlan_id,
2139+
struct qlcnic_host_tx_ring *tx_ring)
21392140
{
21402141
u8 mac[ETH_ALEN];
21412142
memcpy(&mac, addr, ETH_ALEN);
@@ -3650,7 +3651,7 @@ int qlcnic_83xx_interrupt_test(struct net_device *netdev)
36503651
ahw->diag_cnt = 0;
36513652
ret = qlcnic_alloc_mbx_args(&cmd, adapter, QLCNIC_CMD_INTRPT_TEST);
36523653
if (ret)
3653-
goto fail_diag_irq;
3654+
goto fail_mbx_args;
36543655

36553656
if (adapter->flags & QLCNIC_MSIX_ENABLED)
36563657
intrpt_id = ahw->intr_tbl[0].id;
@@ -3680,6 +3681,8 @@ int qlcnic_83xx_interrupt_test(struct net_device *netdev)
36803681

36813682
done:
36823683
qlcnic_free_mbx_args(&cmd);
3684+
3685+
fail_mbx_args:
36833686
qlcnic_83xx_diag_free_res(netdev, drv_sds_rings);
36843687

36853688
fail_diag_irq:

qlcnic_83xx_hw.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -550,7 +550,8 @@ int qlcnic_83xx_wrt_reg_indirect(struct qlcnic_adapter *, ulong, u32);
550550
int qlcnic_83xx_nic_set_promisc(struct qlcnic_adapter *, u32);
551551
int qlcnic_83xx_config_hw_lro(struct qlcnic_adapter *, int);
552552
int qlcnic_83xx_config_rss(struct qlcnic_adapter *, int);
553-
void qlcnic_83xx_change_l2_filter(struct qlcnic_adapter *, u64 *, u16);
553+
void qlcnic_83xx_change_l2_filter(struct qlcnic_adapter *adapter, u64 *addr,
554+
u16 vlan, struct qlcnic_host_tx_ring *ring);
554555
int qlcnic_83xx_get_pci_info(struct qlcnic_adapter *, struct qlcnic_pci_info *);
555556
int qlcnic_83xx_set_nic_info(struct qlcnic_adapter *, struct qlcnic_info *);
556557
void qlcnic_83xx_initialize_nic(struct qlcnic_adapter *, int);

qlcnic_83xx_init.c

Lines changed: 8 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1028,9 +1028,8 @@ static int qlcnic_83xx_idc_check_state_validity(struct qlcnic_adapter *adapter,
10281028
#define QLCNIC_ENABLE_INGRESS_ENCAP_PARSING 1
10291029
#define QLCNIC_DISABLE_INGRESS_ENCAP_PARSING 0
10301030

1031-
static int qlcnic_set_vxlan_port(struct qlcnic_adapter *adapter)
1031+
int qlcnic_set_vxlan_port(struct qlcnic_adapter *adapter, u16 port)
10321032
{
1033-
u16 port = adapter->ahw->vxlan_port;
10341033
struct qlcnic_cmd_args cmd;
10351034
int ret = 0;
10361035

@@ -1057,10 +1056,8 @@ static int qlcnic_set_vxlan_port(struct qlcnic_adapter *adapter)
10571056
return ret;
10581057
}
10591058

1060-
static int qlcnic_set_vxlan_parsing(struct qlcnic_adapter *adapter,
1061-
bool state)
1059+
int qlcnic_set_vxlan_parsing(struct qlcnic_adapter *adapter, u16 port)
10621060
{
1063-
u16 vxlan_port = adapter->ahw->vxlan_port;
10641061
struct qlcnic_cmd_args cmd;
10651062
int ret = 0;
10661063

@@ -1071,18 +1068,18 @@ static int qlcnic_set_vxlan_parsing(struct qlcnic_adapter *adapter,
10711068
if (ret)
10721069
return ret;
10731070

1074-
cmd.req.arg[1] = state ? QLCNIC_ENABLE_INGRESS_ENCAP_PARSING :
1075-
QLCNIC_DISABLE_INGRESS_ENCAP_PARSING;
1071+
cmd.req.arg[1] = port ? QLCNIC_ENABLE_INGRESS_ENCAP_PARSING :
1072+
QLCNIC_DISABLE_INGRESS_ENCAP_PARSING;
10761073

10771074
ret = qlcnic_issue_cmd(adapter, &cmd);
10781075
if (ret)
10791076
netdev_err(adapter->netdev,
10801077
"Failed to %s VXLAN parsing for port %d\n",
1081-
state ? "enable" : "disable", vxlan_port);
1078+
port ? "enable" : "disable", port);
10821079
else
10831080
netdev_info(adapter->netdev,
10841081
"%s VXLAN parsing for port %d\n",
1085-
state ? "Enabled" : "Disabled", vxlan_port);
1082+
port ? "Enabled" : "Disabled", port);
10861083

10871084
qlcnic_free_mbx_args(&cmd);
10881085

@@ -1093,22 +1090,6 @@ static void qlcnic_83xx_periodic_tasks(struct qlcnic_adapter *adapter)
10931090
{
10941091
if (adapter->fhash.fnum)
10951092
qlcnic_prune_lb_filters(adapter);
1096-
1097-
if (adapter->flags & QLCNIC_ADD_VXLAN_PORT) {
1098-
if (qlcnic_set_vxlan_port(adapter))
1099-
return;
1100-
1101-
if (qlcnic_set_vxlan_parsing(adapter, true))
1102-
return;
1103-
1104-
adapter->flags &= ~QLCNIC_ADD_VXLAN_PORT;
1105-
} else if (adapter->flags & QLCNIC_DEL_VXLAN_PORT) {
1106-
if (qlcnic_set_vxlan_parsing(adapter, false))
1107-
return;
1108-
1109-
adapter->ahw->vxlan_port = 0;
1110-
adapter->flags &= ~QLCNIC_DEL_VXLAN_PORT;
1111-
}
11121093
}
11131094

11141095
/**
@@ -1720,7 +1701,7 @@ static int qlcnic_83xx_get_reset_instruction_template(struct qlcnic_adapter *p_d
17201701

17211702
ahw->reset.seq_error = 0;
17221703
ahw->reset.buff = kzalloc(QLC_83XX_RESTART_TEMPLATE_SIZE, GFP_KERNEL);
1723-
if (p_dev->ahw->reset.buff == NULL)
1704+
if (ahw->reset.buff == NULL)
17241705
return -ENOMEM;
17251706

17261707
p_buff = p_dev->ahw->reset.buff;
@@ -2043,6 +2024,7 @@ static void qlcnic_83xx_exec_template_cmd(struct qlcnic_adapter *p_dev,
20432024
break;
20442025
}
20452026
entry += p_hdr->size;
2027+
cond_resched();
20462028
}
20472029
p_dev->ahw->reset.seq_index = index;
20482030
}

qlcnic_ctx.c

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -434,14 +434,14 @@ int qlcnic_82xx_fw_cmd_create_tx_ctx(struct qlcnic_adapter *adapter,
434434
*(tx_ring->hw_consumer) = 0;
435435

436436
rq_size = SIZEOF_HOSTRQ_TX(struct qlcnic_hostrq_tx_ctx);
437-
rq_addr = dma_zalloc_coherent(&adapter->pdev->dev, rq_size,
438-
&rq_phys_addr, GFP_KERNEL);
437+
rq_addr = dma_alloc_coherent(&adapter->pdev->dev, rq_size,
438+
&rq_phys_addr, GFP_KERNEL);
439439
if (!rq_addr)
440440
return -ENOMEM;
441441

442442
rsp_size = SIZEOF_CARDRSP_TX(struct qlcnic_cardrsp_tx_ctx);
443-
rsp_addr = dma_zalloc_coherent(&adapter->pdev->dev, rsp_size,
444-
&rsp_phys_addr, GFP_KERNEL);
443+
rsp_addr = dma_alloc_coherent(&adapter->pdev->dev, rsp_size,
444+
&rsp_phys_addr, GFP_KERNEL);
445445
if (!rsp_addr) {
446446
err = -ENOMEM;
447447
goto out_free_rq;
@@ -855,8 +855,8 @@ int qlcnic_82xx_get_nic_info(struct qlcnic_adapter *adapter,
855855
struct qlcnic_cmd_args cmd;
856856
size_t nic_size = sizeof(struct qlcnic_info_le);
857857

858-
nic_info_addr = dma_zalloc_coherent(&adapter->pdev->dev, nic_size,
859-
&nic_dma_t, GFP_KERNEL);
858+
nic_info_addr = dma_alloc_coherent(&adapter->pdev->dev, nic_size,
859+
&nic_dma_t, GFP_KERNEL);
860860
if (!nic_info_addr)
861861
return -ENOMEM;
862862

@@ -909,8 +909,8 @@ int qlcnic_82xx_set_nic_info(struct qlcnic_adapter *adapter,
909909
if (adapter->ahw->op_mode != QLCNIC_MGMT_FUNC)
910910
return err;
911911

912-
nic_info_addr = dma_zalloc_coherent(&adapter->pdev->dev, nic_size,
913-
&nic_dma_t, GFP_KERNEL);
912+
nic_info_addr = dma_alloc_coherent(&adapter->pdev->dev, nic_size,
913+
&nic_dma_t, GFP_KERNEL);
914914
if (!nic_info_addr)
915915
return -ENOMEM;
916916

@@ -964,8 +964,8 @@ int qlcnic_82xx_get_pci_info(struct qlcnic_adapter *adapter,
964964
void *pci_info_addr;
965965
int err = 0, i;
966966

967-
pci_info_addr = dma_zalloc_coherent(&adapter->pdev->dev, pci_size,
968-
&pci_info_dma_t, GFP_KERNEL);
967+
pci_info_addr = dma_alloc_coherent(&adapter->pdev->dev, pci_size,
968+
&pci_info_dma_t, GFP_KERNEL);
969969
if (!pci_info_addr)
970970
return -ENOMEM;
971971

@@ -1078,8 +1078,8 @@ int qlcnic_get_port_stats(struct qlcnic_adapter *adapter, const u8 func,
10781078
return -EIO;
10791079
}
10801080

1081-
stats_addr = dma_zalloc_coherent(&adapter->pdev->dev, stats_size,
1082-
&stats_dma_t, GFP_KERNEL);
1081+
stats_addr = dma_alloc_coherent(&adapter->pdev->dev, stats_size,
1082+
&stats_dma_t, GFP_KERNEL);
10831083
if (!stats_addr)
10841084
return -ENOMEM;
10851085

@@ -1134,8 +1134,8 @@ int qlcnic_get_mac_stats(struct qlcnic_adapter *adapter,
11341134
if (mac_stats == NULL)
11351135
return -ENOMEM;
11361136

1137-
stats_addr = dma_zalloc_coherent(&adapter->pdev->dev, stats_size,
1138-
&stats_dma_t, GFP_KERNEL);
1137+
stats_addr = dma_alloc_coherent(&adapter->pdev->dev, stats_size,
1138+
&stats_dma_t, GFP_KERNEL);
11391139
if (!stats_addr)
11401140
return -ENOMEM;
11411141

qlcnic_dcb.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -883,7 +883,7 @@ static u8 qlcnic_dcb_get_capability(struct net_device *netdev, int capid,
883883
struct qlcnic_adapter *adapter = netdev_priv(netdev);
884884

885885
if (!test_bit(QLCNIC_DCB_STATE, &adapter->dcb->state))
886-
return 0;
886+
return 1;
887887

888888
switch (capid) {
889889
case DCB_CAP_ATTR_PG:

qlcnic_ethtool.c

Lines changed: 10 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ struct qlcnic_stats {
2020
int stat_offset;
2121
};
2222

23-
#define QLC_SIZEOF(m) FIELD_SIZEOF(struct qlcnic_adapter, m)
23+
#define QLC_SIZEOF(m) sizeof_field(struct qlcnic_adapter, m)
2424
#define QLC_OFF(m) offsetof(struct qlcnic_adapter, m)
2525
static const u32 qlcnic_fw_dump_level[] = {
2626
0x3, 0x7, 0xf, 0x1f, 0x3f, 0x7f, 0xff
@@ -351,9 +351,9 @@ static int qlcnic_82xx_get_link_ksettings(struct qlcnic_adapter *adapter,
351351
case QLCNIC_BRDTYPE_P3P_REF_QG:
352352
case QLCNIC_BRDTYPE_P3P_4_GB:
353353
case QLCNIC_BRDTYPE_P3P_4_GB_MM:
354-
355354
supported |= SUPPORTED_Autoneg;
356355
advertising |= ADVERTISED_Autoneg;
356+
fallthrough;
357357
case QLCNIC_BRDTYPE_P3P_10G_CX4:
358358
case QLCNIC_BRDTYPE_P3P_10G_CX4_LP:
359359
case QLCNIC_BRDTYPE_P3P_10000_BASE_T:
@@ -377,6 +377,7 @@ static int qlcnic_82xx_get_link_ksettings(struct qlcnic_adapter *adapter,
377377
supported |= SUPPORTED_TP;
378378
check_sfp_module = netif_running(adapter->netdev) &&
379379
ahw->has_link_events;
380+
fallthrough;
380381
case QLCNIC_BRDTYPE_P3P_10G_XFP:
381382
supported |= SUPPORTED_FIBRE;
382383
advertising |= ADVERTISED_FIBRE;
@@ -1047,6 +1048,8 @@ int qlcnic_do_lb_test(struct qlcnic_adapter *adapter, u8 mode)
10471048

10481049
for (i = 0; i < QLCNIC_NUM_ILB_PKT; i++) {
10491050
skb = netdev_alloc_skb(adapter->netdev, QLCNIC_ILB_PKT_SIZE);
1051+
if (!skb)
1052+
break;
10501053
qlcnic_create_loopback_buff(skb->data, adapter->mac_addr);
10511054
skb_put(skb, QLCNIC_ILB_PKT_SIZE);
10521055
adapter->ahw->diag_cnt = 0;
@@ -1539,24 +1542,7 @@ static int qlcnic_set_intr_coalesce(struct net_device *netdev,
15391542
if (ethcoal->rx_coalesce_usecs > 0xffff ||
15401543
ethcoal->rx_max_coalesced_frames > 0xffff ||
15411544
ethcoal->tx_coalesce_usecs > 0xffff ||
1542-
ethcoal->tx_max_coalesced_frames > 0xffff ||
1543-
ethcoal->rx_coalesce_usecs_irq ||
1544-
ethcoal->rx_max_coalesced_frames_irq ||
1545-
ethcoal->tx_coalesce_usecs_irq ||
1546-
ethcoal->tx_max_coalesced_frames_irq ||
1547-
ethcoal->stats_block_coalesce_usecs ||
1548-
ethcoal->use_adaptive_rx_coalesce ||
1549-
ethcoal->use_adaptive_tx_coalesce ||
1550-
ethcoal->pkt_rate_low ||
1551-
ethcoal->rx_coalesce_usecs_low ||
1552-
ethcoal->rx_max_coalesced_frames_low ||
1553-
ethcoal->tx_coalesce_usecs_low ||
1554-
ethcoal->tx_max_coalesced_frames_low ||
1555-
ethcoal->pkt_rate_high ||
1556-
ethcoal->rx_coalesce_usecs_high ||
1557-
ethcoal->rx_max_coalesced_frames_high ||
1558-
ethcoal->tx_coalesce_usecs_high ||
1559-
ethcoal->tx_max_coalesced_frames_high)
1545+
ethcoal->tx_max_coalesced_frames > 0xffff)
15601546
return -EINVAL;
15611547

15621548
err = qlcnic_config_intr_coalesce(adapter, ethcoal);
@@ -1831,6 +1817,8 @@ qlcnic_set_dump(struct net_device *netdev, struct ethtool_dump *val)
18311817
}
18321818

18331819
const struct ethtool_ops qlcnic_ethtool_ops = {
1820+
.supported_coalesce_params = ETHTOOL_COALESCE_USECS |
1821+
ETHTOOL_COALESCE_MAX_FRAMES,
18341822
.get_drvinfo = qlcnic_get_drvinfo,
18351823
.get_regs_len = qlcnic_get_regs_len,
18361824
.get_regs = qlcnic_get_regs,
@@ -1862,6 +1850,8 @@ const struct ethtool_ops qlcnic_ethtool_ops = {
18621850
};
18631851

18641852
const struct ethtool_ops qlcnic_sriov_vf_ethtool_ops = {
1853+
.supported_coalesce_params = ETHTOOL_COALESCE_USECS |
1854+
ETHTOOL_COALESCE_MAX_FRAMES,
18651855
.get_drvinfo = qlcnic_get_drvinfo,
18661856
.get_regs_len = qlcnic_get_regs_len,
18671857
.get_regs = qlcnic_get_regs,

0 commit comments

Comments
 (0)