Skip to content

Commit a324484

Browse files
Dr. David Alan Gilbertkuba-moo
authored andcommitted
i40e: Remove unused i40e_commit_partition_bw_setting
i40e_commit_partition_bw_setting() was added in 2017 by commit 4fc8c67 ("i40e: genericize the partition bandwidth control") but hasn't been used. Remove it. Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org> Reviewed-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com> Reviewed-by: Tony Nguyen <anthony.l.nguyen@intel.com> Link: https://patch.msgid.link/20250102173717.200359-8-linux@treblig.org Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent 38dfb07 commit a324484

File tree

2 files changed

+0
-84
lines changed

2 files changed

+0
-84
lines changed

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1311,7 +1311,6 @@ int i40e_update_adq_vsi_queues(struct i40e_vsi *vsi, int vsi_offset);
13111311
int i40e_is_vsi_uplink_mode_veb(struct i40e_vsi *vsi);
13121312
int i40e_get_partition_bw_setting(struct i40e_pf *pf);
13131313
int i40e_set_partition_bw_setting(struct i40e_pf *pf);
1314-
int i40e_commit_partition_bw_setting(struct i40e_pf *pf);
13151314
void i40e_print_link_message(struct i40e_vsi *vsi, bool isup);
13161315

13171316
void i40e_set_fec_in_flags(u8 fec_cfg, unsigned long *flags);

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

Lines changed: 0 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -12576,89 +12576,6 @@ int i40e_set_partition_bw_setting(struct i40e_pf *pf)
1257612576
return status;
1257712577
}
1257812578

12579-
/**
12580-
* i40e_commit_partition_bw_setting - Commit BW settings for this PF partition
12581-
* @pf: board private structure
12582-
**/
12583-
int i40e_commit_partition_bw_setting(struct i40e_pf *pf)
12584-
{
12585-
/* Commit temporary BW setting to permanent NVM image */
12586-
enum i40e_admin_queue_err last_aq_status;
12587-
u16 nvm_word;
12588-
int ret;
12589-
12590-
if (pf->hw.partition_id != 1) {
12591-
dev_info(&pf->pdev->dev,
12592-
"Commit BW only works on partition 1! This is partition %d",
12593-
pf->hw.partition_id);
12594-
ret = -EOPNOTSUPP;
12595-
goto bw_commit_out;
12596-
}
12597-
12598-
/* Acquire NVM for read access */
12599-
ret = i40e_acquire_nvm(&pf->hw, I40E_RESOURCE_READ);
12600-
last_aq_status = pf->hw.aq.asq_last_status;
12601-
if (ret) {
12602-
dev_info(&pf->pdev->dev,
12603-
"Cannot acquire NVM for read access, err %pe aq_err %s\n",
12604-
ERR_PTR(ret),
12605-
i40e_aq_str(&pf->hw, last_aq_status));
12606-
goto bw_commit_out;
12607-
}
12608-
12609-
/* Read word 0x10 of NVM - SW compatibility word 1 */
12610-
ret = i40e_aq_read_nvm(&pf->hw,
12611-
I40E_SR_NVM_CONTROL_WORD,
12612-
0x10, sizeof(nvm_word), &nvm_word,
12613-
false, NULL);
12614-
/* Save off last admin queue command status before releasing
12615-
* the NVM
12616-
*/
12617-
last_aq_status = pf->hw.aq.asq_last_status;
12618-
i40e_release_nvm(&pf->hw);
12619-
if (ret) {
12620-
dev_info(&pf->pdev->dev, "NVM read error, err %pe aq_err %s\n",
12621-
ERR_PTR(ret),
12622-
i40e_aq_str(&pf->hw, last_aq_status));
12623-
goto bw_commit_out;
12624-
}
12625-
12626-
/* Wait a bit for NVM release to complete */
12627-
msleep(50);
12628-
12629-
/* Acquire NVM for write access */
12630-
ret = i40e_acquire_nvm(&pf->hw, I40E_RESOURCE_WRITE);
12631-
last_aq_status = pf->hw.aq.asq_last_status;
12632-
if (ret) {
12633-
dev_info(&pf->pdev->dev,
12634-
"Cannot acquire NVM for write access, err %pe aq_err %s\n",
12635-
ERR_PTR(ret),
12636-
i40e_aq_str(&pf->hw, last_aq_status));
12637-
goto bw_commit_out;
12638-
}
12639-
/* Write it back out unchanged to initiate update NVM,
12640-
* which will force a write of the shadow (alt) RAM to
12641-
* the NVM - thus storing the bandwidth values permanently.
12642-
*/
12643-
ret = i40e_aq_update_nvm(&pf->hw,
12644-
I40E_SR_NVM_CONTROL_WORD,
12645-
0x10, sizeof(nvm_word),
12646-
&nvm_word, true, 0, NULL);
12647-
/* Save off last admin queue command status before releasing
12648-
* the NVM
12649-
*/
12650-
last_aq_status = pf->hw.aq.asq_last_status;
12651-
i40e_release_nvm(&pf->hw);
12652-
if (ret)
12653-
dev_info(&pf->pdev->dev,
12654-
"BW settings NOT SAVED, err %pe aq_err %s\n",
12655-
ERR_PTR(ret),
12656-
i40e_aq_str(&pf->hw, last_aq_status));
12657-
bw_commit_out:
12658-
12659-
return ret;
12660-
}
12661-
1266212579
/**
1266312580
* i40e_is_total_port_shutdown_enabled - read NVM and return value
1266412581
* if total port shutdown feature is enabled for this PF

0 commit comments

Comments
 (0)