-
Notifications
You must be signed in to change notification settings - Fork 75
atlantic: add NET_DIM (Dynamic Interrupt Moderation) support #138
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||
|---|---|---|---|---|
| @@ -0,0 +1,225 @@ | ||||
| --- a/drivers/net/ethernet/aquantia/Kconfig 2026-02-16 16:11:45.000000000 +0000 | ||||
| +++ b/drivers/net/ethernet/aquantia/Kconfig 2026-02-23 01:33:03.716143177 +0000 | ||||
| @@ -20,6 +20,7 @@ | ||||
| tristate "aQuantia AQtion(tm) Support" | ||||
| depends on PCI | ||||
| depends on MACSEC || MACSEC=n | ||||
| + select NET_DIM | ||||
| help | ||||
| This enables the support for the aQuantia AQtion(tm) Ethernet card. | ||||
|
|
||||
| --- a/drivers/net/ethernet/aquantia/atlantic/aq_nic.h 2026-02-16 16:11:45.000000000 +0000 | ||||
| +++ b/drivers/net/ethernet/aquantia/atlantic/aq_nic.h 2026-02-23 01:33:13.450057021 +0000 | ||||
| @@ -12,6 +12,7 @@ | ||||
|
|
||||
| #include <linux/ethtool.h> | ||||
| #include <net/xdp.h> | ||||
| +#include <linux/dim.h> | ||||
| #include <linux/bpf.h> | ||||
|
|
||||
| #include "aq_common.h" | ||||
| @@ -49,6 +50,8 @@ | ||||
| u32 itr; | ||||
| u16 rx_itr; | ||||
| u16 tx_itr; | ||||
| + bool is_rx_adaptive; | ||||
| + bool is_tx_adaptive; | ||||
| u32 rxpageorder; | ||||
| u32 num_rss_queues; | ||||
| u32 mtu; | ||||
| @@ -128,6 +131,10 @@ | ||||
| atomic_t flags; | ||||
| u32 msg_enable; | ||||
| struct aq_vec_s *aq_vec[AQ_CFG_VECS_MAX]; | ||||
| + /* DIM (Dynamic Interrupt Moderation) state */ | ||||
| + struct dim rx_dim; | ||||
| + struct dim tx_dim; | ||||
| + u16 dim_event_ctr; | ||||
| struct aq_ring_s *aq_ring_tx[AQ_HW_QUEUES_MAX]; | ||||
| struct aq_hw_s *aq_hw; | ||||
| struct bpf_prog *xdp_prog; | ||||
| @@ -218,4 +225,7 @@ | ||||
| const u32 max_rate); | ||||
| int aq_nic_setup_tc_min_rate(struct aq_nic_s *self, const unsigned int tc, | ||||
| const u32 min_rate); | ||||
| + | ||||
| +void aq_nic_dim_update(struct aq_nic_s *self); | ||||
|
||||
| +void aq_nic_dim_update(struct aq_nic_s *self); |
Copilot
AI
Feb 24, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the adaptive-coalesce branch, the early return aq_nic_update_interrupt_moderation_settings() bypasses the existing validation below (e.g., checks rejecting rx_max_coalesced_frames > 1, and any bounds checks for usecs). This can allow invalid/unsupported coalesce parameters to be accepted whenever adaptive mode is enabled. Keep the same parameter validation in place before returning (or replicate the relevant checks inside the adaptive branch).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dim_event_ctris declared asu16, but it is used as the monotonically increasingevent_ctrinput todim_update_sample(). A 16-bit counter will wrap quickly and can confuse DIM’s rate calculations. Consider using a wider type (e.g.,u32/u64) for the event counter (and keep it monotonically increasing for the lifetime of the DIM instance).