As noted in the subsequent review.
When disabling adaptive RX coalescing via ethtool, does the driver
cancel any pending Dynamic Interrupt Moderation (DIM) work items?
If adaptive coalescing is disabled but an already-scheduled DIM worker
executes asynchronously in a workqueue, could it blindly apply
dynamically calculated DIM values to the hardware, silently overwriting
the user's newly configured static parameters?
Co-developed-by: Wu Di <redacted>
Signed-off-by: Wu Di <redacted>
Co-developed-by: Teng Peisen <redacted>
Signed-off-by: Teng Peisen <redacted>
Signed-off-by: Fan Gong <gongfan1@huawei.com>
---
drivers/net/ethernet/huawei/hinic3/hinic3_irq.c | 2 +-
drivers/net/ethernet/huawei/hinic3/hinic3_main.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/huawei/hinic3/hinic3_irq.c b/drivers/net/ethernet/huawei/hinic3/hinic3_irq.c
index e7d6c2033b45..b4e58d4c8ba8 100644
--- a/drivers/net/ethernet/huawei/hinic3/hinic3_irq.c
+++ b/drivers/net/ethernet/huawei/hinic3/hinic3_irq.c
@@ -20,7 +20,7 @@ static void hinic3_net_dim(struct hinic3_nic_dev *nic_dev,
struct dim_sample sample = {};
if (!test_bit(HINIC3_INTF_UP, &nic_dev->flags) ||
- !nic_dev->adaptive_rx_coal)
+ !READ_ONCE(nic_dev->adaptive_rx_coal))
return;
dim_update_sample(irq_cfg->total_events, rxq->rxq_stats.packets,diff --git a/drivers/net/ethernet/huawei/hinic3/hinic3_main.c b/drivers/net/ethernet/huawei/hinic3/hinic3_main.c
index 0a888fe4c975..ad0e831ed82b 100644
--- a/drivers/net/ethernet/huawei/hinic3/hinic3_main.c
+++ b/drivers/net/ethernet/huawei/hinic3/hinic3_main.c
@@ -51,7 +51,7 @@ static void init_intr_coal_param(struct net_device *netdev)
info->rx_pending_limit_low = HINIC3_RX_PENDING_LIMIT_LOW;
}
- nic_dev->adaptive_rx_coal = 1;
+ WRITE_ONCE(nic_dev->adaptive_rx_coal, 1);
}
static int hinic3_init_intr_coalesce(struct net_device *netdev)
--
2.43.0