Skip to content

Commit 0605c45

Browse files
jacob-kellerJeff Kirsher
authored andcommitted
i40e: move I40E_FLAG_TEMP_LINK_POLLING to state field
This flag is modified outside of the RTNL lock and thus should not be part of the pf->flags variable. Use a state bit instead, so that we can use atomic bit operations. This is part of a larger effort to remove cmpxchg64 in i40e_set_priv_flags() Signed-off-by: Jacob Keller <jacob.e.keller@intel.com> Tested-by: Andrew Bowers <andrewx.bowers@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
1 parent 134201a commit 0605c45

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,7 @@ enum i40e_state_t {
166166
__I40E_VF_DISABLE,
167167
__I40E_MACVLAN_SYNC_PENDING,
168168
__I40E_UDP_FILTER_SYNC_PENDING,
169+
__I40E_TEMP_LINK_POLLING,
169170
/* This must be last as it determines the size of the BITMAP */
170171
__I40E_STATE_SIZE__,
171172
};
@@ -534,7 +535,7 @@ struct i40e_pf {
534535
#define I40E_FLAG_VEB_STATS_ENABLED BIT_ULL(17)
535536
#define I40E_FLAG_LINK_POLLING_ENABLED BIT_ULL(18)
536537
#define I40E_FLAG_TRUE_PROMISC_SUPPORT BIT_ULL(19)
537-
#define I40E_FLAG_TEMP_LINK_POLLING BIT_ULL(20)
538+
/* Gap for BIT_ULL(20) */
538539
#define I40E_FLAG_LEGACY_RX BIT_ULL(21)
539540
#define I40E_FLAG_PTP BIT_ULL(22)
540541
#define I40E_FLAG_IWARP_ENABLED BIT_ULL(23)

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

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8432,13 +8432,12 @@ static void i40e_link_event(struct i40e_pf *pf)
84328432

84338433
/* On success, disable temp link polling */
84348434
if (status == I40E_SUCCESS) {
8435-
if (pf->flags & I40E_FLAG_TEMP_LINK_POLLING)
8436-
pf->flags &= ~I40E_FLAG_TEMP_LINK_POLLING;
8435+
clear_bit(__I40E_TEMP_LINK_POLLING, pf->state);
84378436
} else {
84388437
/* Enable link polling temporarily until i40e_get_link_status
84398438
* returns I40E_SUCCESS
84408439
*/
8441-
pf->flags |= I40E_FLAG_TEMP_LINK_POLLING;
8440+
set_bit(__I40E_TEMP_LINK_POLLING, pf->state);
84428441
dev_dbg(&pf->pdev->dev, "couldn't get link state, status: %d\n",
84438442
status);
84448443
return;
@@ -8490,7 +8489,7 @@ static void i40e_watchdog_subtask(struct i40e_pf *pf)
84908489
pf->service_timer_previous = jiffies;
84918490

84928491
if ((pf->flags & I40E_FLAG_LINK_POLLING_ENABLED) ||
8493-
(pf->flags & I40E_FLAG_TEMP_LINK_POLLING))
8492+
test_bit(__I40E_TEMP_LINK_POLLING, pf->state))
84948493
i40e_link_event(pf);
84958494

84968495
/* Update the stats for active netdevs so the network stack

0 commit comments

Comments
 (0)