Skip to content

Commit 75887e8

Browse files
committed
Merge branch '40GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/net-queue
Tony Nguyen says: ==================== Intel Wired LAN Driver Updates 2021-03-25 This series contains updates to virtchnl header file and i40e driver. Norbert removes added padding from virtchnl RSS structures as this causes issues when iterating over the arrays. Mateusz adds Asym_Pause as supported to allow these settings to be set as the hardware supports it. Eryk fixes an issue where encountering a VF reset alongside releasing VFs could cause a call trace. Arkadiusz moves TC setup before resource setup as previously it was possible to enter with a null q_vector causing a kernel oops. ==================== Signed-off-by: David S. Miller <[email protected]>
2 parents 3a87571 + f2916ae commit 75887e8

File tree

5 files changed

+16
-8
lines changed

5 files changed

+16
-8
lines changed

drivers/net/ethernet/intel/i40e/i40e.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@ enum i40e_state_t {
142142
__I40E_VIRTCHNL_OP_PENDING,
143143
__I40E_RECOVERY_MODE,
144144
__I40E_VF_RESETS_DISABLED, /* disable resets during i40e_remove */
145+
__I40E_VFS_RELEASING,
145146
/* This must be last as it determines the size of the BITMAP */
146147
__I40E_STATE_SIZE__,
147148
};

drivers/net/ethernet/intel/i40e/i40e_ethtool.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1101,6 +1101,7 @@ static int i40e_get_link_ksettings(struct net_device *netdev,
11011101

11021102
/* Set flow control settings */
11031103
ethtool_link_ksettings_add_link_mode(ks, supported, Pause);
1104+
ethtool_link_ksettings_add_link_mode(ks, supported, Asym_Pause);
11041105

11051106
switch (hw->fc.requested_mode) {
11061107
case I40E_FC_FULL:

drivers/net/ethernet/intel/i40e/i40e_main.c

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10573,12 +10573,6 @@ static void i40e_rebuild(struct i40e_pf *pf, bool reinit, bool lock_acquired)
1057310573
goto end_core_reset;
1057410574
}
1057510575

10576-
if (!lock_acquired)
10577-
rtnl_lock();
10578-
ret = i40e_setup_pf_switch(pf, reinit);
10579-
if (ret)
10580-
goto end_unlock;
10581-
1058210576
#ifdef CONFIG_I40E_DCB
1058310577
/* Enable FW to write a default DCB config on link-up
1058410578
* unless I40E_FLAG_TC_MQPRIO was enabled or DCB
@@ -10607,6 +10601,11 @@ static void i40e_rebuild(struct i40e_pf *pf, bool reinit, bool lock_acquired)
1060710601
}
1060810602

1060910603
#endif /* CONFIG_I40E_DCB */
10604+
if (!lock_acquired)
10605+
rtnl_lock();
10606+
ret = i40e_setup_pf_switch(pf, reinit);
10607+
if (ret)
10608+
goto end_unlock;
1061010609

1061110610
/* The driver only wants link up/down and module qualification
1061210611
* reports from firmware. Note the negative logic.

drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,7 @@ void i40e_vc_notify_vf_reset(struct i40e_vf *vf)
137137
**/
138138
static inline void i40e_vc_disable_vf(struct i40e_vf *vf)
139139
{
140+
struct i40e_pf *pf = vf->pf;
140141
int i;
141142

142143
i40e_vc_notify_vf_reset(vf);
@@ -147,6 +148,11 @@ static inline void i40e_vc_disable_vf(struct i40e_vf *vf)
147148
* ensure a reset.
148149
*/
149150
for (i = 0; i < 20; i++) {
151+
/* If PF is in VFs releasing state reset VF is impossible,
152+
* so leave it.
153+
*/
154+
if (test_bit(__I40E_VFS_RELEASING, pf->state))
155+
return;
150156
if (i40e_reset_vf(vf, false))
151157
return;
152158
usleep_range(10000, 20000);
@@ -1574,6 +1580,8 @@ void i40e_free_vfs(struct i40e_pf *pf)
15741580

15751581
if (!pf->vf)
15761582
return;
1583+
1584+
set_bit(__I40E_VFS_RELEASING, pf->state);
15771585
while (test_and_set_bit(__I40E_VF_DISABLE, pf->state))
15781586
usleep_range(1000, 2000);
15791587

@@ -1631,6 +1639,7 @@ void i40e_free_vfs(struct i40e_pf *pf)
16311639
}
16321640
}
16331641
clear_bit(__I40E_VF_DISABLE, pf->state);
1642+
clear_bit(__I40E_VFS_RELEASING, pf->state);
16341643
}
16351644

16361645
#ifdef CONFIG_PCI_IOV

include/linux/avf/virtchnl.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -476,7 +476,6 @@ struct virtchnl_rss_key {
476476
u16 vsi_id;
477477
u16 key_len;
478478
u8 key[1]; /* RSS hash key, packed bytes */
479-
u8 pad[1];
480479
};
481480

482481
VIRTCHNL_CHECK_STRUCT_LEN(6, virtchnl_rss_key);
@@ -485,7 +484,6 @@ struct virtchnl_rss_lut {
485484
u16 vsi_id;
486485
u16 lut_entries;
487486
u8 lut[1]; /* RSS lookup table */
488-
u8 pad[1];
489487
};
490488

491489
VIRTCHNL_CHECK_STRUCT_LEN(6, virtchnl_rss_lut);

0 commit comments

Comments
 (0)