Skip to content

Commit 0d5044b

Browse files
ffainellikuba-moo
authored andcommitted
lib: Allow for the DIM library to be modular
Allow the Dynamic Interrupt Moderation (DIM) library to be built as a module. This is particularly useful in an Android GKI (Google Kernel Image) configuration where everything is built as a module, including Ethernet controller drivers. Having to build DIMLIB into the kernel image with potentially no user is wasteful. Signed-off-by: Florian Fainelli <florian.fainelli@broadcom.com> Reviewed-by: Alexander Lobakin <aleksander.lobakin@intel.com> Link: https://lore.kernel.org/r/20240506175040.410446-1-florian.fainelli@broadcom.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent 445c0b6 commit 0d5044b

3 files changed

Lines changed: 6 additions & 3 deletions

File tree

lib/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -628,7 +628,7 @@ config SIGNATURE
628628
Implementation is done using GnuPG MPI library
629629

630630
config DIMLIB
631-
bool
631+
tristate
632632
help
633633
Dynamic Interrupt Moderation library.
634634
Implements an algorithm for dynamically changing CQ moderation values

lib/dim/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
# DIM Dynamic Interrupt Moderation library
33
#
44

5-
obj-$(CONFIG_DIMLIB) += dim.o
5+
obj-$(CONFIG_DIMLIB) += dimlib.o
66

7-
dim-y := dim.o net_dim.o rdma_dim.o
7+
dimlib-objs := dim.o net_dim.o rdma_dim.o

lib/dim/dim.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,3 +82,6 @@ bool dim_calc_stats(struct dim_sample *start, struct dim_sample *end,
8282
return true;
8383
}
8484
EXPORT_SYMBOL(dim_calc_stats);
85+
86+
MODULE_DESCRIPTION("Dynamic Interrupt Moderation (DIM) library");
87+
MODULE_LICENSE("Dual BSD/GPL");

0 commit comments

Comments
 (0)