Skip to content

Commit abe2f12

Browse files
committed
Merge branch '100GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/net-queue
Tony Nguyen says: ==================== Intel Wired LAN Driver Updates 2020-09-25 This series contains updates to the iavf and ice driver. Sylwester fixes a crash with iavf resume due to getting the wrong pointers. Ani fixes a call trace in ice resume by calling pci_save_state(). Jakes fixes memory leaks in case of register_netdev() failure or ice_cfg_vsi_lan() failure for the ice driver. v2: Rebased; no other changes ==================== Signed-off-by: David S. Miller <[email protected]>
2 parents 4e1b469 + f6a0727 commit abe2f12

File tree

4 files changed

+22
-22
lines changed

4 files changed

+22
-22
lines changed

drivers/net/ethernet/intel/iavf/iavf_main.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3806,8 +3806,8 @@ static int __maybe_unused iavf_suspend(struct device *dev_d)
38063806
static int __maybe_unused iavf_resume(struct device *dev_d)
38073807
{
38083808
struct pci_dev *pdev = to_pci_dev(dev_d);
3809-
struct iavf_adapter *adapter = pci_get_drvdata(pdev);
3810-
struct net_device *netdev = adapter->netdev;
3809+
struct net_device *netdev = pci_get_drvdata(pdev);
3810+
struct iavf_adapter *adapter = netdev_priv(netdev);
38113811
u32 err;
38123812

38133813
pci_set_master(pdev);

drivers/net/ethernet/intel/ice/ice_lib.c

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ static int ice_get_free_slot(void *array, int size, int curr)
246246
* ice_vsi_delete - delete a VSI from the switch
247247
* @vsi: pointer to VSI being removed
248248
*/
249-
void ice_vsi_delete(struct ice_vsi *vsi)
249+
static void ice_vsi_delete(struct ice_vsi *vsi)
250250
{
251251
struct ice_pf *pf = vsi->back;
252252
struct ice_vsi_ctx *ctxt;
@@ -313,7 +313,7 @@ static void ice_vsi_free_arrays(struct ice_vsi *vsi)
313313
*
314314
* Returns 0 on success, negative on failure
315315
*/
316-
int ice_vsi_clear(struct ice_vsi *vsi)
316+
static int ice_vsi_clear(struct ice_vsi *vsi)
317317
{
318318
struct ice_pf *pf = NULL;
319319
struct device *dev;
@@ -563,7 +563,7 @@ static int ice_vsi_get_qs(struct ice_vsi *vsi)
563563
* ice_vsi_put_qs - Release queues from VSI to PF
564564
* @vsi: the VSI that is going to release queues
565565
*/
566-
void ice_vsi_put_qs(struct ice_vsi *vsi)
566+
static void ice_vsi_put_qs(struct ice_vsi *vsi)
567567
{
568568
struct ice_pf *pf = vsi->back;
569569
int i;
@@ -1196,6 +1196,18 @@ static void ice_vsi_clear_rings(struct ice_vsi *vsi)
11961196
{
11971197
int i;
11981198

1199+
/* Avoid stale references by clearing map from vector to ring */
1200+
if (vsi->q_vectors) {
1201+
ice_for_each_q_vector(vsi, i) {
1202+
struct ice_q_vector *q_vector = vsi->q_vectors[i];
1203+
1204+
if (q_vector) {
1205+
q_vector->tx.ring = NULL;
1206+
q_vector->rx.ring = NULL;
1207+
}
1208+
}
1209+
}
1210+
11991211
if (vsi->tx_rings) {
12001212
for (i = 0; i < vsi->alloc_txq; i++) {
12011213
if (vsi->tx_rings[i]) {
@@ -2291,7 +2303,7 @@ ice_vsi_setup(struct ice_pf *pf, struct ice_port_info *pi,
22912303
if (status) {
22922304
dev_err(dev, "VSI %d failed lan queue config, error %s\n",
22932305
vsi->vsi_num, ice_stat_str(status));
2294-
goto unroll_vector_base;
2306+
goto unroll_clear_rings;
22952307
}
22962308

22972309
/* Add switch rule to drop all Tx Flow Control Frames, of look up

drivers/net/ethernet/intel/ice/ice_lib.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,6 @@ int ice_cfg_vlan_pruning(struct ice_vsi *vsi, bool ena, bool vlan_promisc);
4545

4646
void ice_cfg_sw_lldp(struct ice_vsi *vsi, bool tx, bool create);
4747

48-
void ice_vsi_delete(struct ice_vsi *vsi);
49-
50-
int ice_vsi_clear(struct ice_vsi *vsi);
51-
5248
#ifdef CONFIG_DCB
5349
int ice_vsi_cfg_tc(struct ice_vsi *vsi, u8 ena_tc);
5450
#endif /* CONFIG_DCB */
@@ -79,8 +75,6 @@ bool ice_is_reset_in_progress(unsigned long *state);
7975
void
8076
ice_write_qrxflxp_cntxt(struct ice_hw *hw, u16 pf_q, u32 rxdid, u32 prio);
8177

82-
void ice_vsi_put_qs(struct ice_vsi *vsi);
83-
8478
void ice_vsi_dis_irq(struct ice_vsi *vsi);
8579

8680
void ice_vsi_free_irq(struct ice_vsi *vsi);

drivers/net/ethernet/intel/ice/ice_main.c

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3169,10 +3169,8 @@ static int ice_setup_pf_sw(struct ice_pf *pf)
31693169
return -EBUSY;
31703170

31713171
vsi = ice_pf_vsi_setup(pf, pf->hw.port_info);
3172-
if (!vsi) {
3173-
status = -ENOMEM;
3174-
goto unroll_vsi_setup;
3175-
}
3172+
if (!vsi)
3173+
return -ENOMEM;
31763174

31773175
status = ice_cfg_netdev(vsi);
31783176
if (status) {
@@ -3219,12 +3217,7 @@ static int ice_setup_pf_sw(struct ice_pf *pf)
32193217
}
32203218

32213219
unroll_vsi_setup:
3222-
if (vsi) {
3223-
ice_vsi_free_q_vectors(vsi);
3224-
ice_vsi_delete(vsi);
3225-
ice_vsi_put_qs(vsi);
3226-
ice_vsi_clear(vsi);
3227-
}
3220+
ice_vsi_release(vsi);
32283221
return status;
32293222
}
32303223

@@ -4522,6 +4515,7 @@ static int __maybe_unused ice_suspend(struct device *dev)
45224515
}
45234516
ice_clear_interrupt_scheme(pf);
45244517

4518+
pci_save_state(pdev);
45254519
pci_wake_from_d3(pdev, pf->wol_ena);
45264520
pci_set_power_state(pdev, PCI_D3hot);
45274521
return 0;

0 commit comments

Comments
 (0)