Skip to content

Commit ff42418

Browse files
anambiarinJeff Kirsher
authored andcommitted
i40e: Add macro for PF reset bit
Introduce a macro for the bit setting the PF reset flag and update its usages. This makes it easier to use this flag in functions to be introduced in future without encountering checkpatch issues related to alignment and line over 80 characters. Signed-off-by: Amritha Nambiar <[email protected]> Tested-by: Andrew Bowers <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
1 parent 4e8b86c commit ff42418

File tree

4 files changed

+9
-10
lines changed

4 files changed

+9
-10
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,8 @@ enum i40e_state_t {
157157
__I40E_STATE_SIZE__,
158158
};
159159

160+
#define I40E_PF_RESET_FLAG BIT_ULL(__I40E_PF_RESET_REQUESTED)
161+
160162
/* VSI state flags */
161163
enum i40e_vsi_state_t {
162164
__I40E_VSI_DOWN,

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -798,8 +798,7 @@ static ssize_t i40e_dbg_command_write(struct file *filp,
798798
*/
799799
if (!(pf->flags & I40E_FLAG_VEB_MODE_ENABLED)) {
800800
pf->flags |= I40E_FLAG_VEB_MODE_ENABLED;
801-
i40e_do_reset_safe(pf,
802-
BIT_ULL(__I40E_PF_RESET_REQUESTED));
801+
i40e_do_reset_safe(pf, I40E_PF_RESET_FLAG);
803802
}
804803

805804
vsi = i40e_vsi_setup(pf, I40E_VSI_VMDQ2, vsi_seid, 0);

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

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5747,7 +5747,7 @@ int i40e_vsi_open(struct i40e_vsi *vsi)
57475747
err_setup_tx:
57485748
i40e_vsi_free_tx_resources(vsi);
57495749
if (vsi == pf->vsi[pf->lan_vsi])
5750-
i40e_do_reset(pf, BIT_ULL(__I40E_PF_RESET_REQUESTED), true);
5750+
i40e_do_reset(pf, I40E_PF_RESET_FLAG, true);
57515751

57525752
return err;
57535753
}
@@ -5875,7 +5875,7 @@ void i40e_do_reset(struct i40e_pf *pf, u32 reset_flags, bool lock_acquired)
58755875
wr32(&pf->hw, I40E_GLGEN_RTRIG, val);
58765876
i40e_flush(&pf->hw);
58775877

5878-
} else if (reset_flags & BIT_ULL(__I40E_PF_RESET_REQUESTED)) {
5878+
} else if (reset_flags & I40E_PF_RESET_FLAG) {
58795879

58805880
/* Request a PF Reset
58815881
*
@@ -9223,7 +9223,7 @@ static int i40e_set_features(struct net_device *netdev,
92239223
need_reset = i40e_set_ntuple(pf, features);
92249224

92259225
if (need_reset)
9226-
i40e_do_reset(pf, BIT_ULL(__I40E_PF_RESET_REQUESTED), true);
9226+
i40e_do_reset(pf, I40E_PF_RESET_FLAG, true);
92279227

92289228
return 0;
92299229
}
@@ -9475,8 +9475,7 @@ static int i40e_ndo_bridge_setlink(struct net_device *dev,
94759475
pf->flags |= I40E_FLAG_VEB_MODE_ENABLED;
94769476
else
94779477
pf->flags &= ~I40E_FLAG_VEB_MODE_ENABLED;
9478-
i40e_do_reset(pf, BIT_ULL(__I40E_PF_RESET_REQUESTED),
9479-
true);
9478+
i40e_do_reset(pf, I40E_PF_RESET_FLAG, true);
94809479
break;
94819480
}
94829481
}

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1425,16 +1425,15 @@ int i40e_pci_sriov_configure(struct pci_dev *pdev, int num_vfs)
14251425
if (num_vfs) {
14261426
if (!(pf->flags & I40E_FLAG_VEB_MODE_ENABLED)) {
14271427
pf->flags |= I40E_FLAG_VEB_MODE_ENABLED;
1428-
i40e_do_reset_safe(pf,
1429-
BIT_ULL(__I40E_PF_RESET_REQUESTED));
1428+
i40e_do_reset_safe(pf, I40E_PF_RESET_FLAG);
14301429
}
14311430
return i40e_pci_sriov_enable(pdev, num_vfs);
14321431
}
14331432

14341433
if (!pci_vfs_assigned(pf->pdev)) {
14351434
i40e_free_vfs(pf);
14361435
pf->flags &= ~I40E_FLAG_VEB_MODE_ENABLED;
1437-
i40e_do_reset_safe(pf, BIT_ULL(__I40E_PF_RESET_REQUESTED));
1436+
i40e_do_reset_safe(pf, I40E_PF_RESET_FLAG);
14381437
} else {
14391438
dev_warn(&pdev->dev, "Unable to free VFs because some are assigned to VMs.\n");
14401439
return -EINVAL;

0 commit comments

Comments
 (0)