Skip to content

Commit 6814b59

Browse files
321lipengdavem330
authored andcommitted
net: hns3: code optimization for command queue' spin lock
This patch removes some redundant BH disable when initializing and uninitializing command queue. Signed-off-by: Peng Li <[email protected]> Signed-off-by: Huazhong Tan <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent cc5ff6e commit 6814b59

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@ int hclge_cmd_init(struct hclge_dev *hdev)
355355
int ret;
356356

357357
spin_lock_bh(&hdev->hw.cmq.csq.lock);
358-
spin_lock_bh(&hdev->hw.cmq.crq.lock);
358+
spin_lock(&hdev->hw.cmq.crq.lock);
359359

360360
hdev->hw.cmq.csq.next_to_clean = 0;
361361
hdev->hw.cmq.csq.next_to_use = 0;
@@ -364,7 +364,7 @@ int hclge_cmd_init(struct hclge_dev *hdev)
364364

365365
hclge_cmd_init_regs(&hdev->hw);
366366

367-
spin_unlock_bh(&hdev->hw.cmq.crq.lock);
367+
spin_unlock(&hdev->hw.cmq.crq.lock);
368368
spin_unlock_bh(&hdev->hw.cmq.csq.lock);
369369

370370
clear_bit(HCLGE_STATE_CMD_DISABLE, &hdev->state);

drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_cmd.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ int hclgevf_cmd_init(struct hclgevf_dev *hdev)
334334
int ret;
335335

336336
spin_lock_bh(&hdev->hw.cmq.csq.lock);
337-
spin_lock_bh(&hdev->hw.cmq.crq.lock);
337+
spin_lock(&hdev->hw.cmq.crq.lock);
338338

339339
/* initialize the pointers of async rx queue of mailbox */
340340
hdev->arq.hdev = hdev;
@@ -348,7 +348,7 @@ int hclgevf_cmd_init(struct hclgevf_dev *hdev)
348348

349349
hclgevf_cmd_init_regs(&hdev->hw);
350350

351-
spin_unlock_bh(&hdev->hw.cmq.crq.lock);
351+
spin_unlock(&hdev->hw.cmq.crq.lock);
352352
spin_unlock_bh(&hdev->hw.cmq.csq.lock);
353353

354354
clear_bit(HCLGEVF_STATE_CMD_DISABLE, &hdev->state);

0 commit comments

Comments
 (0)